From e4b2aaa25aa025c3041c4168a7017b89c7d9adca Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:43:12 -0500 Subject: [PATCH 001/494] feat(commands): give each new command group its own module Import, CAD, hand-offs, materials and the library each get a module under ext/ with its own command list and dispatcher, reached from the engine's fallback arm and the catalogue, so these groups are written without editing the same lines. The engine state and the change, refresh, editor install and import helpers become crate-visible for them. The catalogue is unchanged (every list is empty). Run: cargo clippy -p fsh-commands --all-targets -D warnings passes. --- native/crates/fsh-commands/src/catalogue.rs | 3 ++ native/crates/fsh-commands/src/engine.rs | 22 ++++---- native/crates/fsh-commands/src/ext/cad.rs | 12 +++++ native/crates/fsh-commands/src/ext/handoff.rs | 12 +++++ native/crates/fsh-commands/src/ext/import.rs | 12 +++++ native/crates/fsh-commands/src/ext/library.rs | 12 +++++ .../crates/fsh-commands/src/ext/materials.rs | 12 +++++ native/crates/fsh-commands/src/ext/mod.rs | 50 +++++++++++++++++++ native/crates/fsh-commands/src/lib.rs | 1 + 9 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/cad.rs create mode 100644 native/crates/fsh-commands/src/ext/handoff.rs create mode 100644 native/crates/fsh-commands/src/ext/import.rs create mode 100644 native/crates/fsh-commands/src/ext/library.rs create mode 100644 native/crates/fsh-commands/src/ext/materials.rs create mode 100644 native/crates/fsh-commands/src/ext/mod.rs diff --git a/native/crates/fsh-commands/src/catalogue.rs b/native/crates/fsh-commands/src/catalogue.rs index c57718bd..f97bac87 100644 --- a/native/crates/fsh-commands/src/catalogue.rs +++ b/native/crates/fsh-commands/src/catalogue.rs @@ -257,6 +257,9 @@ pub fn catalogue_value() -> Value { for e in ENGINE_COMMANDS { commands.push(entry(e.name, e.description, engine_schema(e.name), e.level, e.mutates, e.read_only, false)); } + for e in crate::ext::commands() { + commands.push(entry(e.name, e.description, (e.schema)(), e.level, e.mutates, e.read_only, false)); + } let mut aliases = Vec::new(); for a in ALIASES { aliases.push(json!({"name": a.name, "target": a.target, "fields": a.fields})); diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index e6a22a29..cff2d990 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -87,12 +87,12 @@ struct View { samples: Option, } -struct State { - editor: Editor, - path: Option, - kept: Project, - revision: u64, - content: u64, +pub(crate) struct State { + pub(crate) editor: Editor, + pub(crate) path: Option, + pub(crate) kept: Project, + pub(crate) revision: u64, + pub(crate) content: u64, view: View, threads: usize, env_cache: Option<(String, EnvImage)>, @@ -364,7 +364,7 @@ impl Engine { lock(&self.state).editor.document().clone() } - fn changed(&self, st: &mut State, out: &Outcome, camera_only: bool) -> Value { + pub(crate) fn changed(&self, st: &mut State, out: &Outcome, camera_only: bool) -> Value { st.revision += 1; if !camera_only { st.content += 1; @@ -477,7 +477,7 @@ impl Engine { self.render.update_request(snap, env) } - fn refresh_render(&self, st: &mut State, level: ChangeLevel, camera_only: bool) -> Vec { + pub(crate) fn refresh_render(&self, st: &mut State, level: ChangeLevel, camera_only: bool) -> Vec { let mut warnings = Vec::new(); st.png_cache = None; if level != ChangeLevel::None && self.render.building() && self.update_request(st, &mut warnings) { @@ -560,7 +560,7 @@ impl Engine { self.install_editor(st, editor, path, kept); } - fn install_editor(&self, st: &mut State, editor: Editor, path: Option, kept: Project) { + pub(crate) fn install_editor(&self, st: &mut State, editor: Editor, path: Option, kept: Project) { st.editor = editor; st.path = path; st.kept = Project { document: Document::default(), ..kept }; @@ -937,11 +937,11 @@ impl Engine { reply["bounds"] = view::bounds_json(&b); Ok(reply) } - other => Err(EngineError::UnknownCommand(other.to_string())), + other => crate::ext::dispatch(self, st, other, args).unwrap_or_else(|| Err(EngineError::UnknownCommand(other.to_string()))), } } - fn import(&self, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { + pub(crate) fn import(&self, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { let empty = json!({}); let opts = args.get("options").unwrap_or(&empty); let clean = clean_options(opts)?; diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs new file mode 100644 index 00000000..0cdfe7d9 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -0,0 +1,12 @@ +//! STEP and IGES through FormCAD's kernel worker (0.5.0). + +use super::ExtCommand; +use crate::engine::{Engine, State}; +use crate::error::Result; +use serde_json::Value; + +pub(super) static COMMANDS: &[ExtCommand] = &[]; + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { + None +} diff --git a/native/crates/fsh-commands/src/ext/handoff.rs b/native/crates/fsh-commands/src/ext/handoff.rs new file mode 100644 index 00000000..7bbd3ced --- /dev/null +++ b/native/crates/fsh-commands/src/ext/handoff.rs @@ -0,0 +1,12 @@ +//! Models and materials handed over by other Form apps (0.5.0). + +use super::ExtCommand; +use crate::engine::{Engine, State}; +use crate::error::Result; +use serde_json::Value; + +pub(super) static COMMANDS: &[ExtCommand] = &[]; + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { + None +} diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs new file mode 100644 index 00000000..d526716d --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -0,0 +1,12 @@ +//! Import options, progress, cancel and re-import (0.5.0). + +use super::ExtCommand; +use crate::engine::{Engine, State}; +use crate::error::Result; +use serde_json::Value; + +pub(super) static COMMANDS: &[ExtCommand] = &[]; + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { + None +} diff --git a/native/crates/fsh-commands/src/ext/library.rs b/native/crates/fsh-commands/src/ext/library.rs new file mode 100644 index 00000000..1c707219 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library.rs @@ -0,0 +1,12 @@ +//! The material library: presets, search, thumbnails and drops (0.6.0). + +use super::ExtCommand; +use crate::engine::{Engine, State}; +use crate::error::Result; +use serde_json::Value; + +pub(super) static COMMANDS: &[ExtCommand] = &[]; + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { + None +} diff --git a/native/crates/fsh-commands/src/ext/materials.rs b/native/crates/fsh-commands/src/ext/materials.rs new file mode 100644 index 00000000..6201a786 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/materials.rs @@ -0,0 +1,12 @@ +//! Material types, textures and graphs (0.6.0). + +use super::ExtCommand; +use crate::engine::{Engine, State}; +use crate::error::Result; +use serde_json::Value; + +pub(super) static COMMANDS: &[ExtCommand] = &[]; + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { + None +} diff --git a/native/crates/fsh-commands/src/ext/mod.rs b/native/crates/fsh-commands/src/ext/mod.rs new file mode 100644 index 00000000..d8cb0a32 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/mod.rs @@ -0,0 +1,50 @@ +//! Command groups added from 0.5.0 on, one module each, so each group is written without touching the others. +//! A module lists its commands in `COMMANDS` and answers them in `dispatch`, returning `None` for any other name. + +use crate::engine::{Engine, State}; +use crate::error::Result; +use fsh_scene::ChangeLevel; +use serde_json::Value; + +mod cad; +mod handoff; +mod import; +mod library; +mod materials; + +/// One command of a group: catalogue fields and a function giving its argument schema. +pub(crate) struct ExtCommand { + pub name: &'static str, + pub description: &'static str, + pub level: ChangeLevel, + pub mutates: bool, + pub read_only: bool, + pub schema: fn() -> Value, +} + +/// Every group's commands, in catalogue order. +pub(crate) fn commands() -> impl Iterator { + import::COMMANDS + .iter() + .chain(cad::COMMANDS.iter()) + .chain(handoff::COMMANDS.iter()) + .chain(materials::COMMANDS.iter()) + .chain(library::COMMANDS.iter()) +} + +/// Answers `name` when one of the groups owns it. +pub(crate) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { + if let Some(r) = import::dispatch(engine, st, name, args) { + return Some(r); + } + if let Some(r) = cad::dispatch(engine, st, name, args) { + return Some(r); + } + if let Some(r) = handoff::dispatch(engine, st, name, args) { + return Some(r); + } + if let Some(r) = materials::dispatch(engine, st, name, args) { + return Some(r); + } + library::dispatch(engine, st, name, args) +} diff --git a/native/crates/fsh-commands/src/lib.rs b/native/crates/fsh-commands/src/lib.rs index 0868765f..8aa0cff3 100644 --- a/native/crates/fsh-commands/src/lib.rs +++ b/native/crates/fsh-commands/src/lib.rs @@ -8,6 +8,7 @@ mod device; mod engine; mod error; mod export; +mod ext; mod gpu; mod journal; mod meshes; From 241bba260333a7df5a51e53db8be249bcf2eb57f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:45:39 -0500 Subject: [PATCH 002/494] feat(io): reserve a module for other Form apps' exports fsh-io gains an empty public family module where the readers for what other Form apps hand over will live, so they are added without editing the crate's module list again. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/mod.rs | 1 + native/crates/fsh-io/src/lib.rs | 1 + 2 files changed, 2 insertions(+) create mode 100644 native/crates/fsh-io/src/family/mod.rs diff --git a/native/crates/fsh-io/src/family/mod.rs b/native/crates/fsh-io/src/family/mod.rs new file mode 100644 index 00000000..2230239a --- /dev/null +++ b/native/crates/fsh-io/src/family/mod.rs @@ -0,0 +1 @@ +//! What other Form apps hand over: their export folders and files, read into the same raw scene as any model. diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index 767dc6bf..5c90ac15 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -6,6 +6,7 @@ mod convert; pub mod deflate; mod error; mod exr; +pub mod family; mod glb_write; mod gltf; mod hdr; From ef1257dbf6aae1abbb2922681903f38ca102bd7f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:45:39 -0500 Subject: [PATCH 003/494] feat(backend): reserve routers for import, cad, hand-offs and library Four empty routers are registered in the service, one per area of 0.5.0 and 0.6.0, so their routes are added without editing main.py again. Run: the service module imports. --- backend/app/main.py | 6 +++++- backend/app/routers/cad.py | 5 +++++ backend/app/routers/handoff.py | 5 +++++ backend/app/routers/imports.py | 5 +++++ backend/app/routers/library.py | 5 +++++ 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 backend/app/routers/cad.py create mode 100644 backend/app/routers/handoff.py create mode 100644 backend/app/routers/imports.py create mode 100644 backend/app/routers/library.py diff --git a/backend/app/main.py b/backend/app/main.py index c2b8ae4d..ccf38b61 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -14,7 +14,7 @@ from app.agent import router as agent_router from app.engine import EngineError, EngineUnavailable, engine from app.local_guard import LocalGuard -from app.routers import mcp +from app.routers import cad, handoff, imports, library, mcp mimetypes.add_type("text/javascript", ".js") mimetypes.add_type("text/javascript", ".mjs") @@ -45,6 +45,10 @@ async def lifespan(app): app.include_router(window_key.router) app.include_router(notices.router) app.include_router(mcp.router) +app.include_router(imports.router) +app.include_router(cad.router) +app.include_router(handoff.router) +app.include_router(library.router) @app.middleware("http") diff --git a/backend/app/routers/cad.py b/backend/app/routers/cad.py new file mode 100644 index 00000000..4553ffea --- /dev/null +++ b/backend/app/routers/cad.py @@ -0,0 +1,5 @@ +"""FormCAD's kernel worker: whether it is here, and fetching it from formai-binaries (0.5.0).""" + +from fastapi import APIRouter + +router = APIRouter() diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py new file mode 100644 index 00000000..3d4507f4 --- /dev/null +++ b/backend/app/routers/handoff.py @@ -0,0 +1,5 @@ +"""Models and materials handed over by other Form apps (0.5.0).""" + +from fastapi import APIRouter + +router = APIRouter() diff --git a/backend/app/routers/imports.py b/backend/app/routers/imports.py new file mode 100644 index 00000000..ce886438 --- /dev/null +++ b/backend/app/routers/imports.py @@ -0,0 +1,5 @@ +"""Model files sent by the window for import (0.5.0).""" + +from fastapi import APIRouter + +router = APIRouter() diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py new file mode 100644 index 00000000..d046b625 --- /dev/null +++ b/backend/app/routers/library.py @@ -0,0 +1,5 @@ +"""The material library: the user's own presets folder and thumbnails (0.6.0).""" + +from fastapi import APIRouter + +router = APIRouter() From 5d043a283925254a98796918dc67b6e15bfdf026 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:45:39 -0500 Subject: [PATCH 004/494] feat(frontend): reserve modules for the import dialog and hand-offs The window mounts two empty modules, import and handoff, so they are filled without editing the module list again. Run: tsc --noEmit passes. --- frontend/src/modules.ts | 4 ++++ frontend/src/ui/handoff/index.ts | 3 +++ frontend/src/ui/import/index.ts | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 frontend/src/ui/handoff/index.ts create mode 100644 frontend/src/ui/import/index.ts diff --git a/frontend/src/modules.ts b/frontend/src/modules.ts index ddb26cea..70b9d136 100644 --- a/frontend/src/modules.ts +++ b/frontend/src/modules.ts @@ -4,6 +4,8 @@ import { mount as settings } from './shell/settings'; import { mount as menu } from './shell/topbar'; import { mount as dock } from './shell/dock-adapter'; import { mount as home } from './shell/home'; +import { mount as importer } from './ui/import/index'; +import { mount as handoff } from './ui/handoff/index'; export const MODULES: readonly ShellModule[] = [ { id: 'workspace', mount: workspace }, @@ -11,4 +13,6 @@ export const MODULES: readonly ShellModule[] = [ { id: 'menu', mount: menu }, { id: 'dock', mount: dock }, { id: 'home', mount: home }, + { id: 'import', mount: importer }, + { id: 'handoff', mount: handoff }, ]; diff --git a/frontend/src/ui/handoff/index.ts b/frontend/src/ui/handoff/index.ts new file mode 100644 index 00000000..64a1dab9 --- /dev/null +++ b/frontend/src/ui/handoff/index.ts @@ -0,0 +1,3 @@ +import type { ModuleContext } from '../../shell/app-shell'; + +export function mount(_ctx: ModuleContext): void {} diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts new file mode 100644 index 00000000..64a1dab9 --- /dev/null +++ b/frontend/src/ui/import/index.ts @@ -0,0 +1,3 @@ +import type { ModuleContext } from '../../shell/app-shell'; + +export function mount(_ctx: ModuleContext): void {} From 79d1b8bb96a5158664ef94be8f5e19aba46eaf00 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:54:05 -0500 Subject: [PATCH 005/494] feat(backend): take model uploads for import into a service folder POST /api/imports streams a multipart upload (main model plus sibling buffers, materials and textures) into /.imports// with sanitised names and size limits, DELETE removes it, and POST /api/imports/scan expands dropped desktop folders into model files. Ran curl against uvicorn on 127.0.0.1:8377: 403 without the window key, 200 with byte-identical files, 400 for a bad extension and a climbing name, 413 for a 1.1 GB file with the partial folder removed. --- backend/app/routers/imports.py | 275 ++++++++++++++++++++++++++++++++- 1 file changed, 274 insertions(+), 1 deletion(-) diff --git a/backend/app/routers/imports.py b/backend/app/routers/imports.py index ce886438..759e17da 100644 --- a/backend/app/routers/imports.py +++ b/backend/app/routers/imports.py @@ -1,5 +1,278 @@ """Model files sent by the window for import (0.5.0).""" -from fastapi import APIRouter +import re +import secrets +import shutil +import unicodedata +from pathlib import Path + +from fastapi import APIRouter, HTTPException, Request + +from app import project_library as library +from app import window_key router = APIRouter() + +FOLDER = ".imports" +ID = re.compile(r"^[a-f0-9]{16}\Z") +BAD = re.compile(r'[\x00-\x1f\x7f<>:"|?*]') +WINDOWS_NAMES = {"con", "prn", "aux", "nul", *(f"com{i}" for i in range(1, 10)), *(f"lpt{i}" for i in range(1, 10))} +MODEL_SUFFIXES = library.MESH_SUFFIXES +SIBLING_SUFFIXES = {".bin", ".mtl", ".png", ".jpg", ".jpeg", ".webp", ".ktx2", ".tga", ".bmp", ".tif", ".tiff", ".exr", ".hdr", ".dds", ".gif"} +NAME_LIMIT = 120 +DEPTH_LIMIT = 4 +FILE_LIMIT = library.MESH_LIMIT +TOTAL_LIMIT = 2 * library.MESH_LIMIT +FILE_COUNT = 256 +HEADER_LIMIT = 16 * 1024 +FIELD_LIMIT = 4096 +SCAN_DEPTH = 6 +SCAN_LIMIT = 500 +TOO_BIG = "The upload is too large: one file may be at most 1 GB and one import at most 2 GB" +NOT_MULTIPART = "Send the model as multipart/form-data with a file part named main and any sibling files named files" + + +def root() -> Path: + return library.PROJECTS / FOLDER + + +def clean_segment(raw: str) -> str: + text = unicodedata.normalize("NFC", raw) + text = BAD.sub("_", text).strip().lstrip(".").rstrip(". ") + if not text: + raise HTTPException(400, "A file name is empty after removing characters that cannot be in a file name") + if len(text) > NAME_LIMIT: + stem, dot, ext = text.rpartition(".") + keep = f".{ext}" if dot and len(ext) <= 10 else "" + text = text[: NAME_LIMIT - len(keep)].rstrip(". ") + keep + if text.split(".")[0].lower() in WINDOWS_NAMES: + text = f"_{text}" + return text + + +def clean_name(raw: str, nested: bool) -> str: + parts = [p for p in re.split(r"[\\/]+", raw or "") if p not in ("", ".")] + if not parts: + raise HTTPException(400, "A file has no name") + if ".." in parts: + raise HTTPException(400, f"The file name {raw!r} climbs out of its folder") + if not nested: + parts = parts[-1:] + if len(parts) > DEPTH_LIMIT: + parts = parts[-DEPTH_LIMIT:] + return "/".join(clean_segment(p) for p in parts) + + +def suffix(name: str) -> str: + return Path(name).suffix.lower() + + +def folder_for(entry: str) -> Path: + if not isinstance(entry, str) or not ID.match(entry): + raise HTTPException(404, "No such upload") + path = root() / entry + if path.is_symlink() or not path.is_dir() or not library.inside(path): + raise HTTPException(404, "No such upload") + return path + + +def disposition(headers: bytes) -> tuple[str, str | None]: + text = headers.decode("utf-8", "replace") + line = next((l for l in text.split("\r\n") if l.lower().startswith("content-disposition:")), "") + name = re.search(r'\bname="((?:[^"\\]|\\.)*)"', line) + filename = re.search(r'\bfilename="((?:[^"\\]|\\.)*)"', line) + unquote = lambda s: s.replace('\\"', '"').replace("%22", '"') + return (unquote(name.group(1)) if name else ""), (unquote(filename.group(1)) if filename else None) + + +class Upload: + def __init__(self, folder: Path) -> None: + self.folder = folder + self.files: list[str] = [] + self.main: str | None = None + self.total = 0 + self.handle = None + self.size = 0 + self.field: str | None = None + self.value = b"" + self.fields: dict[str, str] = {} + + def begin(self, field: str, filename: str | None) -> None: + if filename is None: + self.field = field + self.value = b"" + return + if len(self.files) >= FILE_COUNT: + raise HTTPException(400, f"One import may hold at most {FILE_COUNT} files") + is_main = field == "main" or (self.main is None and field != "files" and not self.files) + name = clean_name(filename, nested=not is_main) + kind = suffix(name) + if is_main and kind not in MODEL_SUFFIXES: + raise HTTPException(400, f"FormShot does not import {kind or 'files without an extension'}; it reads {library.MESH_WORDS}") + if not is_main and kind not in MODEL_SUFFIXES | SIBLING_SUFFIXES: + raise HTTPException(400, f"The file {name} is not a model, buffer, material or texture file") + if is_main and self.main is not None: + raise HTTPException(400, "Send one main model per import") + if name in self.files: + raise HTTPException(400, f"The file {name} was sent twice") + target = self.folder / name + target.parent.mkdir(parents=True, exist_ok=True) + if not library.inside(target.parent): + raise HTTPException(400, library.OUTSIDE) + self.handle = target.open("wb") + self.size = 0 + self.files.append(name) + if is_main: + self.main = name + + def write(self, data: bytes) -> None: + if not data: + return + if self.handle is None: + if self.field is not None: + self.value += data + if len(self.value) > FIELD_LIMIT: + raise HTTPException(400, "A form field is too long") + return + self.size += len(data) + self.total += len(data) + if self.size > FILE_LIMIT or self.total > TOTAL_LIMIT: + raise HTTPException(413, TOO_BIG) + self.handle.write(data) + + def end(self) -> None: + if self.handle is not None: + self.handle.close() + self.handle = None + elif self.field is not None: + self.fields[self.field] = self.value.decode("utf-8", "replace") + self.field = None + + def close(self) -> None: + if self.handle is not None: + self.handle.close() + self.handle = None + + +async def receive(request: Request, upload: Upload, boundary: bytes) -> None: + delimiter = b"\r\n--" + boundary + buffer = b"\r\n" + state = "preamble" + async for chunk in request.stream(): + buffer += chunk + while True: + if state == "preamble": + at = buffer.find(delimiter) + if at < 0: + buffer = buffer[-len(delimiter):] + break + buffer = buffer[at + len(delimiter):] + state = "boundary" + if state == "boundary": + if len(buffer) < 2: + break + if buffer.startswith(b"--"): + return + if not buffer.startswith(b"\r\n"): + raise HTTPException(400, NOT_MULTIPART) + buffer = buffer[2:] + state = "headers" + if state == "headers": + at = buffer.find(b"\r\n\r\n") + if at < 0: + if len(buffer) > HEADER_LIMIT: + raise HTTPException(400, NOT_MULTIPART) + break + field, filename = disposition(buffer[:at]) + buffer = buffer[at + 4:] + upload.begin(field, filename) + state = "body" + if state == "body": + at = buffer.find(delimiter) + if at < 0: + keep = len(delimiter) - 1 + if len(buffer) > keep: + upload.write(buffer[:-keep]) + buffer = buffer[-keep:] + break + upload.write(buffer[:at]) + upload.end() + buffer = buffer[at + len(delimiter):] + state = "boundary" + raise HTTPException(400, "The upload ended before its last part") + + +@router.post("/api/imports") +async def create_upload(request: Request): + window_key.require(request) + kind = request.headers.get("content-type", "") + found = re.search(r'boundary="?([^";]+)"?', kind) + if not kind.lower().startswith("multipart/form-data") or not found: + raise HTTPException(400, NOT_MULTIPART) + declared = request.headers.get("content-length", "") + if declared.isdigit() and int(declared) > TOTAL_LIMIT + 1_000_000: + raise HTTPException(413, TOO_BIG) + base = root() + base.mkdir(parents=True, exist_ok=True) + if base.is_symlink() or not library.inside(base): + raise HTTPException(400, library.OUTSIDE) + entry = secrets.token_hex(8) + folder = base / entry + folder.mkdir() + upload = Upload(folder) + try: + await receive(request, upload, found.group(1).encode("latin-1")) + if upload.main is None: + raise HTTPException(400, "The upload holds no model file") + except BaseException: + upload.close() + shutil.rmtree(folder, ignore_errors=True) + raise + main = (folder / upload.main).resolve() + return {"id": entry, "path": str(main), "folder": str(folder.resolve()), "name": upload.main, "files": upload.files, "bytes": upload.total} + + +@router.delete("/api/imports/{entry}") +def delete_upload(entry: str, request: Request): + window_key.require(request) + shutil.rmtree(folder_for(entry)) + return {"ok": True} + + +def walk(path: Path, depth: int, out: list[Path]) -> None: + if len(out) >= SCAN_LIMIT: + return + if path.is_file(): + if suffix(path.name) in MODEL_SUFFIXES and not path.name.startswith("."): + out.append(path) + return + if depth <= 0 or not path.is_dir() or path.is_symlink(): + return + try: + children = sorted(path.iterdir(), key=lambda p: (p.is_dir(), p.name.lower())) + except OSError: + return + for child in children: + if not child.name.startswith("."): + walk(child, depth - 1, out) + + +@router.post("/api/imports/scan") +async def scan_paths(request: Request): + window_key.require(request) + try: + body = await request.json() + except ValueError as error: + raise HTTPException(400, "Send a JSON object with paths") from error + paths = body.get("paths") if isinstance(body, dict) else None + if not isinstance(paths, list) or not all(isinstance(p, str) for p in paths): + raise HTTPException(400, "Send a JSON object with paths, a list of absolute paths") + found: list[Path] = [] + missing = 0 + for raw in paths[:SCAN_LIMIT]: + path = Path(raw).expanduser() + if not path.is_absolute() or not path.exists(): + missing += 1 + continue + walk(path, SCAN_DEPTH, found) + return {"files": [{"path": str(p), "name": p.name} for p in found], "missing": missing, "capped": len(found) >= SCAN_LIMIT} From 8f4d4ecbba83e0f4b2541e04d325573df24c9166 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:55:50 -0500 Subject: [PATCH 006/494] feat(import): add the engine side of the import window The import module now keeps its own view of the engine catalogue and wraps import.probe, import.start with import.status polling, import.cancel and a direct file.import fallback, reading replies tolerantly. Ran npx tsc --noEmit with no errors. --- frontend/src/ui/import/engine.ts | 213 ++++++++++++++++++++++++++++++ frontend/src/ui/import/formats.ts | 29 ++++ frontend/src/ui/import/index.ts | 9 +- 3 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/import/engine.ts create mode 100644 frontend/src/ui/import/formats.ts diff --git a/frontend/src/ui/import/engine.ts b/frontend/src/ui/import/engine.ts new file mode 100644 index 00000000..af0e9f24 --- /dev/null +++ b/frontend/src/ui/import/engine.ts @@ -0,0 +1,213 @@ +import { api, ApiError } from '../../shell/api'; +import { t } from '../../i18n'; + +export const COMMANDS = { + probe: 'import.probe', + start: 'import.start', + status: 'import.status', + cancel: 'import.cancel', + direct: 'file.import', + reimport: 'file.reimport', + summary: 'scene.summary', +} as const; + +export type Units = 'auto' | 'mm' | 'cm' | 'm' | 'in' | 'ft'; +export type UpAxis = 'auto' | 'y' | 'z'; +export type CadQuality = 'draft' | 'medium' | 'high' | 'ultra'; +export const UNITS: readonly Units[] = ['auto', 'mm', 'cm', 'm', 'in', 'ft']; +export const CAD_QUALITIES: readonly CadQuality[] = ['draft', 'medium', 'high', 'ultra']; + +export interface ImportOptions { + units: Units; + up_axis: UpAxis; + stand_on_floor: boolean; + center: boolean; + frame: boolean; + merge: boolean; + cad_quality?: CadQuality; +} + +export interface Probe { + format: string; + unitsDeclared: string; + unitsGuess: string; + unitGuessed: boolean; + upAxis: string; + size: [number, number, number] | null; + triangles: number | null; + meshes: number | null; + nodes: number | null; + materials: number | null; + warnings: string[]; +} + +export type JobState = 'running' | 'done' | 'failed' | 'cancelled'; + +export interface Progress { stage: string; fraction: number | null } + +export interface Outcome { state: 'done' | 'failed' | 'cancelled'; result: unknown; error: string } + +const POLL_MS = 200; +const POLL_FAILURES = 5; + +type Obj = Record; +const obj = (v: unknown): Obj => (v && typeof v === 'object' && !Array.isArray(v) ? v as Obj : {}); +const str = (v: unknown): string => (typeof v === 'string' ? v : ''); +const count = (v: unknown): number | null => (typeof v === 'number' && Number.isFinite(v) ? v : Array.isArray(v) ? v.length : null); + +function vec(v: unknown): [number, number, number] | null { + if (!Array.isArray(v) || v.length < 3) return null; + const n = v.slice(0, 3).map(Number); + return n.every(Number.isFinite) ? [n[0], n[1], n[2]] : null; +} + +export function parseProbe(raw: unknown): Probe { + const o = obj(raw); + const b = obj(o.bounds); + const lo = vec(b.min), hi = vec(b.max); + const warnings = Array.isArray(o.warnings) ? o.warnings.map((w) => (typeof w === 'string' ? w : str(obj(w).message))).filter(Boolean) : []; + return { + format: str(o.format), + unitsDeclared: str(o.units_declared), + unitsGuess: str(o.units_guess), + unitGuessed: o.unit_guessed === true, + upAxis: str(o.up_axis), + size: lo && hi ? [hi[0] - lo[0], hi[1] - lo[1], hi[2] - lo[2]] : null, + triangles: count(o.triangles), + meshes: count(o.meshes), + nodes: count(o.nodes), + materials: count(o.materials), + warnings, + }; +} + +export function errorText(err: unknown): string { + if (err instanceof ApiError || err instanceof Error) return err.message; + return String(err); +} + +class Catalogue { + state: 'unknown' | 'ready' | 'down' = 'unknown'; + reason = ''; + private names = new Set(); + private loading: Promise | null = null; + private readonly fns = new Set<() => void>(); + + onChange(fn: () => void): () => void { this.fns.add(fn); return () => { this.fns.delete(fn); }; } + has(name: string): boolean { return this.names.has(name); } + + load(): Promise { + if (this.loading) return this.loading; + this.loading = api.catalogue({ timeoutMs: 8000 }).then((cat) => { + this.names = new Set(cat.commands.map((c) => c.name).filter((n) => typeof n === 'string')); + this.state = 'ready'; + this.reason = ''; + }).catch((err: unknown) => { + this.state = 'down'; + this.reason = errorText(err); + }).finally(() => { + this.loading = null; + for (const fn of this.fns) fn(); + }); + return this.loading; + } + + why(name: string): string { + if (this.state === 'unknown') return t('Waiting for the engine'); + if (this.state === 'down') return this.reason || t('The engine is not available'); + if (!this.has(name)) return t('The engine has no command {name} yet', { name }); + return ''; + } + + canImport(): boolean { return this.state === 'ready' && (this.has(COMMANDS.start) || this.has(COMMANDS.direct)); } + importReason(): string { return this.has(COMMANDS.start) ? '' : this.why(COMMANDS.direct); } +} + +export const catalogue = new Catalogue(); + +export async function probe(path: string): Promise { + return parseProbe(await api.dispatch(COMMANDS.probe, { path }, { timeoutMs: 120000 })); +} + +function args(path: string, o: ImportOptions): Obj { + const out: Obj = { path, units: o.units, up_axis: o.up_axis, stand_on_floor: o.stand_on_floor, center: o.center, frame: o.frame, merge: o.merge }; + if (o.cad_quality) out.cad_quality = o.cad_quality; + return out; +} + +const sleep = (ms: number): Promise => new Promise((r) => window.setTimeout(r, ms)); + +export class ImportJob { + private job: unknown = null; + private cancelAsked = false; + readonly cancellable: boolean; + + constructor(private readonly path: string, private readonly options: ImportOptions, private readonly onProgress: (p: Progress) => void) { + this.cancellable = catalogue.has(COMMANDS.start) && catalogue.has(COMMANDS.cancel); + } + + async run(): Promise { + if (!catalogue.has(COMMANDS.start)) return this.direct(); + let started: Obj; + try { + started = obj(await api.dispatch(COMMANDS.start, args(this.path, this.options))); + } catch (err) { + return { state: 'failed', result: null, error: errorText(err) }; + } + this.job = started.job ?? null; + if (this.job === null) return { state: 'failed', result: null, error: t('The engine did not start an import job') }; + if (this.cancelAsked) void this.sendCancel(); + let failures = 0; + for (;;) { + await sleep(POLL_MS); + let s: Obj; + try { + s = obj(await api.dispatch(COMMANDS.status, { job: this.job }, { timeoutMs: 15000 })); + failures = 0; + } catch (err) { + if (++failures >= POLL_FAILURES) return { state: 'failed', result: null, error: errorText(err) }; + continue; + } + const state = str(s.state) as JobState; + const fraction = typeof s.fraction === 'number' && Number.isFinite(s.fraction) ? Math.min(1, Math.max(0, s.fraction)) : null; + this.onProgress({ stage: str(s.stage), fraction }); + if (state === 'done') return { state, result: s.result ?? null, error: '' }; + if (state === 'cancelled') return { state, result: null, error: '' }; + if (state === 'failed') return { state, result: null, error: str(s.error) || str(obj(s.error).message) || t('The import failed') }; + } + } + + cancel(): void { + if (!this.cancellable || this.cancelAsked) return; + this.cancelAsked = true; + if (this.job !== null) void this.sendCancel(); + } + + private async sendCancel(): Promise { + try { await api.dispatch(COMMANDS.cancel, { job: this.job }); } catch { return; } + } + + private async direct(): Promise { + this.onProgress({ stage: 'importing', fraction: null }); + try { + const result = await api.dispatch(COMMANDS.direct, args(this.path, this.options), { timeoutMs: 600000 }); + return { state: 'done', result, error: '' }; + } catch (err) { + return { state: 'failed', result: null, error: errorText(err) }; + } + } +} + +export interface ResultCounts { parts: number | null; triangles: number | null; warnings: string[] } + +export function resultCounts(raw: unknown): ResultCounts { + const o = obj(raw); + const report = obj(o.report); + const pick = (...vals: unknown[]): number | null => { for (const v of vals) { const n = count(v); if (n !== null) return n; } return null; }; + const w = Array.isArray(report.warnings) ? report.warnings : Array.isArray(o.warnings) ? o.warnings : []; + return { + parts: pick(o.parts, o.meshes, o.created, report.meshes), + triangles: pick(o.triangles, report.triangles), + warnings: w.map((x) => (typeof x === 'string' ? x : str(obj(x).message))).filter(Boolean), + }; +} diff --git a/frontend/src/ui/import/formats.ts b/frontend/src/ui/import/formats.ts new file mode 100644 index 00000000..fd4bf13f --- /dev/null +++ b/frontend/src/ui/import/formats.ts @@ -0,0 +1,29 @@ +export const MODEL_EXTS = ['glb', 'gltf', 'obj', 'stl', 'ply', '3mf', 'fbx', 'step', 'stp', 'iges', 'igs'] as const; +export const CAD_EXTS: readonly string[] = ['step', 'stp', 'iges', 'igs']; +export const SIBLING_EXTS: readonly string[] = ['bin', 'mtl', 'png', 'jpg', 'jpeg', 'webp', 'ktx2', 'tga', 'bmp', 'tif', 'tiff', 'exr', 'hdr', 'dds', 'gif']; +export const FORMAT_LABELS: readonly string[] = ['GLB', 'glTF', 'OBJ', 'STL', 'PLY', '3MF', 'FBX', 'STEP', 'IGES']; + +export const extOf = (name: string): string => (/\.([a-z0-9]+)$/i.exec(name)?.[1] ?? '').toLowerCase(); +export const baseName = (p: string): string => p.split(/[\\/]/).pop() ?? p; +export const stemOf = (name: string): string => baseName(name).replace(/\.[^.]+$/, ''); +export const isModel = (name: string): boolean => (MODEL_EXTS as readonly string[]).includes(extOf(name)); +export const isCad = (name: string): boolean => CAD_EXTS.includes(extOf(name)); +export const isSibling = (name: string): boolean => SIBLING_EXTS.includes(extOf(name)); +export const acceptList = (): string => [...MODEL_EXTS, ...SIBLING_EXTS].map((x) => `.${x}`).join(','); + +export function formatName(name: string): string { + const ext = extOf(name); + if (ext === 'glb') return 'GLB'; + if (ext === 'gltf') return 'glTF'; + if (ext === 'stp' || ext === 'step') return 'STEP'; + if (ext === 'igs' || ext === 'iges') return 'IGES'; + return ext.toUpperCase(); +} + +export function bytesText(n: number): string { + if (!Number.isFinite(n) || n <= 0) return ''; + const units = ['B', 'KB', 'MB', 'GB']; + let v = n, i = 0; + while (v >= 1024 && i < units.length - 1) { v /= 1024; i++; } + return `${v >= 100 || i === 0 ? Math.round(v) : v.toFixed(1)} ${units[i]}`; +} diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index 64a1dab9..0c7f0b53 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -1,3 +1,10 @@ import type { ModuleContext } from '../../shell/app-shell'; +import { catalogue } from './engine'; -export function mount(_ctx: ModuleContext): void {} +export function mount(ctx: ModuleContext): void { + const reload = (): void => { void catalogue.load(); }; + ctx.events.on('hello', reload); + ctx.events.on('resync', reload); + catalogue.onChange(() => ctx.registry.refreshState()); + reload(); +} From 29c8db17ddca666b8c52689d89f1f8cb8ebe5849 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:56:35 -0500 Subject: [PATCH 007/494] feat(import): send browser files to the service upload route Groups dropped or picked files into one job per model with its sibling buffers and textures (kept relative to the model's folder, folders read through webkitGetAsEntry), uploads each job with XMLHttpRequest for upload progress and the window key, and can abort and remove an upload. Ran npx tsc --noEmit with no errors. --- frontend/src/ui/import/upload.ts | 103 +++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 frontend/src/ui/import/upload.ts diff --git a/frontend/src/ui/import/upload.ts b/frontend/src/ui/import/upload.ts new file mode 100644 index 00000000..0240b8f4 --- /dev/null +++ b/frontend/src/ui/import/upload.ts @@ -0,0 +1,103 @@ +import { api } from '../../shell/api'; +import { keyMessage, WINDOW_KEY_HEADER, windowKeyReady } from '../../shell/window-key'; +import { t } from '../../i18n'; +import { isModel, isSibling } from './formats'; + +export interface Uploaded { id: string; path: string; name: string; files: string[]; bytes: number } + +export interface LocalFile { file: File; rel: string } + +export interface BrowserJob { main: File; siblings: Array<{ file: File; name: string }> } + +const ROUTE = '/api/imports'; + +const dirOf = (rel: string): string => { const i = rel.lastIndexOf('/'); return i > 0 ? rel.slice(0, i) : ''; }; + +export function groupFiles(items: readonly LocalFile[]): BrowserJob[] { + const models = items.filter((x) => isModel(x.file.name)); + const extras = items.filter((x) => !isModel(x.file.name) && isSibling(x.file.name)); + return models.map((m) => { + const dir = dirOf(m.rel); + const siblings = extras + .filter((x) => !dir || x.rel.startsWith(`${dir}/`)) + .map((x) => ({ file: x.file, name: dir ? x.rel.slice(dir.length + 1) : x.rel })); + return { main: m.file, siblings }; + }); +} + +async function entryFiles(entry: FileSystemEntry, out: LocalFile[], depth: number): Promise { + if (entry.isFile) { + const file = await new Promise((resolve) => (entry as FileSystemFileEntry).file(resolve, () => resolve(null))); + if (file) out.push({ file, rel: entry.fullPath.replace(/^\/+/, '') }); + return; + } + if (!entry.isDirectory || depth <= 0) return; + const reader = (entry as FileSystemDirectoryEntry).createReader(); + for (;;) { + const batch = await new Promise((resolve) => reader.readEntries(resolve, () => resolve([]))); + if (!batch.length) break; + for (const child of batch) if (!child.name.startsWith('.')) await entryFiles(child, out, depth - 1); + } +} + +export async function droppedFiles(data: DataTransfer): Promise { + const entries = Array.from(data.items ?? []) + .map((item) => (item.kind === 'file' && typeof item.webkitGetAsEntry === 'function' ? item.webkitGetAsEntry() : null)) + .filter((e): e is FileSystemEntry => e !== null); + if (!entries.length) return Array.from(data.files ?? []).map((file) => ({ file, rel: file.name })); + const out: LocalFile[] = []; + for (const e of entries) await entryFiles(e, out, 6); + return out; +} + +function windowKey(): string { + try { return (JSON.parse(keyMessage()) as { key?: unknown }).key as string || ''; } catch { return ''; } +} + +export class Sending { + readonly done: Promise; + private readonly xhr = new XMLHttpRequest(); + private aborted = false; + + constructor(job: BrowserJob, onProgress: (fraction: number) => void) { + this.done = this.send(job, onProgress); + } + + abort(): void { + this.aborted = true; + this.xhr.abort(); + } + + private async send(job: BrowserJob, onProgress: (fraction: number) => void): Promise { + await windowKeyReady(); + if (this.aborted) throw new Error(t('The upload was cancelled')); + const form = new FormData(); + form.append('main', job.main, job.main.name); + for (const s of job.siblings) form.append('files', s.file, s.name); + const xhr = this.xhr; + return new Promise((resolve, reject) => { + xhr.open('POST', api.url(ROUTE)); + const key = windowKey(); + if (key) xhr.setRequestHeader(WINDOW_KEY_HEADER, key); + xhr.responseType = 'text'; + xhr.upload.onprogress = (e) => { if (e.lengthComputable && e.total > 0) onProgress(e.loaded / e.total); }; + xhr.onabort = () => reject(new Error(t('The upload was cancelled'))); + xhr.onerror = () => reject(new Error(t('The FormShot service is not reachable'))); + xhr.onload = () => { + let body: Record = {}; + try { body = JSON.parse(xhr.responseText) as Record; } catch { body = {}; } + if (xhr.status >= 200 && xhr.status < 300 && typeof body.path === 'string' && typeof body.id === 'string') { + resolve(body as unknown as Uploaded); + return; + } + const detail = typeof body.detail === 'string' ? body.detail : t('The upload failed ({status})', { status: xhr.status }); + reject(new Error(detail)); + }; + xhr.send(form); + }); + } +} + +export function removeUpload(id: string): void { + void api.del(`${ROUTE}/${encodeURIComponent(id)}`).catch(() => undefined); +} From ede53d86a0494c3553230b04af223b2b7a341543 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:56:35 -0500 Subject: [PATCH 008/494] feat(import): take real paths from the desktop open panel and drops In the desktop app the import window asks the dialog plugin's open panel for model paths, listens to the webview's native drag and drop events (positions turned into CSS pixels), and expands dropped folders through the service's scan route. Ran npx tsc --noEmit with no errors; not run inside Tauri. --- frontend/src/ui/import/desktop.ts | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 frontend/src/ui/import/desktop.ts diff --git a/frontend/src/ui/import/desktop.ts b/frontend/src/ui/import/desktop.ts new file mode 100644 index 00000000..5b39e39e --- /dev/null +++ b/frontend/src/ui/import/desktop.ts @@ -0,0 +1,54 @@ +import { api } from '../../shell/api'; +import { inTauri } from '../../shell/dom'; +import { t } from '../../i18n'; +import { isModel, MODEL_EXTS } from './formats'; + +export type NativeDrop = + | { type: 'enter'; paths: string[] } + | { type: 'over'; x: number; y: number } + | { type: 'drop'; paths: string[]; x: number; y: number } + | { type: 'leave' }; + +export const desktop = (): boolean => inTauri(); + +export async function pickPaths(): Promise { + if (!desktop()) return null; + try { + const { invoke } = await import('@tauri-apps/api/core'); + const picked = await invoke('plugin:dialog|open', { + options: { multiple: true, directory: false, title: t('Import Model'), filters: [{ name: t('3D models'), extensions: [...MODEL_EXTS] }] }, + }); + if (picked === null) return []; + return Array.isArray(picked) ? picked : [picked]; + } catch { + return null; + } +} + +export async function expandPaths(paths: readonly string[]): Promise { + try { + const out = await api.post<{ files?: Array<{ path?: unknown }> }>('/api/imports/scan', { paths }); + const found = (out.files ?? []).map((f) => f.path).filter((p): p is string => typeof p === 'string'); + if (found.length || !paths.some(isModel)) return found; + } catch { + return paths.filter(isModel); + } + return paths.filter(isModel); +} + +export async function listenNativeDrop(fn: (e: NativeDrop) => void): Promise<() => void> { + if (!desktop()) return () => undefined; + try { + const { getCurrentWebview } = await import('@tauri-apps/api/webview'); + const ratio = (): number => window.devicePixelRatio || 1; + return await getCurrentWebview().onDragDropEvent((event) => { + const p = event.payload; + if (p.type === 'enter') fn({ type: 'enter', paths: p.paths }); + else if (p.type === 'over') fn({ type: 'over', x: p.position.x / ratio(), y: p.position.y / ratio() }); + else if (p.type === 'drop') fn({ type: 'drop', paths: p.paths, x: p.position.x / ratio(), y: p.position.y / ratio() }); + else fn({ type: 'leave' }); + }); + } catch { + return () => undefined; + } +} From c9acca7c5facc05acd621940e82b77dd11bbd303 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:59:01 -0500 Subject: [PATCH 009/494] feat(import): add the import options sheet with summary and progress One dialog per import walks the chosen files: it uploads in the browser, probes the file, fills a fixed summary (triangles, parts, materials, size, warnings), preselects the guessed unit with a plain warning, keeps the other options between runs, and shows a reserved progress row with stage, fraction and Cancel while import.status is polled. Ran npx tsc --noEmit with no errors. --- frontend/src/ui/import/import.css | 48 ++++ frontend/src/ui/import/sheet.ts | 360 ++++++++++++++++++++++++++++++ 2 files changed, 408 insertions(+) create mode 100644 frontend/src/ui/import/import.css create mode 100644 frontend/src/ui/import/sheet.ts diff --git a/frontend/src/ui/import/import.css b/frontend/src/ui/import/import.css new file mode 100644 index 00000000..b4208ffc --- /dev/null +++ b/frontend/src/ui/import/import.css @@ -0,0 +1,48 @@ +.fsh-imp { display: grid; gap: var(--space-3); color: var(--text-primary); font-size: var(--fs-12); } + +.fsh-imp-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-1); } +.fsh-imp-file-icon { display: inline-flex; color: var(--text-secondary); } +.fsh-imp-file-text { display: grid; min-width: 0; line-height: var(--lh-tight); } +.fsh-imp-name { overflow: hidden; font-size: var(--fs-13); font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; } +.fsh-imp-meta { overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-imp-count { min-width: 7ch; color: var(--text-muted); font-size: var(--fs-11); text-align: right; } + +.fsh-imp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-4); } +.fsh-imp-head { margin: 0 0 var(--space-2); color: var(--text-secondary); font-size: var(--fs-11); font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase; } + +.fsh-imp-facts { display: grid; gap: 0; margin: 0; } +.fsh-imp-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; height: 24px; border-bottom: 1px solid var(--line-1); } +.fsh-imp-facts dt { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-imp-facts dd { min-width: 10ch; margin: 0; color: var(--text-primary); text-align: right; white-space: nowrap; } + +.fsh-imp-notes { height: 84px; margin-top: var(--space-2); overflow-y: auto; overscroll-behavior: contain; color: var(--text-muted); font-size: var(--fs-11); line-height: var(--lh); } +.fsh-imp-notes-text { margin: 0; } +.fsh-imp-warnings { margin: 0; padding-left: var(--space-4); color: var(--warn); } +.fsh-imp-warnings:empty { display: none; } + +.fsh-imp-options { display: grid; align-content: start; gap: var(--space-1); } +.fsh-imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: center; gap: var(--space-2); height: var(--ctl-lg); color: var(--text-secondary); } +.fsh-imp-row > select { width: 100%; } +.fsh-imp-check { display: flex; align-items: center; gap: var(--space-2); height: var(--ctl-md); color: var(--text-primary); cursor: pointer; } +.fsh-imp-check input { margin: 0; accent-color: var(--accent-color); } +.fsh-imp-cad.is-off { visibility: hidden; } + +.fsh-imp-unit-note { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--space-1); height: 32px; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); line-height: var(--lh-tight); } +.fsh-imp-unit-icon { visibility: hidden; color: var(--warn); } +.fsh-imp-unit-note.is-warn { color: var(--warn); } +.fsh-imp-unit-note.is-warn .fsh-imp-unit-icon { visibility: visible; } + +.fsh-imp-progress { display: grid; grid-template-columns: 22ch minmax(0, 1fr) 5ch; align-items: center; gap: var(--space-3); height: 24px; visibility: hidden; } +.fsh-imp-progress.is-on { visibility: visible; } +.fsh-imp-stage { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-imp-bar { position: relative; height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--line-2); } +.fsh-imp-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--accent-color); transform: scaleX(var(--fsh-imp-fraction, 0)); transform-origin: left center; transition: transform var(--dur-fast) linear; } +.fsh-imp-progress.is-indeterminate .fsh-imp-fill { width: 30%; transform: none; animation: fsh-imp-slide calc(var(--dur-slow) * 3) ease-in-out infinite; } +.fsh-imp-pct { color: var(--text-muted); text-align: right; } +@keyframes fsh-imp-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } } + +.fsh-imp-reason { height: 1.4em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } + +.fsh-imp-dialog .fsh-dialog-foot .fsh-btn { min-width: 104px; } +.fsh-imp-dialog .fsh-dialog-foot .fsh-imp-all { margin-right: auto; order: -1; } +.fsh-imp-dialog .fsh-dialog-foot .fsh-imp-all[data-hidden] { visibility: hidden; } diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts new file mode 100644 index 00000000..52af7c74 --- /dev/null +++ b/frontend/src/ui/import/sheet.ts @@ -0,0 +1,360 @@ +import { Dialog } from '../../shell/dialog'; +import { el, q, setAttr, setDisabled, setStyleVar, setText, setValue, setChecked } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import { + catalogue, COMMANDS, CAD_QUALITIES, errorText, ImportJob, probe, resultCounts, UNITS, + type CadQuality, type ImportOptions, type Outcome, type Probe, type Progress, type Units, type UpAxis, +} from './engine'; +import { bytesText, formatName, isCad } from './formats'; +import { removeUpload, Sending, type BrowserJob } from './upload'; + +export type Source = + | { kind: 'path'; path: string; name: string } + | { kind: 'browser'; job: BrowserJob; name: string }; + +export interface SheetHooks { + finished(name: string, path: string, outcome: Outcome, frame: boolean): void; +} + +const OPTIONS_KEY = 'formshot.import.options'; + +const UNIT_LABELS: Record = { + auto: 'Automatic', mm: 'Millimetres (mm)', cm: 'Centimetres (cm)', m: 'Metres (m)', in: 'Inches (in)', ft: 'Feet (ft)', +}; +const UNIT_WORDS: Record = { mm: 'millimetres', cm: 'centimetres', m: 'metres', in: 'inches', ft: 'feet' }; +const QUALITY_LABELS: Record = { draft: 'Draft', medium: 'Medium', high: 'High', ultra: 'Ultra' }; +const STAGES: Record = { + uploading: 'Uploading', + reading: 'Reading the file', + parsing: 'Reading the file', + tessellating: 'Tessellating CAD surfaces', + cleaning: 'Cleaning up meshes', + cleanup: 'Cleaning up meshes', + materials: 'Making materials', + placing: 'Placing in the scene', + importing: 'Importing', + done: 'Done', +}; + +interface Kept { up_axis: UpAxis; stand_on_floor: boolean; center: boolean; frame: boolean; merge: boolean; cad_quality: CadQuality } +const DEFAULTS: Kept = { up_axis: 'auto', stand_on_floor: true, center: true, frame: true, merge: false, cad_quality: 'medium' }; + +function kept(): Kept { + try { + const raw = JSON.parse(localStorage.getItem(OPTIONS_KEY) ?? 'null') as Partial | null; + return { ...DEFAULTS, ...(raw && typeof raw === 'object' ? raw : {}) }; + } catch { + return { ...DEFAULTS }; + } +} + +function keep(o: Kept): void { + try { localStorage.setItem(OPTIONS_KEY, JSON.stringify(o)); } catch { return; } +} + +const numberText = (n: number | null): string => (n === null ? '' : new Intl.NumberFormat().format(n)); + +function sizeText(p: Probe): string { + if (!p.size) return ''; + const unit = p.unitsDeclared || p.unitsGuess; + const f = (v: number): string => new Intl.NumberFormat(undefined, { maximumSignificantDigits: 4 }).format(v); + return `${p.size.map(f).join(' x ')}${unit ? ` ${unit}` : ''}`; +} + +const isUnit = (v: string): v is Units => (UNITS as readonly string[]).includes(v); + +type Phase = 'preparing' | 'ready' | 'running' | 'finished'; + +export class ImportSheet { + private readonly dialog = new Dialog('Import Model', 'wide'); + private readonly root: HTMLElement; + private readonly units: HTMLSelectElement; + private readonly up: HTMLSelectElement; + private readonly cad: HTMLSelectElement; + private readonly boxes: Record<'stand_on_floor' | 'center' | 'frame' | 'merge', HTMLInputElement>; + private readonly importBtn: HTMLButtonElement; + private readonly allBtn: HTMLButtonElement; + private readonly cancelBtn: HTMLButtonElement; + private index = 0; + private phase: Phase = 'preparing'; + private all = false; + private closed = false; + private unitsTouched = false; + private path = ''; + private uploadId = ''; + private sending: Sending | null = null; + private job: ImportJob | null = null; + private probed: Probe | null = null; + private token = 0; + + constructor(private readonly sources: Source[], private readonly hooks: SheetHooks) { + const d = this.dialog; + d.scrim.querySelector('.fsh-dialog')?.classList.add('fsh-imp-dialog'); + this.root = el(`
+
${icon('file', 18)}
+
+
+

${t('In this file')}

+
+
${t('Format')}
+
${t('Triangles')}
+
${t('Parts')}
+
${t('Materials')}
+
${t('Size')}
+
${t('Up axis in file')}
+
+

    +
    +
    +

    ${t('Options')}

    + +

    ${icon('warning', 14)}

    + + + + + + +
    +
    +
    +

    +
    `); + d.body.appendChild(this.root); + this.units = q(this.root, '[data-o="units"]'); + this.up = q(this.root, '[data-o="up"]'); + this.cad = q(this.root, '[data-o="cad"]'); + for (const u of UNITS) this.units.appendChild(el(``)); + for (const c of CAD_QUALITIES) this.cad.appendChild(el(``)); + this.boxes = { + stand_on_floor: q(this.root, '[data-o="stand_on_floor"]'), + center: q(this.root, '[data-o="center"]'), + frame: q(this.root, '[data-o="frame"]'), + merge: q(this.root, '[data-o="merge"]'), + }; + const k = kept(); + setValue(this.up, k.up_axis); + setValue(this.cad, k.cad_quality); + for (const key of Object.keys(this.boxes) as Array) setChecked(this.boxes[key], k[key]); + this.units.addEventListener('change', () => { this.unitsTouched = true; this.unitNote(); }); + this.cancelBtn = d.action('Cancel', () => this.cancel()); + this.allBtn = d.action('Import All', () => { this.all = true; this.start(); }); + this.importBtn = d.action('Import', () => this.start(), 'primary'); + this.allBtn.classList.add('fsh-imp-all'); + setAttr(this.allBtn, 'data-hidden', sources.length > 1 ? null : 'true'); + d.onClose = () => this.closing(); + catalogue.onChange(() => this.syncButtons()); + } + + open(): void { + this.dialog.open(); + this.show(0); + this.units.focus(); + } + + private options(): ImportOptions { + const units = isUnit(this.units.value) ? this.units.value : 'auto'; + const up = this.up.value === 'y' || this.up.value === 'z' ? this.up.value : 'auto'; + const cad = (CAD_QUALITIES as readonly string[]).includes(this.cad.value) ? this.cad.value as CadQuality : 'medium'; + const o: ImportOptions = { + units, up_axis: up, + stand_on_floor: this.boxes.stand_on_floor.checked, center: this.boxes.center.checked, + frame: this.boxes.frame.checked, merge: this.boxes.merge.checked, + }; + if (isCad(this.sources[this.index].name)) o.cad_quality = cad; + keep({ up_axis: up, stand_on_floor: o.stand_on_floor, center: o.center, frame: o.frame, merge: o.merge, cad_quality: cad }); + return o; + } + + private field(name: string, value: string): void { + setText(this.root.querySelector(`[data-f="${name}"]`), value); + } + + private show(i: number): void { + this.index = i; + const src = this.sources[i]; + const token = ++this.token; + this.path = src.kind === 'path' ? src.path : ''; + this.uploadId = ''; + this.probed = null; + this.job = null; + setText(q(this.root, '.fsh-imp-name'), src.name); + const size = src.kind === 'browser' ? bytesText(src.job.main.size + src.job.siblings.reduce((s, x) => s + x.file.size, 0)) : ''; + const extra = src.kind === 'browser' && src.job.siblings.length ? t('{n} files beside it', { n: src.job.siblings.length }) : ''; + setText(q(this.root, '.fsh-imp-meta'), [formatName(src.name), size, extra].filter(Boolean).join(' · ')); + setText(q(this.root, '.fsh-imp-count'), this.sources.length > 1 ? t('{i} of {n}', { i: i + 1, n: this.sources.length }) : ''); + q(this.root, '.fsh-imp-cad').classList.toggle('is-off', !isCad(src.name)); + for (const f of ['format', 'triangles', 'parts', 'materials', 'size', 'up']) this.field(f, ''); + this.field('format', formatName(src.name)); + this.notes(t('Reading the file...'), []); + if (!this.unitsTouched) setValue(this.units, 'auto'); + this.unitNote(); + this.progress(null); + this.setPhase('preparing'); + void this.prepare(src, token); + } + + private async prepare(src: Source, token: number): Promise { + if (src.kind === 'browser') { + this.progress({ stage: 'uploading', fraction: 0 }); + const sending = new Sending(src.job, (f) => { if (token === this.token) this.progress({ stage: 'uploading', fraction: f }); }); + this.sending = sending; + try { + const up = await sending.done; + if (token !== this.token || this.closed) { removeUpload(up.id); return; } + this.path = up.path; + this.uploadId = up.id; + } catch (err) { + if (token !== this.token) return; + this.sending = null; + this.progress(null); + const reason = t('Could not send the file: {reason}', { reason: errorText(err) }); + this.notes(reason, []); + this.setPhase('finished'); + if (this.index + 1 < this.sources.length) { toast(`${src.name}: ${reason}`, 'error'); this.next(); } + return; + } + this.sending = null; + this.progress(null); + } + if (catalogue.state === 'unknown') await catalogue.load(); + if (token !== this.token) return; + if (!catalogue.has(COMMANDS.probe)) { + this.notes(catalogue.state === 'ready' ? t('This engine cannot look inside a file before importing it, so the summary stays empty.') : catalogue.why(COMMANDS.probe), []); + } else { + try { + const p = await probe(this.path); + if (token !== this.token) return; + this.fill(p); + } catch (err) { + if (token !== this.token) return; + this.notes(t('Could not read the file: {reason}', { reason: errorText(err) }), []); + } + } + this.setPhase('ready'); + if (this.all) this.start(); + } + + private fill(p: Probe): void { + this.probed = p; + if (p.format) this.field('format', p.format.toUpperCase()); + this.field('triangles', numberText(p.triangles)); + this.field('parts', numberText(p.meshes ?? p.nodes)); + this.field('materials', numberText(p.materials)); + this.field('size', sizeText(p)); + this.field('up', p.upAxis ? p.upAxis.toUpperCase() : ''); + this.notes(p.warnings.length ? '' : t('No warnings.'), p.warnings); + const unit = p.unitsDeclared || p.unitsGuess; + if (!this.unitsTouched && isUnit(unit)) setValue(this.units, unit); + this.unitNote(); + } + + private notes(text: string, warnings: readonly string[]): void { + setText(q(this.root, '.fsh-imp-notes-text'), text); + const list = q(this.root, '.fsh-imp-warnings'); + const key = warnings.join('\n'); + if (list.dataset.key === key) return; + list.dataset.key = key; + list.replaceChildren(...warnings.map((w) => { const li = document.createElement('li'); li.textContent = w; return li; })); + } + + private unitNote(): void { + const p = this.probed; + const note = q(this.root, '.fsh-imp-unit-note'); + let text = '', warn = false; + if (p && p.unitGuessed && p.unitsGuess && this.units.value === p.unitsGuess) { + text = t('This file does not say its units. FormShot guessed {unit} from its size; check it before importing.', { unit: t(UNIT_WORDS[p.unitsGuess] ?? p.unitsGuess) }); + warn = true; + } else if (p && p.unitsDeclared) { + text = t('The file says it is in {unit}.', { unit: t(UNIT_WORDS[p.unitsDeclared] ?? p.unitsDeclared) }); + } else if (this.units.value === 'auto') { + text = t('The engine decides from the file.'); + } + note.classList.toggle('is-warn', warn); + setText(q(note, '.fsh-imp-unit-text'), text); + } + + private progress(p: Progress | null): void { + const row = q(this.root, '.fsh-imp-progress'); + row.classList.toggle('is-on', p !== null); + if (!p) return; + const known = STAGES[p.stage]; + setText(q(row, '.fsh-imp-stage'), known ? t(known) : p.stage ? p.stage.charAt(0).toUpperCase() + p.stage.slice(1) : t('Importing')); + row.classList.toggle('is-indeterminate', p.fraction === null); + setStyleVar(row, '--fsh-imp-fraction', String(p.fraction ?? 0)); + setText(q(row, '.fsh-imp-pct'), p.fraction === null ? '' : `${Math.round(p.fraction * 100)}%`); + } + + private setPhase(phase: Phase): void { + this.phase = phase; + for (const c of [this.units, this.up, this.cad, ...Object.values(this.boxes)]) setDisabled(c, phase === 'running'); + this.syncButtons(); + } + + private syncButtons(): void { + const reason = catalogue.canImport() ? '' : catalogue.importReason() || catalogue.why(COMMANDS.start); + const ready = this.phase === 'ready' && !reason; + setDisabled(this.importBtn, !ready); + setDisabled(this.allBtn, !ready); + const running = this.phase === 'running'; + setDisabled(this.cancelBtn, running && !(this.job?.cancellable ?? false)); + setAttr(this.cancelBtn, 'title', running && !(this.job?.cancellable ?? false) ? t('This engine cannot stop an import once it has started') : null); + let text = this.phase === 'finished' ? '' : reason; + if (!text && running && !this.job?.cancellable) text = t('This engine imports in one step, so there is no progress to show or stop.'); + setText(q(this.root, '.fsh-imp-reason'), text); + } + + private start(): void { + if (this.phase !== 'ready' || !catalogue.canImport()) return; + const src = this.sources[this.index]; + const options = this.options(); + if (this.all && !this.unitsTouched) options.units = 'auto'; + const path = this.path; + const uploadId = this.uploadId; + const job = new ImportJob(path, options, (p) => { if (this.job === job) this.progress(p); }); + this.job = job; + this.setPhase('running'); + this.progress({ stage: 'reading', fraction: job.cancellable ? 0 : null }); + void job.run().then((outcome) => { + if (outcome.state !== 'done' && uploadId) removeUpload(uploadId); + this.hooks.finished(src.name, path, outcome, options.frame); + if (this.job !== job) return; + this.job = null; + this.uploadId = ''; + if (outcome.state === 'failed') { + this.progress(null); + this.notes(t('Could not import the file: {reason}', { reason: outcome.error }), []); + this.setPhase('finished'); + if (this.index + 1 < this.sources.length) this.next(); + return; + } + this.next(); + }); + } + + private next(): void { + if (this.closed) return; + if (this.index + 1 < this.sources.length) { this.show(this.index + 1); return; } + this.closed = true; + this.dialog.close(); + } + + private cancel(): void { + if (this.phase === 'running' && this.job) { this.job.cancel(); return; } + this.dialog.close(); + } + + private closing(): void { + const wasClosed = this.closed; + this.closed = true; + this.token++; + this.sending?.abort(); + this.sending = null; + if (this.uploadId && this.phase !== 'running') removeUpload(this.uploadId); + const after = this.sources.length - this.index - 1; + if (wasClosed || after <= 0) return; + toast(this.phase === 'running' ? t('The import goes on; {n} files after it were not imported.', { n: after }) : t('{n} files were not imported.', { n: after + (this.phase === 'finished' ? 0 : 1) })); + } +} From 6502150b9a504658faf8963fff46374acf95bc51 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:59:01 -0500 Subject: [PATCH 010/494] feat(import): open the import sheet from file.import and add reimport The module takes over the workspace's file.import entry (Mod+I) so the File menu item, the palette and callers with paths or files open the sheet, adds import.files for other modules and file.reimport in the File menu, and refreshes the workspace with scene.changed after an import. Ran npx tsc --noEmit with no errors. --- frontend/src/ui/import/index.ts | 127 +++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index 0c7f0b53..e891bab5 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -1,10 +1,129 @@ +import './import.css'; import type { ModuleContext } from '../../shell/app-shell'; -import { catalogue } from './engine'; +import { api } from '../../shell/api'; +import type { CommandSpec } from '../../shell/registry'; +import { t } from '../../i18n'; +import { catalogue, COMMANDS, errorText, resultCounts, type Outcome } from './engine'; +import { acceptList, baseName, isModel } from './formats'; +import { desktop, expandPaths, pickPaths } from './desktop'; +import { ImportSheet, type Source } from './sheet'; +import { groupFiles, type LocalFile } from './upload'; + +const REFRESH_EVENTS = ['scene.changed', 'document.changed']; + +export interface Importer { + files(items: readonly LocalFile[]): void; + paths(paths: readonly string[]): Promise; + pick(): Promise; +} + +function idsOf(raw: unknown): string[] { + const o = raw && typeof raw === 'object' ? raw as Record : {}; + const sel = Array.isArray(o.selection) ? o.selection : []; + return sel.map((v) => (typeof v === 'string' ? v : typeof v === 'number' ? String(v) : '')).filter(Boolean); +} export function mount(ctx: ModuleContext): void { + const { registry, events } = ctx; const reload = (): void => { void catalogue.load(); }; - ctx.events.on('hello', reload); - ctx.events.on('resync', reload); - catalogue.onChange(() => ctx.registry.refreshState()); + events.on('hello', reload); + events.on('resync', reload); + catalogue.onChange(() => registry.refreshState()); reload(); + + const changed = (): void => { for (const type of REFRESH_EVENTS) events.emit({ type }); }; + + const finished = (name: string, path: string, outcome: Outcome): void => { + if (outcome.state === 'cancelled') { ctx.toast(t('The import of {name} was cancelled.', { name })); return; } + if (outcome.state === 'failed') { ctx.toast(t('Could not import {name}: {reason}', { name, reason: outcome.error }), 'error'); return; } + const c = resultCounts(outcome.result); + let text = t('Imported {name}.', { name }); + if (c.parts !== null && c.triangles !== null) text = t('Imported {name}: {parts} parts, {triangles} triangles.', { name, parts: c.parts, triangles: new Intl.NumberFormat().format(c.triangles) }); + else if (c.parts !== null) text = t('Imported {name}: {parts} parts.', { name, parts: c.parts }); + if (c.warnings.length) text = `${text} ${t('{n} warnings; the Scene page lists the parts.', { n: c.warnings.length })}`; + ctx.toast(text); + changed(); + events.emit({ type: 'ui.import.done', name, path }); + }; + + const open = (sources: Source[]): void => { + if (!sources.length) { + ctx.toast(t('Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.'), 'error'); + return; + } + if (catalogue.state !== 'ready') reload(); + new ImportSheet(sources, { finished }).open(); + }; + + const picker = document.createElement('input'); + picker.type = 'file'; + picker.multiple = true; + picker.accept = acceptList(); + picker.hidden = true; + picker.className = 'fsh-imp-picker'; + ctx.slots.overlayRoot.appendChild(picker); + picker.addEventListener('change', () => { + const files = Array.from(picker.files ?? []); + picker.value = ''; + importer.files(files.map((file) => ({ file, rel: file.name }))); + }); + + const importer: Importer = { + files(items) { + open(groupFiles(items).map((job) => ({ kind: 'browser', job, name: job.main.name }))); + }, + async paths(paths) { + const found = paths.every(isModel) ? [...paths] : await expandPaths(paths); + open(found.map((path) => ({ kind: 'path', path, name: baseName(path) }))); + }, + async pick() { + const chosen = await pickPaths(); + if (chosen === null) { picker.click(); return; } + if (chosen.length) await importer.paths(chosen); + }, + }; + + const run = (args?: Record): Promise | void => { + const a = args ?? {}; + if (Array.isArray(a.files)) { + const files = a.files.filter((f): f is File => f instanceof File); + importer.files(files.map((file) => ({ file, rel: file.webkitRelativePath || file.name }))); + return; + } + const list = Array.isArray(a.paths) ? a.paths.filter((p): p is string => typeof p === 'string') : typeof a.path === 'string' && a.path ? [a.path] : []; + if (list.length) return importer.paths(list); + return importer.pick(); + }; + + const importSpec: CommandSpec = { + id: 'file.import', label: 'Import Model...', group: 'File', icon: 'import', keys: ['Mod+I'], + description: desktop() ? 'Choose model files and import them into the scene with options.' : 'Send model files to FormShot and import them into the scene with options.', + run, + }; + const existing = registry.getCommand('file.import'); + if (existing) Object.assign(existing, { label: importSpec.label, description: importSpec.description, icon: importSpec.icon, enabled: undefined, run }); + else registry.registerCommand(importSpec); + + registry.registerCommands([ + { id: 'import.files', label: 'Import Files', group: 'File', palette: false, run }, + { + id: 'file.reimport', label: 'Reimport', group: 'File', icon: 'refresh', + description: 'Read the source files of the selected parts (or of every imported part) again, keeping their materials.', + enabled: () => catalogue.has(COMMANDS.reimport), + run: async () => { + let nodes: string[] = []; + try { nodes = idsOf(await api.dispatch(COMMANDS.summary, {})); } catch { nodes = []; } + try { + const out = await api.dispatch(COMMANDS.reimport, nodes.length ? { nodes } : {}, { timeoutMs: 600000 }); + const o = out && typeof out === 'object' ? out as Record : {}; + const n = (k: string): number => (typeof o[k] === 'number' ? o[k] as number : Array.isArray(o[k]) ? (o[k] as unknown[]).length : 0); + ctx.toast(t('Reimported: {matched} parts updated, {added} new, {hidden} hidden.', { matched: n('matched'), added: n('added'), hidden: n('hidden') })); + changed(); + } catch (err) { + ctx.toast(t('Could not reimport: {reason}', { reason: errorText(err) }), 'error'); + } + }, + }, + ]); + registry.registerMenu({ id: 'file', items: [{ command: 'file.reimport', section: 2 }] }); } From 4ce4b88f0d754d24287a5a7c66aa5db8c553e0b1 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:20 -0500 Subject: [PATCH 011/494] fix(import): preselect the probed unit while the units field has focus The dialog focuses the units field on open, and the shell's setValue skips a focused field, so the guessed unit never showed; the sheet now writes the select directly while the person has not touched it. Ran the sheet in headless Chrome against the service with a stand-in engine over the real one: bottle_mm.glb showed Millimetres with the guess warning and import.start received units mm. --- frontend/src/ui/import/sheet.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index 52af7c74..f38b1838 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -189,7 +189,7 @@ export class ImportSheet { for (const f of ['format', 'triangles', 'parts', 'materials', 'size', 'up']) this.field(f, ''); this.field('format', formatName(src.name)); this.notes(t('Reading the file...'), []); - if (!this.unitsTouched) setValue(this.units, 'auto'); + if (!this.unitsTouched && this.units.value !== 'auto') this.units.value = 'auto'; this.unitNote(); this.progress(null); this.setPhase('preparing'); @@ -247,7 +247,7 @@ export class ImportSheet { this.field('up', p.upAxis ? p.upAxis.toUpperCase() : ''); this.notes(p.warnings.length ? '' : t('No warnings.'), p.warnings); const unit = p.unitsDeclared || p.unitsGuess; - if (!this.unitsTouched && isUnit(unit)) setValue(this.units, unit); + if (!this.unitsTouched && isUnit(unit) && this.units.value !== unit) this.units.value = unit; this.unitNote(); } From f370abede762f65e5fd66d77899cedae1f0eca06 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:06:06 -0500 Subject: [PATCH 012/494] feat(import): import model files dropped on the viewport or the window A drop overlay in the overlay root names the accepted formats and outlines the viewport (accented while the pointer is over it); browser drops go through the upload path, desktop drops through the webview's native paths with folders expanded, and a desktop drop on Home starts a new project first. Ran a synthetic three-file drop in headless Chrome: the overlay showed, bottle.glb and pair.gltf with pair.bin imported one after the other through the real engine. --- frontend/src/ui/import/drop.ts | 99 +++++++++++++++++++++++++++++++ frontend/src/ui/import/import.css | 11 ++++ frontend/src/ui/import/index.ts | 11 +++- 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/import/drop.ts diff --git a/frontend/src/ui/import/drop.ts b/frontend/src/ui/import/drop.ts new file mode 100644 index 00000000..53dae5dc --- /dev/null +++ b/frontend/src/ui/import/drop.ts @@ -0,0 +1,99 @@ +import { el, q, setClass, setStyleVar } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import { desktop, listenNativeDrop } from './desktop'; +import { FORMAT_LABELS } from './formats'; +import { droppedFiles, type LocalFile } from './upload'; + +export interface DropTarget { + files(items: LocalFile[]): void; + paths(paths: string[]): void; + onHome(paths: string[]): void; +} + +const DOM_DROP_WINDOW_MS = 600; +const NATIVE_SETTLE_MS = 300; + +const homeOpen = (): boolean => { const h = document.getElementById('fsh-home'); return !!h && !h.hidden; }; +const dialogOpen = (): boolean => document.querySelector('#overlay-root .fsh-scrim:not([hidden])') !== null; +const carriesFiles = (e: DragEvent): boolean => Array.from(e.dataTransfer?.types ?? []).includes('Files'); + +export function mountDropZone(overlayRoot: HTMLElement, viewport: HTMLElement, target: DropTarget): void { + const chips = FORMAT_LABELS.map((f) => `${f}`).join(''); + const root = el(``); + overlayRoot.appendChild(root); + const frame = q(root, '.fsh-imp-drop-frame'); + + const place = (): void => { + const r = viewport.getBoundingClientRect(); + setStyleVar(frame, '--fsh-imp-drop-x', `${Math.round(r.left)}px`); + setStyleVar(frame, '--fsh-imp-drop-y', `${Math.round(r.top)}px`); + setStyleVar(frame, '--fsh-imp-drop-w', `${Math.round(r.width)}px`); + setStyleVar(frame, '--fsh-imp-drop-h', `${Math.round(r.height)}px`); + }; + const over = (x: number, y: number): void => { + const r = viewport.getBoundingClientRect(); + setClass(root, 'is-viewport', x >= r.left && x <= r.right && y >= r.top && y <= r.bottom); + }; + const show = (): void => { + if (!root.hidden) return; + place(); + root.hidden = false; + }; + const hide = (): void => { + if (root.hidden) return; + root.hidden = true; + setClass(root, 'is-viewport', false); + }; + + let depth = 0; + let lastDomDrop = 0; + const wanted = (e: DragEvent): boolean => carriesFiles(e) && !homeOpen() && !dialogOpen(); + + window.addEventListener('drop', (e) => { if (carriesFiles(e)) lastDomDrop = performance.now(); }, true); + window.addEventListener('dragenter', (e) => { + if (!wanted(e) || desktop()) return; + depth++; + show(); + }); + window.addEventListener('dragover', (e) => { + if (!wanted(e) || desktop()) return; + e.preventDefault(); + if (e.dataTransfer) e.dataTransfer.dropEffect = 'copy'; + show(); + over(e.clientX, e.clientY); + }); + window.addEventListener('dragleave', (e) => { + if (desktop() || root.hidden) return; + depth = Math.max(0, depth - 1); + if (depth === 0 || e.relatedTarget === null) { depth = 0; hide(); } + }); + window.addEventListener('drop', (e) => { + depth = 0; + hide(); + if (desktop() || e.defaultPrevented || !wanted(e) || !e.dataTransfer) return; + e.preventDefault(); + void droppedFiles(e.dataTransfer).then((items) => target.files(items)); + }); + window.addEventListener('blur', () => { depth = 0; hide(); }); + + void listenNativeDrop((d) => { + if (d.type === 'leave') { hide(); return; } + if (d.type === 'enter') { if (!homeOpen() && !dialogOpen()) show(); return; } + if (d.type === 'over') { if (!root.hidden) over(d.x, d.y); return; } + hide(); + if (dialogOpen() || !d.paths.length) return; + if (!homeOpen()) { target.paths(d.paths); return; } + const at = performance.now(); + window.setTimeout(() => { + if (Math.abs(lastDomDrop - at) < DOM_DROP_WINDOW_MS) return; + target.onHome(d.paths); + }, NATIVE_SETTLE_MS); + }); +} diff --git a/frontend/src/ui/import/import.css b/frontend/src/ui/import/import.css index b4208ffc..2926bff7 100644 --- a/frontend/src/ui/import/import.css +++ b/frontend/src/ui/import/import.css @@ -43,6 +43,17 @@ .fsh-imp-reason { height: 1.4em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-imp-drop { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; background: var(--bg-scrim); pointer-events: none; } +.fsh-imp-drop[hidden] { display: none; } +.fsh-imp-drop-frame { position: fixed; left: var(--fsh-imp-drop-x, 0); top: var(--fsh-imp-drop-y, 0); width: var(--fsh-imp-drop-w, 0); height: var(--fsh-imp-drop-h, 0); box-sizing: border-box; border: 2px dashed var(--line-3); border-radius: var(--radius-lg); transition: border-color var(--dur-fast), background-color var(--dur-fast); } +.fsh-imp-drop.is-viewport .fsh-imp-drop-frame { border-color: var(--accent-color); background: var(--accent-wash); } +.fsh-imp-drop-card { display: grid; justify-items: center; gap: var(--space-2); width: min(440px, calc(100vw - 48px)); padding: var(--space-6) var(--space-6) var(--space-5); border: 1px solid var(--glass-border); border-radius: var(--radius-2xl); background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); text-align: center; } +.fsh-imp-drop-icon { display: inline-flex; color: var(--accent-color); } +.fsh-imp-drop-title { margin: 0; color: var(--text-primary); font-size: var(--fs-16); font-weight: var(--fw-semibold); } +.fsh-imp-drop-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1); margin: 0; } +.fsh-imp-drop-chip { padding: 1px var(--space-2); border: 1px solid var(--line-3); border-radius: var(--radius-sm); color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--fs-10); } +.fsh-imp-drop-hint { margin: 0; color: var(--text-muted); font-size: var(--fs-12); line-height: var(--lh); } + .fsh-imp-dialog .fsh-dialog-foot .fsh-btn { min-width: 104px; } .fsh-imp-dialog .fsh-dialog-foot .fsh-imp-all { margin-right: auto; order: -1; } .fsh-imp-dialog .fsh-dialog-foot .fsh-imp-all[data-hidden] { visibility: hidden; } diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index e891bab5..eb4ed821 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -4,8 +4,9 @@ import { api } from '../../shell/api'; import type { CommandSpec } from '../../shell/registry'; import { t } from '../../i18n'; import { catalogue, COMMANDS, errorText, resultCounts, type Outcome } from './engine'; -import { acceptList, baseName, isModel } from './formats'; +import { acceptList, baseName, isModel, stemOf } from './formats'; import { desktop, expandPaths, pickPaths } from './desktop'; +import { mountDropZone } from './drop'; import { ImportSheet, type Source } from './sheet'; import { groupFiles, type LocalFile } from './upload'; @@ -126,4 +127,12 @@ export function mount(ctx: ModuleContext): void { }, ]); registry.registerMenu({ id: 'file', items: [{ command: 'file.reimport', section: 2 }] }); + + mountDropZone(ctx.slots.overlayRoot, ctx.slots.viewport, { + files: (items) => importer.files(items), + paths: (paths) => { void importer.paths(paths); }, + onHome: (paths) => { + void registry.callCommand('file.new', { title: stemOf(paths[0]) }).then(() => importer.paths(paths)).catch((err: unknown) => ctx.toast(errorText(err), 'error')); + }, + }); } From 46a5549c88c7a2d259459ab77142cb7cdb67c3d5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:06:18 -0500 Subject: [PATCH 013/494] fix(import): send sibling files only with models that refer to them A GLB dropped beside a glTF pair was uploaded with the pair's .bin; only glTF and OBJ files read buffers, materials and textures from beside them, so other formats now travel alone, and the sheet says One file beside it for a single sibling. Ran npx tsc --noEmit with no errors. --- frontend/src/ui/import/sheet.ts | 3 ++- frontend/src/ui/import/upload.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index f38b1838..db680825 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -182,7 +182,8 @@ export class ImportSheet { this.job = null; setText(q(this.root, '.fsh-imp-name'), src.name); const size = src.kind === 'browser' ? bytesText(src.job.main.size + src.job.siblings.reduce((s, x) => s + x.file.size, 0)) : ''; - const extra = src.kind === 'browser' && src.job.siblings.length ? t('{n} files beside it', { n: src.job.siblings.length }) : ''; + const beside = src.kind === 'browser' ? src.job.siblings.length : 0; + const extra = beside === 1 ? t('One file beside it') : beside > 1 ? t('{n} files beside it', { n: beside }) : ''; setText(q(this.root, '.fsh-imp-meta'), [formatName(src.name), size, extra].filter(Boolean).join(' · ')); setText(q(this.root, '.fsh-imp-count'), this.sources.length > 1 ? t('{i} of {n}', { i: i + 1, n: this.sources.length }) : ''); q(this.root, '.fsh-imp-cad').classList.toggle('is-off', !isCad(src.name)); diff --git a/frontend/src/ui/import/upload.ts b/frontend/src/ui/import/upload.ts index 0240b8f4..12d9b9ec 100644 --- a/frontend/src/ui/import/upload.ts +++ b/frontend/src/ui/import/upload.ts @@ -1,7 +1,7 @@ import { api } from '../../shell/api'; import { keyMessage, WINDOW_KEY_HEADER, windowKeyReady } from '../../shell/window-key'; import { t } from '../../i18n'; -import { isModel, isSibling } from './formats'; +import { extOf, isModel, isSibling } from './formats'; export interface Uploaded { id: string; path: string; name: string; files: string[]; bytes: number } @@ -10,6 +10,7 @@ export interface LocalFile { file: File; rel: string } export interface BrowserJob { main: File; siblings: Array<{ file: File; name: string }> } const ROUTE = '/api/imports'; +const REFERS: readonly string[] = ['gltf', 'obj']; const dirOf = (rel: string): string => { const i = rel.lastIndexOf('/'); return i > 0 ? rel.slice(0, i) : ''; }; @@ -17,6 +18,7 @@ export function groupFiles(items: readonly LocalFile[]): BrowserJob[] { const models = items.filter((x) => isModel(x.file.name)); const extras = items.filter((x) => !isModel(x.file.name) && isSibling(x.file.name)); return models.map((m) => { + if (!REFERS.includes(extOf(m.file.name))) return { main: m.file, siblings: [] }; const dir = dirOf(m.rel); const siblings = extras .filter((x) => !dir || x.rel.startsWith(`${dir}/`)) From b678a8121cdb573c481232417d625a7aa3fd29be Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:07:16 -0500 Subject: [PATCH 014/494] feat(import): list recent imports in the File menu Finished imports are kept (eight at most, in localStorage formshot.import.recent) and shown as a Recent Imports submenu re-registered through the registry when the list changes, with Clear Recent Imports and a disabled row when empty; choosing one opens the sheet for that path again. Ran in headless Chrome: after an import the submenu listed bottle_mm.glb, choosing it probed the same file, and File, Reimport reached file.reimport. --- frontend/src/ui/import/index.ts | 27 ++++++++++++++++++++++++++- frontend/src/ui/import/recent.ts | 25 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/import/recent.ts diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index eb4ed821..5aeb0e78 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -1,12 +1,13 @@ import './import.css'; import type { ModuleContext } from '../../shell/app-shell'; import { api } from '../../shell/api'; -import type { CommandSpec } from '../../shell/registry'; +import type { CommandSpec, MenuEntry } from '../../shell/registry'; import { t } from '../../i18n'; import { catalogue, COMMANDS, errorText, resultCounts, type Outcome } from './engine'; import { acceptList, baseName, isModel, stemOf } from './formats'; import { desktop, expandPaths, pickPaths } from './desktop'; import { mountDropZone } from './drop'; +import { forgetImports, recentImports, rememberImport } from './recent'; import { ImportSheet, type Source } from './sheet'; import { groupFiles, type LocalFile } from './upload'; @@ -128,6 +129,30 @@ export function mount(ctx: ModuleContext): void { ]); registry.registerMenu({ id: 'file', items: [{ command: 'file.reimport', section: 2 }] }); + let recentOff: (() => void) | null = null; + let recentKey = ''; + const syncRecent = (): void => { + const list = recentImports(); + const key = list.map((r) => r.path).join('\n'); + if (key === recentKey && recentOff) return; + recentKey = key; + recentOff?.(); + const items: MenuEntry[] = list.length + ? [...list.map((r) => ({ command: 'import.recent', label: r.name, args: { path: r.path } })), { command: 'import.clearRecent', section: 1 }] + : [{ command: 'import.noRecent' }]; + recentOff = registry.registerMenu({ id: 'file', items: [{ label: 'Recent Imports', section: 2, items }] }); + }; + registry.registerCommands([ + { + id: 'import.recent', label: 'Import Recent File', group: 'File', palette: false, + run: (a) => { if (typeof a?.path === 'string' && a.path) return importer.paths([a.path]); return undefined; }, + }, + { id: 'import.clearRecent', label: 'Clear Recent Imports', group: 'File', palette: false, run: () => { forgetImports(); syncRecent(); } }, + { id: 'import.noRecent', label: 'No Recent Imports', group: 'File', palette: false, enabled: () => false, run: () => undefined }, + ]); + events.on('ui.import.done', (e) => { rememberImport(typeof e.name === 'string' ? e.name : '', typeof e.path === 'string' ? e.path : ''); syncRecent(); }); + syncRecent(); + mountDropZone(ctx.slots.overlayRoot, ctx.slots.viewport, { files: (items) => importer.files(items), paths: (paths) => { void importer.paths(paths); }, diff --git a/frontend/src/ui/import/recent.ts b/frontend/src/ui/import/recent.ts new file mode 100644 index 00000000..3f5754b7 --- /dev/null +++ b/frontend/src/ui/import/recent.ts @@ -0,0 +1,25 @@ +const KEY = 'formshot.import.recent'; +const MAX = 8; + +export interface RecentImport { name: string; path: string; at: number } + +export function recentImports(): RecentImport[] { + try { + const raw = JSON.parse(localStorage.getItem(KEY) ?? '[]') as unknown; + if (!Array.isArray(raw)) return []; + return raw.filter((r): r is RecentImport => !!r && typeof r === 'object' && typeof (r as RecentImport).path === 'string' && typeof (r as RecentImport).name === 'string').slice(0, MAX); + } catch { + return []; + } +} + +function store(list: RecentImport[]): void { + try { localStorage.setItem(KEY, JSON.stringify(list.slice(0, MAX))); } catch { return; } +} + +export function rememberImport(name: string, path: string): void { + if (!path) return; + store([{ name, path, at: Date.now() }, ...recentImports().filter((r) => r.path !== path)]); +} + +export function forgetImports(): void { store([]); } From 24e7d337011a1dbbdb63c619409fab290eab3885 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:08:50 -0500 Subject: [PATCH 015/494] feat(i18n): add the import namespace with English placeholders strings.json lists the 83 English strings the import window shows that no other table holds; the 23 language tables carry English as placeholder values and es-MX and fr-CA are empty, as in the other namespaces. Checked with a throwaway script that every table has exactly the sorted keys, ran setup/i18n.py check (passes) and scanned for em dashes. --- frontend/src/i18n/modules/import/cs.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/da.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/de.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/es-MX.json | 1 + frontend/src/i18n/modules/import/es.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/fi.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/fr-CA.json | 1 + frontend/src/i18n/modules/import/fr.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/hu.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/id.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/it.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/ja.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/ko.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/nb.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/nl.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/pl.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/pt-BR.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/ru.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/strings.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/sv.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/th.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/tr.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/uk.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/vi.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/zh-CN.json | 85 +++++++++++++++++++ frontend/src/i18n/modules/import/zh-TW.json | 85 +++++++++++++++++++ 26 files changed, 2042 insertions(+) create mode 100644 frontend/src/i18n/modules/import/cs.json create mode 100644 frontend/src/i18n/modules/import/da.json create mode 100644 frontend/src/i18n/modules/import/de.json create mode 100644 frontend/src/i18n/modules/import/es-MX.json create mode 100644 frontend/src/i18n/modules/import/es.json create mode 100644 frontend/src/i18n/modules/import/fi.json create mode 100644 frontend/src/i18n/modules/import/fr-CA.json create mode 100644 frontend/src/i18n/modules/import/fr.json create mode 100644 frontend/src/i18n/modules/import/hu.json create mode 100644 frontend/src/i18n/modules/import/id.json create mode 100644 frontend/src/i18n/modules/import/it.json create mode 100644 frontend/src/i18n/modules/import/ja.json create mode 100644 frontend/src/i18n/modules/import/ko.json create mode 100644 frontend/src/i18n/modules/import/nb.json create mode 100644 frontend/src/i18n/modules/import/nl.json create mode 100644 frontend/src/i18n/modules/import/pl.json create mode 100644 frontend/src/i18n/modules/import/pt-BR.json create mode 100644 frontend/src/i18n/modules/import/ru.json create mode 100644 frontend/src/i18n/modules/import/strings.json create mode 100644 frontend/src/i18n/modules/import/sv.json create mode 100644 frontend/src/i18n/modules/import/th.json create mode 100644 frontend/src/i18n/modules/import/tr.json create mode 100644 frontend/src/i18n/modules/import/uk.json create mode 100644 frontend/src/i18n/modules/import/vi.json create mode 100644 frontend/src/i18n/modules/import/zh-CN.json create mode 100644 frontend/src/i18n/modules/import/zh-TW.json diff --git a/frontend/src/i18n/modules/import/cs.json b/frontend/src/i18n/modules/import/cs.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/cs.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/da.json b/frontend/src/i18n/modules/import/da.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/da.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/de.json b/frontend/src/i18n/modules/import/de.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/de.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/es-MX.json b/frontend/src/i18n/modules/import/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/import/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/import/es.json b/frontend/src/i18n/modules/import/es.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/es.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/fi.json b/frontend/src/i18n/modules/import/fi.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/fi.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/fr-CA.json b/frontend/src/i18n/modules/import/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/import/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/import/fr.json b/frontend/src/i18n/modules/import/fr.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/fr.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/hu.json b/frontend/src/i18n/modules/import/hu.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/hu.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/id.json b/frontend/src/i18n/modules/import/id.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/id.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/it.json b/frontend/src/i18n/modules/import/it.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/it.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/ja.json b/frontend/src/i18n/modules/import/ja.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/ja.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/ko.json b/frontend/src/i18n/modules/import/ko.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/ko.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/nb.json b/frontend/src/i18n/modules/import/nb.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/nb.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/nl.json b/frontend/src/i18n/modules/import/nl.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/nl.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/pl.json b/frontend/src/i18n/modules/import/pl.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/pl.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/pt-BR.json b/frontend/src/i18n/modules/import/pt-BR.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/pt-BR.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/ru.json b/frontend/src/i18n/modules/import/ru.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/ru.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/strings.json b/frontend/src/i18n/modules/import/strings.json new file mode 100644 index 00000000..d5935f9a --- /dev/null +++ b/frontend/src/i18n/modules/import/strings.json @@ -0,0 +1,85 @@ +[ + "3D models", + "Automatic", + "CAD quality", + "Centimetres (cm)", + "Centre on the origin", + "Choose model files and import them into the scene with options.", + "Cleaning up meshes", + "Clear Recent Imports", + "Could not import the file: {reason}", + "Could not import {name}: {reason}", + "Could not read the file: {reason}", + "Could not reimport: {reason}", + "Could not send the file: {reason}", + "Draft", + "Drop to import into the scene", + "Feet (ft)", + "Format", + "Frame the view after import", + "High", + "Import", + "Import All", + "Import Files", + "Import Model", + "Import Recent File", + "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.", + "Importing", + "In this file", + "Inches (in)", + "Making materials", + "Materials", + "Medium", + "Merge into one group", + "Metres (m)", + "Millimetres (mm)", + "No Recent Imports", + "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it", + "Options", + "Parts", + "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file", + "Reading the file...", + "Recent Imports", + "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size", + "Stand on the floor", + "Tessellating CAD surfaces", + "The engine decides from the file.", + "The engine did not start an import job", + "The file says it is in {unit}.", + "The import failed", + "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.", + "The upload failed ({status})", + "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles", + "Ultra", + "Units", + "Up axis", + "Up axis in file", + "Uploading", + "Y is up", + "Z is up", + "centimetres", + "feet", + "inches", + "metres", + "millimetres", + "{i} of {n}", + "{n} files beside it", + "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts." +] diff --git a/frontend/src/i18n/modules/import/sv.json b/frontend/src/i18n/modules/import/sv.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/sv.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/th.json b/frontend/src/i18n/modules/import/th.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/th.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/tr.json b/frontend/src/i18n/modules/import/tr.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/tr.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/uk.json b/frontend/src/i18n/modules/import/uk.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/uk.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/vi.json b/frontend/src/i18n/modules/import/vi.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/vi.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/zh-CN.json b/frontend/src/i18n/modules/import/zh-CN.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/zh-CN.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} diff --git a/frontend/src/i18n/modules/import/zh-TW.json b/frontend/src/i18n/modules/import/zh-TW.json new file mode 100644 index 00000000..021d8966 --- /dev/null +++ b/frontend/src/i18n/modules/import/zh-TW.json @@ -0,0 +1,85 @@ +{ + "3D models": "3D models", + "Automatic": "Automatic", + "CAD quality": "CAD quality", + "Centimetres (cm)": "Centimetres (cm)", + "Centre on the origin": "Centre on the origin", + "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", + "Cleaning up meshes": "Cleaning up meshes", + "Clear Recent Imports": "Clear Recent Imports", + "Could not import the file: {reason}": "Could not import the file: {reason}", + "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not read the file: {reason}": "Could not read the file: {reason}", + "Could not reimport: {reason}": "Could not reimport: {reason}", + "Could not send the file: {reason}": "Could not send the file: {reason}", + "Draft": "Draft", + "Drop to import into the scene": "Drop to import into the scene", + "Feet (ft)": "Feet (ft)", + "Format": "Format", + "Frame the view after import": "Frame the view after import", + "High": "High", + "Import": "Import", + "Import All": "Import All", + "Import Files": "Import Files", + "Import Model": "Import Model", + "Import Recent File": "Import Recent File", + "Imported {name}.": "Imported {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", + "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", + "Importing": "Importing", + "In this file": "In this file", + "Inches (in)": "Inches (in)", + "Making materials": "Making materials", + "Materials": "Materials", + "Medium": "Medium", + "Merge into one group": "Merge into one group", + "Metres (m)": "Metres (m)", + "Millimetres (mm)": "Millimetres (mm)", + "No Recent Imports": "No Recent Imports", + "No warnings.": "No warnings.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", + "One file beside it": "One file beside it", + "Options": "Options", + "Parts": "Parts", + "Placing in the scene": "Placing in the scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", + "Reading the file": "Reading the file", + "Reading the file...": "Reading the file...", + "Recent Imports": "Recent Imports", + "Reimport": "Reimport", + "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", + "Size": "Size", + "Stand on the floor": "Stand on the floor", + "Tessellating CAD surfaces": "Tessellating CAD surfaces", + "The engine decides from the file.": "The engine decides from the file.", + "The engine did not start an import job": "The engine did not start an import job", + "The file says it is in {unit}.": "The file says it is in {unit}.", + "The import failed": "The import failed", + "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import of {name} was cancelled.": "The import of {name} was cancelled.", + "The upload failed ({status})": "The upload failed ({status})", + "The upload was cancelled": "The upload was cancelled", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", + "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", + "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Triangles": "Triangles", + "Ultra": "Ultra", + "Units": "Units", + "Up axis": "Up axis", + "Up axis in file": "Up axis in file", + "Uploading": "Uploading", + "Y is up": "Y is up", + "Z is up": "Z is up", + "centimetres": "centimetres", + "feet": "feet", + "inches": "inches", + "metres": "metres", + "millimetres": "millimetres", + "{i} of {n}": "{i} of {n}", + "{n} files beside it": "{n} files beside it", + "{n} files were not imported.": "{n} files were not imported.", + "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." +} From 5a39f98986a30ce829d8f37b29bc561765443cc3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:09:36 -0500 Subject: [PATCH 016/494] feat(home): send a model dropped on Home to the import sheet When the import module has registered import.files, a model dropped or picked on Home starts a new project from the default template named after the file and then opens the import sheet with the dropped files, instead of storing the model beside the project and importing it with no options. Ran a synthetic drop on the Home hero in headless Chrome: a bottle_mm project opened, the sheet probed the file and the import finished. --- frontend/src/shell/home.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/shell/home.ts b/frontend/src/shell/home.ts index 5843884f..36b90905 100644 --- a/frontend/src/shell/home.ts +++ b/frontend/src/shell/home.ts @@ -337,6 +337,12 @@ ${nav('start', icon('home', 16), 'Start')}${nav('recent', icon('layers', 16), 'R const file = files.find((f) => extOf(f.name) === PROJECT_EXT) ?? files.find((f) => MODEL_EXTS.includes(extOf(f.name))); if (!file) { toast(t('FormShot opens .fshot projects and {formats} models.', { formats: MODEL_EXTS.map((x) => x.toUpperCase()).join(', ') }), 'error'); return; } if (this.busy) return; + if (extOf(file.name) !== PROJECT_EXT && getCommand('import.files')) { + const before = this.doc; + await this.create(DEFAULT_TEMPLATE, baseName(file.name)); + if (this.doc !== before && this.doc.hasDocument) runCommand('import.files', { files }); + return; + } this.busy = true; const project = extOf(file.name) === PROJECT_EXT; try { From 2d16fae72dd54d55e2837c9c86bd1c4ed99a18fb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:11:34 -0500 Subject: [PATCH 017/494] fix(import): keep focus in the sheet after a failed import A failed import disables the Import button that had focus, so Escape no longer reached the dialog; the sheet now moves focus to Cancel when a file is finished. Ran a damaged GLB through the sheet in headless Chrome: the engine's reason showed in the sheet and a toast, the upload was removed, Escape closed the sheet and the next import opened. --- frontend/src/ui/import/sheet.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index db680825..4cc06dab 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -292,6 +292,7 @@ export class ImportSheet { this.phase = phase; for (const c of [this.units, this.up, this.cad, ...Object.values(this.boxes)]) setDisabled(c, phase === 'running'); this.syncButtons(); + if (phase === 'finished' && !this.closed) this.cancelBtn.focus(); } private syncButtons(): void { From a6916fac5a5e7a2a030d191da679e36f99079765 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:14:36 -0500 Subject: [PATCH 018/494] fix(import): stop counting one file or part in the plural Closing the sheet during an import of two files toasted 1 files after it; that toast and the reimport report are now count-neutral, part counts are named only above one, and a single engine warning is shown as its own text. The two changed keys were edited in strings.json and every language table; checked with a throwaway script that the tables match the strings the module uses and ran npx tsc --noEmit. --- frontend/src/i18n/modules/import/cs.json | 4 ++-- frontend/src/i18n/modules/import/da.json | 4 ++-- frontend/src/i18n/modules/import/de.json | 4 ++-- frontend/src/i18n/modules/import/es.json | 4 ++-- frontend/src/i18n/modules/import/fi.json | 4 ++-- frontend/src/i18n/modules/import/fr.json | 4 ++-- frontend/src/i18n/modules/import/hu.json | 4 ++-- frontend/src/i18n/modules/import/id.json | 4 ++-- frontend/src/i18n/modules/import/it.json | 4 ++-- frontend/src/i18n/modules/import/ja.json | 4 ++-- frontend/src/i18n/modules/import/ko.json | 4 ++-- frontend/src/i18n/modules/import/nb.json | 4 ++-- frontend/src/i18n/modules/import/nl.json | 4 ++-- frontend/src/i18n/modules/import/pl.json | 4 ++-- frontend/src/i18n/modules/import/pt-BR.json | 4 ++-- frontend/src/i18n/modules/import/ru.json | 4 ++-- frontend/src/i18n/modules/import/strings.json | 4 ++-- frontend/src/i18n/modules/import/sv.json | 4 ++-- frontend/src/i18n/modules/import/th.json | 4 ++-- frontend/src/i18n/modules/import/tr.json | 4 ++-- frontend/src/i18n/modules/import/uk.json | 4 ++-- frontend/src/i18n/modules/import/vi.json | 4 ++-- frontend/src/i18n/modules/import/zh-CN.json | 4 ++-- frontend/src/i18n/modules/import/zh-TW.json | 4 ++-- frontend/src/ui/import/index.ts | 9 +++++---- frontend/src/ui/import/sheet.ts | 4 +++- 26 files changed, 56 insertions(+), 53 deletions(-) diff --git a/frontend/src/i18n/modules/import/cs.json b/frontend/src/i18n/modules/import/cs.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/cs.json +++ b/frontend/src/i18n/modules/import/cs.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/da.json b/frontend/src/i18n/modules/import/da.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/da.json +++ b/frontend/src/i18n/modules/import/da.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/de.json b/frontend/src/i18n/modules/import/de.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/de.json +++ b/frontend/src/i18n/modules/import/de.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/es.json b/frontend/src/i18n/modules/import/es.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/es.json +++ b/frontend/src/i18n/modules/import/es.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/fi.json b/frontend/src/i18n/modules/import/fi.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/fi.json +++ b/frontend/src/i18n/modules/import/fi.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/fr.json b/frontend/src/i18n/modules/import/fr.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/fr.json +++ b/frontend/src/i18n/modules/import/fr.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/hu.json b/frontend/src/i18n/modules/import/hu.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/hu.json +++ b/frontend/src/i18n/modules/import/hu.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/id.json b/frontend/src/i18n/modules/import/id.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/id.json +++ b/frontend/src/i18n/modules/import/id.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/it.json b/frontend/src/i18n/modules/import/it.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/it.json +++ b/frontend/src/i18n/modules/import/it.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/ja.json b/frontend/src/i18n/modules/import/ja.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/ja.json +++ b/frontend/src/i18n/modules/import/ja.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/ko.json b/frontend/src/i18n/modules/import/ko.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/ko.json +++ b/frontend/src/i18n/modules/import/ko.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/nb.json b/frontend/src/i18n/modules/import/nb.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/nb.json +++ b/frontend/src/i18n/modules/import/nb.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/nl.json b/frontend/src/i18n/modules/import/nl.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/nl.json +++ b/frontend/src/i18n/modules/import/nl.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/pl.json b/frontend/src/i18n/modules/import/pl.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/pl.json +++ b/frontend/src/i18n/modules/import/pl.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/pt-BR.json b/frontend/src/i18n/modules/import/pt-BR.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/pt-BR.json +++ b/frontend/src/i18n/modules/import/pt-BR.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/ru.json b/frontend/src/i18n/modules/import/ru.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/ru.json +++ b/frontend/src/i18n/modules/import/ru.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/strings.json b/frontend/src/i18n/modules/import/strings.json index d5935f9a..73feedd0 100644 --- a/frontend/src/i18n/modules/import/strings.json +++ b/frontend/src/i18n/modules/import/strings.json @@ -47,7 +47,7 @@ "Reading the file...", "Recent Imports", "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job", "The file says it is in {unit}.", "The import failed", - "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.", "The upload failed ({status})", "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/sv.json b/frontend/src/i18n/modules/import/sv.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/sv.json +++ b/frontend/src/i18n/modules/import/sv.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/th.json b/frontend/src/i18n/modules/import/th.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/th.json +++ b/frontend/src/i18n/modules/import/th.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/tr.json b/frontend/src/i18n/modules/import/tr.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/tr.json +++ b/frontend/src/i18n/modules/import/tr.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/uk.json b/frontend/src/i18n/modules/import/uk.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/uk.json +++ b/frontend/src/i18n/modules/import/uk.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/vi.json b/frontend/src/i18n/modules/import/vi.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/vi.json +++ b/frontend/src/i18n/modules/import/vi.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/zh-CN.json b/frontend/src/i18n/modules/import/zh-CN.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/zh-CN.json +++ b/frontend/src/i18n/modules/import/zh-CN.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/i18n/modules/import/zh-TW.json b/frontend/src/i18n/modules/import/zh-TW.json index 021d8966..b9546484 100644 --- a/frontend/src/i18n/modules/import/zh-TW.json +++ b/frontend/src/i18n/modules/import/zh-TW.json @@ -47,7 +47,7 @@ "Reading the file...": "Reading the file...", "Recent Imports": "Recent Imports", "Reimport": "Reimport", - "Reimported: {matched} parts updated, {added} new, {hidden} hidden.": "Reimported: {matched} parts updated, {added} new, {hidden} hidden.", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", "Size": "Size", @@ -57,7 +57,7 @@ "The engine did not start an import job": "The engine did not start an import job", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", - "The import goes on; {n} files after it were not imported.": "The import goes on; {n} files after it were not imported.", + "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", "The import of {name} was cancelled.": "The import of {name} was cancelled.", "The upload failed ({status})": "The upload failed ({status})", "The upload was cancelled": "The upload was cancelled", diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index 5aeb0e78..09e5635d 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -40,9 +40,10 @@ export function mount(ctx: ModuleContext): void { if (outcome.state === 'failed') { ctx.toast(t('Could not import {name}: {reason}', { name, reason: outcome.error }), 'error'); return; } const c = resultCounts(outcome.result); let text = t('Imported {name}.', { name }); - if (c.parts !== null && c.triangles !== null) text = t('Imported {name}: {parts} parts, {triangles} triangles.', { name, parts: c.parts, triangles: new Intl.NumberFormat().format(c.triangles) }); - else if (c.parts !== null) text = t('Imported {name}: {parts} parts.', { name, parts: c.parts }); - if (c.warnings.length) text = `${text} ${t('{n} warnings; the Scene page lists the parts.', { n: c.warnings.length })}`; + if (c.parts !== null && c.parts > 1 && c.triangles !== null) text = t('Imported {name}: {parts} parts, {triangles} triangles.', { name, parts: c.parts, triangles: new Intl.NumberFormat().format(c.triangles) }); + else if (c.parts !== null && c.parts > 1) text = t('Imported {name}: {parts} parts.', { name, parts: c.parts }); + if (c.warnings.length > 1) text = `${text} ${t('{n} warnings; the Scene page lists the parts.', { n: c.warnings.length })}`; + else if (c.warnings.length === 1) text = `${text} ${c.warnings[0]}`; ctx.toast(text); changed(); events.emit({ type: 'ui.import.done', name, path }); @@ -119,7 +120,7 @@ export function mount(ctx: ModuleContext): void { const out = await api.dispatch(COMMANDS.reimport, nodes.length ? { nodes } : {}, { timeoutMs: 600000 }); const o = out && typeof out === 'object' ? out as Record : {}; const n = (k: string): number => (typeof o[k] === 'number' ? o[k] as number : Array.isArray(o[k]) ? (o[k] as unknown[]).length : 0); - ctx.toast(t('Reimported: {matched} parts updated, {added} new, {hidden} hidden.', { matched: n('matched'), added: n('added'), hidden: n('hidden') })); + ctx.toast(t('Reimported: updated {matched}, new {added}, hidden {hidden}.', { matched: n('matched'), added: n('added'), hidden: n('hidden') })); changed(); } catch (err) { ctx.toast(t('Could not reimport: {reason}', { reason: errorText(err) }), 'error'); diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index 4cc06dab..9199c6d1 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -357,6 +357,8 @@ export class ImportSheet { if (this.uploadId && this.phase !== 'running') removeUpload(this.uploadId); const after = this.sources.length - this.index - 1; if (wasClosed || after <= 0) return; - toast(this.phase === 'running' ? t('The import goes on; {n} files after it were not imported.', { n: after }) : t('{n} files were not imported.', { n: after + (this.phase === 'finished' ? 0 : 1) })); + const left = after + (this.phase === 'finished' ? 0 : 1); + if (this.phase === 'running') toast(t('The import goes on; the files after it were not imported.')); + else if (left > 1) toast(t('{n} files were not imported.', { n: left })); } } From 365e10b7eed29d5f33f419836788c9e49df985ab Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:15:51 -0500 Subject: [PATCH 019/494] feat(import): import with Enter and stop claiming to read while uploading Enter anywhere in the sheet except a select starts the import once the file is ready, and the summary stays empty while the upload row runs, saying Reading the file only once the engine is probing. Ran in headless Chrome: Enter on the Merge checkbox started the import and it finished; a 1 MB/s throttled upload showed Uploading with its percentage, and Cancel there removed the partial upload folder on the service. --- frontend/src/ui/import/sheet.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index 9199c6d1..94351e62 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -139,6 +139,12 @@ export class ImportSheet { setValue(this.cad, k.cad_quality); for (const key of Object.keys(this.boxes) as Array) setChecked(this.boxes[key], k[key]); this.units.addEventListener('change', () => { this.unitsTouched = true; this.unitNote(); }); + this.root.addEventListener('keydown', (e) => { + if (e.key !== 'Enter' || e.target instanceof HTMLSelectElement || this.phase !== 'ready') return; + e.preventDefault(); + e.stopPropagation(); + this.start(); + }); this.cancelBtn = d.action('Cancel', () => this.cancel()); this.allBtn = d.action('Import All', () => { this.all = true; this.start(); }); this.importBtn = d.action('Import', () => this.start(), 'primary'); @@ -189,7 +195,7 @@ export class ImportSheet { q(this.root, '.fsh-imp-cad').classList.toggle('is-off', !isCad(src.name)); for (const f of ['format', 'triangles', 'parts', 'materials', 'size', 'up']) this.field(f, ''); this.field('format', formatName(src.name)); - this.notes(t('Reading the file...'), []); + this.notes(src.kind === 'browser' ? '' : t('Reading the file...'), []); if (!this.unitsTouched && this.units.value !== 'auto') this.units.value = 'auto'; this.unitNote(); this.progress(null); @@ -219,6 +225,7 @@ export class ImportSheet { } this.sending = null; this.progress(null); + this.notes(t('Reading the file...'), []); } if (catalogue.state === 'unknown') await catalogue.load(); if (token !== this.token) return; From 6c4dff96dc5b101253ab414f3e0989c42d1c689d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:29 -0500 Subject: [PATCH 020/494] fix(import): name the probed format the way the file line does The summary upper-cased the engine's format id (GLTF) while the file line said glTF; both now go through the same format names, falling back to upper case for ids the window does not know. Ran npx tsc --noEmit and a path import of pair.gltf in headless Chrome. --- frontend/src/ui/import/sheet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index 94351e62..1ac81a0c 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -247,7 +247,7 @@ export class ImportSheet { private fill(p: Probe): void { this.probed = p; - if (p.format) this.field('format', p.format.toUpperCase()); + if (p.format) this.field('format', formatName(`file.${p.format}`) || p.format.toUpperCase()); this.field('triangles', numberText(p.triangles)); this.field('parts', numberText(p.meshes ?? p.nodes)); this.field('materials', numberText(p.materials)); From 71dcea0e9ffe3f98a2a4ac47072b94fe51374681 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:37:53 -0500 Subject: [PATCH 021/494] fix(commands): route command group names to the engine dispatch_value only sent the built-in engine command names to engine_command, so every command a group module declared answered unknown_command. Names from the group modules now take the same path. Ran cargo clippy -p fsh-commands with -D warnings. --- native/crates/fsh-commands/src/engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index cff2d990..85504991 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -310,7 +310,7 @@ impl Engine { let mut st = lock(&self.state); let (name, mut args) = alias::translate(name, args, st.editor.document())?; numeric_keys(&mut args); - if ENGINE_COMMANDS.iter().any(|c| c.name == name) { + if ENGINE_COMMANDS.iter().any(|c| c.name == name) || crate::ext::commands().any(|c| c.name == name) { return self.engine_command(&mut st, &name, &args); } if !Command::NAMES.contains(&name.as_str()) { From fd24450507768e81cf9a5e8d2f2f738e0ff0ee0d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:01:06 -0500 Subject: [PATCH 022/494] feat(io): recognise which Form app wrote a model file fsh_io::family gains FamilyApp and origin_of, which read the writer from a glTF generator and extras, the first comment of an OBJ, or the Application metadata inside a 3MF, as FormCAD, FormSculpt, FormSurface and FormFabric write them. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/app.rs | 158 +++++++++++++++++++++++++ native/crates/fsh-io/src/family/mod.rs | 4 + 2 files changed, 162 insertions(+) create mode 100644 native/crates/fsh-io/src/family/app.rs diff --git a/native/crates/fsh-io/src/family/app.rs b/native/crates/fsh-io/src/family/app.rs new file mode 100644 index 00000000..3a579a66 --- /dev/null +++ b/native/crates/fsh-io/src/family/app.rs @@ -0,0 +1,158 @@ +use crate::deflate; +use serde_json::Value; +use std::path::Path; + +/// A Form app whose exports FormShot receives. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum FamilyApp { + /// FormCAD (CAD; GLB, 3MF, STEP, STL, OBJ, PLY). + FormCad, + /// FormSculpt (sculpting; GoF folder with GLB, OBJ, FBX). + FormSculpt, + /// FormSurface (texture painting; map folders and an OBJ). + FormSurface, + /// FormFabric (garments; GLB, OBJ, FBX and GoF entries). + FormFabric, +} + +impl FamilyApp { + /// Every app. + pub const ALL: [FamilyApp; 4] = [FamilyApp::FormCad, FamilyApp::FormSculpt, FamilyApp::FormSurface, FamilyApp::FormFabric]; + + /// Lower-case id as the family writes it ("formsculpt" in gof.json). + pub fn id(self) -> &'static str { + match self { + FamilyApp::FormCad => "formcad", + FamilyApp::FormSculpt => "formsculpt", + FamilyApp::FormSurface => "formsurface", + FamilyApp::FormFabric => "formfabric", + } + } + + /// Display name. + pub fn name(self) -> &'static str { + match self { + FamilyApp::FormCad => "FormCAD", + FamilyApp::FormSculpt => "FormSculpt", + FamilyApp::FormSurface => "FormSurface", + FamilyApp::FormFabric => "FormFabric", + } + } + + /// Parses an id or a display name, ignoring case. + pub fn parse(s: &str) -> Option { + let s = s.trim(); + Self::ALL.into_iter().find(|a| a.id().eq_ignore_ascii_case(s) || a.name().eq_ignore_ascii_case(s)) + } +} + +/// What a model file says about the program that wrote it. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Origin { + /// The family app, when the file names one. + pub app: Option, + /// The writer as the file names it (glTF generator, OBJ first comment, 3MF Application). + pub writer: Option, + /// A title the file carries (FormCAD's glTF extras and 3MF Title). + pub title: Option, + /// The unit the model was designed in, when the file records it apart from its own unit (FormCAD's sourceUnit). + pub design_unit: Option, +} + +fn app_of_writer(writer: &str) -> Option { + let w = writer.trim(); + let first = w.split_whitespace().next().unwrap_or(""); + FamilyApp::parse(first) +} + +pub(crate) fn glb_json(bytes: &[u8]) -> Option { + if bytes.len() < 20 || &bytes[..4] != b"glTF" { + return None; + } + let len = u32::from_le_bytes(bytes[12..16].try_into().ok()?) as usize; + if &bytes[16..20] != b"JSON" || 20 + len > bytes.len() { + return None; + } + serde_json::from_slice(&bytes[20..20 + len]).ok() +} + +fn gltf_origin(json: &Value) -> Origin { + let asset = json.get("asset"); + let writer = asset.and_then(|a| a.get("generator")).and_then(Value::as_str).map(str::to_string); + let extras = asset.and_then(|a| a.get("extras")); + let text = |k: &str| extras.and_then(|e| e.get(k)).and_then(Value::as_str).filter(|s| !s.trim().is_empty()).map(str::to_string); + Origin { app: writer.as_deref().and_then(app_of_writer), writer, title: text("title"), design_unit: text("sourceUnit") } +} + +fn obj_origin(bytes: &[u8]) -> Origin { + let head = String::from_utf8_lossy(&bytes[..bytes.len().min(512)]); + let Some(first) = head.lines().next().and_then(|l| l.strip_prefix('#')) else { return Origin::default() }; + let writer = first.trim().to_string(); + match app_of_writer(&writer) { + Some(app) => Origin { app: Some(app), writer: Some(writer), ..Origin::default() }, + None => Origin::default(), + } +} + +fn zip_member(bytes: &[u8], wanted: &str) -> Option> { + let tail = bytes.len().saturating_sub(65_557); + let eocd = (tail..bytes.len().saturating_sub(21)).rev().find(|&i| bytes[i..i + 4] == [0x50, 0x4b, 0x05, 0x06])?; + let u16_at = |i: usize| -> Option { Some(u16::from_le_bytes(bytes.get(i..i + 2)?.try_into().ok()?) as usize) }; + let u32_at = |i: usize| -> Option { Some(u32::from_le_bytes(bytes.get(i..i + 4)?.try_into().ok()?) as usize) }; + let count = u16_at(eocd + 10)?; + let mut at = u32_at(eocd + 16)?; + for _ in 0..count { + if bytes.get(at..at + 4)? != [0x50, 0x4b, 0x01, 0x02] { + return None; + } + let method = u16_at(at + 10)?; + let packed = u32_at(at + 20)?; + let size = u32_at(at + 24)?; + let (name_len, extra_len, note_len) = (u16_at(at + 28)?, u16_at(at + 30)?, u16_at(at + 32)?); + let local = u32_at(at + 42)?; + let name = String::from_utf8_lossy(bytes.get(at + 46..at + 46 + name_len)?).to_string(); + at += 46 + name_len + extra_len + note_len; + if !name.trim_start_matches('/').eq_ignore_ascii_case(wanted) || size > 64 << 20 { + continue; + } + let start = local + 30 + u16_at(local + 26)? + u16_at(local + 28)?; + let data = bytes.get(start..start + packed)?; + return match method { + 0 => Some(data.to_vec()), + 8 => deflate::inflate(data, size.max(1)).ok().map(|(out, _)| out), + _ => None, + }; + } + None +} + +fn xml_metadata(xml: &str, name: &str) -> Option { + let key = format!("name=\"{name}\""); + let at = xml.find(&key)?; + let open = at + xml[at..].find('>')? + 1; + let close = open + xml[open..].find("")?; + let value = xml[open..close].replace("&", "&").replace("<", "<").replace(">", ">").replace(""", "\""); + Some(value.trim().to_string()).filter(|v| !v.is_empty()) +} + +fn threemf_origin(bytes: &[u8]) -> Origin { + let Some(model) = zip_member(bytes, "3D/3dmodel.model") else { return Origin::default() }; + let xml = String::from_utf8_lossy(&model[..model.len().min(1 << 20)]).to_string(); + let writer = xml_metadata(&xml, "Application"); + Origin { app: writer.as_deref().and_then(app_of_writer), title: xml_metadata(&xml, "Title"), writer, design_unit: None } +} + +/// Reads who wrote a model file from its content: the glTF generator and extras, the first comment of an OBJ, the +/// Application metadata of a 3MF. +pub fn origin_of(path: &Path, bytes: &[u8]) -> Origin { + if let Some(json) = glb_json(bytes) { + return gltf_origin(&json); + } + let ext = path.extension().and_then(|e| e.to_str()).map(str::to_ascii_lowercase).unwrap_or_default(); + match ext.as_str() { + "gltf" => serde_json::from_slice::(bytes).map(|j| gltf_origin(&j)).unwrap_or_default(), + "obj" => obj_origin(bytes), + "3mf" => threemf_origin(bytes), + _ => Origin::default(), + } +} diff --git a/native/crates/fsh-io/src/family/mod.rs b/native/crates/fsh-io/src/family/mod.rs index 2230239a..b7c124d6 100644 --- a/native/crates/fsh-io/src/family/mod.rs +++ b/native/crates/fsh-io/src/family/mod.rs @@ -1 +1,5 @@ //! What other Form apps hand over: their export folders and files, read into the same raw scene as any model. + +mod app; + +pub use app::{origin_of, FamilyApp, Origin}; From 78e15c70ca99d45ea0c3737878e8a8c0ec91be99 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:01:38 -0500 Subject: [PATCH 023/494] feat(io): read the family's GoF folder manifest read_gof parses gof.json as FormSculpt's gof_send and FormFabric's gof.send write it: entries with file, format, target, units, scale, sent and the writing app, and picks the newest entry meant for FormShot (target any or formshot). Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/gof.rs | 193 +++++++++++++++++++++++++ native/crates/fsh-io/src/family/mod.rs | 2 + 2 files changed, 195 insertions(+) create mode 100644 native/crates/fsh-io/src/family/gof.rs diff --git a/native/crates/fsh-io/src/family/gof.rs b/native/crates/fsh-io/src/family/gof.rs new file mode 100644 index 00000000..a6f65cfb --- /dev/null +++ b/native/crates/fsh-io/src/family/gof.rs @@ -0,0 +1,193 @@ +use super::FamilyApp; +use crate::error::{IoError, Result}; +use serde_json::{json, Value}; +use std::path::{Path, PathBuf}; + +/// The manifest file name in a GoF folder. +pub const GOF_MANIFEST: &str = "gof.json"; + +/// GoF targets FormShot takes without being named: "any" and its own name. +pub const GOF_TARGETS: [&str; 2] = ["formshot", "any"]; + +const MAX_MANIFEST: u64 = 4 << 20; + +/// One object a sender put in the GoF folder. +#[derive(Clone, Debug, PartialEq)] +pub struct GofEntry { + /// Sender's object id. + pub id: i64, + /// Object name in the sender. + pub name: String, + /// File name inside the folder. + pub file: String, + /// glb, fbx, obj or package. + pub format: String, + /// The app it was sent for (blender, unreal, unity, formsurface, substance, any). + pub target: String, + /// Sender's revision of the object. + pub revision: i64, + /// Vertex count the sender wrote. + pub vertices: u64, + /// Triangle count the sender wrote. + pub triangles: u64, + /// When it was sent, Unix seconds. + pub sent: i64, + /// True when the file is a bridge the sender reads back. + pub returns: bool, + /// Unit of the file: m, cm or scene. + pub units: Option, + /// Sender scene units to file units. + pub scale: Option, + /// The app that wrote the entry: the entry's own `app`, else the manifest's. + pub app: Option, + /// The writer's name as the manifest gives it, when it is not a family app. + pub writer: String, +} + +impl GofEntry { + /// The file's path in `folder`. + pub fn path_in(&self, folder: &Path) -> PathBuf { + folder.join(&self.file) + } + + /// True when FormShot is meant to take it without being named (target any or formshot). + pub fn for_formshot(&self) -> bool { + GOF_TARGETS.contains(&self.target.as_str()) + } + + /// The entry as JSON, with whether its file is present in `folder`. + pub fn to_json(&self, folder: &Path) -> Value { + json!({ + "id": self.id, "name": self.name, "file": self.file, "path": self.path_in(folder).to_string_lossy(), + "present": self.path_in(folder).is_file(), "format": self.format, "target": self.target, + "revision": self.revision, "vertices": self.vertices, "triangles": self.triangles, "sent": self.sent, + "returns": self.returns, "units": self.units, "scale": self.scale, + "app": self.app.map(FamilyApp::id), "app_name": self.app.map(FamilyApp::name).unwrap_or(self.writer.as_str()), + }) + } +} + +/// A GoF folder's manifest. +#[derive(Clone, Debug, PartialEq)] +pub struct GofManifest { + /// The folder. + pub folder: PathBuf, + /// Manifest version (1). + pub gof: i64, + /// The app that wrote the manifest last. + pub app: Option, + /// That app's name as written. + pub writer: String, + /// That app's version. + pub version: String, + /// Up axis of the files ("y"). + pub up_axis: String, + /// Sender's real size: millimetres per scene unit, when it has one. + pub mm_per_unit: Option, + /// Objects, newest last. + pub objects: Vec, +} + +impl GofManifest { + /// The entry for a file name, or for an id given as text. + pub fn find(&self, item: &str) -> Option<&GofEntry> { + let item = item.trim(); + self.objects + .iter() + .rev() + .find(|e| e.file == item) + .or_else(|| item.parse::().ok().and_then(|id| self.objects.iter().rev().find(|e| e.id == id))) + .or_else(|| self.objects.iter().rev().find(|e| e.name == item)) + } + + /// The entry FormShot opens when none is named: the newest meant for FormShot whose file is present, else the + /// newest present one that FormShot can read. + pub fn newest(&self) -> Option<&GofEntry> { + let readable = |e: &&GofEntry| e.format != "package" && e.path_in(&self.folder).is_file(); + let newest = |only: bool| self.objects.iter().filter(readable).filter(|e| !only || e.for_formshot()).max_by_key(|e| e.sent); + newest(true).or_else(|| newest(false)) + } + + /// The manifest as JSON. + pub fn to_json(&self) -> Value { + json!({ + "folder": self.folder.to_string_lossy(), "gof": self.gof, "app": self.app.map(FamilyApp::id), + "app_name": self.app.map(FamilyApp::name).unwrap_or(self.writer.as_str()), "version": self.version, + "up_axis": self.up_axis, "mm_per_unit": self.mm_per_unit, + "objects": self.objects.iter().map(|e| e.to_json(&self.folder)).collect::>(), + }) + } +} + +fn text(v: &Value, k: &str) -> String { + match v.get(k) { + Some(Value::String(s)) => s.clone(), + Some(Value::Number(n)) => n.to_string(), + _ => String::new(), + } +} + +fn int(v: &Value, k: &str) -> i64 { + v.get(k).and_then(|x| x.as_i64().or_else(|| x.as_f64().map(|f| f as i64))).unwrap_or(0) +} + +fn entry(v: &Value, top: Option, top_writer: &str) -> Option { + let file = text(v, "file"); + if file.is_empty() || Path::new(&file).file_name().and_then(|n| n.to_str()) != Some(file.as_str()) { + return None; + } + let own = text(v, "app"); + let app = FamilyApp::parse(&own).or(if own.is_empty() { top } else { None }); + let format = match text(v, "format").to_ascii_lowercase() { + f if f.is_empty() => Path::new(&file).extension().and_then(|e| e.to_str()).unwrap_or("").to_ascii_lowercase(), + f => f, + }; + Some(GofEntry { + id: int(v, "id"), + name: Some(text(v, "name")).filter(|n| !n.is_empty()).unwrap_or_else(|| file.clone()), + format, + target: text(v, "target").to_ascii_lowercase(), + revision: int(v, "revision"), + vertices: int(v, "vertices").max(0) as u64, + triangles: int(v, "triangles").max(0) as u64, + sent: int(v, "sent"), + returns: v.get("returns").and_then(Value::as_bool).unwrap_or(false), + units: Some(text(v, "units")).filter(|u| !u.is_empty()), + scale: v.get("scale").and_then(Value::as_f64), + app, + writer: if own.is_empty() { top_writer.to_string() } else { own }, + file, + }) +} + +/// True when `folder` holds a GoF manifest. +pub fn is_gof_folder(folder: &Path) -> bool { + folder.join(GOF_MANIFEST).is_file() +} + +/// Reads a GoF folder's manifest; entries whose file name is not a plain name are skipped. +pub fn read_gof(folder: &Path) -> Result { + let path = folder.join(GOF_MANIFEST); + let size = std::fs::metadata(&path).map_err(|e| IoError::Io(format!("{}: {e}", path.display())))?.len(); + if size > MAX_MANIFEST { + return Err(IoError::Unsupported(format!("{} is larger than 4 MB", path.display()))); + } + let bytes = std::fs::read(&path)?; + let v: Value = serde_json::from_slice(&bytes).map_err(|e| IoError::Malformed(format!("{GOF_MANIFEST}: {e}")))?; + if !v.is_object() { + return Err(IoError::Malformed(format!("{GOF_MANIFEST} is not an object"))); + } + let writer = text(&v, "app"); + let app = FamilyApp::parse(&writer); + let objects = v.get("objects").and_then(Value::as_array).map(|a| a.iter().filter_map(|o| entry(o, app, &writer)).collect()).unwrap_or_default(); + Ok(GofManifest { + folder: folder.to_path_buf(), + gof: int(&v, "gof"), + app, + writer, + version: text(&v, "version"), + up_axis: Some(text(&v, "up_axis")).filter(|u| !u.is_empty()).unwrap_or_else(|| "y".into()), + mm_per_unit: v.get("mm_per_unit").and_then(Value::as_f64), + objects, + }) +} diff --git a/native/crates/fsh-io/src/family/mod.rs b/native/crates/fsh-io/src/family/mod.rs index b7c124d6..f5be8c09 100644 --- a/native/crates/fsh-io/src/family/mod.rs +++ b/native/crates/fsh-io/src/family/mod.rs @@ -1,5 +1,7 @@ //! What other Form apps hand over: their export folders and files, read into the same raw scene as any model. mod app; +mod gof; pub use app::{origin_of, FamilyApp, Origin}; +pub use gof::{is_gof_folder, read_gof, GofEntry, GofManifest, GOF_MANIFEST, GOF_TARGETS}; From 2136ff32697091c71c4a853cefdc9296d57224db Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:02:38 -0500 Subject: [PATCH 024/494] feat(io): name FormSurface's exported maps by role and colour space read_maps reads _[_][.]. as FormSurface's own names and its built-in templates write them, giving each file a texture slot role, the packed source, sRGB or linear (float files linear), UV set, texture set and UDIM tile; the unreal template's Normal is marked DirectX. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/maps.rs | 243 ++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 native/crates/fsh-io/src/family/maps.rs diff --git a/native/crates/fsh-io/src/family/maps.rs b/native/crates/fsh-io/src/family/maps.rs new file mode 100644 index 00000000..1daa0055 --- /dev/null +++ b/native/crates/fsh-io/src/family/maps.rs @@ -0,0 +1,243 @@ +use fsh_scene::TextureRole; +use serde_json::{json, Value}; +use std::path::{Path, PathBuf}; + +/// Picture extensions FormSurface writes maps in. +pub const MAP_EXTENSIONS: [&str; 8] = ["png", "tif", "tiff", "exr", "hdr", "jpg", "jpeg", "psd"]; + +const SRGB: &str = "srgb"; +const LINEAR: &str = "linear"; + +struct Known { + name: &'static str, + source: &'static str, + role: TextureRole, + colour: bool, +} + +const fn k(name: &'static str, source: &'static str, role: TextureRole, colour: bool) -> Known { + Known { name, source, role, colour } +} + +use TextureRole::{BaseColour, Bump, Emission, Metalness, Normal, OcclusionRoughnessMetalness as Orm, Opacity, Other, Roughness}; + +const KNOWN: &[Known] = &[ + k("basecolor", "basecolor", BaseColour, true), + k("baseColor", "basecolor", BaseColour, true), + k("BaseColor", "basecolor", BaseColour, true), + k("BaseMap", "basecolor", BaseColour, true), + k("albedo", "basecolor", BaseColour, true), + k("diffuseColor", "basecolor", BaseColour, true), + k("Albedo", "diffuse", BaseColour, true), + k("Diffuse", "diffuse", BaseColour, true), + k("roughness", "roughness", Roughness, false), + k("Roughness", "roughness", Roughness, false), + k("SpecularRoughness", "roughness", Roughness, false), + k("metallic", "metallic", Metalness, false), + k("Metallic", "metallic", Metalness, false), + k("Metalness", "metallic", Metalness, false), + k("height", "height", Bump, false), + k("Height", "height", Bump, false), + k("displacement", "height", Bump, false), + k("normal", "normal_gl", Normal, false), + k("Normal", "normal_gl", Normal, false), + k("occlusionRoughnessMetallic", "ao_roughness_metallic", Orm, false), + k("OcclusionRoughnessMetallic", "ao_roughness_metallic", Orm, false), + k("orm", "ao_roughness_metallic", Orm, false), + k("opacity", "opacity", Opacity, false), + k("emissive", "emissive", Emission, true), + k("Emissive", "emissive", Emission, true), + k("ambient_occlusion", "ao", Other, false), + k("occlusion", "ao", Other, false), + k("Occlusion", "ao", Other, false), + k("AO", "ao", Other, false), + k("ambient_occlusion_high", "ao_high", Other, false), + k("height_high", "height_high", Other, false), + k("MaskMap", "metallic_ao_smoothness", Other, false), + k("MetallicSmoothness", "metallic_smoothness", Other, false), + k("SpecularSmoothness", "specular_smoothness", Other, true), + k("Specular", "specular", Other, true), + k("Glossiness", "smoothness", Other, false), + k("curvature", "curvature", Other, false), + k("thickness", "thickness", Other, false), + k("position", "position", Other, false), + k("world_normal", "world_normal", Other, false), + k("bent_normal", "bent_normal", Other, false), + k("normal_baked", "normal_baked", Other, false), + k("id", "id", Other, false), +]; + +/// One map file of a map set, with what it drives. +#[derive(Clone, Debug, PartialEq)] +pub struct MapRef { + /// Absolute path. + pub path: PathBuf, + /// File name. + pub file: String, + /// The map's name as written in the file name ("basecolor", "BaseColor", "OcclusionRoughnessMetallic"). + pub map: String, + /// What FormSurface packed into it: basecolor, diffuse, roughness, metallic, height, normal_gl, normal_dx, + /// ao_roughness_metallic, metallic_ao_smoothness, ao, opacity, emissive, or the map's own name. + pub source: String, + /// The texture slot role in FormShot's document. + pub role: TextureRole, + /// "srgb" for colour maps in 8 and 16 bit files, "linear" for data maps and float files. + pub colour_space: &'static str, + /// UV set (FormSurface paints UV0; its uv_channel 1 export is not told apart by the files). + pub uv_set: u32, + /// Texture set (material) name; empty when the folder holds one set. + pub texture_set: String, + /// UDIM tile, for tiled sets. + pub udim: Option, + /// File extension, lower case. + pub format: String, +} + +impl MapRef { + /// The map as JSON. + pub fn to_json(&self) -> Value { + json!({ + "path": self.path.to_string_lossy(), "file": self.file, "map": self.map, "source": self.source, + "role": role_name(self.role), "colour_space": self.colour_space, "uv_set": self.uv_set, + "texture_set": self.texture_set, "udim": self.udim, "format": self.format, + }) + } +} + +/// The document's name for a texture role. +pub fn role_name(role: TextureRole) -> &'static str { + match role { + BaseColour => "base_colour", + Roughness => "roughness", + Metalness => "metalness", + Normal => "normal", + Bump => "bump", + Opacity => "opacity", + Emission => "emission", + Orm => "occlusion_roughness_metalness", + Other => "other", + } +} + +fn is_map_file(path: &Path) -> bool { + path.is_file() + && path + .extension() + .and_then(|e| e.to_str()) + .is_some_and(|e| MAP_EXTENSIONS.iter().any(|m| e.eq_ignore_ascii_case(m))) +} + +fn split_udim(name: &str) -> (&str, Option) { + if let Some((rest, tile)) = name.rsplit_once('.') { + if tile.len() == 4 && tile.bytes().all(|b| b.is_ascii_digit()) { + if let Ok(n) = tile.parse::() { + if (1001..=1999).contains(&n) { + return (rest, Some(n)); + } + } + } + } + (name, None) +} + +fn known_for(rest: &str) -> Option<(&'static Known, String)> { + let mut order: Vec<&Known> = KNOWN.iter().collect(); + order.sort_by_key(|k| std::cmp::Reverse(k.name.len())); + let pick = |exact: bool| { + order.iter().copied().find_map(|k| { + let same = |a: &str, b: &str| if exact { a == b } else { a.eq_ignore_ascii_case(b) }; + if same(rest, k.name) { + return Some((k, String::new())); + } + let cut = rest.len().checked_sub(k.name.len() + 1)?; + let (head, tail) = (rest.get(..cut)?, rest.get(cut..)?); + (tail.starts_with('_') && same(&tail[1..], k.name) && !head.is_empty()).then(|| (k, head.to_string())) + }) + }; + pick(true).or_else(|| pick(false)) +} + +/// Cleans a material name the way FormSurface names a texture set's files (letters, digits, dash, underscore). +pub fn set_name(material: &str) -> String { + material.chars().map(|c| if c.is_ascii_alphanumeric() || c == '-' || c == '_' { c } else { '_' }).collect() +} + +/// Reads the maps in a FormSurface export folder: `_[_][.].`. Files that name no known +/// map are skipped. The unreal template's `Normal` is DirectX (green down), every other normal OpenGL. +pub fn read_maps(folder: &Path, stem: &str) -> Vec { + let Ok(dir) = std::fs::read_dir(folder) else { return Vec::new() }; + let mut files: Vec = dir.filter_map(|e| e.ok().map(|e| e.path())).filter(|p| is_map_file(p)).collect(); + files.sort(); + let mut maps = Vec::new(); + for path in files { + let Some(file) = path.file_name().and_then(|n| n.to_str()).map(str::to_string) else { continue }; + let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("").to_ascii_lowercase(); + let base = &file[..file.len() - ext.len() - 1]; + let (base, udim) = split_udim(base); + let prefix = format!("{stem}_"); + let rest = base.strip_prefix(prefix.as_str()).unwrap_or(base); + let Some((known, texture_set)) = known_for(rest) else { continue }; + let float = matches!(ext.as_str(), "exr" | "hdr"); + let map = rest[rest.len() - known.name.len()..].to_string(); + maps.push(MapRef { + path: path.canonicalize().unwrap_or(path.clone()), + file, + map, + source: known.source.to_string(), + role: known.role, + colour_space: if known.colour && !float { SRGB } else { LINEAR }, + uv_set: 0, + texture_set, + udim, + format: ext, + }); + } + let unreal = maps.iter().any(|m| m.map == "OcclusionRoughnessMetallic"); + for m in maps.iter_mut().filter(|m| m.map == "Normal" && unreal) { + m.source = "normal_dx".into(); + } + maps +} + +/// The texture sets the maps name, in file order; one empty name when the folder holds a single set. +pub fn texture_sets(maps: &[MapRef]) -> Vec { + let mut sets: Vec = Vec::new(); + for m in maps { + if !sets.contains(&m.texture_set) { + sets.push(m.texture_set.clone()); + } + } + sets +} + +/// The template a set of map names matches, when it matches one of FormSurface's built-in templates. +pub fn template_of(maps: &[MapRef]) -> Option<&'static str> { + let has = |n: &str| maps.iter().any(|m| m.map == n); + Some(if has("OcclusionRoughnessMetallic") { + "unreal" + } else if has("occlusionRoughnessMetallic") { + "gltf" + } else if has("MaskMap") { + "unity_hdrp" + } else if has("MetallicSmoothness") { + "unity_urp" + } else if has("SpecularSmoothness") { + "unity_standard_specular" + } else if has("orm") { + "godot" + } else if has("diffuseColor") { + "usd" + } else if has("Glossiness") { + "spec_gloss" + } else if has("SpecularRoughness") { + "arnold" + } else if has("basecolor") { + "pbr" + } else if has("BaseColor") && has("AO") { + "sketchfab" + } else if has("BaseColor") { + "blender" + } else { + return None; + }) +} From 99e2e0278279de53bbce51c9c1efdbff6aaca4b8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:02:38 -0500 Subject: [PATCH 025/494] feat(io): read a FormSurface export folder with its mesh read_surface finds the maps named after the folder, the OBJ FormSurface writes beside them (first line # FormSurface), or else the mesh it painted from the workspace's meshes folder. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/mod.rs | 4 ++ native/crates/fsh-io/src/family/surface.rs | 71 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 native/crates/fsh-io/src/family/surface.rs diff --git a/native/crates/fsh-io/src/family/mod.rs b/native/crates/fsh-io/src/family/mod.rs index f5be8c09..8e7b62c4 100644 --- a/native/crates/fsh-io/src/family/mod.rs +++ b/native/crates/fsh-io/src/family/mod.rs @@ -2,6 +2,10 @@ mod app; mod gof; +mod maps; +mod surface; pub use app::{origin_of, FamilyApp, Origin}; pub use gof::{is_gof_folder, read_gof, GofEntry, GofManifest, GOF_MANIFEST, GOF_TARGETS}; +pub use maps::{read_maps, role_name, set_name, template_of, texture_sets, MapRef, MAP_EXTENSIONS}; +pub use surface::{is_formsurface_obj, read_surface, SurfaceExport}; diff --git a/native/crates/fsh-io/src/family/surface.rs b/native/crates/fsh-io/src/family/surface.rs new file mode 100644 index 00000000..e7cdbd5d --- /dev/null +++ b/native/crates/fsh-io/src/family/surface.rs @@ -0,0 +1,71 @@ +use super::maps::{read_maps, MapRef}; +use std::path::{Path, PathBuf}; + +const OBJ_MARK: &[u8] = b"# FormSurface"; +const MESH_EXTENSIONS: [&str; 4] = ["glb", "gltf", "obj", "fbx"]; + +/// A FormSurface export folder: `/exports//` with maps and, when exported, the painted mesh. +#[derive(Clone, Debug, PartialEq)] +pub struct SurfaceExport { + /// The folder. + pub folder: PathBuf, + /// Its name, the stem every file starts with. + pub stem: String, + /// Maps found. + pub maps: Vec, + /// The mesh: the OBJ FormSurface wrote beside the maps, else the mesh it painted, from its workspace's meshes folder. + pub mesh: Option, + /// "export" when the mesh is the OBJ in the folder, "workspace" when it is the mesh FormSurface loaded. + pub mesh_from: Option<&'static str>, +} + +/// True when the file is an OBJ FormSurface wrote (its first line starts `# FormSurface`). +pub fn is_formsurface_obj(path: &Path) -> bool { + use std::io::Read; + let mut head = [0u8; 13]; + std::fs::File::open(path).and_then(|mut f| f.read_exact(&mut head)).is_ok() && head == OBJ_MARK +} + +fn folder_stem(folder: &Path) -> String { + folder.file_name().and_then(|n| n.to_str()).unwrap_or("").to_string() +} + +fn painted_mesh(folder: &Path, stem: &str) -> Option { + let exports = folder.parent()?; + if exports.file_name().and_then(|n| n.to_str()) != Some("exports") { + return None; + } + let meshes = exports.parent()?.join("meshes"); + MESH_EXTENSIONS.iter().map(|e| meshes.join(format!("{stem}.{e}"))).find(|p| p.is_file()) +} + +/// Reads a FormSurface export folder; `None` when the folder holds neither a known map named after it nor a +/// FormSurface OBJ. +pub fn read_surface(folder: &Path) -> Option { + if !folder.is_dir() { + return None; + } + let stem = folder_stem(folder); + let maps: Vec = read_maps(folder, &stem).into_iter().filter(|m| m.file.starts_with(&format!("{stem}_"))).collect(); + let own = folder.join(format!("{stem}.obj")); + let obj = if own.is_file() && is_formsurface_obj(&own) { + Some(own) + } else { + std::fs::read_dir(folder) + .ok()? + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("obj"))) + .find(|p| is_formsurface_obj(p)) + }; + if maps.is_empty() && obj.is_none() { + return None; + } + let (mesh, mesh_from) = match obj { + Some(p) => (Some(p), Some("export")), + None => match painted_mesh(folder, &stem) { + Some(p) => (Some(p), Some("workspace")), + None => (None, None), + }, + }; + Some(SurfaceExport { folder: folder.to_path_buf(), stem, maps, mesh, mesh_from }) +} From fbd446702df448bbf4ebd2b4cf28c860053f02c9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:52 -0500 Subject: [PATCH 026/494] feat(io): inspect a hand-off and read it into a raw scene family::inspect tells a GoF folder, a FormSurface export folder or a family model file apart and names the app, title and model; Inspection::read reads the model through fsh-io's readers, renames FormCAD's Z-up root to its title, makes texture paths absolute, and puts FormSurface's maps on the materials they belong to as texture references by role. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/handoff.rs | 398 +++++++++++++++++++++ native/crates/fsh-io/src/family/mod.rs | 2 + 2 files changed, 400 insertions(+) create mode 100644 native/crates/fsh-io/src/family/handoff.rs diff --git a/native/crates/fsh-io/src/family/handoff.rs b/native/crates/fsh-io/src/family/handoff.rs new file mode 100644 index 00000000..00582bce --- /dev/null +++ b/native/crates/fsh-io/src/family/handoff.rs @@ -0,0 +1,398 @@ +use super::app::{origin_of, FamilyApp, Origin}; +use super::gof::{is_gof_folder, read_gof, GofEntry, GofManifest}; +use super::maps::{role_name, set_name, template_of, texture_sets, MapRef, MAP_EXTENSIONS}; +use super::surface::{is_formsurface_obj, read_surface, SurfaceExport}; +use crate::error::{IoError, Result}; +use crate::raw::{RawMaterial, RawScene, RawTexture}; +use crate::watch::Watch; +use fsh_scene::TextureRole; +use serde_json::{json, Value}; +use std::path::{Path, PathBuf}; + +const CAD_ROOT: &str = "FormCAD Z-up to Y-up"; + +/// What a hand-off is. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum HandoffKind { + /// One model file. + Model, + /// A FormSurface export folder: maps by role, with or without the painted mesh. + MapFolder, + /// A GoF folder; one of its entries is read. + GofFolder, +} + +impl HandoffKind { + /// Short name. + pub fn as_str(self) -> &'static str { + match self { + HandoffKind::Model => "model", + HandoffKind::MapFolder => "map_folder", + HandoffKind::GofFolder => "gof_folder", + } + } +} + +/// What a file or folder another Form app wrote is, found without reading its geometry. +#[derive(Clone, Debug, PartialEq)] +pub struct Inspection { + /// The path as given, made absolute. + pub path: PathBuf, + /// What it is. + pub kind: HandoffKind, + /// The app that wrote it, when it can be told. + pub app: Option, + /// The writer as the file names it. + pub writer: Option, + /// A name for what arrives: the sender's title or object name, else the file or folder name. + pub title: String, + /// The model file that is read, when there is one. + pub model: Option, + /// The unit the model was designed in, when the file records it apart from its own unit. + pub design_unit: Option, + /// The GoF manifest, for GoF folders and files inside one. + pub gof: Option, + /// The GoF entry that is read. + pub entry: Option, + /// The FormSurface export folder. + pub surface: Option, + /// Notes for the person. + pub warnings: Vec, +} + +fn is_map(path: &Path) -> bool { + path.extension().and_then(|e| e.to_str()).is_some_and(|e| MAP_EXTENSIONS.iter().any(|m| e.eq_ignore_ascii_case(m))) +} + +fn name_of(path: &Path) -> String { + path.file_stem().and_then(|s| s.to_str()).filter(|s| !s.is_empty()).unwrap_or("Hand-off").to_string() +} + +fn absolute(path: &Path) -> PathBuf { + path.canonicalize().unwrap_or_else(|_| if path.is_absolute() { path.to_path_buf() } else { std::env::current_dir().map(|d| d.join(path)).unwrap_or(path.to_path_buf()) }) +} + +fn model_origin(path: &Path) -> Origin { + use std::io::Read; + let ext = path.extension().and_then(|e| e.to_str()).map(str::to_ascii_lowercase).unwrap_or_default(); + let limit: u64 = if matches!(ext.as_str(), "gltf" | "3mf") { 256 << 20 } else { 4 << 20 }; + let mut bytes = Vec::new(); + match std::fs::File::open(path) { + Ok(f) => { + let _ = f.take(limit).read_to_end(&mut bytes); + } + Err(_) => return Origin::default(), + } + origin_of(path, &bytes) +} + +fn inspect_gof(folder: &Path, item: Option<&str>) -> Result { + let gof = read_gof(folder)?; + let entry = match item { + Some(i) => Some(gof.find(i).cloned().ok_or_else(|| IoError::MissingSibling(format!("{i} is not an entry of {}", folder.join("gof.json").display())))?), + None => gof.newest().cloned(), + }; + let mut warnings = Vec::new(); + let model = match &entry { + Some(e) if e.format == "package" => { + warnings.push(format!("{} is a Substance package; FormShot reads the GoF entries that are model files", e.file)); + None + } + Some(e) if !e.path_in(folder).is_file() => { + warnings.push(format!("{} is listed in gof.json but is not in the folder", e.file)); + None + } + Some(e) => Some(e.path_in(folder)), + None => { + warnings.push("the GoF folder has no entry FormShot can read".into()); + None + } + }; + let origin = model.as_deref().map(model_origin).unwrap_or_default(); + let app = origin.app.or(entry.as_ref().and_then(|e| e.app)).or(gof.app); + let title = entry.as_ref().map(|e| e.name.clone()).unwrap_or_else(|| name_of(folder)); + Ok(Inspection { + path: folder.to_path_buf(), + kind: HandoffKind::GofFolder, + app, + writer: origin.writer.or_else(|| Some(gof.writer.clone()).filter(|w| !w.is_empty())), + title, + model, + design_unit: None, + gof: Some(gof), + entry, + surface: None, + warnings, + }) +} + +fn inspect_surface(surface: SurfaceExport) -> Inspection { + let mut warnings = Vec::new(); + if surface.mesh.is_none() { + warnings.push("no mesh travels with these maps; they arrive as materials only".into()); + } + Inspection { + path: surface.folder.clone(), + kind: HandoffKind::MapFolder, + app: Some(FamilyApp::FormSurface), + writer: Some("FormSurface".into()), + title: surface.stem.clone(), + model: surface.mesh.clone(), + design_unit: None, + gof: None, + entry: None, + surface: Some(surface), + warnings, + } +} + +/// Finds out what `path` is: a GoF folder (with `item` naming an entry by file, id or name; the newest meant for +/// FormShot otherwise), a FormSurface export folder or one of its files, or a model file another Form app wrote. +pub fn inspect(path: &Path, item: Option<&str>) -> Result { + if !path.exists() { + return Err(IoError::Io(format!("{} does not exist", path.display()))); + } + let path = absolute(path); + if path.is_dir() { + if is_gof_folder(&path) { + return inspect_gof(&path, item); + } + return read_surface(&path).map(inspect_surface).ok_or_else(|| { + IoError::Unsupported(format!("{} is neither a GoF folder nor a FormSurface export folder", path.display())) + }); + } + let parent = path.parent().map(Path::to_path_buf).unwrap_or_default(); + if is_map(&path) { + return read_surface(&parent).map(inspect_surface).ok_or_else(|| { + IoError::Unsupported(format!("{} is a picture outside a FormSurface export folder", path.display())) + }); + } + if is_formsurface_obj(&path) { + if let Some(mut s) = read_surface(&parent) { + s.mesh = Some(path.clone()); + s.mesh_from = Some("export"); + return Ok(inspect_surface(s)); + } + } + let origin = model_origin(&path); + let file = path.file_name().and_then(|n| n.to_str()).unwrap_or("").to_string(); + let (gof, entry) = match is_gof_folder(&parent).then(|| read_gof(&parent)).and_then(|g| g.ok()) { + Some(g) => { + let e = g.objects.iter().rev().find(|e| e.file == file).cloned(); + (Some(g), e) + } + None => (None, None), + }; + let app = origin.app.or(entry.as_ref().and_then(|e| e.app)); + let title = origin.title.clone().or_else(|| entry.as_ref().map(|e| e.name.clone())).unwrap_or_else(|| name_of(&path)); + Ok(Inspection { + kind: HandoffKind::Model, + app, + writer: origin.writer, + title, + model: Some(path.clone()), + design_unit: origin.design_unit, + gof, + entry, + surface: None, + warnings: Vec::new(), + path, + }) +} + +fn percent_decode(s: &str) -> String { + let b = s.as_bytes(); + let mut out = Vec::with_capacity(b.len()); + let mut i = 0; + while i < b.len() { + let hex = |c: u8| (c as char).to_digit(16); + if b[i] == b'%' && i + 2 < b.len() { + if let (Some(h), Some(l)) = (hex(b[i + 1]), hex(b[i + 2])) { + out.push((h * 16 + l) as u8); + i += 3; + continue; + } + } + out.push(b[i]); + i += 1; + } + String::from_utf8_lossy(&out).into_owned() +} + +fn resolve_texture(uri: &str, folder: &Path) -> String { + if uri.starts_with('#') || uri.starts_with("data:") { + return uri.to_string(); + } + let decoded = percent_decode(uri).replace('\\', "/"); + let p = Path::new(&decoded); + let full = if p.is_absolute() { p.to_path_buf() } else { folder.join(p) }; + full.canonicalize().unwrap_or(full).to_string_lossy().into_owned() +} + +fn attach(material: &mut RawMaterial, textures: &mut Vec, maps: &[&MapRef]) { + for m in maps { + textures.push(RawTexture { uri: m.path.to_string_lossy().into_owned(), role: m.role, uv_set: m.uv_set, colour_space: m.colour_space }); + material.textures.push(textures.len() - 1); + match m.role { + TextureRole::BaseColour => material.base_colour = [1.0; 3], + TextureRole::Roughness => material.roughness = 1.0, + TextureRole::Metalness => material.metallic = 1.0, + TextureRole::OcclusionRoughnessMetalness => { + material.roughness = 1.0; + material.metallic = 1.0; + } + TextureRole::Emission => material.emissive = [1.0; 3], + _ => {} + } + } +} + +fn add_maps(scene: &mut RawScene, maps: &[MapRef], stem: &str) { + let sets = texture_sets(maps); + let single = sets.len() == 1 && sets[0].is_empty(); + if scene.materials.is_empty() { + for s in &sets { + let name = if s.is_empty() { stem.to_string() } else { s.clone() }; + scene.materials.push(RawMaterial { name, ..RawMaterial::default() }); + } + if single { + for mesh in scene.meshes.iter_mut().filter(|m| m.material.is_none()) { + mesh.material = Some(0); + } + } + } + let mut used = vec![false; sets.len()]; + for i in 0..scene.materials.len() { + let wanted = set_name(&scene.materials[i].name); + let chosen: Vec<&MapRef> = maps.iter().filter(|m| single || m.texture_set == wanted).collect(); + if let Some(k) = sets.iter().position(|s| single || *s == wanted) { + used[k] = true; + } + let mut material = std::mem::take(&mut scene.materials[i]); + attach(&mut material, &mut scene.textures, &chosen); + scene.materials[i] = material; + } + for (k, s) in sets.iter().enumerate().filter(|(k, _)| !used[*k]) { + scene.warnings.push(format!("the maps of texture set {s} match no material of the mesh; they arrive as material {s}")); + let mut material = RawMaterial { name: s.clone(), ..RawMaterial::default() }; + let chosen: Vec<&MapRef> = maps.iter().filter(|m| m.texture_set == sets[k]).collect(); + attach(&mut material, &mut scene.textures, &chosen); + scene.materials.push(material); + } +} + +impl Inspection { + /// The maps that travel with the hand-off. + pub fn maps(&self) -> &[MapRef] { + self.surface.as_ref().map(|s| s.maps.as_slice()).unwrap_or(&[]) + } + + /// The file that is read: the model, else the folder. + pub fn source_path(&self) -> &Path { + self.model.as_deref().unwrap_or(&self.path) + } + + /// True when only materials arrive (maps without a mesh). + pub fn materials_only(&self) -> bool { + self.model.is_none() && !self.maps().is_empty() + } + + /// Reads the hand-off into a raw scene: the model through fsh-io's readers with what its app adds (FormCAD's title + /// on the root, texture paths made absolute), and FormSurface's maps as texture references by role on the + /// materials they belong to. Maps without a mesh give a scene with materials and no meshes. + pub fn read(&self, watch: &Watch) -> Result { + let mut scene = match &self.model { + Some(model) => crate::read_model(model, watch)?, + None if !self.maps().is_empty() => RawScene::named(self.title.clone()), + None => return Err(IoError::Unsupported(format!("{} holds nothing FormShot can read", self.path.display()))), + }; + let folder = self.model.as_deref().and_then(Path::parent).map(Path::to_path_buf).unwrap_or_else(|| self.path.clone()); + for t in &mut scene.textures { + t.uri = resolve_texture(&t.uri, &folder); + } + if self.app == Some(FamilyApp::FormSurface) { + scene.warnings.retain(|w| !(w.starts_with("material ") && w.ends_with("is not defined in any library; a default was used"))); + } + if self.app == Some(FamilyApp::FormCad) { + for n in scene.nodes.iter_mut().filter(|n| n.parent.is_none() && n.name == CAD_ROOT) { + n.name = self.title.clone(); + } + } + if let Some(s) = &self.surface { + add_maps(&mut scene, &s.maps, &s.stem); + } + scene.name = self.title.clone(); + Ok(scene) + } + + /// Metadata FormShot records on the nodes that arrive, besides `source.path` and `source.node`. + pub fn metadata(&self) -> Vec<(String, String)> { + let mut out: Vec<(String, String)> = vec![("source.handoff".into(), self.kind.as_str().into())]; + if let Some(app) = self.app { + out.push(("source.app".into(), app.id().into())); + } + if let Some(w) = self.writer.as_ref().filter(|w| !w.is_empty()) { + out.push(("source.writer".into(), w.clone())); + } + out.push(("source.title".into(), self.title.clone())); + if self.path != self.source_path() { + out.push(("source.folder".into(), self.path.to_string_lossy().into_owned())); + } + if let Some(u) = &self.design_unit { + out.push(("source.design_unit".into(), u.clone())); + } + if let Some(e) = &self.entry { + out.push(("source.gof.id".into(), e.id.to_string())); + out.push(("source.gof.target".into(), e.target.clone())); + out.push(("source.gof.revision".into(), e.revision.to_string())); + out.push(("source.gof.sent".into(), e.sent.to_string())); + if let Some(u) = &e.units { + out.push(("source.gof.units".into(), u.clone())); + } + if let Some(s) = e.scale { + out.push(("source.gof.scale".into(), s.to_string())); + } + } + if let Some(mm) = self.gof.as_ref().and_then(|g| g.mm_per_unit) { + out.push(("source.gof.mm_per_unit".into(), mm.to_string())); + } + if let Some(s) = &self.surface { + if let Some(t) = template_of(&s.maps) { + out.push(("source.template".into(), t.into())); + } + if !s.maps.is_empty() { + let maps: Vec = s.maps.iter().map(MapRef::to_json).collect(); + out.push(("source.maps".into(), Value::Array(maps).to_string())); + } + } + out + } + + /// The inspection as JSON. + pub fn to_json(&self) -> Value { + let maps = self.maps(); + json!({ + "path": self.path.to_string_lossy(), + "kind": self.kind.as_str(), + "app": self.app.map(FamilyApp::id), + "app_name": self.app.map(FamilyApp::name), + "writer": self.writer, + "title": self.title, + "model": self.model.as_ref().map(|m| m.to_string_lossy()), + "format": self.model.as_ref().and_then(|m| m.extension()).and_then(|e| e.to_str()).map(str::to_ascii_lowercase), + "design_unit": self.design_unit, + "materials_only": self.materials_only(), + "gof": self.gof.as_ref().map(GofManifest::to_json), + "entry": match (&self.entry, &self.gof) { + (Some(e), Some(g)) => e.to_json(&g.folder), + _ => Value::Null, + }, + "mesh_from": self.surface.as_ref().and_then(|s| s.mesh_from), + "template": template_of(maps), + "texture_sets": texture_sets(maps), + "maps": maps.iter().map(MapRef::to_json).collect::>(), + "roles": maps.iter().map(|m| role_name(m.role)).collect::>(), + "warnings": self.warnings, + }) + } +} diff --git a/native/crates/fsh-io/src/family/mod.rs b/native/crates/fsh-io/src/family/mod.rs index 8e7b62c4..64f91459 100644 --- a/native/crates/fsh-io/src/family/mod.rs +++ b/native/crates/fsh-io/src/family/mod.rs @@ -2,10 +2,12 @@ mod app; mod gof; +mod handoff; mod maps; mod surface; pub use app::{origin_of, FamilyApp, Origin}; +pub use handoff::{inspect, HandoffKind, Inspection}; pub use gof::{is_gof_folder, read_gof, GofEntry, GofManifest, GOF_MANIFEST, GOF_TARGETS}; pub use maps::{read_maps, role_name, set_name, template_of, texture_sets, MapRef, MAP_EXTENSIONS}; pub use surface::{is_formsurface_obj, read_surface, SurfaceExport}; From d7b5ad749ba7d45a4772c3f2cedf841d1bc7aa10 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:09:03 -0500 Subject: [PATCH 027/494] feat(commands): add handoff.inspect for files other Form apps write handoff.inspect names the sending app, the kind (model, map folder, GoF folder), the title, the model, the GoF entry and FormSurface maps by role, and with read on counts meshes, triangles, materials and textures; it never changes the document. Run: cargo clippy -p fsh-commands -D warnings passes. --- native/crates/fsh-commands/src/ext/handoff.rs | 85 +++++++++++++++++-- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/handoff.rs b/native/crates/fsh-commands/src/ext/handoff.rs index 7bbd3ced..a060e987 100644 --- a/native/crates/fsh-commands/src/ext/handoff.rs +++ b/native/crates/fsh-commands/src/ext/handoff.rs @@ -2,11 +2,86 @@ use super::ExtCommand; use crate::engine::{Engine, State}; -use crate::error::Result; -use serde_json::Value; +use crate::error::{EngineError, Result}; +use crate::util::{get_bool, get_str}; +use fsh_io::family::{self, Inspection}; +use fsh_io::{RawScene, Watch}; +use fsh_scene::ChangeLevel; +use serde_json::{json, Value}; +use std::path::Path; -pub(super) static COMMANDS: &[ExtCommand] = &[]; +pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { + name: "handoff.inspect", + description: "Tell what a file or folder another Form app wrote is (a GoF folder from FormSculpt or FormFabric, a FormSurface export folder of maps, a FormCAD, FormSculpt or FormFabric model) and what it holds, without changing the document.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: inspect_schema, +}]; -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { - None +fn path_schema() -> Value { + json!({"type": "string", "minLength": 1, "description": "Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file."}) +} + +fn item_schema() -> Value { + json!({"type": ["string", "integer"], "description": "For a GoF folder: the entry's file name, id or name; the newest entry meant for FormShot (target any or formshot) when omitted."}) +} + +fn inspect_schema() -> Value { + json!({ + "type": "object", + "properties": { + "path": path_schema(), + "item": item_schema(), + "read": {"type": "boolean", "default": true, "description": "Read the model too, to count meshes, triangles, materials and textures."} + }, + "required": ["path"], + "additionalProperties": false + }) +} + +fn item_of(args: &Value) -> Option { + match args.get("item") { + Some(Value::String(s)) if !s.trim().is_empty() => Some(s.clone()), + Some(Value::Number(n)) => Some(n.to_string()), + _ => None, + } +} + +fn inspection(args: &Value) -> Result { + let path = get_str(args, "path").filter(|p| !p.trim().is_empty()).ok_or_else(|| EngineError::args("give path: the file or folder another Form app wrote"))?; + Ok(family::inspect(Path::new(path), item_of(args).as_deref())?) +} + +fn contents(raw: &RawScene) -> Value { + json!({ + "meshes": raw.meshes.iter().filter(|m| !m.indices.is_empty()).count(), + "triangles": raw.triangle_count(), + "nodes": raw.nodes.len(), + "materials": raw.materials.iter().map(|m| m.name.clone()).collect::>(), + "textures": raw.textures.len(), + "unit": raw.unit.map(|u| u.as_str()), + "up_axis": raw.up_axis.map(|a| a.as_str()), + "warnings": raw.warnings, + }) +} + +fn inspect(args: &Value) -> Result { + let insp = inspection(args)?; + let mut out = insp.to_json(); + if get_bool(args, "read").unwrap_or(true) && (insp.model.is_some() || insp.materials_only()) { + out["contents"] = match insp.read(&Watch::new()) { + Ok(raw) => contents(&raw), + Err(e) => json!({"error": e.to_string(), "code": e.code()}), + }; + } + out["ok"] = json!(true); + Ok(out) +} + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { + match name { + "handoff.inspect" => Some(inspect(args)), + _ => None, + } } From 4a2a44452e4c390fb87e5104eeea9affa035a6b8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:09:50 -0500 Subject: [PATCH 028/494] feat(commands): add handoff.open as a new document or one undo step handoff.open reads a hand-off, cleans it like an import, and either installs a new document holding it or adds it to the current one in one history group, framing the camera when the scene had no parts; every arriving node records source.app, source.path and source.node, roots also the title, GoF entry and FormSurface maps, and maps without a mesh arrive as materials. The engine's journal helpers and frame_values become crate-visible for it. Run: cargo clippy -p fsh-commands -D warnings passes. --- native/crates/fsh-commands/src/engine.rs | 8 +- native/crates/fsh-commands/src/ext/handoff.rs | 188 ++++++++++++++++-- 2 files changed, 180 insertions(+), 16 deletions(-) diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index 85504991..9a2c80a9 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -107,19 +107,19 @@ pub(crate) struct State { } impl State { - fn note(&mut self, out: &Outcome) { + pub(crate) fn note(&mut self, out: &Outcome) { if let Some(j) = self.journal.as_mut() { j.record(out, &self.editor); } } - fn note_begin(&mut self, label: &str) { + pub(crate) fn note_begin(&mut self, label: &str) { if let Some(j) = self.journal.as_mut() { j.begin(label, &self.editor); } } - fn note_end(&mut self) { + pub(crate) fn note_end(&mut self) { if let Some(j) = self.journal.as_mut() { j.end(&self.editor); } @@ -1361,7 +1361,7 @@ fn still_options(args: &Value) -> Result { } /// Camera position and target that fit every visible part, keeping the active camera's direction. -fn frame_values(doc: &Document, margin: f32) -> Result { +pub(crate) fn frame_values(doc: &Document, margin: f32) -> Result { let snap = fsh_scene::flatten(doc); if snap.bounds.is_empty() || snap.instances.is_empty() { return Err(EngineError::state("nothing visible to frame")); diff --git a/native/crates/fsh-commands/src/ext/handoff.rs b/native/crates/fsh-commands/src/ext/handoff.rs index a060e987..59bf421d 100644 --- a/native/crates/fsh-commands/src/ext/handoff.rs +++ b/native/crates/fsh-commands/src/ext/handoff.rs @@ -1,23 +1,52 @@ //! Models and materials handed over by other Form apps (0.5.0). use super::ExtCommand; -use crate::engine::{Engine, State}; +use crate::engine::{frame_values, Engine, State}; use crate::error::{EngineError, Result}; use crate::util::{get_bool, get_str}; +use fsh_core::{DocKey, MaterialKey, NodeId, TextureKey}; +use fsh_format::Project; use fsh_io::family::{self, Inspection}; -use fsh_io::{RawScene, Watch}; -use fsh_scene::ChangeLevel; +use fsh_io::{surface_params, CleanOptions, ImportOptions, RawScene, Watch}; +use fsh_scene::{ + ChangeLevel, Command, Document, Editor, Import, ImportMaterial, ImportPayload, ImportTexture, Material, NodeKind, Outcome, TextureRef, +}; use serde_json::{json, Value}; +use std::collections::HashMap; use std::path::Path; -pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { - name: "handoff.inspect", - description: "Tell what a file or folder another Form app wrote is (a GoF folder from FormSculpt or FormFabric, a FormSurface export folder of maps, a FormCAD, FormSculpt or FormFabric model) and what it holds, without changing the document.", - level: ChangeLevel::None, - mutates: false, - read_only: true, - schema: inspect_schema, -}]; +pub(super) static COMMANDS: &[ExtCommand] = &[ + ExtCommand { + name: "handoff.inspect", + description: "Tell what a file or folder another Form app wrote is (a GoF folder from FormSculpt or FormFabric, a FormSurface export folder of maps, a FormCAD, FormSculpt or FormFabric model) and what it holds, without changing the document.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: inspect_schema, + }, + ExtCommand { + name: "handoff.open", + description: "Open what another Form app handed over, as a new document or added to the current one as one undo step; every node that arrives records source.app, source.path and source.node in its metadata, and FormSurface's maps arrive as texture references by role and colour space.", + level: ChangeLevel::Full, + mutates: true, + read_only: false, + schema: open_schema, + }, +]; + +fn open_schema() -> Value { + json!({ + "type": "object", + "properties": { + "path": path_schema(), + "item": item_schema(), + "as": {"type": "string", "enum": ["new", "add"], "default": "add", "description": "new replaces the document with a new one holding the hand-off; add puts it into the current document as one undo step."}, + "frame": {"type": "boolean", "description": "Frame the camera on the scene afterwards; by default when the document had no parts before, or for a new document."} + }, + "required": ["path"], + "additionalProperties": false + }) +} fn path_schema() -> Value { json!({"type": "string", "minLength": 1, "description": "Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file."}) @@ -79,9 +108,144 @@ fn inspect(args: &Value) -> Result { Ok(out) } -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { +fn materials_command(raw: &RawScene, doc: &Document) -> Command { + let mut next = doc.next_key().max(1); + let mut key = || { + next += 1; + next - 1 + }; + let mut payload = ImportPayload::default(); + let mut tex_keys: Vec> = vec![None; raw.textures.len()]; + for (i, t) in raw.textures.iter().enumerate() { + let k = TextureKey::from_raw(key()); + tex_keys[i] = Some(k); + let texture = TextureRef { path: t.uri.clone(), role: t.role, uv_set: t.uv_set, colour_space: Some(t.colour_space.to_string()) }; + payload.textures.push(ImportTexture { key: k, texture }); + } + for m in &raw.materials { + let mut material = Material::new(m.name.clone(), if m.metallic > 0.5 { "metal" } else { "generic" }, surface_params(m)); + material.textures = m.textures.iter().filter_map(|&t| tex_keys.get(t).copied().flatten()).collect(); + payload.materials.push(ImportMaterial { key: MaterialKey::from_raw(key()), material }); + } + Command::Import(Import { parent: None, payload }) +} + +fn stamp(cmd: &mut Command, insp: &Inspection) { + let Command::Import(import) = cmd else { return }; + let nodes = &mut import.payload.nodes; + let names: HashMap)> = nodes.iter().map(|n| (n.id, (n.node.name.clone(), n.node.parent))).collect(); + let source = insp.source_path().to_string_lossy().into_owned(); + let extra = insp.metadata(); + for n in nodes.iter_mut() { + let mut path = vec![n.node.name.clone()]; + let mut up = n.node.parent; + let mut guard = 0; + while let Some(p) = up.and_then(|p| names.get(&p)) { + path.push(p.0.clone()); + up = p.1; + guard += 1; + if guard > names.len() { + break; + } + } + path.reverse(); + let root = n.node.parent.is_none_or(|p| !names.contains_key(&p)); + let meta = &mut n.node.metadata; + meta.insert("source.path".into(), source.clone()); + meta.insert("source.node".into(), path.join("/")); + for (k, v) in &extra { + if root || k == "source.app" || k == "source.handoff" { + meta.insert(k.clone(), v.clone()); + } + } + } +} + +fn has_parts(doc: &Document) -> bool { + doc.nodes().values().any(|n| matches!(n.kind, NodeKind::Part { .. })) +} + +fn open(engine: &Engine, st: &mut State, args: &Value) -> Result { + let mode = get_str(args, "as").unwrap_or("add"); + if !matches!(mode, "new" | "add") { + return Err(EngineError::args(format!("as is new or add, not \"{mode}\""))); + } + let insp = inspection(args)?; + let watch = Watch::new(); + let mut raw = insp.read(&watch)?; + let materials_only = insp.materials_only(); + let report = if materials_only { None } else { Some(fsh_io::clean(&mut raw, &CleanOptions::default(), &watch)?) }; + if mode == "new" { + let doc = crate::sample::build(None, &insp.title)?; + let mut editor = Editor::new(doc); + editor.history_mut().mark_saved(); + engine.install_editor(st, editor, None, Project::default()); + } + let was_empty = !has_parts(st.editor.document()); + let mut cmd = if materials_only { + materials_command(&raw, st.editor.document()) + } else { + fsh_io::to_import_command(&raw, st.editor.document(), &ImportOptions { parent: None, wrap_in_group: true }, &watch)? + }; + stamp(&mut cmd, &insp); + let from = insp.app.map(|a| a.name()).or(insp.writer.as_deref()).unwrap_or("another app"); + let label = format!("Hand-off from {from}: {}", insp.title); + let frame = get_bool(args, "frame").unwrap_or(was_empty && !materials_only); + st.editor.begin_group(&label); + st.note_begin(&label); + let result = (|| -> Result { + let out = st.editor.execute(cmd)?; + st.note(&out); + if frame { + if let Ok(values) = frame_values(st.editor.document(), 1.15) { + let index = st.editor.document().active_camera_index(); + let framed = st.editor.dispatch("camera.set", json!({"index": index, "values": values}))?; + st.note(&framed); + } + } + Ok(out) + })(); + let out = match result { + Ok(o) => { + st.editor.end_group()?; + st.note_end(); + o + } + Err(e) => { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } + return Err(e); + } + }; + let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); + reply["name"] = json!("handoff.open"); + reply["as"] = json!(mode); + reply["app"] = json!(insp.app.map(|a| a.id())); + reply["app_name"] = json!(from); + reply["kind"] = json!(insp.kind.as_str()); + reply["title"] = json!(insp.title); + reply["source"] = json!(insp.source_path().to_string_lossy()); + reply["materials_only"] = json!(materials_only); + reply["contents"] = contents(&raw); + reply["maps"] = json!(insp.maps().iter().map(|m| m.to_json()).collect::>()); + if let Some(r) = report { + reply["report"] = json!({ + "triangles_dropped": r.triangles_dropped, "vertices_welded": r.vertices_welded, "meshes_given_normals": r.meshes_given_normals, + "instances_found": r.instances_found, "unit": r.unit.as_str(), "unit_guessed": r.unit_guessed, "up_axis": r.up_axis.as_str(), + "warnings": r.warnings, + }); + } + if !insp.warnings.is_empty() { + reply["notes"] = json!(insp.warnings); + } + Ok(reply) +} + +pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { match name { "handoff.inspect" => Some(inspect(args)), + "handoff.open" => Some(open(engine, st, args)), _ => None, } } From 08c35de1693da5cbf811d12b98ebeb7f4c9f950a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:11:33 -0500 Subject: [PATCH 029/494] feat(backend): find the family's hand-off folders and keep per-app choices The handoff router locates the GoF folder (FORMSCULPT_GOF or Formsculpt/GoF) and FormSurface's exports (FORMSURFACE_DATA, its service's reported data folder, or FormSurface in the home folder), and keeps ask, allowed or blocked per Form app in handoff.json. Run: the service module imports and the two sources resolve. --- backend/app/routers/handoff.py | 127 ++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py index 3d4507f4..dd0a0402 100644 --- a/backend/app/routers/handoff.py +++ b/backend/app/routers/handoff.py @@ -1,5 +1,126 @@ -"""Models and materials handed over by other Form apps (0.5.0).""" +"""Models and materials handed over by other Form apps (0.5.0). -from fastapi import APIRouter +The family hands work over through two places: the GoF folder (FORMSCULPT_GOF, else Formsculpt/GoF in the home folder), +where FormSculpt and FormFabric write files and gof.json, and FormSurface's exports folder (FORMSURFACE_DATA, else the +data folder its service reports at /api/health, else FormSurface in the home folder). This router watches both while the +window is open, holds what arrives for FormShot, and asks the person in the window before anything is opened. Each app +can be asked about, always allowed or blocked; the choice is kept in handoff.json in the data folder.""" -router = APIRouter() +import json +import os +import threading +import time +import urllib.error +import urllib.request +from pathlib import Path + +from fastapi import APIRouter, HTTPException, Request + +from app import window_key +from app.agent import config + +router = APIRouter(prefix="/api/handoff", tags=["handoff"]) + +APPS = {"formcad": "FormCAD", "formsculpt": "FormSculpt", "formsurface": "FormSurface", "formfabric": "FormFabric"} +CHOICES = ("ask", "allowed", "blocked") +GOF_MANIFEST = "gof.json" +GOF_TARGETS = ("formshot", "any") +SURFACE_PORT = 8766 +HEALTH_SECONDS = 30.0 +_lock = threading.Lock() +_opener = urllib.request.build_opener(urllib.request.ProxyHandler({})) +_health = {"at": -HEALTH_SECONDS, "data": None} + + +def _store_path() -> Path: + return config.data_dir() / "handoff.json" + + +def stored() -> dict: + try: + found = json.loads(_store_path().read_text(encoding="utf-8")) + except (OSError, ValueError): + return {} + return found if isinstance(found, dict) else {} + + +def _save(values: dict) -> None: + part = _store_path().with_name("handoff.json.part") + part.write_text(json.dumps(values, indent=1), encoding="utf-8") + part.replace(_store_path()) + + +def app_choices() -> dict: + kept = stored().get("apps") + kept = kept if isinstance(kept, dict) else {} + return {app: kept.get(app) if kept.get(app) in CHOICES else "ask" for app in APPS} + + +def set_choice(app: str, choice: str) -> dict: + if app not in APPS: + raise HTTPException(400, f"app is one of {', '.join(APPS)}") + if choice not in CHOICES: + raise HTTPException(400, f"choice is one of {', '.join(CHOICES)}") + with _lock: + values = stored() + apps = values.get("apps") if isinstance(values.get("apps"), dict) else {} + apps[app] = choice + values["apps"] = apps + _save(values) + return app_choices() + + +def gof_folder() -> Path: + given = config.env("HANDOFF_GOF") or os.environ.get("FORMSCULPT_GOF", "").strip() + return Path(given).expanduser() if given else Path.home() / "Formsculpt" / "GoF" + + +def _surface_health() -> str | None: + now = time.monotonic() + if now - _health["at"] < HEALTH_SECONDS: + return _health["data"] + port = os.environ.get("FORMSURFACE_PORT", "").strip() + base = os.environ.get("FORMSURFACE_SERVICE", "").strip() or f"http://127.0.0.1:{port if port.isdigit() else SURFACE_PORT}" + data = None + try: + with _opener.open(base.rstrip("/") + "/api/health", timeout=1.0) as reply: + found = json.loads(reply.read().decode("utf-8") or "{}") + data = str(found.get("data") or "") or None if isinstance(found, dict) else None + except (urllib.error.URLError, OSError, ValueError): + data = None + _health.update(at=now, data=data) + return data + + +def surface_exports() -> Path: + given = config.env("HANDOFF_SURFACE") or os.environ.get("FORMSURFACE_DATA", "").strip() + if given: + return Path(given).expanduser() / "exports" + reported = _surface_health() + if reported: + return Path(reported).expanduser() / "exports" + return Path.home() / "FormSurface" / "exports" + + +def sources() -> list[dict]: + gof, surface = gof_folder(), surface_exports() + return [ + {"id": "gof", "label": "GoF folder", "apps": ["formsculpt", "formfabric"], "folder": str(gof), "found": (gof / GOF_MANIFEST).is_file()}, + {"id": "formsurface", "label": "FormSurface exports", "apps": ["formsurface"], "folder": str(surface), "found": surface.is_dir()}, + ] + + +@router.get("/apps") +def get_apps(request: Request) -> dict: + window_key.require(request) + return {"apps": app_choices(), "names": APPS, "choices": list(CHOICES)} + + +@router.post("/apps") +async def post_apps(request: Request) -> dict: + try: + body = await request.json() + except ValueError: + body = {} + body = body if isinstance(body, dict) else {} + return {"apps": set_choice(str(body.get("app") or ""), str(body.get("choice") or "")), "names": APPS} From acf2faa0944385fd25c75dbc4b2700874c17513b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:12:25 -0500 Subject: [PATCH 030/494] feat(backend): hold what the family hands over until the person answers A watcher scans the GoF folder for entries meant for FormShot (target any or formshot) and FormSurface's export folders while the window is open, waits until files stop changing, remembers what it has seen in handoff.json so nothing old is offered, and turns each arrival into a held offer (published as handoff.offered), opens it at once for an always-allowed app, or drops it for a blocked one. Run: the scanner listed the GoF and FormSurface corpus and its first pass offered nothing. --- backend/app/routers/handoff.py | 186 ++++++++++++++++++++++++++++++++- 1 file changed, 184 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py index dd0a0402..d7d4678f 100644 --- a/backend/app/routers/handoff.py +++ b/backend/app/routers/handoff.py @@ -8,6 +8,7 @@ import json import os +import secrets import threading import time import urllib.error @@ -17,7 +18,8 @@ from fastapi import APIRouter, HTTPException, Request from app import window_key -from app.agent import config +from app.agent import config, events +from app.engine import EngineError, EngineUnavailable, engine router = APIRouter(prefix="/api/handoff", tags=["handoff"]) @@ -27,9 +29,16 @@ GOF_TARGETS = ("formshot", "any") SURFACE_PORT = 8766 HEALTH_SECONDS = 30.0 -_lock = threading.Lock() +SCAN_SECONDS = 2.0 +STABLE_SECONDS = 1.5 +LIVE_SECONDS = 8.0 +MAP_EXTENSIONS = ("png", "tif", "tiff", "exr", "hdr", "jpg", "jpeg", "psd") +MODES = ("new", "add") +_lock = threading.RLock() _opener = urllib.request.build_opener(urllib.request.ProxyHandler({})) _health = {"at": -HEALTH_SECONDS, "data": None} +_offers: dict[str, dict] = {} +_watch: dict = {"thread": None, "window": -LIVE_SECONDS} def _store_path() -> Path: @@ -110,6 +119,179 @@ def sources() -> list[dict]: ] +def _app_id(value) -> str | None: + text = str(value or "").strip().lower() + return text if text in APPS else None + + +def _mtime(path: Path) -> float: + try: + return path.stat().st_mtime + except OSError: + return 0.0 + + +def gof_items() -> list[dict]: + folder = gof_folder() + try: + manifest = json.loads((folder / GOF_MANIFEST).read_text(encoding="utf-8")) + except (OSError, ValueError): + return [] + if not isinstance(manifest, dict) or not isinstance(manifest.get("objects"), list): + return [] + top = manifest.get("app") + now = time.time() + out = [] + for entry in manifest["objects"]: + if not isinstance(entry, dict): + continue + file = str(entry.get("file") or "") + fmt = str(entry.get("format") or Path(file).suffix.lstrip(".")).lower() + path = folder / file + if not file or Path(file).name != file or fmt == "package" or not path.is_file(): + continue + changed = _mtime(path) + target = str(entry.get("target") or "").lower() + app = _app_id(entry.get("app")) or _app_id(top) + out.append({ + "key": f"gof:{file}", "source": "gof", "path": str(folder), "item": file, "file": str(path), + "app": app, "app_name": APPS.get(app or "", str(entry.get("app") or top or "")), "title": str(entry.get("name") or file), + "format": fmt, "target": target, "for_formshot": target in GOF_TARGETS, "triangles": entry.get("triangles"), + "units": entry.get("units"), "sent": entry.get("sent"), "changed": changed, + "mark": f"{entry.get('sent')}:{entry.get('revision')}:{changed}", "stable": now - changed >= STABLE_SECONDS, + }) + return out + + +def surface_items() -> list[dict]: + exports = surface_exports() + try: + folders = [p for p in exports.iterdir() if p.is_dir() and not p.name.startswith(".")] + except OSError: + return [] + now = time.time() + out = [] + for folder in folders: + stem = folder.name + try: + files = [p for p in folder.iterdir() if p.is_file()] + except OSError: + continue + maps = [p for p in files if p.name.startswith(f"{stem}_") and p.suffix.lower().lstrip(".") in MAP_EXTENSIONS] + mesh = folder / f"{stem}.obj" + if not maps and not mesh.is_file(): + continue + changed = max(_mtime(p) for p in maps + ([mesh] if mesh.is_file() else [])) + out.append({ + "key": f"formsurface:{stem}", "source": "formsurface", "path": str(folder), "item": None, "file": str(folder), + "app": "formsurface", "app_name": APPS["formsurface"], "title": stem, "format": "maps", "target": "any", + "for_formshot": True, "maps": len(maps), "mesh": mesh.is_file(), "changed": changed, + "mark": f"{len(maps)}:{changed}", "stable": now - changed >= STABLE_SECONDS, + }) + return out + + +def available() -> list[dict]: + return sorted(gof_items() + surface_items(), key=lambda i: i["changed"], reverse=True) + + +def run_engine(name: str, args: dict): + try: + return engine.dispatch(name, args) + except EngineUnavailable as error: + raise HTTPException(503, str(error)) from None + except EngineError as error: + raise HTTPException(error.status, str(error)) from None + + +def open_offer(offer: dict, mode: str) -> dict: + args = {"path": offer["path"], "as": mode} + if offer.get("item"): + args["item"] = offer["item"] + result = run_engine("handoff.open", args) + events.publish("document.changed", source="handoff") + events.publish("handoff.opened", id=offer.get("id"), app=offer.get("app"), title=offer.get("title"), mode=mode) + return result + + +def _public(offer: dict) -> dict: + return {k: v for k, v in offer.items() if k not in ("mark", "stable", "for_formshot")} + + +def pending() -> list[dict]: + return sorted((_public(o) for o in _offers.values()), key=lambda o: o["arrived"]) + + +def _arrive(item: dict) -> None: + choice = app_choices().get(item.get("app") or "", "ask") + if choice == "blocked": + events.publish("handoff.blocked", app=item.get("app"), title=item.get("title")) + return + for old in [k for k, o in _offers.items() if o["key"] == item["key"]]: + _offers.pop(old, None) + events.publish("handoff.withdrawn", id=old) + offer = {**item, "id": secrets.token_urlsafe(9), "arrived": int(time.time() * 1000)} + if choice == "allowed": + try: + open_offer(offer, "add") + except HTTPException as error: + offer["error"] = str(error.detail) + else: + return + _offers[offer["id"]] = offer + events.publish("handoff.offered", offer=_public(offer)) + + +def scan() -> int: + fresh = [] + with _lock: + values = stored() + seen = values.get("seen") if isinstance(values.get("seen"), dict) else {} + started = values.get("started") if isinstance(values.get("started"), dict) else {} + for source, folder, items in (("gof", gof_folder(), gof_items()), ("formsurface", surface_exports(), surface_items())): + place = f"{source}:{folder}" + first = place not in started + for item in items: + if not item["for_formshot"] or not item["stable"]: + continue + key = f"{place}|{item['key']}" + if seen.get(key) == item["mark"]: + continue + seen[key] = item["mark"] + if not first: + fresh.append(item) + if folder.is_dir(): + started[place] = int(time.time()) + values["seen"], values["started"] = seen, started + _save(values) + for item in fresh: + _arrive(item) + return len(fresh) + + +def _window_live() -> bool: + return time.monotonic() - _watch["window"] <= LIVE_SECONDS or events.watching() > 0 + + +def _loop() -> None: + while True: + time.sleep(SCAN_SECONDS) + if not _window_live(): + continue + try: + scan() + except Exception: + continue + + +def ensure_watcher() -> None: + _watch["window"] = time.monotonic() + with _lock: + if _watch["thread"] is None: + _watch["thread"] = threading.Thread(target=_loop, name="formshot-handoff-watch", daemon=True) + _watch["thread"].start() + + @router.get("/apps") def get_apps(request: Request) -> dict: window_key.require(request) From 96b7c2efe678842198b6bd4e73dde9b354cb8ae9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:13:19 -0500 Subject: [PATCH 031/494] feat(backend): add hand-off routes for offers, answers, inspect and open GET /api/handoff/offers starts the watcher and lists held offers with per-app choices and sources; POST /api/handoff/offers/{id} answers deny, once or always (always allows that app from then on) and opens as new or add; available, inspect and open serve the window's own list; reads need the window key and writes pass the window-key guard. Run: on a spare port, a real FormFabric gof.send became one held offer, and requests without the key got 403. --- backend/app/routers/handoff.py | 83 ++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py index d7d4678f..6fe02e28 100644 --- a/backend/app/routers/handoff.py +++ b/backend/app/routers/handoff.py @@ -16,6 +16,7 @@ from pathlib import Path from fastapi import APIRouter, HTTPException, Request +from starlette.concurrency import run_in_threadpool from app import window_key from app.agent import config, events @@ -34,6 +35,7 @@ LIVE_SECONDS = 8.0 MAP_EXTENSIONS = ("png", "tif", "tiff", "exr", "hdr", "jpg", "jpeg", "psd") MODES = ("new", "add") +ANSWERS = ("deny", "once", "always") _lock = threading.RLock() _opener = urllib.request.build_opener(urllib.request.ProxyHandler({})) _health = {"at": -HEALTH_SECONDS, "data": None} @@ -298,11 +300,86 @@ def get_apps(request: Request) -> dict: return {"apps": app_choices(), "names": APPS, "choices": list(CHOICES)} -@router.post("/apps") -async def post_apps(request: Request) -> dict: +async def _body(request: Request) -> dict: try: body = await request.json() except ValueError: body = {} - body = body if isinstance(body, dict) else {} + return body if isinstance(body, dict) else {} + + +@router.post("/apps") +async def post_apps(request: Request) -> dict: + body = await _body(request) return {"apps": set_choice(str(body.get("app") or ""), str(body.get("choice") or "")), "names": APPS} + + +@router.get("/offers") +async def get_offers(request: Request) -> dict: + window_key.require(request) + ensure_watcher() + await run_in_threadpool(scan) + return {"offers": pending(), "apps": app_choices(), "names": APPS, "sources": await run_in_threadpool(sources)} + + +def answer(oid: str, reply: str, mode: str) -> dict: + if reply not in ANSWERS: + raise HTTPException(400, f"answer is one of {', '.join(ANSWERS)}") + if mode not in MODES: + raise HTTPException(400, f"as is one of {', '.join(MODES)}") + with _lock: + offer = _offers.pop(oid, None) + if offer is None: + raise HTTPException(404, "That hand-off is no longer waiting") + events.publish("handoff.withdrawn", id=oid) + if reply == "deny": + return {"ok": True, "id": oid, "answer": reply} + if reply == "always" and offer.get("app"): + set_choice(offer["app"], "allowed") + try: + result = open_offer(offer, mode) + except HTTPException: + with _lock: + _offers[oid] = offer + events.publish("handoff.offered", offer=_public(offer)) + raise + return {"ok": True, "id": oid, "answer": reply, "as": mode, "result": result, "apps": app_choices()} + + +@router.post("/offers/{oid}") +async def post_answer(oid: str, request: Request) -> dict: + body = await _body(request) + return await run_in_threadpool(answer, oid, str(body.get("answer") or ""), str(body.get("as") or "add")) + + +@router.get("/available") +async def get_available(request: Request) -> dict: + window_key.require(request) + return {"items": await run_in_threadpool(available), "sources": await run_in_threadpool(sources)} + + +def _target(body: dict) -> dict: + path = str(body.get("path") or "").strip() + if not path: + raise HTTPException(400, "Give path: the file or folder another Form app wrote") + args = {"path": path} + item = body.get("item") + if isinstance(item, (str, int)) and str(item).strip(): + args["item"] = item + return args + + +@router.post("/inspect") +async def post_inspect(request: Request) -> dict: + args = _target(await _body(request)) + return await run_in_threadpool(run_engine, "handoff.inspect", args) + + +@router.post("/open") +async def post_open(request: Request) -> dict: + body = await _body(request) + mode = str(body.get("as") or "add") + if mode not in MODES: + raise HTTPException(400, f"as is one of {', '.join(MODES)}") + args = _target(body) + return await run_in_threadpool(open_offer, {**args, "title": Path(args["path"]).name}, mode) From 693d75bbb9dd456ecf7e18858df4812a8d450329 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:16 -0500 Subject: [PATCH 032/494] fix(backend): mark hand-offs opened without a prompt handoff.opened now carries auto true when an always-allowed app's hand-off opened on arrival, and the app's display name, so the window tells the person what came in without repeating its own answers. Run: the service module imports. --- backend/app/routers/handoff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py index 6fe02e28..91b9f9de 100644 --- a/backend/app/routers/handoff.py +++ b/backend/app/routers/handoff.py @@ -206,13 +206,13 @@ def run_engine(name: str, args: dict): raise HTTPException(error.status, str(error)) from None -def open_offer(offer: dict, mode: str) -> dict: +def open_offer(offer: dict, mode: str, auto: bool = False) -> dict: args = {"path": offer["path"], "as": mode} if offer.get("item"): args["item"] = offer["item"] result = run_engine("handoff.open", args) events.publish("document.changed", source="handoff") - events.publish("handoff.opened", id=offer.get("id"), app=offer.get("app"), title=offer.get("title"), mode=mode) + events.publish("handoff.opened", id=offer.get("id"), app=offer.get("app"), app_name=offer.get("app_name"), title=offer.get("title"), mode=mode, auto=auto) return result @@ -235,7 +235,7 @@ def _arrive(item: dict) -> None: offer = {**item, "id": secrets.token_urlsafe(9), "arrived": int(time.time() * 1000)} if choice == "allowed": try: - open_offer(offer, "add") + open_offer(offer, "add", auto=True) except HTTPException as error: offer["error"] = str(error.detail) else: From a847732471d7326d6dd82fb32423f6576dc622e9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:16 -0500 Subject: [PATCH 033/494] feat(frontend): add the hand-off service client and its strings The handoff module gets a typed client for the hand-off routes, sentence helpers for kinds, contents, maps and ages, and the handoff i18n namespace with every string the module shows, English as placeholder in each language table. Strings other namespaces already translate (Open, Cancel, Ask each time, the time phrases) are reused, not redefined. Run: npx tsc --noEmit passes. --- frontend/src/i18n/modules/handoff/cs.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/da.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/de.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/es-MX.json | 1 + frontend/src/i18n/modules/handoff/es.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/fi.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/fr-CA.json | 1 + frontend/src/i18n/modules/handoff/fr.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/hu.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/id.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/it.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/ja.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/ko.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/nb.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/nl.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/pl.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/pt-BR.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/ru.json | 62 +++++++++++++++++ .../src/i18n/modules/handoff/strings.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/sv.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/th.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/tr.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/uk.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/vi.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/zh-CN.json | 62 +++++++++++++++++ frontend/src/i18n/modules/handoff/zh-TW.json | 62 +++++++++++++++++ frontend/src/ui/handoff/describe.ts | 54 +++++++++++++++ frontend/src/ui/handoff/service.ts | 67 +++++++++++++++++++ 28 files changed, 1611 insertions(+) create mode 100644 frontend/src/i18n/modules/handoff/cs.json create mode 100644 frontend/src/i18n/modules/handoff/da.json create mode 100644 frontend/src/i18n/modules/handoff/de.json create mode 100644 frontend/src/i18n/modules/handoff/es-MX.json create mode 100644 frontend/src/i18n/modules/handoff/es.json create mode 100644 frontend/src/i18n/modules/handoff/fi.json create mode 100644 frontend/src/i18n/modules/handoff/fr-CA.json create mode 100644 frontend/src/i18n/modules/handoff/fr.json create mode 100644 frontend/src/i18n/modules/handoff/hu.json create mode 100644 frontend/src/i18n/modules/handoff/id.json create mode 100644 frontend/src/i18n/modules/handoff/it.json create mode 100644 frontend/src/i18n/modules/handoff/ja.json create mode 100644 frontend/src/i18n/modules/handoff/ko.json create mode 100644 frontend/src/i18n/modules/handoff/nb.json create mode 100644 frontend/src/i18n/modules/handoff/nl.json create mode 100644 frontend/src/i18n/modules/handoff/pl.json create mode 100644 frontend/src/i18n/modules/handoff/pt-BR.json create mode 100644 frontend/src/i18n/modules/handoff/ru.json create mode 100644 frontend/src/i18n/modules/handoff/strings.json create mode 100644 frontend/src/i18n/modules/handoff/sv.json create mode 100644 frontend/src/i18n/modules/handoff/th.json create mode 100644 frontend/src/i18n/modules/handoff/tr.json create mode 100644 frontend/src/i18n/modules/handoff/uk.json create mode 100644 frontend/src/i18n/modules/handoff/vi.json create mode 100644 frontend/src/i18n/modules/handoff/zh-CN.json create mode 100644 frontend/src/i18n/modules/handoff/zh-TW.json create mode 100644 frontend/src/ui/handoff/describe.ts create mode 100644 frontend/src/ui/handoff/service.ts diff --git a/frontend/src/i18n/modules/handoff/cs.json b/frontend/src/i18n/modules/handoff/cs.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/cs.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/da.json b/frontend/src/i18n/modules/handoff/da.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/da.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/de.json b/frontend/src/i18n/modules/handoff/de.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/de.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/es-MX.json b/frontend/src/i18n/modules/handoff/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/handoff/es.json b/frontend/src/i18n/modules/handoff/es.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/es.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/fi.json b/frontend/src/i18n/modules/handoff/fi.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/fi.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/fr-CA.json b/frontend/src/i18n/modules/handoff/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/handoff/fr.json b/frontend/src/i18n/modules/handoff/fr.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/fr.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/hu.json b/frontend/src/i18n/modules/handoff/hu.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/hu.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/id.json b/frontend/src/i18n/modules/handoff/id.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/id.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/it.json b/frontend/src/i18n/modules/handoff/it.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/it.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/ja.json b/frontend/src/i18n/modules/handoff/ja.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/ja.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/ko.json b/frontend/src/i18n/modules/handoff/ko.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/ko.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/nb.json b/frontend/src/i18n/modules/handoff/nb.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/nb.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/nl.json b/frontend/src/i18n/modules/handoff/nl.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/nl.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/pl.json b/frontend/src/i18n/modules/handoff/pl.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/pl.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/pt-BR.json b/frontend/src/i18n/modules/handoff/pt-BR.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/pt-BR.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/ru.json b/frontend/src/i18n/modules/handoff/ru.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/ru.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/strings.json b/frontend/src/i18n/modules/handoff/strings.json new file mode 100644 index 00000000..a9e61bad --- /dev/null +++ b/frontend/src/i18n/modules/handoff/strings.json @@ -0,0 +1,62 @@ +[ + "1 of {count}", + "A Form app is handing something over", + "A mesh with maps by role", + "A model file", + "Add to this document", + "Added {title} from {app}", + "Always allow", + "Always allow {app}", + "An object from the GoF folder", + "another app", + "As a new document", + "Base colour", + "Block", + "Choose a hand-off or give a path", + "Contents", + "Could not be read", + "Decline", + "Emission", + "FormCAD", + "FormFabric", + "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface", + "FormSurface exports", + "From", + "GoF folder", + "Hand-off Settings", + "Hand-offs", + "Hand-offs from {app}", + "Maps", + "Maps by role, without a mesh", + "Metalness", + "Normal", + "not found", + "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness", + "Opacity", + "Open a Hand-off", + "Open a Hand-off...", + "Open it", + "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document", + "Or a path to a file or folder", + "Other maps", + "Reading...", + "Roughness", + "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface", + "{count} maps: {roles}", + "{count} materials", + "{format} file", + "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago" +] diff --git a/frontend/src/i18n/modules/handoff/sv.json b/frontend/src/i18n/modules/handoff/sv.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/sv.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/th.json b/frontend/src/i18n/modules/handoff/th.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/th.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/tr.json b/frontend/src/i18n/modules/handoff/tr.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/tr.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/uk.json b/frontend/src/i18n/modules/handoff/uk.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/uk.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/vi.json b/frontend/src/i18n/modules/handoff/vi.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/vi.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/zh-CN.json b/frontend/src/i18n/modules/handoff/zh-CN.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/zh-CN.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/i18n/modules/handoff/zh-TW.json b/frontend/src/i18n/modules/handoff/zh-TW.json new file mode 100644 index 00000000..a93ea0c0 --- /dev/null +++ b/frontend/src/i18n/modules/handoff/zh-TW.json @@ -0,0 +1,62 @@ +{ + "1 of {count}": "1 of {count}", + "A Form app is handing something over": "A Form app is handing something over", + "A mesh with maps by role": "A mesh with maps by role", + "A model file": "A model file", + "Add to this document": "Add to this document", + "Added {title} from {app}": "Added {title} from {app}", + "Always allow": "Always allow", + "Always allow {app}": "Always allow {app}", + "An object from the GoF folder": "An object from the GoF folder", + "another app": "another app", + "As a new document": "As a new document", + "Base colour": "Base colour", + "Block": "Block", + "Choose a hand-off or give a path": "Choose a hand-off or give a path", + "Contents": "Contents", + "Could not be read": "Could not be read", + "Decline": "Decline", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface exports", + "From": "From", + "GoF folder": "GoF folder", + "Hand-off Settings": "Hand-off Settings", + "Hand-offs": "Hand-offs", + "Hand-offs from {app}": "Hand-offs from {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps by role, without a mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "not found", + "Not read yet": "Not read yet", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", + "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", + "Opacity": "Opacity", + "Open a Hand-off": "Open a Hand-off", + "Open a Hand-off...": "Open a Hand-off...", + "Open it": "Open it", + "Open once": "Open once", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", + "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", + "Or a path to a file or folder": "Or a path to a file or folder", + "Other maps": "Other maps", + "Reading...": "Reading...", + "Roughness": "Roughness", + "Sent as": "Sent as", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", + "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", + "{count} maps from FormSurface": "{count} maps from FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materials", + "{format} file": "{format} file", + "{format} file, {count} triangles": "{format} file, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", + "{n} days ago": "{n} days ago" +} diff --git a/frontend/src/ui/handoff/describe.ts b/frontend/src/ui/handoff/describe.ts new file mode 100644 index 00000000..7b9043ab --- /dev/null +++ b/frontend/src/ui/handoff/describe.ts @@ -0,0 +1,54 @@ +import { t } from '../../i18n'; +import type { Inspection, Offer } from './service'; + +const ROLES: Record = { + base_colour: 'Base colour', + roughness: 'Roughness', + metalness: 'Metalness', + normal: 'Normal', + bump: 'Height', + opacity: 'Opacity', + emission: 'Emission', + occlusion_roughness_metalness: 'Occlusion, roughness and metalness', + other: 'Other maps', +}; + +export function appName(o: { app_name?: string | null; app?: string | null }): string { + return o.app_name || o.app || t('another app'); +} + +export function kindText(i: Inspection): string { + if (i.kind === 'map_folder') return i.materials_only ? t('Maps by role, without a mesh') : t('A mesh with maps by role'); + if (i.kind === 'gof_folder') return t('An object from the GoF folder'); + return t('A model file'); +} + +export function offerLine(o: Offer): string { + if (o.source === 'formsurface') return t('{count} maps from FormSurface', { count: o.maps ?? 0 }); + if (typeof o.triangles === 'number') return t('{format} file, {count} triangles', { format: o.format.toUpperCase(), count: o.triangles.toLocaleString() }); + return t('{format} file', { format: o.format.toUpperCase() }); +} + +export function contentsText(i: Inspection): string { + const c = i.contents; + if (!c) return t('Not read yet'); + if (c.error) return c.error; + if (i.materials_only) return t('{count} materials', { count: c.materials.length }); + return t('{meshes} meshes, {triangles} triangles, {materials} materials', { + meshes: c.meshes, triangles: c.triangles.toLocaleString(), materials: c.materials.length, + }); +} + +export function mapsText(i: Inspection): string { + if (!i.maps.length) return t('None'); + const roles = i.roles.map((r) => t(ROLES[r] ?? 'Other maps')); + return t('{count} maps: {roles}', { count: i.maps.length, roles: roles.join(', ') }); +} + +export function ago(ms: number): string { + const s = Math.max(0, Math.round((Date.now() - ms) / 1000)); + if (s < 60) return t('just now'); + if (s < 3600) return t('{n} min ago', { n: Math.round(s / 60) }); + if (s < 86400) return t('{n} h ago', { n: Math.round(s / 3600) }); + return t('{n} days ago', { n: Math.round(s / 86400) }); +} diff --git a/frontend/src/ui/handoff/service.ts b/frontend/src/ui/handoff/service.ts new file mode 100644 index 00000000..d0d2461b --- /dev/null +++ b/frontend/src/ui/handoff/service.ts @@ -0,0 +1,67 @@ +import { api } from '../../shell/api'; + +export type AppChoice = 'ask' | 'allowed' | 'blocked'; +export type Answer = 'deny' | 'once' | 'always'; +export type OpenMode = 'add' | 'new'; + +export interface Offer { + id: string; + key: string; + source: 'gof' | 'formsurface'; + path: string; + item: string | null; + file: string; + app: string | null; + app_name: string; + title: string; + format: string; + target: string; + triangles?: number; + maps?: number; + mesh?: boolean; + changed: number; + arrived: number; + error?: string; +} + +export interface Source { id: string; label: string; apps: string[]; folder: string; found: boolean } + +export interface OffersReply { + offers: Offer[]; + apps: Record; + names: Record; + sources: Source[]; +} + +export interface MapInfo { file: string; map: string; source: string; role: string; colour_space: string; texture_set: string; udim: number | null } + +export interface Inspection { + path: string; + kind: 'model' | 'map_folder' | 'gof_folder'; + app: string | null; + app_name: string | null; + writer: string | null; + title: string; + model: string | null; + format: string | null; + design_unit: string | null; + materials_only: boolean; + template: string | null; + texture_sets: string[]; + maps: MapInfo[]; + roles: string[]; + warnings: string[]; + contents?: { meshes: number; triangles: number; nodes: number; materials: string[]; textures: number; unit: string | null; warnings: string[]; error?: string }; +} + +export interface OpenResult { title?: string; app_name?: string; created?: unknown[] } + +export const service = { + offers: () => api.get('/api/handoff/offers'), + answer: (id: string, answer: Answer, mode: OpenMode) => api.post<{ ok: boolean; result?: OpenResult }>(`/api/handoff/offers/${encodeURIComponent(id)}`, { answer, as: mode }, { timeoutMs: 600_000 }), + apps: () => api.get<{ apps: Record; names: Record }>('/api/handoff/apps'), + setApp: (app: string, choice: AppChoice) => api.post<{ apps: Record }>('/api/handoff/apps', { app, choice }), + available: () => api.get<{ items: Offer[]; sources: Source[] }>('/api/handoff/available'), + inspect: (path: string, item: string | null) => api.post('/api/handoff/inspect', item ? { path, item } : { path }, { timeoutMs: 120_000 }), + open: (path: string, item: string | null, mode: OpenMode) => api.post('/api/handoff/open', item ? { path, item, as: mode } : { path, as: mode }, { timeoutMs: 600_000 }), +}; From 0e7ae0f8986ef37e3c3f814e7611b9797081d62c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:24 -0500 Subject: [PATCH 034/494] feat(frontend): ask before opening anything a Form app hands over A prompt in the overlay root names the sending app and the content, reads the hand-off through handoff.inspect for its kind, counts and maps by role, lets the person add it or open it as a new document, and answers Decline, Open once or Always allow the app; it is built once and patched, with a count when several wait. Run: npx tsc --noEmit passes. --- frontend/src/ui/handoff/handoff.css | 28 +++++ frontend/src/ui/handoff/prompt.ts | 168 ++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+) create mode 100644 frontend/src/ui/handoff/handoff.css create mode 100644 frontend/src/ui/handoff/prompt.ts diff --git a/frontend/src/ui/handoff/handoff.css b/frontend/src/ui/handoff/handoff.css new file mode 100644 index 00000000..d0eeb61e --- /dev/null +++ b/frontend/src/ui/handoff/handoff.css @@ -0,0 +1,28 @@ +.fsh-handoff-count { min-width: 8ch; color: var(--text-muted); font-size: var(--fs-12); text-align: right; } +.fsh-handoff-lede { margin: 0 0 var(--space-3); color: var(--text-primary); font-size: var(--fs-13); line-height: var(--lh); } +.fsh-handoff-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); font-size: var(--fs-12); } +.fsh-handoff-facts dt { color: var(--text-muted); } +.fsh-handoff-facts dd { min-height: calc(var(--fs-12) * 1.5); margin: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-handoff-path { font-family: var(--font-mono); font-size: var(--fs-11); } +.fsh-handoff-mode { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--line-1); border-radius: var(--radius-md); } +.fsh-handoff-legend { padding: 0 var(--space-1); color: var(--text-muted); font-size: var(--fs-11); } +.fsh-handoff-choice { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-primary); font-size: var(--fs-12); cursor: pointer; } +.fsh-handoff-choice input { accent-color: var(--accent); } +.fsh-handoff-note { margin: 0; } +.fsh-handoff-error { margin: var(--space-2) 0 0; color: var(--danger-text); font-size: var(--fs-12); } +.fsh-handoff-browse { display: grid; gap: var(--space-3); } +.fsh-handoff-browse > .fsh-note { margin: 0; } +.fsh-handoff-list { display: grid; gap: var(--space-1); max-height: 280px; min-height: 120px; margin: 0; padding: var(--space-1); overflow-y: auto; list-style: none; border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-field); } +.fsh-handoff-pick { display: grid; grid-template-columns: 12ch minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: var(--space-3); width: 100%; height: 44px; padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; } +.fsh-handoff-pick:hover { background: var(--bg-hover); } +.fsh-handoff-item.is-chosen .fsh-handoff-pick { border-color: var(--accent-line); background: var(--accent-tint); } +.fsh-handoff-item-app { grid-row: 1 / 3; color: var(--text-muted); font-size: var(--fs-11); } +.fsh-handoff-item-title { overflow: hidden; font-size: var(--fs-13); text-overflow: ellipsis; white-space: nowrap; } +.fsh-handoff-item-line { grid-column: 2; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-handoff-item-when { grid-column: 3; grid-row: 1 / 3; min-width: 10ch; color: var(--text-faint); font-size: var(--fs-11); text-align: right; } +.fsh-handoff-sources { margin: 0; font-family: var(--font-mono); font-size: var(--fs-11); white-space: pre-wrap; word-break: break-all; } +.fsh-handoff-field { display: grid; gap: var(--space-1); color: var(--text-muted); font-size: var(--fs-11); } +.fsh-handoff-settings { display: grid; gap: var(--space-3); } +.fsh-handoff-settings > .fsh-note { margin: 0; } +.fsh-handoff-apps { display: grid; gap: var(--space-2); } +.fsh-handoff-app { display: grid; grid-template-columns: minmax(0, 1fr) 16ch; align-items: center; gap: var(--space-3); min-height: var(--ctl); color: var(--text-primary); font-size: var(--fs-13); } diff --git a/frontend/src/ui/handoff/prompt.ts b/frontend/src/ui/handoff/prompt.ts new file mode 100644 index 00000000..be207909 --- /dev/null +++ b/frontend/src/ui/handoff/prompt.ts @@ -0,0 +1,168 @@ +import { el, q, setDisabled, setHidden, setText, setTitle } from '../../shell/dom'; +import { t } from '../../i18n'; +import { appName, contentsText, kindText, mapsText, offerLine } from './describe'; +import { service, type Answer, type Inspection, type Offer, type OpenMode } from './service'; + +export interface PromptHost { + opened: (offer: Offer, mode: OpenMode) => void; + failed: (message: string) => void; +} + +export class Prompt { + private readonly root: HTMLElement; + private readonly queue: Offer[] = []; + private readonly details = new Map(); + private readonly loading = new Set(); + private readonly before: { el: Element | null } = { el: null }; + private busy = false; + + constructor(private readonly host: PromptHost) { + this.root = el(``); + for (const b of this.root.querySelectorAll('.fsh-handoff-btn')) { + b.addEventListener('click', () => void this.answer(b.dataset.answer as Answer)); + } + this.root.addEventListener('keydown', (e) => { + if (e.key === 'Escape') { e.stopPropagation(); void this.answer('deny'); } + }); + (document.getElementById('overlay-root') ?? document.body).appendChild(this.root); + } + + get waiting(): number { return this.queue.length; } + + set(offers: Offer[]): void { + const ids = new Set(offers.map((o) => o.id)); + for (let i = this.queue.length - 1; i >= 0; i--) if (!ids.has(this.queue[i].id)) this.queue.splice(i, 1); + for (const o of offers) if (!this.queue.some((x) => x.id === o.id)) this.queue.push(o); + this.render(); + } + + add(offer: Offer): void { + const at = this.queue.findIndex((o) => o.id === offer.id || o.key === offer.key); + if (at >= 0) this.queue.splice(at, 1, offer); + else this.queue.push(offer); + this.render(); + } + + withdraw(id: string): void { + const at = this.queue.findIndex((o) => o.id === id); + if (at < 0) return; + this.queue.splice(at, 1); + this.details.delete(id); + this.render(); + } + + private mode(): OpenMode { + return (this.root.querySelector('input[name="fsh-handoff-mode"]:checked')?.value as OpenMode) || 'add'; + } + + private render(): void { + const offer = this.queue[0]; + const wasHidden = this.root.hidden; + if (!offer) { + setHidden(this.root, true); + if (!wasHidden && this.before.el instanceof HTMLElement) this.before.el.focus(); + return; + } + const app = appName(offer); + setText(q(this.root, '.fsh-handoff-count'), this.queue.length > 1 ? t('1 of {count}', { count: this.queue.length }) : ''); + setText(q(this.root, '.fsh-handoff-lede'), t('{app} is handing over {title}: {what}.', { app, title: offer.title, what: offerLine(offer) })); + setText(q(this.root, '.fsh-handoff-always'), t('Always allow {app}', { app })); + setHidden(q(this.root, '.fsh-handoff-always'), !offer.app); + const path = offer.item ? `${offer.path}/${offer.item}` : offer.path; + setText(q(this.root, '.fsh-handoff-path'), path); + setTitle(q(this.root, '.fsh-handoff-path'), path); + this.showDetails(offer); + this.error(offer.error ?? ''); + if (wasHidden) { + this.before.el = document.activeElement; + setHidden(this.root, false); + q(this.root, '.fsh-handoff-btn[data-answer="once"]').focus(); + } + void this.load(offer); + } + + private showDetails(offer: Offer): void { + const d = this.details.get(offer.id); + const kind = q(this.root, '.fsh-handoff-kind'); + const contents = q(this.root, '.fsh-handoff-contents'); + const maps = q(this.root, '.fsh-handoff-maps'); + if (d === undefined) { + for (const n of [kind, contents, maps]) setText(n, t('Reading...')); + } else if (typeof d === 'string') { + setText(kind, t('Could not be read')); + setText(contents, d); + setText(maps, ''); + } else { + setText(kind, kindText(d)); + setText(contents, contentsText(d)); + setText(maps, mapsText(d)); + } + } + + private async load(offer: Offer): Promise { + if (this.details.has(offer.id) || this.loading.has(offer.id)) return; + this.loading.add(offer.id); + let found: Inspection | string; + try { + found = await service.inspect(offer.path, offer.item); + } catch (err) { + found = err instanceof Error ? err.message : String(err); + } + this.loading.delete(offer.id); + this.details.set(offer.id, found); + if (this.queue[0]?.id === offer.id) this.showDetails(offer); + } + + private error(text: string): void { + const n = q(this.root, '.fsh-handoff-error'); + setText(n, text); + setHidden(n, !text); + } + + private async answer(answer: Answer): Promise { + const offer = this.queue[0]; + if (!offer || this.busy) return; + this.busy = true; + const buttons = [...this.root.querySelectorAll('.fsh-handoff-btn')]; + for (const b of buttons) setDisabled(b, true); + const mode = this.mode(); + try { + await service.answer(offer.id, answer, mode); + this.withdraw(offer.id); + if (answer !== 'deny') this.host.opened(offer, mode); + } catch (err) { + const message = err instanceof Error ? err.message : String(err); + this.error(message); + if (/no longer waiting/.test(message)) this.withdraw(offer.id); + else this.host.failed(message); + } finally { + this.busy = false; + for (const b of buttons) setDisabled(b, false); + } + } +} From 13303d3d85fd6d6869c92584918a3b4e1b6ef9c9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:24 -0500 Subject: [PATCH 035/494] feat(frontend): list the family's hand-off folders to open one by choice Open a Hand-off lists what the GoF folder and FormSurface's exports hold, newest first, with the sending app and what it is, or takes a path, and opens it as new or added without a prompt because the person chose it. Run: npx tsc --noEmit passes. --- frontend/src/ui/handoff/browse.ts | 95 +++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 frontend/src/ui/handoff/browse.ts diff --git a/frontend/src/ui/handoff/browse.ts b/frontend/src/ui/handoff/browse.ts new file mode 100644 index 00000000..2c308f63 --- /dev/null +++ b/frontend/src/ui/handoff/browse.ts @@ -0,0 +1,95 @@ +import { Dialog } from '../../shell/dialog'; +import { el, patchList, q, setDisabled, setHidden, setText, setTitle } from '../../shell/dom'; +import { t } from '../../i18n'; +import { ago, appName, offerLine } from './describe'; +import { service, type Offer, type OpenMode, type OpenResult } from './service'; + +export interface BrowseHost { + opened: (offer: { title: string; app_name: string }, mode: OpenMode, result: OpenResult) => void; +} + +function row(): HTMLElement { + return el(`
  • `); +} + +export function browse(host: BrowseHost): void { + const d = new Dialog('Open a Hand-off', 'wide'); + const body = el(`
    +

    What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.

    +
      + +
      + +
      + Open it + + +
      + +
      `); + d.body.appendChild(body); + const list = q(body, '.fsh-handoff-list'); + const empty = q(body, '.fsh-handoff-empty'); + const error = q(body, '.fsh-handoff-error'); + const input = q(body, '.fsh-handoff-path-input'); + let chosen: Offer | null = null; + let busy = false; + const mode = (): OpenMode => (body.querySelector('input[name="fsh-handoff-browse-mode"]:checked')?.value as OpenMode) || 'add'; + const fail = (text: string): void => { setText(error, text); setHidden(error, !text); }; + const mark = (): void => { + for (const li of list.querySelectorAll('.fsh-handoff-item')) li.classList.toggle('is-chosen', li.dataset.key === chosen?.key); + }; + const go = async (): Promise => { + if (busy) return; + const path = input.value.trim() || chosen?.path || ''; + if (!path) { fail(t('Choose a hand-off or give a path')); return; } + const item = input.value.trim() ? null : chosen?.item ?? null; + busy = true; + setDisabled(open, true); + fail(''); + try { + const m = mode(); + const result = await service.open(path, item, m); + host.opened({ title: chosen && !input.value.trim() ? chosen.title : path.split('/').pop() ?? path, app_name: chosen && !input.value.trim() ? appName(chosen) : '' }, m, result); + d.close(); + } catch (err) { + fail(err instanceof Error ? err.message : String(err)); + } finally { + busy = false; + setDisabled(open, false); + } + }; + d.action('Cancel', () => d.close()); + const open = d.action('Open', go, 'primary'); + input.addEventListener('input', () => { if (input.value.trim()) { chosen = null; mark(); } }); + input.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); void go(); } }); + d.open(); + void service.available().then((reply) => { + patchList(list, reply.items, { + key: (o) => o.key, + create: (o) => { + const li = row(); + q(li, 'button').addEventListener('click', () => { chosen = reply.items.find((x) => x.key === li.dataset.key) ?? o; input.value = ''; mark(); }); + q(li, 'button').addEventListener('dblclick', () => void go()); + return li; + }, + update: () => undefined, + }); + for (const li of list.querySelectorAll('.fsh-handoff-item')) { + const o = reply.items.find((x) => x.key === li.dataset.key); + if (!o) continue; + setText(q(li, '.fsh-handoff-item-app'), appName(o)); + setText(q(li, '.fsh-handoff-item-title'), o.title); + setText(q(li, '.fsh-handoff-item-line'), offerLine(o)); + setText(q(li, '.fsh-handoff-item-when'), ago(o.changed * 1000)); + setTitle(q(li, 'button'), o.item ? `${o.path}/${o.item}` : o.path); + } + setHidden(empty, reply.items.length > 0); + setText(q(body, '.fsh-handoff-sources'), reply.sources.map((s) => `${t(s.label)}: ${s.folder}${s.found ? '' : ` (${t('not found')})`}`).join('\n')); + }, (err: unknown) => fail(err instanceof Error ? err.message : String(err))); +} From 3216686fb72bda9d8abe0e07100a5d74b9e45eb7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:24 -0500 Subject: [PATCH 036/494] feat(frontend): add a settings page for hand-offs per Form app Each of FormSculpt, FormFabric, FormSurface and FormCAD can be asked about, always allowed or blocked, stored by the service like the outside-agents choice, and the page shows which folders are watched. Run: npx tsc --noEmit passes. --- frontend/src/ui/handoff/settings.ts | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 frontend/src/ui/handoff/settings.ts diff --git a/frontend/src/ui/handoff/settings.ts b/frontend/src/ui/handoff/settings.ts new file mode 100644 index 00000000..d8e4cf47 --- /dev/null +++ b/frontend/src/ui/handoff/settings.ts @@ -0,0 +1,44 @@ +import { el, q, setHidden, setText, setValue } from '../../shell/dom'; +import { t } from '../../i18n'; +import { service, type AppChoice } from './service'; + +const APPS: [string, string][] = [['formsculpt', 'FormSculpt'], ['formfabric', 'FormFabric'], ['formsurface', 'FormSurface'], ['formcad', 'FormCAD']]; + +export function settingsPage(host: HTMLElement): void { + const root = el(`
      +

      FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.

      +
      +
      + +
      `); + const apps = q(root, '.fsh-handoff-apps'); + const error = q(root, '.fsh-handoff-error'); + const selects = new Map(); + for (const [id, name] of APPS) { + const r = el(``); + setText(q(r, '.fsh-handoff-app-name'), name); + const s = q(r, 'select'); + s.setAttribute('aria-label', t('Hand-offs from {app}', { app: name })); + s.addEventListener('change', () => { + void service.setApp(id, s.value as AppChoice).then(() => setHidden(error, true), () => { setHidden(error, false); void read(); }); + }); + selects.set(id, s); + apps.appendChild(r); + } + const read = async (): Promise => { + try { + const reply = await service.offers(); + for (const [id, s] of selects) setValue(s, reply.apps[id] ?? 'ask'); + setText(q(root, '.fsh-handoff-sources'), reply.sources.map((x) => `${t(x.label)}: ${x.folder}${x.found ? '' : ` (${t('not found')})`}`).join('\n')); + setHidden(error, true); + } catch { + setHidden(error, false); + } + }; + host.appendChild(root); + void read(); +} From 42bae9cc8a4ad829b0b5ab26a719a8520ba14177 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:24 -0500 Subject: [PATCH 037/494] feat(frontend): mount the hand-off prompt, command, menu item and page The handoff module follows handoff.offered, handoff.withdrawn and handoff.opened, reads waiting offers when the window starts or reconnects, and registers handoff.browse in the File menu and the Hand-offs settings page. Run: npx tsc --noEmit passes. --- frontend/src/ui/handoff/index.ts | 47 +++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/handoff/index.ts b/frontend/src/ui/handoff/index.ts index 64a1dab9..f6166dc4 100644 --- a/frontend/src/ui/handoff/index.ts +++ b/frontend/src/ui/handoff/index.ts @@ -1,3 +1,48 @@ +import './handoff.css'; import type { ModuleContext } from '../../shell/app-shell'; +import { browse } from './browse'; +import { appName } from './describe'; +import { Prompt } from './prompt'; +import { service, type Offer } from './service'; +import { settingsPage } from './settings'; -export function mount(_ctx: ModuleContext): void {} +const SETTINGS_PAGE = 'handoff'; + +export function mount(ctx: ModuleContext): void { + const said = (offer: object, mode: string): string => { + const o = offer as { title?: unknown; app?: unknown; app_name?: unknown }; + const vars = { title: String(o.title ?? ''), app: appName({ app: String(o.app ?? ''), app_name: String(o.app_name ?? '') }) }; + return mode === 'new' ? ctx.t('Opened {title} from {app} as a new document', vars) : ctx.t('Added {title} from {app}', vars); + }; + const prompt = new Prompt({ + opened: (offer, mode) => ctx.toast(said(offer, mode)), + failed: (message) => ctx.toast(message, 'error'), + }); + const sync = async (): Promise => { + try { + const reply = await service.offers(); + prompt.set(reply.offers); + } catch { + return; + } + }; + ctx.events.on('handoff.offered', (e) => { if (e.offer && typeof e.offer === 'object') prompt.add(e.offer as Offer); }); + ctx.events.on('handoff.withdrawn', (e) => prompt.withdraw(String(e.id ?? ''))); + ctx.events.on('handoff.opened', (e) => { if (e.auto === true) ctx.toast(said(e, String(e.mode ?? 'add'))); }); + ctx.events.on('hello', () => void sync()); + ctx.events.on('resync', () => void sync()); + ctx.onReady(() => void sync()); + + ctx.registry.registerCommand({ + id: 'handoff.browse', label: 'Open a Hand-off...', group: 'File', icon: 'import', + description: 'Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over', + run: () => browse({ opened: (o, mode) => ctx.toast(said(o, mode)) }), + }); + ctx.registry.registerCommand({ id: 'handoff.settings', label: 'Hand-off Settings', group: 'File', palette: false, run: () => ctx.registry.runCommand('app.settings', { page: SETTINGS_PAGE }) }); + ctx.registry.registerMenu({ id: 'file', items: [{ command: 'handoff.browse', section: 3 }] }); + ctx.registry.registerSettingsPage({ + id: SETTINGS_PAGE, title: 'Hand-offs', icon: 'import', order: 60, group: 'Files', + keywords: ['FormSculpt', 'FormSurface', 'FormFabric', 'FormCAD', 'GoF', 'hand-off', 'send to'], + mount: settingsPage, + }); +} From 1fd67dbdf97e56a4e18c4d54eea631892bdb0290 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:22:44 -0500 Subject: [PATCH 038/494] fix(io): keep senders' factors, units and resolved texture paths Maps no longer force glTF factors onto materials (the slot model's multiply defaults off, and forced metalness made FormSurface materials metal); declared_unit gives a GoF entry's units for the clean-up pass; not-found warnings are dropped for percent-encoded texture paths the hand-off resolves to files. Found by opening the corpus through the release CLI. Run: cargo clippy -p fsh-io -D warnings passes. --- native/crates/fsh-io/src/family/handoff.rs | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/native/crates/fsh-io/src/family/handoff.rs b/native/crates/fsh-io/src/family/handoff.rs index 00582bce..24e307c3 100644 --- a/native/crates/fsh-io/src/family/handoff.rs +++ b/native/crates/fsh-io/src/family/handoff.rs @@ -5,7 +5,7 @@ use super::surface::{is_formsurface_obj, read_surface, SurfaceExport}; use crate::error::{IoError, Result}; use crate::raw::{RawMaterial, RawScene, RawTexture}; use crate::watch::Watch; -use fsh_scene::TextureRole; +use fsh_core::LengthUnit; use serde_json::{json, Value}; use std::path::{Path, PathBuf}; @@ -233,17 +233,6 @@ fn attach(material: &mut RawMaterial, textures: &mut Vec, maps: &[&M for m in maps { textures.push(RawTexture { uri: m.path.to_string_lossy().into_owned(), role: m.role, uv_set: m.uv_set, colour_space: m.colour_space }); material.textures.push(textures.len() - 1); - match m.role { - TextureRole::BaseColour => material.base_colour = [1.0; 3], - TextureRole::Roughness => material.roughness = 1.0, - TextureRole::Metalness => material.metallic = 1.0, - TextureRole::OcclusionRoughnessMetalness => { - material.roughness = 1.0; - material.metallic = 1.0; - } - TextureRole::Emission => material.emissive = [1.0; 3], - _ => {} - } } } @@ -292,6 +281,16 @@ impl Inspection { self.model.as_deref().unwrap_or(&self.path) } + /// The unit the sender declares for the file apart from the file itself (a GoF entry's units). + pub fn declared_unit(&self) -> Option { + match self.entry.as_ref()?.units.as_deref()? { + "m" => Some(LengthUnit::Metre), + "cm" => Some(LengthUnit::Centimetre), + "mm" => Some(LengthUnit::Millimetre), + _ => None, + } + } + /// True when only materials arrive (maps without a mesh). pub fn materials_only(&self) -> bool { self.model.is_none() && !self.maps().is_empty() @@ -307,9 +306,15 @@ impl Inspection { None => return Err(IoError::Unsupported(format!("{} holds nothing FormShot can read", self.path.display()))), }; let folder = self.model.as_deref().and_then(Path::parent).map(Path::to_path_buf).unwrap_or_else(|| self.path.clone()); + let mut found = Vec::new(); for t in &mut scene.textures { - t.uri = resolve_texture(&t.uri, &folder); + let resolved = resolve_texture(&t.uri, &folder); + if resolved != t.uri && Path::new(&resolved).is_file() { + found.push(t.uri.clone()); + } + t.uri = resolved; } + scene.warnings.retain(|w| !found.iter().any(|uri| w.contains(uri.as_str()) && w.contains("not found"))); if self.app == Some(FamilyApp::FormSurface) { scene.warnings.retain(|w| !(w.starts_with("material ") && w.ends_with("is not defined in any library; a default was used"))); } From f7ea42e9acb16b6035a726cecef63e5b8ab5d569 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:25:07 -0500 Subject: [PATCH 039/494] fix(commands): keep unmatched texture sets and the GoF unit on open handoff.open passes a GoF entry's units to the clean-up pass (FormSculpt's metre OBJ was guessed as centimetres) and adds materials no mesh uses, such as FormSurface texture sets that match no material of the mesh, to the same import step instead of dropping them. Run: through the release CLI's dispatch, six hand-offs opened, one undo removed the last one whole, and a saved project reopened and saved again with identical JSON. --- native/crates/fsh-commands/src/ext/handoff.rs | 51 +++++++++++++++---- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/handoff.rs b/native/crates/fsh-commands/src/ext/handoff.rs index 59bf421d..bfc6fc15 100644 --- a/native/crates/fsh-commands/src/ext/handoff.rs +++ b/native/crates/fsh-commands/src/ext/handoff.rs @@ -108,28 +108,55 @@ fn inspect(args: &Value) -> Result { Ok(out) } -fn materials_command(raw: &RawScene, doc: &Document) -> Command { - let mut next = doc.next_key().max(1); +fn add_materials(payload: &mut ImportPayload, raw: &RawScene, which: &[usize], first_key: u64) { + let mut next = first_key.max(1); let mut key = || { next += 1; next - 1 }; - let mut payload = ImportPayload::default(); let mut tex_keys: Vec> = vec![None; raw.textures.len()]; - for (i, t) in raw.textures.iter().enumerate() { - let k = TextureKey::from_raw(key()); - tex_keys[i] = Some(k); - let texture = TextureRef { path: t.uri.clone(), role: t.role, uv_set: t.uv_set, colour_space: Some(t.colour_space.to_string()) }; - payload.textures.push(ImportTexture { key: k, texture }); + for &mi in which { + for &ti in &raw.materials[mi].textures { + let Some(t) = raw.textures.get(ti).filter(|_| tex_keys[ti].is_none()) else { continue }; + let k = TextureKey::from_raw(key()); + tex_keys[ti] = Some(k); + let texture = TextureRef { path: t.uri.clone(), role: t.role, uv_set: t.uv_set, colour_space: Some(t.colour_space.to_string()) }; + payload.textures.push(ImportTexture { key: k, texture }); + } } - for m in &raw.materials { + for &mi in which { + let m = &raw.materials[mi]; let mut material = Material::new(m.name.clone(), if m.metallic > 0.5 { "metal" } else { "generic" }, surface_params(m)); material.textures = m.textures.iter().filter_map(|&t| tex_keys.get(t).copied().flatten()).collect(); payload.materials.push(ImportMaterial { key: MaterialKey::from_raw(key()), material }); } +} + +fn materials_command(raw: &RawScene, doc: &Document) -> Command { + let mut payload = ImportPayload::default(); + add_materials(&mut payload, raw, &(0..raw.materials.len()).collect::>(), doc.next_key()); Command::Import(Import { parent: None, payload }) } +fn with_unused_materials(mut cmd: Command, raw: &RawScene, doc: &Document) -> Command { + let used: Vec = (0..raw.materials.len()).map(|i| raw.meshes.iter().any(|m| m.material == Some(i))).collect(); + let unused: Vec = (0..raw.materials.len()).filter(|&i| !used[i]).collect(); + if let (Command::Import(import), false) = (&mut cmd, unused.is_empty()) { + let p = &import.payload; + let top = p + .meshes + .iter() + .map(|m| m.key.raw()) + .chain(p.materials.iter().map(|m| m.key.raw())) + .chain(p.textures.iter().map(|t| t.key.raw())) + .chain(p.nodes.iter().map(|n| n.id.raw())) + .max() + .unwrap_or(0); + add_materials(&mut import.payload, raw, &unused, (top + 1).max(doc.next_key())); + } + cmd +} + fn stamp(cmd: &mut Command, insp: &Inspection) { let Command::Import(import) = cmd else { return }; let nodes = &mut import.payload.nodes; @@ -174,7 +201,8 @@ fn open(engine: &Engine, st: &mut State, args: &Value) -> Result { let watch = Watch::new(); let mut raw = insp.read(&watch)?; let materials_only = insp.materials_only(); - let report = if materials_only { None } else { Some(fsh_io::clean(&mut raw, &CleanOptions::default(), &watch)?) }; + let clean = CleanOptions { unit: insp.declared_unit(), ..CleanOptions::default() }; + let report = if materials_only { None } else { Some(fsh_io::clean(&mut raw, &clean, &watch)?) }; if mode == "new" { let doc = crate::sample::build(None, &insp.title)?; let mut editor = Editor::new(doc); @@ -185,7 +213,8 @@ fn open(engine: &Engine, st: &mut State, args: &Value) -> Result { let mut cmd = if materials_only { materials_command(&raw, st.editor.document()) } else { - fsh_io::to_import_command(&raw, st.editor.document(), &ImportOptions { parent: None, wrap_in_group: true }, &watch)? + let cmd = fsh_io::to_import_command(&raw, st.editor.document(), &ImportOptions { parent: None, wrap_in_group: true }, &watch)?; + with_unused_materials(cmd, &raw, st.editor.document()) }; stamp(&mut cmd, &insp); let from = insp.app.map(|a| a.name()).or(insp.writer.as_deref()).unwrap_or("another app"); From ca21ed324139d6b0e2494ebbb9c659547d6f7cea Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:49 -0500 Subject: [PATCH 040/494] fix(frontend): keep the hand-off prompt the same size between offers The lede reserves two lines and the maps row wraps to two lines in reserved space, so the dialog no longer moves when one offer's sentence is longer than another's. Run: in headless Chrome against the service, the dialog box stayed at top 251 and height 397 px across a FormSculpt and a FormSurface offer. --- frontend/src/ui/handoff/handoff.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/handoff/handoff.css b/frontend/src/ui/handoff/handoff.css index d0eeb61e..7037923d 100644 --- a/frontend/src/ui/handoff/handoff.css +++ b/frontend/src/ui/handoff/handoff.css @@ -1,8 +1,9 @@ .fsh-handoff-count { min-width: 8ch; color: var(--text-muted); font-size: var(--fs-12); text-align: right; } -.fsh-handoff-lede { margin: 0 0 var(--space-3); color: var(--text-primary); font-size: var(--fs-13); line-height: var(--lh); } +.fsh-handoff-lede { display: -webkit-box; min-height: calc(var(--fs-13) * var(--lh) * 2); margin: 0 0 var(--space-3); overflow: hidden; color: var(--text-primary); font-size: var(--fs-13); line-height: var(--lh); -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .fsh-handoff-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); font-size: var(--fs-12); } .fsh-handoff-facts dt { color: var(--text-muted); } .fsh-handoff-facts dd { min-height: calc(var(--fs-12) * 1.5); margin: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-handoff-facts dd.fsh-handoff-maps { display: -webkit-box; min-height: calc(var(--fs-12) * 3); white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } .fsh-handoff-path { font-family: var(--font-mono); font-size: var(--fs-11); } .fsh-handoff-mode { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--line-1); border-radius: var(--radius-md); } .fsh-handoff-legend { padding: 0 var(--space-1); color: var(--text-muted); font-size: var(--fs-11); } From 99112cb3c34110ca439b1155b9ba4c346ea46606 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:49 -0500 Subject: [PATCH 041/494] fix(backend): open an app's other waiting hand-offs once it is always allowed Answering Always allow now also opens the other offers from the same app that were already waiting, as additions, instead of asking about each again. Run: in headless Chrome, Always allow FormSurface opened all three waiting FormSurface exports and the prompt closed. --- backend/app/routers/handoff.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/backend/app/routers/handoff.py b/backend/app/routers/handoff.py index 91b9f9de..9c6d60c2 100644 --- a/backend/app/routers/handoff.py +++ b/backend/app/routers/handoff.py @@ -343,9 +343,27 @@ def answer(oid: str, reply: str, mode: str) -> dict: _offers[oid] = offer events.publish("handoff.offered", offer=_public(offer)) raise + if reply == "always" and offer.get("app"): + _open_held(offer["app"]) return {"ok": True, "id": oid, "answer": reply, "as": mode, "result": result, "apps": app_choices()} +def _open_held(app: str) -> None: + with _lock: + held = sorted((o for o in _offers.values() if o.get("app") == app), key=lambda o: o["arrived"]) + for o in held: + _offers.pop(o["id"], None) + for o in held: + events.publish("handoff.withdrawn", id=o["id"]) + try: + open_offer(o, "add", auto=True) + except HTTPException as error: + o["error"] = str(error.detail) + with _lock: + _offers[o["id"]] = o + events.publish("handoff.offered", offer=_public(o)) + + @router.post("/offers/{oid}") async def post_answer(oid: str, request: Request) -> dict: body = await _body(request) From 8f80c69577d2c951046f1a2ffd521ce6d439fec7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:54:23 -0500 Subject: [PATCH 042/494] feat(io): know step and iges files and leave them to the cad worker ModelFormat gains Step (.step, .stp) and Iges (.iges, .igs), detected by content or extension; reading them answers unsupported with a plain note that the CAD worker reads them. Adds the detect, read_any and Format names the seams use. Ran the check program on own STEP, IGES and extensionless IGES files. --- native/crates/fsh-io/src/lib.rs | 55 ++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index 5c90ac15..bf359b1f 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -50,11 +50,26 @@ pub enum ModelFormat { Stl, /// PLY, ASCII or binary. Ply, + /// STEP (ISO 10303-21); read by the CAD worker through fsh-cad, not by this crate. + Step, + /// IGES; read by the CAD worker through fsh-cad, not by this crate. + Iges, } +/// Short name used by the import commands. +pub type Format = ModelFormat; + impl ModelFormat { /// Every format. - pub const ALL: [ModelFormat; 5] = [ModelFormat::Gltf, ModelFormat::Glb, ModelFormat::Obj, ModelFormat::Stl, ModelFormat::Ply]; + pub const ALL: [ModelFormat; 7] = [ + ModelFormat::Gltf, + ModelFormat::Glb, + ModelFormat::Obj, + ModelFormat::Stl, + ModelFormat::Ply, + ModelFormat::Step, + ModelFormat::Iges, + ]; /// Lower-case extension. pub fn extension(self) -> &'static str { @@ -64,6 +79,8 @@ impl ModelFormat { ModelFormat::Obj => "obj", ModelFormat::Stl => "stl", ModelFormat::Ply => "ply", + ModelFormat::Step => "step", + ModelFormat::Iges => "iges", } } @@ -75,9 +92,25 @@ impl ModelFormat { "obj" => ModelFormat::Obj, "stl" => ModelFormat::Stl, "ply" => ModelFormat::Ply, + "step" | "stp" => ModelFormat::Step, + "iges" | "igs" => ModelFormat::Iges, _ => return None, }) } + + /// True for formats this crate reads itself; false for the B-rep formats the CAD worker reads. + pub fn read_here(self) -> bool { + !matches!(self, ModelFormat::Step | ModelFormat::Iges) + } +} + +fn looks_like_step(bytes: &[u8]) -> bool { + let trimmed = bytes.iter().position(|b| !b.is_ascii_whitespace()).map(|i| &bytes[i..]).unwrap_or(&[]); + trimmed.starts_with(b"ISO-10303-21;") +} + +fn looks_like_iges(bytes: &[u8]) -> bool { + bytes.len() >= 80 && bytes[72] == b'S' && bytes[73..80].iter().all(|b| b.is_ascii_digit() || *b == b' ') } fn looks_like_obj(bytes: &[u8]) -> bool { @@ -99,6 +132,12 @@ pub fn detect_model(name: &str, bytes: &[u8]) -> Option { if stl::is_binary_stl(bytes) || stl::is_ascii_stl(bytes) { return Some(ModelFormat::Stl); } + if looks_like_step(bytes) { + return Some(ModelFormat::Step); + } + if looks_like_iges(bytes) { + return Some(ModelFormat::Iges); + } let ext = Path::new(name).extension().and_then(|e| e.to_str()).and_then(ModelFormat::from_extension); let trimmed = bytes.iter().position(|b| !b.is_ascii_whitespace()).map(|i| &bytes[i..]).unwrap_or(&[]); if trimmed.starts_with(b"{") && (ext == Some(ModelFormat::Gltf) || bytes.windows(7).take(1 << 16).any(|w| w == b"\"asset\"")) { @@ -120,6 +159,10 @@ pub fn read_model_bytes(format: ModelFormat, bytes: &[u8], name: &str, siblings: ModelFormat::Obj => read_obj(bytes, name, siblings, watch), ModelFormat::Stl => read_stl(bytes, name, watch), ModelFormat::Ply => read_ply(bytes, name, watch), + ModelFormat::Step | ModelFormat::Iges => Err(IoError::Unsupported(format!( + "{} files are read by the CAD worker (fsh-cad), not by the mesh readers", + format.extension().to_ascii_uppercase() + ))), } } @@ -131,6 +174,16 @@ pub fn read_model(path: &Path, watch: &Watch) -> Result { read_model_bytes(format, &bytes, &paths::stem(path), &Siblings::of(path), watch) } +/// Same as [`detect_model`]. +pub fn detect(name: &str, bytes: &[u8]) -> Option { + detect_model(name, bytes) +} + +/// Same as [`read_model`]: reads any model file this crate reads; STEP and IGES answer that the CAD worker reads them. +pub fn read_any(path: &Path, watch: &Watch) -> Result { + read_model(path, watch) +} + /// Reads, cleans and converts a model file into one `scene.import` command plus the clean-up report. pub fn import_file( path: &Path, From 5e77166467bd27edaf6b563aff4c32589338be0f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:57:56 -0500 Subject: [PATCH 043/494] feat(io): read 3mf packages with components and build items Adds a ZIP reader (stored and deflated members, ZIP64 sizes, CRC and size checks before inflating) and a 3MF reader on roxmltree: objects, nested and cross-part components with a cycle check, build transforms, the declared unit (micron scaled to mm) and Z up. Ran the check program on six own packages (bounds as expected, cycle and bad index refused) and 2800 truncated or bit-flipped copies with no panic. --- native/crates/fsh-io/Cargo.toml | 1 + native/crates/fsh-io/src/lib.rs | 14 +- native/crates/fsh-io/src/threemf.rs | 324 ++++++++++++++++++++++++++++ native/crates/fsh-io/src/zip.rs | 181 ++++++++++++++++ 4 files changed, 519 insertions(+), 1 deletion(-) create mode 100644 native/crates/fsh-io/src/threemf.rs create mode 100644 native/crates/fsh-io/src/zip.rs diff --git a/native/crates/fsh-io/Cargo.toml b/native/crates/fsh-io/Cargo.toml index 45451a0a..23f94623 100644 --- a/native/crates/fsh-io/Cargo.toml +++ b/native/crates/fsh-io/Cargo.toml @@ -9,3 +9,4 @@ publish = false fsh-core = { path = "../fsh-core" } fsh-scene = { path = "../fsh-scene" } serde_json = "1" +roxmltree = "0.21" diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index bf359b1f..ef136991 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -17,7 +17,9 @@ mod ply; mod png; mod raw; mod stl; +mod threemf; mod watch; +mod zip; pub use clean::{clean, world_bounds, CleanOptions, CleanReport}; pub use convert::{surface_params, to_import_command, ImportOptions, EMISSIVE_NITS_PER_UNIT}; @@ -33,6 +35,7 @@ pub use ply::read_ply; pub use png::{read_png, write_png, write_png_rgb16, write_png_rgba8}; pub use raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; pub use stl::read_stl; +pub use threemf::read_3mf; pub use watch::{Stage, Watch}; use std::path::Path; @@ -50,6 +53,8 @@ pub enum ModelFormat { Stl, /// PLY, ASCII or binary. Ply, + /// 3D Manufacturing Format package. + ThreeMf, /// STEP (ISO 10303-21); read by the CAD worker through fsh-cad, not by this crate. Step, /// IGES; read by the CAD worker through fsh-cad, not by this crate. @@ -61,12 +66,13 @@ pub type Format = ModelFormat; impl ModelFormat { /// Every format. - pub const ALL: [ModelFormat; 7] = [ + pub const ALL: [ModelFormat; 8] = [ ModelFormat::Gltf, ModelFormat::Glb, ModelFormat::Obj, ModelFormat::Stl, ModelFormat::Ply, + ModelFormat::ThreeMf, ModelFormat::Step, ModelFormat::Iges, ]; @@ -79,6 +85,7 @@ impl ModelFormat { ModelFormat::Obj => "obj", ModelFormat::Stl => "stl", ModelFormat::Ply => "ply", + ModelFormat::ThreeMf => "3mf", ModelFormat::Step => "step", ModelFormat::Iges => "iges", } @@ -92,6 +99,7 @@ impl ModelFormat { "obj" => ModelFormat::Obj, "stl" => ModelFormat::Stl, "ply" => ModelFormat::Ply, + "3mf" => ModelFormat::ThreeMf, "step" | "stp" => ModelFormat::Step, "iges" | "igs" => ModelFormat::Iges, _ => return None, @@ -129,6 +137,9 @@ pub fn detect_model(name: &str, bytes: &[u8]) -> Option { if ply::is_ply(bytes) { return Some(ModelFormat::Ply); } + if threemf::is_3mf(bytes) { + return Some(ModelFormat::ThreeMf); + } if stl::is_binary_stl(bytes) || stl::is_ascii_stl(bytes) { return Some(ModelFormat::Stl); } @@ -159,6 +170,7 @@ pub fn read_model_bytes(format: ModelFormat, bytes: &[u8], name: &str, siblings: ModelFormat::Obj => read_obj(bytes, name, siblings, watch), ModelFormat::Stl => read_stl(bytes, name, watch), ModelFormat::Ply => read_ply(bytes, name, watch), + ModelFormat::ThreeMf => read_3mf(bytes, name, watch), ModelFormat::Step | ModelFormat::Iges => Err(IoError::Unsupported(format!( "{} files are read by the CAD worker (fsh-cad), not by the mesh readers", format.extension().to_ascii_uppercase() diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs new file mode 100644 index 00000000..a7c9a269 --- /dev/null +++ b/native/crates/fsh-io/src/threemf.rs @@ -0,0 +1,324 @@ +use crate::error::{malformed, IoError, Result}; +use crate::raw::{RawMesh, RawNode, RawScene, UpAxis}; +use crate::watch::{Stage, Watch}; +use crate::zip::{is_zip, Zip}; +use fsh_core::{LengthUnit, Mat4, Vec3}; +use roxmltree::{Document, Node, ParsingOptions}; +use std::collections::HashMap; + +const MAX_MODEL_XML: u64 = 1 << 31; +const MAX_NODES: usize = 1 << 20; +const MAX_DEPTH: usize = 64; + +/// True for a ZIP package that holds a 3MF model part. +pub fn is_3mf(bytes: &[u8]) -> bool { + is_zip(bytes) + && Zip::open(bytes) + .map(|z| z.entries.iter().any(|e| e.name.to_ascii_lowercase().ends_with(".model"))) + .unwrap_or(false) +} + +struct Tri { + v: [u32; 3], +} + +#[derive(Default)] +struct MeshData { + verts: Vec, + tris: Vec, +} + +struct Component { + path: Option, + id: u32, + transform: Mat4, +} + +struct Object { + name: String, + skipped: bool, + mesh: Option, + components: Vec, +} + +struct Item { + path: Option, + id: u32, + transform: Mat4, +} + +#[derive(Default)] +struct Model { + unit: Option<(LengthUnit, f32)>, + objects: HashMap, + build: Vec, +} + +fn local<'a>(n: &Node<'a, '_>) -> &'a str { + n.tag_name().name() +} + +fn attr<'a>(n: &Node<'a, '_>, name: &str) -> Option<&'a str> { + n.attributes().find(|a| a.name() == name).map(|a| a.value()) +} + +fn children<'a, 'i>(n: Node<'a, 'i>, name: &'static str) -> impl Iterator> { + n.children().filter(move |c| c.is_element() && local(c) == name) +} + +fn num(n: &Node, name: &str) -> Result { + let s = attr(n, name).ok_or_else(|| IoError::Malformed(format!("<{}> has no {name}", local(n))))?; + let v: f32 = s.trim().parse().map_err(|_| IoError::Malformed(format!("<{}> {name}={s:?} is not a number", local(n))))?; + if !v.is_finite() { + return Err(IoError::InvalidData(format!("<{}> {name} is not finite", local(n)))); + } + Ok(v) +} + +fn index(n: &Node, name: &str) -> Result> { + match attr(n, name) { + None => Ok(None), + Some(s) => s + .trim() + .parse::() + .map(Some) + .map_err(|_| IoError::Malformed(format!("<{}> {name}={s:?} is not an index", local(n)))), + } +} + +fn transform(n: &Node) -> Result { + let Some(s) = attr(n, "transform") else { return Ok(Mat4::IDENTITY) }; + let v: Vec = s + .split_whitespace() + .map(|t| t.parse::().map_err(|_| IoError::Malformed(format!("transform value {t:?} is not a number")))) + .collect::>()?; + if v.len() != 12 || v.iter().any(|x| !x.is_finite()) { + return malformed(format!("a transform needs 12 finite numbers, found {s:?}")); + } + Ok(Mat4::from_rows([ + [v[0], v[3], v[6], v[9]], + [v[1], v[4], v[7], v[10]], + [v[2], v[5], v[8], v[11]], + [0.0, 0.0, 0.0, 1.0], + ])) +} + +fn unit_of(s: &str) -> Option<(LengthUnit, f32)> { + Some(match s { + "micron" => (LengthUnit::Millimetre, 0.001), + "millimeter" => (LengthUnit::Millimetre, 1.0), + "centimeter" => (LengthUnit::Centimetre, 1.0), + "meter" => (LengthUnit::Metre, 1.0), + "inch" => (LengthUnit::Inch, 1.0), + "foot" => (LengthUnit::Foot, 1.0), + _ => return None, + }) +} + +fn path_attr(n: &Node) -> Option { + attr(n, "path").map(|p| p.trim().to_string()).filter(|p| !p.is_empty()) +} + +fn read_mesh(m: Node, name: &str, watch: &Watch) -> Result { + let mut out = MeshData::default(); + for vs in children(m, "vertices") { + for (i, v) in children(vs, "vertex").enumerate() { + if i % 65536 == 0 { + watch.step(Stage::Reading, 0.5)?; + } + out.verts.push(Vec3::new(num(&v, "x")?, num(&v, "y")?, num(&v, "z")?)); + } + } + let nv = out.verts.len() as u32; + for ts in children(m, "triangles") { + for (i, t) in children(ts, "triangle").enumerate() { + if i % 65536 == 0 { + watch.step(Stage::Reading, 0.6)?; + } + let mut v = [0u32; 3]; + for (k, key) in ["v1", "v2", "v3"].iter().enumerate() { + v[k] = index(&t, key)?.ok_or_else(|| IoError::Malformed(format!("{name}: a triangle has no {key}")))?; + if v[k] >= nv { + return Err(IoError::InvalidData(format!("{name}: vertex {} is out of range ({nv} defined)", v[k]))); + } + } + out.tris.push(Tri { v }); + } + } + Ok(out) +} + +fn parse_model(text: &str, part: &str, scene: &mut RawScene, watch: &Watch) -> Result { + let opts = ParsingOptions { allow_dtd: false, ..ParsingOptions::default() }; + let doc = Document::parse_with_options(text, opts).map_err(|e| IoError::Malformed(format!("{part}: {e}")))?; + watch.step(Stage::Reading, 0.4)?; + let root = doc.root_element(); + if local(&root) != "model" { + return malformed(format!("{part}: the root element is <{}>, not ", local(&root))); + } + let mut model = Model::default(); + if let Some(u) = attr(&root, "unit") { + match unit_of(u.trim()) { + Some(x) => model.unit = Some(x), + None => scene.warnings.push(format!("{part}: unknown unit {u:?}; millimetres assumed")), + } + } + if let Some(req) = attr(&root, "requiredextensions") { + let known: Vec<&str> = root.namespaces().filter(|ns| ns.uri().contains("/material/") || ns.uri().contains("/production/")).filter_map(|ns| ns.name()).collect(); + for prefix in req.split_whitespace().filter(|p| !known.contains(p)) { + let uri = root.lookup_namespace_uri(Some(prefix)).unwrap_or(prefix); + scene.warnings.push(format!("{part}: requires the extension {uri}, which is not read; the model may be incomplete")); + } + } + for res in children(root, "resources") { + for r in res.children().filter(|c| c.is_element()) { + if local(&r) != "object" { + continue; + } + let id = index(&r, "id")?.ok_or_else(|| IoError::Malformed(format!("{part}: an object has no id")))?; + let name = attr(&r, "name").map(str::to_string).filter(|s| !s.trim().is_empty()).unwrap_or_else(|| format!("Object {id}")); + let kind = attr(&r, "type").unwrap_or("model"); + let skipped = matches!(kind, "support" | "solidsupport"); + let mut obj = Object { name, skipped, mesh: None, components: Vec::new() }; + if let Some(m) = children(r, "mesh").next() { + obj.mesh = Some(read_mesh(m, &obj.name, watch)?); + } + for cs in children(r, "components") { + for c in children(cs, "component") { + let cid = index(&c, "objectid")?.ok_or_else(|| IoError::Malformed(format!("{part}: a component has no objectid")))?; + obj.components.push(Component { path: path_attr(&c), id: cid, transform: transform(&c)? }); + } + } + if model.objects.insert(id, obj).is_some() { + return malformed(format!("{part}: object id {id} is used twice")); + } + } + } + for b in children(root, "build") { + for it in children(b, "item") { + let id = index(&it, "objectid")?.ok_or_else(|| IoError::Malformed(format!("{part}: a build item has no objectid")))?; + model.build.push(Item { path: path_attr(&it), id, transform: transform(&it)? }); + } + } + Ok(model) +} + +fn root_part(zip: &Zip) -> String { + let fallback = "3D/3dmodel.model".to_string(); + let Some(e) = zip.find("_rels/.rels") else { return fallback }; + let Ok(bytes) = zip.read(e, 1 << 24) else { return fallback }; + let text = String::from_utf8_lossy(&bytes); + let Ok(doc) = Document::parse(&text) else { return fallback }; + doc.descendants() + .filter(|n| n.is_element() && local(n) == "Relationship") + .find(|n| attr(n, "Type").is_some_and(|t| t.ends_with("/3dmodel"))) + .and_then(|n| attr(&n, "Target")) + .map(|t| t.trim_start_matches('/').to_string()) + .unwrap_or(fallback) +} + +struct Reader<'z, 'w> { + zip: Zip<'z>, + watch: &'w Watch, + parts: Vec<(String, Model)>, + meshes: HashMap<(usize, u32), Vec>, + scale: f32, +} + +impl Reader<'_, '_> { + fn part(&mut self, path: Option<&str>, from: usize, scene: &mut RawScene) -> Result { + let Some(p) = path else { return Ok(from) }; + let p = p.trim_start_matches('/'); + if let Some(i) = self.parts.iter().position(|(n, _)| n.eq_ignore_ascii_case(p)) { + return Ok(i); + } + let e = self.zip.find(p).ok_or_else(|| IoError::Malformed(format!("the package has no part {p}")))?.clone(); + let bytes = self.zip.read(&e, MAX_MODEL_XML)?; + let text = std::str::from_utf8(&bytes).map_err(|_| IoError::Malformed(format!("{p} is not UTF-8")))?; + let model = parse_model(text, p, scene, self.watch)?; + self.parts.push((p.to_string(), model)); + Ok(self.parts.len() - 1) + } + + fn object_meshes(&mut self, part: usize, id: u32, scene: &mut RawScene) -> Result> { + if let Some(v) = self.meshes.get(&(part, id)) { + return Ok(v.clone()); + } + let Some(obj) = self.parts[part].1.objects.get(&id) else { return Ok(Vec::new()) }; + let mut out = Vec::new(); + if let (Some(md), false) = (&obj.mesh, obj.skipped) { + if !md.tris.is_empty() { + let mut m = RawMesh { name: obj.name.clone(), ..Default::default() }; + m.positions = md.verts.iter().map(|p| *p * self.scale).collect(); + m.indices = md.tris.iter().flat_map(|t| t.v).collect(); + scene.meshes.push(m); + out.push(scene.meshes.len() - 1); + } + } + self.meshes.insert((part, id), out.clone()); + Ok(out) + } + + fn emit(&mut self, part: usize, id: u32, parent: Option, t: Mat4, stack: &mut Vec<(usize, u32)>, scene: &mut RawScene) -> Result<()> { + if stack.contains(&(part, id)) { + return malformed(format!("object {id} contains itself through its components")); + } + if stack.len() >= MAX_DEPTH { + return malformed("components are nested too deeply"); + } + if scene.nodes.len() >= MAX_NODES { + return Err(IoError::Unsupported("the build expands to more than a million nodes".into())); + } + let (name, skipped, comps) = match self.parts[part].1.objects.get(&id) { + Some(o) => (o.name.clone(), o.skipped, o.components.iter().map(|c| (c.path.clone(), c.id, c.transform)).collect::>()), + None => return malformed(format!("object {id} is referenced but not defined")), + }; + if skipped { + scene.warnings.push(format!("{name}: support geometry was skipped")); + return Ok(()); + } + if scene.nodes.len() % 256 == 0 { + self.watch.step(Stage::Reading, 0.9)?; + } + let meshes = self.object_meshes(part, id, scene)?; + let mut sc = t; + sc.m[0][3] *= self.scale; + sc.m[1][3] *= self.scale; + sc.m[2][3] *= self.scale; + let mut node = RawNode::new(name, parent, meshes); + node.transform = sc; + scene.nodes.push(node); + let me = scene.nodes.len() - 1; + stack.push((part, id)); + for (path, cid, ct) in comps { + let cp = self.part(path.as_deref(), part, scene)?; + self.emit(cp, cid, Some(me), ct, stack, scene)?; + } + stack.pop(); + Ok(()) + } +} + +/// Reads a 3MF package: build items and components become nodes, meshes keep the declared unit, Z is up. +pub fn read_3mf(bytes: &[u8], name: &str, watch: &Watch) -> Result { + watch.step(Stage::Reading, 0.0)?; + let zip = Zip::open(bytes)?; + let root = root_part(&zip); + let mut scene = RawScene::named(name); + scene.up_axis = Some(UpAxis::Z); + let mut r = Reader { zip, watch, parts: Vec::new(), meshes: HashMap::new(), scale: 1.0 }; + let main = r.part(Some(&root), 0, &mut scene)?; + let (unit, scale) = r.parts[main].1.unit.unwrap_or((LengthUnit::Millimetre, 1.0)); + scene.unit = Some(unit); + r.scale = scale; + let items: Vec<(Option, u32, Mat4)> = r.parts[main].1.build.iter().map(|i| (i.path.clone(), i.id, i.transform)).collect(); + if items.is_empty() { + scene.warnings.push("the 3MF build has no items".into()); + } + for (path, id, t) in items { + let p = r.part(path.as_deref(), main, &mut scene)?; + r.emit(p, id, None, t, &mut Vec::new(), &mut scene)?; + } + watch.step(Stage::Reading, 1.0)?; + Ok(scene) +} diff --git a/native/crates/fsh-io/src/zip.rs b/native/crates/fsh-io/src/zip.rs new file mode 100644 index 00000000..91ee912f --- /dev/null +++ b/native/crates/fsh-io/src/zip.rs @@ -0,0 +1,181 @@ +use crate::deflate::{crc32, inflate}; +use crate::error::{malformed, IoError, Result}; + +const EOCD: u32 = 0x0605_4b50; +const EOCD64: u32 = 0x0606_4b50; +const EOCD64_LOCATOR: u32 = 0x0706_4b50; +const CENTRAL: u32 = 0x0201_4b50; +const LOCAL: u32 = 0x0403_4b50; + +/// Largest member this reader inflates. +pub(crate) const MAX_MEMBER: u64 = 2 << 30; + +/// One member of a ZIP archive, as its central directory describes it. +#[derive(Clone, Debug)] +pub(crate) struct Entry { + pub name: String, + method: u16, + flags: u16, + compressed: u64, + pub size: u64, + crc: u32, + local: u64, +} + +/// A ZIP archive held in memory (stored and deflated members, ZIP64 sizes). +pub(crate) struct Zip<'a> { + data: &'a [u8], + pub entries: Vec, +} + +pub(crate) fn is_zip(bytes: &[u8]) -> bool { + bytes.len() >= 4 && u32le(bytes, 0) == Some(LOCAL) +} + +fn u16le(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(2)?).map(|s| u16::from_le_bytes([s[0], s[1]])) +} + +fn u32le(b: &[u8], at: usize) -> Option { + b.get(at..at.checked_add(4)?).map(|s| u32::from_le_bytes([s[0], s[1], s[2], s[3]])) +} + +fn u64le(b: &[u8], at: usize) -> Option { + let s = b.get(at..at.checked_add(8)?)?; + let mut a = [0u8; 8]; + a.copy_from_slice(s); + Some(u64::from_le_bytes(a)) +} + +fn cut() -> IoError { + IoError::Malformed("the ZIP archive is cut short".into()) +} + +fn find_eocd(data: &[u8]) -> Option { + if data.len() < 22 { + return None; + } + let lowest = data.len().saturating_sub(22 + 65535); + (lowest..=data.len() - 22).rev().find(|&i| u32le(data, i) == Some(EOCD)) +} + +fn zip64_fields(extra: &[u8], size: &mut u64, compressed: &mut u64, local: &mut u64) -> Result<()> { + let mut i = 0; + while i + 4 <= extra.len() { + let id = u16le(extra, i).ok_or_else(cut)?; + let len = u16le(extra, i + 2).ok_or_else(cut)? as usize; + let body = extra.get(i + 4..i + 4 + len).ok_or_else(cut)?; + if id == 1 { + let mut at = 0; + for slot in [size, compressed, local] { + if *slot == u32::MAX as u64 { + *slot = u64le(body, at).ok_or_else(|| IoError::Malformed("ZIP64 extra field is cut short".into()))?; + at += 8; + } + } + return Ok(()); + } + i += 4 + len; + } + Ok(()) +} + +impl<'a> Zip<'a> { + /// Reads the central directory. + pub fn open(data: &'a [u8]) -> Result { + let e = find_eocd(data).ok_or_else(|| IoError::Malformed("no ZIP end-of-directory record".into()))?; + let mut count = u16le(data, e + 10).ok_or_else(cut)? as u64; + let mut dir_size = u32le(data, e + 12).ok_or_else(cut)? as u64; + let mut dir_at = u32le(data, e + 16).ok_or_else(cut)? as u64; + if e >= 20 && u32le(data, e - 20) == Some(EOCD64_LOCATOR) { + let at = u64le(data, e - 12).ok_or_else(cut)?; + let at = usize::try_from(at).map_err(|_| cut())?; + if u32le(data, at) != Some(EOCD64) { + return malformed("ZIP64 end-of-directory record is missing"); + } + count = u64le(data, at + 32).ok_or_else(cut)?; + dir_size = u64le(data, at + 40).ok_or_else(cut)?; + dir_at = u64le(data, at + 48).ok_or_else(cut)?; + } + let end = dir_at.checked_add(dir_size).ok_or_else(cut)?; + if end > data.len() as u64 { + return Err(cut()); + } + if count > dir_size / 46 + 1 { + return malformed("the ZIP directory claims more members than it can hold"); + } + let mut entries = Vec::with_capacity(count as usize); + let mut p = dir_at as usize; + for _ in 0..count { + if u32le(data, p) != Some(CENTRAL) { + return malformed("bad ZIP central directory entry"); + } + let flags = u16le(data, p + 8).ok_or_else(cut)?; + let method = u16le(data, p + 10).ok_or_else(cut)?; + let crc = u32le(data, p + 16).ok_or_else(cut)?; + let mut compressed = u32le(data, p + 20).ok_or_else(cut)? as u64; + let mut size = u32le(data, p + 24).ok_or_else(cut)? as u64; + let name_len = u16le(data, p + 28).ok_or_else(cut)? as usize; + let extra_len = u16le(data, p + 30).ok_or_else(cut)? as usize; + let comment_len = u16le(data, p + 32).ok_or_else(cut)? as usize; + let mut local = u32le(data, p + 42).ok_or_else(cut)? as u64; + let name = data.get(p + 46..p + 46 + name_len).ok_or_else(cut)?; + let extra = data.get(p + 46 + name_len..p + 46 + name_len + extra_len).ok_or_else(cut)?; + zip64_fields(extra, &mut size, &mut compressed, &mut local)?; + entries.push(Entry { + name: String::from_utf8_lossy(name).into_owned(), + method, + flags, + compressed, + size, + crc, + local, + }); + p += 46 + name_len + extra_len + comment_len; + } + Ok(Self { data, entries }) + } + + /// Member by path, ignoring a leading slash and letter case. + pub fn find(&self, path: &str) -> Option<&Entry> { + let want = path.trim_start_matches('/'); + self.entries + .iter() + .find(|e| e.name == want) + .or_else(|| self.entries.iter().find(|e| e.name.trim_start_matches('/').eq_ignore_ascii_case(want))) + } + + /// Bytes of one member, refusing members larger than `cap`. + pub fn read(&self, e: &Entry, cap: u64) -> Result> { + if e.flags & 1 != 0 { + return Err(IoError::Unsupported(format!("{} is encrypted", e.name))); + } + if e.size > cap.min(MAX_MEMBER) { + return Err(IoError::Unsupported(format!("{} is too large ({} bytes)", e.name, e.size))); + } + let at = usize::try_from(e.local).map_err(|_| cut())?; + if u32le(self.data, at) != Some(LOCAL) { + return malformed(format!("bad ZIP local header for {}", e.name)); + } + let n = u16le(self.data, at + 26).ok_or_else(cut)? as usize; + let x = u16le(self.data, at + 28).ok_or_else(cut)? as usize; + let start = at + 30 + n + x; + let len = usize::try_from(e.compressed).map_err(|_| cut())?; + let body = self.data.get(start..start.checked_add(len).ok_or_else(cut)?).ok_or_else(cut)?; + if e.method == 8 && e.size > e.compressed.saturating_mul(1032).saturating_add(64) { + return malformed(format!("{} declares more data than deflate can hold", e.name)); + } + let out = match e.method { + 0 => body.to_vec(), + 8 => inflate(body, e.size as usize)?.0, + m => return Err(IoError::Unsupported(format!("{} uses ZIP compression method {m}", e.name))), + }; + if out.len() as u64 != e.size { + return malformed(format!("{} inflated to {} bytes, not the {} declared", e.name, out.len(), e.size)); + } + if crc32(&out) != e.crc { + return malformed(format!("{} fails its CRC check", e.name)); + } + Ok(out) + } +} From 6ef743ea7e825b0ba63069c827969623c4dabbdd Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:27 -0500 Subject: [PATCH 044/494] feat(io): read 3mf base materials, colour groups and textures Triangles split into one mesh per property: base materials (with metallic, specular and translucent display properties), colour groups as a flat material when uniform or vertex colours otherwise, composites blended to colours, texture groups as UVs with a #3mf: texture reference, multiproperties by their first layer. Ran the check program on an own mixed-property package (5 meshes, 5 materials as expected), 4500 damaged package copies and 300 packages with mutated model XML, no panic. --- native/crates/fsh-io/src/threemf.rs | 341 +++++++++++++++++++++++++++- 1 file changed, 331 insertions(+), 10 deletions(-) diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index a7c9a269..705b93a5 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -1,8 +1,9 @@ use crate::error::{malformed, IoError, Result}; -use crate::raw::{RawMesh, RawNode, RawScene, UpAxis}; +use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; use crate::watch::{Stage, Watch}; use crate::zip::{is_zip, Zip}; -use fsh_core::{LengthUnit, Mat4, Vec3}; +use fsh_core::{srgb_decode, srgb_encode, LengthUnit, Mat4, Vec2, Vec3, Vec4}; +use fsh_scene::TextureRole; use roxmltree::{Document, Node, ParsingOptions}; use std::collections::HashMap; @@ -20,6 +21,45 @@ pub fn is_3mf(bytes: &[u8]) -> bool { struct Tri { v: [u32; 3], + pid: Option, + p: [Option; 3], +} + +#[derive(Clone, Copy)] +struct Display { + metallic: f32, + roughness: f32, + transmission: f32, + ior: f32, +} + +struct Base { + name: String, + colour: [f32; 4], + display: Option, +} + +enum Group { + Base(Vec), + Colour(Vec<[f32; 4]>), + Tex { tex: u32, uvs: Vec }, + Composite { base: u32, mats: Vec, rows: Vec> }, + Multi { pids: Vec, rows: Vec> }, +} + +#[derive(Clone, Copy, PartialEq, Eq, Hash)] +enum Bucket { + Plain, + Base(u32, u32), + Colour, + Tex(u32), +} + +enum Corner { + None, + Base(u32, u32), + Colour([f32; 4]), + Tex(u32, Vec2), } #[derive(Default)] @@ -37,6 +77,8 @@ struct Component { struct Object { name: String, skipped: bool, + pid: Option, + pindex: u32, mesh: Option, components: Vec, } @@ -52,6 +94,92 @@ struct Model { unit: Option<(LengthUnit, f32)>, objects: HashMap, build: Vec, + groups: HashMap, + displays: HashMap>, + textures: HashMap, +} + +fn colour(s: &str) -> Option<[f32; 4]> { + let h = s.trim().strip_prefix('#')?; + if !(h.len() == 6 || h.len() == 8) || !h.is_ascii() { + return None; + } + let byte = |i: usize| u8::from_str_radix(&h[i..i + 2], 16).ok().map(|v| v as f32 / 255.0); + let a = if h.len() == 8 { byte(6)? } else { 1.0 }; + Some([srgb_decode(byte(0)?), srgb_decode(byte(2)?), srgb_decode(byte(4)?), a]) +} + +fn floats(s: &str) -> Option> { + s.split_whitespace().map(|t| t.parse::().ok().filter(|v| v.is_finite())).collect() +} + +fn ints(s: &str) -> Option> { + s.split_whitespace().map(|t| t.parse::().ok()).collect() +} + +fn read_group(r: Node, part: &str, model: &mut Model, scene: &mut RawScene) -> Result<()> { + let kind = local(&r); + let Some(id) = index(&r, "id")? else { return Ok(()) }; + let bad = |what: &str| IoError::Malformed(format!("{part}: {kind} {id}: {what}")); + let group = match kind { + "basematerials" => { + let disp = index(&r, "displaypropertiesid")?; + let mut v = Vec::new(); + for (i, b) in children(r, "base").enumerate() { + let c = attr(&b, "displaycolor").and_then(colour).ok_or_else(|| bad("a base material has no valid displaycolor"))?; + let name = attr(&b, "name").map(str::to_string).filter(|s| !s.trim().is_empty()).unwrap_or_else(|| format!("Material {id}.{i}")); + let display = disp.and_then(|d| model.displays.get(&d)).and_then(|d| d.get(i)).copied(); + v.push(Base { name, colour: c, display }); + } + Group::Base(v) + } + "colorgroup" => { + let v = children(r, "color").map(|c| attr(&c, "color").and_then(colour).ok_or_else(|| bad("a colour is not #RRGGBB or #RRGGBBAA"))).collect::>()?; + Group::Colour(v) + } + "texture2d" => { + let p = attr(&r, "path").ok_or_else(|| bad("no path"))?; + model.textures.insert(id, p.trim().to_string()); + return Ok(()); + } + "texture2dgroup" => { + let tex = index(&r, "texid")?.ok_or_else(|| bad("no texid"))?; + let uvs = children(r, "tex2coord").map(|c| Ok(Vec2::new(num(&c, "u")?, 1.0 - num(&c, "v")?))).collect::>()?; + Group::Tex { tex, uvs } + } + "compositematerials" => { + let base = index(&r, "matid")?.ok_or_else(|| bad("no matid"))?; + let mats = attr(&r, "matindices").and_then(ints).ok_or_else(|| bad("bad matindices"))?; + let rows = children(r, "composite").map(|c| attr(&c, "values").and_then(floats).ok_or_else(|| bad("bad values"))).collect::>()?; + Group::Composite { base, mats, rows } + } + "multiproperties" => { + let pids = attr(&r, "pids").and_then(ints).ok_or_else(|| bad("bad pids"))?; + let rows = children(r, "multi").map(|c| attr(&c, "pindices").and_then(ints).ok_or_else(|| bad("bad pindices"))).collect::>()?; + scene.warnings.push(format!("{part}: multiproperties {id} are approximated by their first layer")); + Group::Multi { pids, rows } + } + "pbmetallicdisplayproperties" | "pbspeculardisplayproperties" | "translucentdisplayproperties" => { + let mut v = Vec::new(); + for c in r.children().filter(|c| c.is_element()) { + let f = |k: &str, d: f32| attr(&c, k).and_then(|s| s.trim().parse::().ok()).filter(|x| x.is_finite()).unwrap_or(d); + v.push(match local(&c) { + "pbmetallic" => Display { metallic: f("metallicness", 0.0), roughness: f("roughness", 1.0), transmission: 0.0, ior: 1.5 }, + "pbspecular" => Display { metallic: 0.0, roughness: 1.0 - f("glossiness", 0.0), transmission: 0.0, ior: 1.5 }, + "translucent" => { + let ior = attr(&c, "refractiveindex").and_then(floats).and_then(|v| v.first().copied()).unwrap_or(1.5); + Display { metallic: 0.0, roughness: f("roughness", 0.0), transmission: 1.0, ior } + } + _ => continue, + }); + } + model.displays.insert(id, v); + return Ok(()); + } + _ => return Ok(()), + }; + model.groups.insert(id, group); + Ok(()) } fn local<'a>(n: &Node<'a, '_>) -> &'a str { @@ -142,7 +270,9 @@ fn read_mesh(m: Node, name: &str, watch: &Watch) -> Result { return Err(IoError::InvalidData(format!("{name}: vertex {} is out of range ({nv} defined)", v[k]))); } } - out.tris.push(Tri { v }); + let p1 = index(&t, "p1")?; + let p = [p1, index(&t, "p2")?.or(p1), index(&t, "p3")?.or(p1)]; + out.tris.push(Tri { v, pid: index(&t, "pid")?, p }); } } Ok(out) @@ -170,16 +300,26 @@ fn parse_model(text: &str, part: &str, scene: &mut RawScene, watch: &Watch) -> R scene.warnings.push(format!("{part}: requires the extension {uri}, which is not read; the model may be incomplete")); } } + for res in children(root, "resources") { + for r in res.children().filter(|c| c.is_element() && local(c).ends_with("displayproperties")) { + read_group(r, part, &mut model, scene)?; + } + } for res in children(root, "resources") { for r in res.children().filter(|c| c.is_element()) { if local(&r) != "object" { + if !local(&r).ends_with("displayproperties") { + read_group(r, part, &mut model, scene)?; + } continue; } let id = index(&r, "id")?.ok_or_else(|| IoError::Malformed(format!("{part}: an object has no id")))?; let name = attr(&r, "name").map(str::to_string).filter(|s| !s.trim().is_empty()).unwrap_or_else(|| format!("Object {id}")); let kind = attr(&r, "type").unwrap_or("model"); let skipped = matches!(kind, "support" | "solidsupport"); - let mut obj = Object { name, skipped, mesh: None, components: Vec::new() }; + let pid = index(&r, "pid")?; + let pindex = index(&r, "pindex")?.unwrap_or(0); + let mut obj = Object { name, skipped, pid, pindex, mesh: None, components: Vec::new() }; if let Some(m) = children(r, "mesh").next() { obj.mesh = Some(read_mesh(m, &obj.name, watch)?); } @@ -203,6 +343,119 @@ fn parse_model(text: &str, part: &str, scene: &mut RawScene, watch: &Watch) -> R Ok(model) } +impl Model { + fn corner(&self, pid: u32, idx: u32, depth: u32) -> Option { + let i = idx as usize; + match self.groups.get(&pid)? { + Group::Base(v) => (i < v.len()).then_some(Corner::Base(pid, idx)), + Group::Colour(v) => v.get(i).map(|c| Corner::Colour(*c)), + Group::Tex { uvs, .. } => uvs.get(i).map(|uv| Corner::Tex(pid, *uv)), + Group::Composite { base, mats, rows } => { + let Some(Group::Base(b)) = self.groups.get(base) else { return None }; + let mut c = [0.0f32; 4]; + let mut w = 0.0f32; + for (m, x) in mats.iter().zip(rows.get(i)?) { + let bc = b.get(*m as usize)?.colour; + for k in 0..4 { + c[k] += bc[k] * x.max(0.0); + } + w += x.max(0.0); + } + (w > 0.0).then(|| Corner::Colour(c.map(|v| v / w))) + } + Group::Multi { pids, rows } => { + if depth > 0 { + return None; + } + self.corner(*pids.first()?, *rows.get(i)?.first()?, depth + 1) + } + } + } +} + +fn bucket_of(c: &Corner) -> Bucket { + match c { + Corner::None => Bucket::Plain, + Corner::Base(g, i) => Bucket::Base(*g, *i), + Corner::Colour(_) => Bucket::Colour, + Corner::Tex(g, _) => Bucket::Tex(*g), + } +} + +fn buckets(model: &Model, obj: &Object, md: &MeshData, scale: f32, warnings: &mut Vec) -> Vec<(Bucket, RawMesh)> { + let mut out: Vec<(Bucket, RawMesh)> = Vec::new(); + let mut slot: HashMap = HashMap::new(); + let mut maps: Vec> = Vec::new(); + let mut missing = false; + for t in &md.tris { + let (pid, p) = match (t.pid, obj.pid) { + (Some(pid), _) => (Some(pid), t.p.map(|x| Some(x.unwrap_or(obj.pindex)))), + (None, Some(pid)) => (Some(pid), [Some(obj.pindex); 3]), + (None, None) => (None, [None; 3]), + }; + let corners: [Corner; 3] = std::array::from_fn(|k| match (pid, p[k]) { + (Some(g), Some(i)) => model.corner(g, i, 0).unwrap_or_else(|| { + missing = true; + Corner::None + }), + _ => Corner::None, + }); + let b = bucket_of(&corners[0]); + let s = *slot.entry(b).or_insert_with(|| { + out.push((b, RawMesh { name: obj.name.clone(), ..Default::default() })); + maps.push(HashMap::new()); + out.len() - 1 + }); + let mesh = &mut out[s].1; + for (k, c) in corners.iter().enumerate() { + let c = if bucket_of(c) == b { c } else { &corners[0] }; + let v = t.v[k]; + let key = match c { + Corner::Colour(col) => (v, col.map(f32::to_bits)), + Corner::Tex(_, uv) => (v, [uv.x.to_bits(), uv.y.to_bits(), 0, 0]), + _ => (v, [0; 4]), + }; + let next = mesh.positions.len() as u32; + let id = *maps[s].entry(key).or_insert_with(|| { + mesh.positions.push(md.verts[v as usize] * scale); + match c { + Corner::Colour(col) => mesh.colours.push(Vec4::from(*col)), + Corner::Tex(_, uv) => { + if mesh.uvs.is_empty() { + mesh.uvs.push(Vec::new()); + } + mesh.uvs[0].push(*uv); + } + _ => {} + } + next + }); + mesh.indices.push(id); + } + } + if missing { + warnings.push(format!("{}: some triangles name properties that do not exist; the default material was used", obj.name)); + } + out +} + +#[derive(PartialEq, Eq, Hash)] +enum MatKey { + Base(usize, u32, u32), + Flat([u32; 4]), + VertexColours, + Tex(usize, u32), +} + +fn flat_material(name: String, c: [f32; 4]) -> RawMaterial { + RawMaterial { name, base_colour: [c[0], c[1], c[2]], opacity: c[3].clamp(0.0, 1.0), roughness: 0.4, ..Default::default() } +} + +fn hex(c: [f32; 4]) -> String { + let b = |v: f32| (srgb_encode(v.clamp(0.0, 1.0)) * 255.0).round() as u8; + format!("#{:02X}{:02X}{:02X}", b(c[0]), b(c[1]), b(c[2])) +} + fn root_part(zip: &Zip) -> String { let fallback = "3D/3dmodel.model".to_string(); let Some(e) = zip.find("_rels/.rels") else { return fallback }; @@ -222,6 +475,7 @@ struct Reader<'z, 'w> { watch: &'w Watch, parts: Vec<(String, Model)>, meshes: HashMap<(usize, u32), Vec>, + mats: HashMap, scale: f32, } @@ -244,13 +498,77 @@ impl Reader<'_, '_> { if let Some(v) = self.meshes.get(&(part, id)) { return Ok(v.clone()); } - let Some(obj) = self.parts[part].1.objects.get(&id) else { return Ok(Vec::new()) }; + let model = &self.parts[part].1; + let Some(obj) = model.objects.get(&id) else { return Ok(Vec::new()) }; let mut out = Vec::new(); if let (Some(md), false) = (&obj.mesh, obj.skipped) { - if !md.tris.is_empty() { - let mut m = RawMesh { name: obj.name.clone(), ..Default::default() }; - m.positions = md.verts.iter().map(|p| *p * self.scale).collect(); - m.indices = md.tris.iter().flat_map(|t| t.v).collect(); + for (b, mut m) in buckets(model, obj, md, self.scale, &mut scene.warnings) { + let key = match b { + Bucket::Plain => None, + Bucket::Base(g, i) => Some(MatKey::Base(part, g, i)), + Bucket::Tex(g) => match model.groups.get(&g) { + Some(Group::Tex { tex, .. }) => Some(MatKey::Tex(part, *tex)), + _ => None, + }, + Bucket::Colour => { + let first = m.colours.first().copied().unwrap_or(Vec4::ONE); + if m.colours.iter().all(|c| *c == first) { + m.colours = Vec::new(); + Some(MatKey::Flat([first.x, first.y, first.z, first.w].map(f32::to_bits))) + } else { + Some(MatKey::VertexColours) + } + } + }; + if let Some(k) = key { + let slot = match self.mats.get(&k) { + Some(&s) => s, + None => { + let mat = match &k { + MatKey::Base(_, g, i) => match model.groups.get(g) { + Some(Group::Base(v)) => { + let base = &v[*i as usize]; + let mut mat = flat_material(base.name.clone(), base.colour); + if let Some(d) = base.display { + mat.metallic = d.metallic.clamp(0.0, 1.0); + mat.roughness = d.roughness.clamp(0.0, 1.0); + mat.transmission = d.transmission; + mat.ior = d.ior; + } + mat + } + _ => RawMaterial::default(), + }, + MatKey::Flat(bits) => { + let c = bits.map(f32::from_bits); + flat_material(format!("Colour {}", hex(c)), c) + } + MatKey::VertexColours => flat_material("Vertex colours".into(), [1.0; 4]), + MatKey::Tex(_, t) => { + let mut mat = flat_material("Textured".into(), [1.0; 4]); + match model.textures.get(t) { + Some(path) => { + mat.name = path.rsplit('/').next().unwrap_or(path).to_string(); + scene.textures.push(RawTexture { + uri: format!("#3mf:{}", path.trim_start_matches('/')), + role: TextureRole::BaseColour, + uv_set: 0, + colour_space: "srgb", + }); + mat.textures.push(scene.textures.len() - 1); + } + None => scene.warnings.push(format!("texture {t} is not defined")), + } + mat + } + }; + scene.materials.push(mat); + self.mats.insert(k, scene.materials.len() - 1); + scene.materials.len() - 1 + } + }; + m.material = Some(slot); + } scene.meshes.push(m); out.push(scene.meshes.len() - 1); } @@ -306,7 +624,7 @@ pub fn read_3mf(bytes: &[u8], name: &str, watch: &Watch) -> Result { let root = root_part(&zip); let mut scene = RawScene::named(name); scene.up_axis = Some(UpAxis::Z); - let mut r = Reader { zip, watch, parts: Vec::new(), meshes: HashMap::new(), scale: 1.0 }; + let mut r = Reader { zip, watch, parts: Vec::new(), meshes: HashMap::new(), mats: HashMap::new(), scale: 1.0 }; let main = r.part(Some(&root), 0, &mut scene)?; let (unit, scale) = r.parts[main].1.unit.unwrap_or((LengthUnit::Millimetre, 1.0)); scene.unit = Some(unit); @@ -319,6 +637,9 @@ pub fn read_3mf(bytes: &[u8], name: &str, watch: &Watch) -> Result { let p = r.part(path.as_deref(), main, &mut scene)?; r.emit(p, id, None, t, &mut Vec::new(), &mut scene)?; } + if scene.textures.iter().any(|t| t.uri.starts_with("#3mf:")) { + scene.warnings.push("textures inside the package are referenced as #3mf: and not unpacked".into()); + } watch.step(Stage::Reading, 1.0)?; Ok(scene) } From a39520e7cbcc24bf66055359ec2be21c9454209c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:02:53 -0500 Subject: [PATCH 045/494] fix(io): accept 3mf display properties on base elements and stray prefixes The consortium's multiproperty samples put displaypropertiesid on each base and use an undeclared namespace prefix; the reader now takes the per-base reference and, only after a parse fails on an unknown prefix, declares it on the model element with a warning. Ran the check program on all 22 consortium samples (all import and round-trip) and damaged copies of three of them, no panic. --- native/crates/fsh-io/src/threemf.rs | 35 ++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index 705b93a5..84c99b79 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -128,7 +128,10 @@ fn read_group(r: Node, part: &str, model: &mut Model, scene: &mut RawScene) -> R for (i, b) in children(r, "base").enumerate() { let c = attr(&b, "displaycolor").and_then(colour).ok_or_else(|| bad("a base material has no valid displaycolor"))?; let name = attr(&b, "name").map(str::to_string).filter(|s| !s.trim().is_empty()).unwrap_or_else(|| format!("Material {id}.{i}")); - let display = disp.and_then(|d| model.displays.get(&d)).and_then(|d| d.get(i)).copied(); + let display = match index(&b, "displaypropertiesid")? { + Some(d) => model.displays.get(&d).and_then(|d| d.get(i).or(d.first())).copied(), + None => disp.and_then(|d| model.displays.get(&d)).and_then(|d| d.get(i)).copied(), + }; v.push(Base { name, colour: c, display }); } Group::Base(v) @@ -278,9 +281,35 @@ fn read_mesh(m: Node, name: &str, watch: &Watch) -> Result { Ok(out) } +fn xml_opts<'a>() -> ParsingOptions<'a> { + ParsingOptions { allow_dtd: false, ..ParsingOptions::default() } +} + +fn declare_prefixes(text: &str, part: &str, scene: &mut RawScene) -> Result { + let mut cur = text.to_string(); + for _ in 0..8 { + let prefix = match Document::parse_with_options(&cur, xml_opts()) { + Ok(_) => return Ok(cur), + Err(roxmltree::Error::UnknownNamespace(p, _)) if p.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_') => p, + Err(e) => return malformed(format!("{part}: {e}")), + }; + let at = cur.find(" element")))?; + cur.insert_str(at, &format!(" xmlns:{prefix}=\"urn:formshot:undeclared:{prefix}\"")); + scene.warnings.push(format!("{part}: the namespace prefix {prefix:?} is used without a declaration; read by element name")); + } + malformed(format!("{part}: too many undeclared namespace prefixes")) +} + fn parse_model(text: &str, part: &str, scene: &mut RawScene, watch: &Watch) -> Result { - let opts = ParsingOptions { allow_dtd: false, ..ParsingOptions::default() }; - let doc = Document::parse_with_options(text, opts).map_err(|e| IoError::Malformed(format!("{part}: {e}")))?; + let fixed; + let doc = match Document::parse_with_options(text, xml_opts()) { + Ok(d) => d, + Err(roxmltree::Error::UnknownNamespace(..)) => { + fixed = declare_prefixes(text, part, scene)?; + Document::parse_with_options(&fixed, xml_opts()).map_err(|e| IoError::Malformed(format!("{part}: {e}")))? + } + Err(e) => return malformed(format!("{part}: {e}")), + }; watch.step(Stage::Reading, 0.4)?; let root = doc.root_element(); if local(&root) != "model" { From cf6e7eedc3e82d26bca2023bb6212e89ff7fed9f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:11:52 -0500 Subject: [PATCH 046/494] feat(io): read fbx files through ufbx Adds an FBX reader on the ufbx crate (MIT or Unlicense): node tree with transforms turned to Y up, the file unit kept, meshes split by material with normals, every UV set and vertex colours, classic and PBR materials with texture paths resolved beside the model; cameras, lights, skins and blend shapes are reported and skipped. The reader is left out of wasm32 builds, where FBX answers unsupported. Ran own ASCII, binary and zlib files plus 39 ufbx sample files through the check program, 13650 damaged copies with no crash, and a wasm32 check of fsh-io. --- native/crates/fsh-io/Cargo.toml | 3 + native/crates/fsh-io/src/fbx.rs | 353 ++++++++++++++++++++++++++++++++ native/crates/fsh-io/src/lib.rs | 22 +- 3 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 native/crates/fsh-io/src/fbx.rs diff --git a/native/crates/fsh-io/Cargo.toml b/native/crates/fsh-io/Cargo.toml index 23f94623..63515018 100644 --- a/native/crates/fsh-io/Cargo.toml +++ b/native/crates/fsh-io/Cargo.toml @@ -10,3 +10,6 @@ fsh-core = { path = "../fsh-core" } fsh-scene = { path = "../fsh-scene" } serde_json = "1" roxmltree = "0.21" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +ufbx = "0.11" diff --git a/native/crates/fsh-io/src/fbx.rs b/native/crates/fsh-io/src/fbx.rs new file mode 100644 index 00000000..acd563c0 --- /dev/null +++ b/native/crates/fsh-io/src/fbx.rs @@ -0,0 +1,353 @@ +use crate::error::{IoError, Result}; +use crate::obj::roughness_from_phong; +use crate::paths::Siblings; +use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +use crate::watch::{Stage, Watch}; +use fsh_core::{srgb_decode, LengthUnit, Mat4, Vec2, Vec3, Vec4}; +use fsh_scene::TextureRole; +use std::collections::HashMap; + +const MEMORY_LIMIT: usize = 3 << 30; + +fn unit_of(m: f64) -> (LengthUnit, f32) { + let known = [ + (0.001, LengthUnit::Millimetre), + (0.01, LengthUnit::Centimetre), + (1.0, LengthUnit::Metre), + (0.0254, LengthUnit::Inch), + (0.3048, LengthUnit::Foot), + ]; + if !(m.is_finite() && m > 0.0) { + return (LengthUnit::Centimetre, 1.0); + } + for (v, u) in known { + if ((m - v) / v).abs() < 1e-4 { + return (u, 1.0); + } + } + (LengthUnit::Metre, m as f32) +} + +fn matrix(m: &ufbx::Matrix, scale: f32) -> Mat4 { + let f = |v: f64| v as f32; + Mat4::from_rows([ + [f(m.m00), f(m.m01), f(m.m02), f(m.m03) * scale], + [f(m.m10), f(m.m11), f(m.m12), f(m.m13) * scale], + [f(m.m20), f(m.m21), f(m.m22), f(m.m23) * scale], + [0.0, 0.0, 0.0, 1.0], + ]) +} + +fn map_value(m: &ufbx::MaterialMap, default: f32) -> f32 { + if m.has_value { + let v = m.value_vec4.x as f32; + if v.is_finite() { + return v; + } + } + default +} + +fn map_colour(m: &ufbx::MaterialMap, default: [f32; 3]) -> [f32; 3] { + if m.has_value { + let c = [m.value_vec4.x as f32, m.value_vec4.y as f32, m.value_vec4.z as f32]; + if c.iter().all(|v| v.is_finite()) { + return c; + } + } + default +} + +fn texture_uri(t: &ufbx::Texture, siblings: &Siblings) -> Option { + let rel: &str = &t.relative_filename; + let abs: &str = &t.filename; + let base = abs.rsplit(['/', '\\']).next().unwrap_or(""); + for c in [rel, base] { + if c.is_empty() { + continue; + } + if let Ok(p) = siblings.resolve(c) { + return Some(p.to_string_lossy().into_owned()); + } + } + [rel, abs].into_iter().find(|s| !s.is_empty()).map(str::to_string) +} + +fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings) -> RawMaterial { + let mut r = RawMaterial { name: m.element.name.to_string(), ..Default::default() }; + if r.name.trim().is_empty() { + r.name = "Material".into(); + } + let classic = matches!(m.shader_type, ufbx::ShaderType::FbxLambert | ufbx::ShaderType::FbxPhong | ufbx::ShaderType::Unknown | ufbx::ShaderType::BlenderPhong); + let p = &m.pbr; + if classic && !m.features.pbr.enabled { + let d = map_colour(&m.fbx.diffuse_color, [0.8; 3]); + let k = map_value(&m.fbx.diffuse_factor, 1.0); + r.base_colour = d.map(|v| (v * k).clamp(0.0, 1.0)); + if m.shader_type == ufbx::ShaderType::FbxLambert { + r.roughness = 0.9; + r.specular = 0.5; + } else { + r.roughness = roughness_from_phong(map_value(&m.fbx.specular_exponent, 20.0)); + let s = map_colour(&m.fbx.specular_color, [0.2; 3]); + r.specular = (s[0].max(s[1]).max(s[2]) * map_value(&m.fbx.specular_factor, 1.0)).clamp(0.0, 1.0); + } + let e = map_colour(&m.fbx.emission_color, [0.0; 3]); + let ek = map_value(&m.fbx.emission_factor, 1.0); + r.emissive = e.map(|v| (v * ek).max(0.0)); + } else { + let b = map_colour(&p.base_color, [0.8; 3]); + let k = map_value(&p.base_factor, 1.0); + r.base_colour = b.map(|v| (v * k).clamp(0.0, 1.0)); + r.metallic = map_value(&p.metalness, 0.0).clamp(0.0, 1.0); + let rough = map_value(&p.roughness, 0.5); + r.roughness = if m.features.roughness_as_glossiness.enabled { 1.0 - rough } else { rough }.clamp(0.0, 1.0); + r.specular = map_value(&p.specular_factor, 1.0).clamp(0.0, 1.0); + r.ior = map_value(&p.specular_ior, 1.5); + r.transmission = map_value(&p.transmission_factor, 0.0).clamp(0.0, 1.0); + r.clearcoat = map_value(&p.coat_factor, 0.0).clamp(0.0, 1.0); + r.clearcoat_roughness = map_value(&p.coat_roughness, 0.0).clamp(0.0, 1.0); + let e = map_colour(&p.emission_color, [0.0; 3]); + let ek = map_value(&p.emission_factor, 1.0); + r.emissive = e.map(|v| (v * ek).max(0.0)); + } + r.opacity = map_value(&p.opacity, 1.0).clamp(0.0, 1.0); + r.double_sided = m.features.double_sided.enabled; + let slots: [(&ufbx::MaterialMap, &ufbx::MaterialMap, TextureRole, &'static str); 6] = [ + (&p.base_color, &m.fbx.diffuse_color, TextureRole::BaseColour, "srgb"), + (&p.roughness, &p.glossiness, TextureRole::Roughness, "linear"), + (&p.metalness, &p.metalness, TextureRole::Metalness, "linear"), + (&p.normal_map, &m.fbx.normal_map, TextureRole::Normal, "linear"), + (&p.emission_color, &m.fbx.emission_color, TextureRole::Emission, "srgb"), + (&p.opacity, &m.fbx.transparency_factor, TextureRole::Opacity, "linear"), + ]; + for (a, b, role, space) in slots { + let Some(t) = a.texture.as_ref().or(b.texture.as_ref()) else { continue }; + match texture_uri(t, siblings) { + Some(uri) => { + scene.textures.push(RawTexture { uri, role, uv_set: 0, colour_space: space }); + r.textures.push(scene.textures.len() - 1); + } + None => scene.warnings.push(format!("{}: a texture without a file name was skipped", r.name)), + } + } + if let Some(t) = m.fbx.bump.texture.as_ref().filter(|_| p.normal_map.texture.is_none() && m.fbx.normal_map.texture.is_none()) { + if let Some(uri) = texture_uri(t, siblings) { + scene.textures.push(RawTexture { uri, role: TextureRole::Bump, uv_set: 0, colour_space: "linear" }); + r.textures.push(scene.textures.len() - 1); + } + } + r +} + +struct Builder<'a> { + scene: RawScene, + siblings: &'a Siblings, + watch: &'a Watch, + scale: f32, + materials: HashMap, + meshes: HashMap<(u32, u32, Option), usize>, + tris: usize, + total_tris: usize, +} + +impl Builder<'_> { + fn material_slot(&mut self, m: &ufbx::Material) -> usize { + let id = m.element.element_id; + if let Some(&s) = self.materials.get(&id) { + return s; + } + let r = material(m, &mut self.scene, self.siblings); + self.scene.materials.push(r); + let s = self.scene.materials.len() - 1; + self.materials.insert(id, s); + s + } + + fn part(&mut self, mesh: &ufbx::Mesh, part: &ufbx::MeshPart, mat: Option) -> Result> { + if let Some(&i) = self.meshes.get(&key_of(mesh, part, mat)) { + return Ok(Some(i)); + } + if part.num_triangles == 0 { + return Ok(None); + } + let mut out = RawMesh { name: mesh.element.name.to_string(), material: mat, ..Default::default() }; + if out.name.trim().is_empty() { + out.name = "Mesh".into(); + } + let has_n = mesh.vertex_normal.exists; + let has_c = mesh.vertex_color.exists; + let sets: Vec<&ufbx::UvSet> = mesh.uv_sets.iter().filter(|s| s.vertex_uv.exists).collect(); + out.uvs = vec![Vec::new(); sets.len()]; + let mut map: HashMap, u32> = HashMap::new(); + let mut key = Vec::with_capacity(3 + sets.len()); + let mut corners = vec![0u32; mesh.max_face_triangles.max(1) * 3]; + let ni = mesh.num_indices; + for (fi, &face_ix) in part.face_indices.iter().enumerate() { + if fi % 16384 == 0 { + let f = self.tris as f32 / self.total_tris.max(1) as f32; + self.watch.step(Stage::Reading, 0.6 + 0.4 * f.min(1.0))?; + } + let Some(&face) = mesh.faces.get(face_ix as usize) else { continue }; + if face.num_indices < 3 { + continue; + } + let n = mesh.triangulate_face(&mut corners, face) as usize; + self.tris += n; + for &ix in &corners[..n * 3] { + let ix = ix as usize; + if ix >= ni { + return Err(IoError::InvalidData(format!("{}: corner {ix} is out of range", out.name))); + } + key.clear(); + key.push(mesh.vertex_position.indices[ix]); + if has_n { + key.push(mesh.vertex_normal.indices[ix]); + } + for s in &sets { + key.push(s.vertex_uv.indices[ix]); + } + if has_c { + key.push(mesh.vertex_color.indices[ix]); + } + let next = out.positions.len() as u32; + let id = match map.get(&key) { + Some(&id) => id, + None => { + let p = mesh.vertex_position[ix]; + out.positions.push(Vec3::new(p.x as f32, p.y as f32, p.z as f32) * self.scale); + if has_n { + let v = mesh.vertex_normal[ix]; + out.normals.push(Vec3::new(v.x as f32, v.y as f32, v.z as f32).normalize_or(Vec3::Y)); + } + for (k, s) in sets.iter().enumerate() { + let t = s.vertex_uv[ix]; + out.uvs[k].push(Vec2::new(t.x as f32, 1.0 - t.y as f32)); + } + if has_c { + let c = mesh.vertex_color[ix]; + let lin = |v: f64| srgb_decode((v as f32).clamp(0.0, 1.0)); + out.colours.push(Vec4::new(lin(c.x), lin(c.y), lin(c.z), (c.w as f32).clamp(0.0, 1.0))); + } + map.insert(key.clone(), next); + next + } + }; + out.indices.push(id); + } + } + if out.indices.is_empty() { + return Ok(None); + } + self.scene.meshes.push(out); + let i = self.scene.meshes.len() - 1; + self.meshes.insert(key_of(mesh, part, mat), i); + Ok(Some(i)) + } + + fn node(&mut self, n: &ufbx::Node, parent: Option) -> Result { + let mut meshes = Vec::new(); + if let Some(mesh) = n.mesh.as_ref() { + for part in mesh.material_parts.iter() { + let m = n.materials.get(part.index as usize).or_else(|| mesh.materials.get(part.index as usize)); + let mat = m.map(|m| self.material_slot(m)); + if let Some(i) = self.part(mesh, part, mat)? { + meshes.push(i); + } + } + } + let name = if n.element.name.trim().is_empty() { "Node".to_string() } else { n.element.name.to_string() }; + let mut raw = RawNode::new(name, parent, meshes); + raw.transform = matrix(&n.node_to_parent, self.scale); + self.scene.nodes.push(raw); + Ok(self.scene.nodes.len() - 1) + } +} + +fn key_of(mesh: &ufbx::Mesh, part: &ufbx::MeshPart, mat: Option) -> (u32, u32, Option) { + (mesh.element.element_id, part.index, mat) +} + +fn load_error(e: ufbx::Error) -> IoError { + match e.type_ { + ufbx::ErrorType::Cancelled => IoError::Cancelled, + ufbx::ErrorType::OutOfMemory | ufbx::ErrorType::MemoryLimit | ufbx::ErrorType::AllocationLimit => { + IoError::Unsupported(format!("the FBX file needs more memory than allowed ({})", e.description.as_ref() as &str)) + } + ufbx::ErrorType::UnsupportedVersion | ufbx::ErrorType::FeatureDisabled => IoError::Unsupported(format!("FBX: {}", e.description.as_ref() as &str)), + _ => { + let info = e.info(); + let d: &str = e.description.as_ref(); + IoError::Malformed(if info.is_empty() { format!("FBX: {d}") } else { format!("FBX: {d} ({info})") }) + } + } +} + +/// Reads binary or ASCII FBX through ufbx: hierarchy, meshes split by material, normals, UV sets, vertex colours, +/// materials and texture paths; axes turned to Y up, the file's unit kept. +pub fn read_fbx(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> Result { + watch.step(Stage::Reading, 0.0)?; + let mut progress = |p: &ufbx::Progress| { + let f = if p.bytes_total > 0 { p.bytes_read as f32 / p.bytes_total as f32 } else { 0.0 }; + watch.set(Stage::Reading, 0.6 * f.min(1.0)); + if watch.is_cancelled() { + ufbx::ProgressResult::Cancel + } else { + ufbx::ProgressResult::Continue + } + }; + let mut refuse = |_: &str, _: &ufbx::OpenFileInfo| -> Option { None }; + let mut opts = ufbx::LoadOpts { + ignore_animation: true, + ignore_embedded: true, + load_external_files: false, + target_axes: ufbx::CoordinateAxes::right_handed_y_up(), + space_conversion: ufbx::SpaceConversion::ModifyGeometry, + geometry_transform_handling: ufbx::GeometryTransformHandling::ModifyGeometry, + progress_cb: ufbx::ProgressCb::Mut(&mut progress), + progress_interval_hint: 1 << 20, + open_file_cb: ufbx::OpenFileCb::Mut(&mut refuse), + ..Default::default() + }; + opts.temp_allocator.memory_limit = MEMORY_LIMIT; + opts.result_allocator.memory_limit = MEMORY_LIMIT; + let fbx = ufbx::load_memory(bytes, opts).map_err(load_error)?; + watch.step(Stage::Reading, 0.6)?; + let (unit, scale) = unit_of(fbx.settings.unit_meters); + let mut b = Builder { + scene: RawScene::named(name), + siblings, + watch, + scale, + materials: HashMap::new(), + meshes: HashMap::new(), + tris: 0, + total_tris: fbx.meshes.iter().map(|m| m.num_triangles).sum(), + }; + b.scene.unit = Some(unit); + b.scene.up_axis = Some(UpAxis::Y); + let mut stack: Vec<(&ufbx::Node, Option)> = fbx.root_node.children.iter().rev().map(|c| (&**c, None)).collect(); + while let Some((n, parent)) = stack.pop() { + let me = b.node(n, parent)?; + for c in n.children.iter().rev() { + stack.push((c, Some(me))); + } + } + let skipped = [ + (fbx.cameras.len(), "cameras"), + (fbx.lights.len(), "lights"), + (fbx.skin_deformers.len(), "skins (meshes kept in their bind pose)"), + (fbx.blend_deformers.len(), "blend shapes"), + (fbx.nurbs_surfaces.len(), "NURBS surfaces"), + ]; + for (n, what) in skipped { + if n > 0 { + b.scene.warnings.push(format!("{n} {what} ignored")); + } + } + if fbx.textures.iter().any(|t| t.content.size > 0) { + b.scene.warnings.push("textures embedded in the FBX file are not unpacked; their file names are used".into()); + } + watch.step(Stage::Reading, 1.0)?; + Ok(b.scene) +} diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index ef136991..3007329c 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -5,6 +5,8 @@ mod clean; mod convert; pub mod deflate; mod error; +#[cfg(not(target_arch = "wasm32"))] +mod fbx; mod exr; pub mod family; mod glb_write; @@ -34,6 +36,8 @@ pub use picture::{FloatPicture, Picture, Samples}; pub use ply::read_ply; pub use png::{read_png, write_png, write_png_rgb16, write_png_rgba8}; pub use raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +#[cfg(not(target_arch = "wasm32"))] +pub use fbx::read_fbx; pub use stl::read_stl; pub use threemf::read_3mf; pub use watch::{Stage, Watch}; @@ -55,6 +59,8 @@ pub enum ModelFormat { Ply, /// 3D Manufacturing Format package. ThreeMf, + /// Autodesk FBX, binary or ASCII (not in the wasm32 build). + Fbx, /// STEP (ISO 10303-21); read by the CAD worker through fsh-cad, not by this crate. Step, /// IGES; read by the CAD worker through fsh-cad, not by this crate. @@ -66,13 +72,14 @@ pub type Format = ModelFormat; impl ModelFormat { /// Every format. - pub const ALL: [ModelFormat; 8] = [ + pub const ALL: [ModelFormat; 9] = [ ModelFormat::Gltf, ModelFormat::Glb, ModelFormat::Obj, ModelFormat::Stl, ModelFormat::Ply, ModelFormat::ThreeMf, + ModelFormat::Fbx, ModelFormat::Step, ModelFormat::Iges, ]; @@ -86,6 +93,7 @@ impl ModelFormat { ModelFormat::Stl => "stl", ModelFormat::Ply => "ply", ModelFormat::ThreeMf => "3mf", + ModelFormat::Fbx => "fbx", ModelFormat::Step => "step", ModelFormat::Iges => "iges", } @@ -100,6 +108,7 @@ impl ModelFormat { "stl" => ModelFormat::Stl, "ply" => ModelFormat::Ply, "3mf" => ModelFormat::ThreeMf, + "fbx" => ModelFormat::Fbx, "step" | "stp" => ModelFormat::Step, "iges" | "igs" => ModelFormat::Iges, _ => return None, @@ -112,6 +121,10 @@ impl ModelFormat { } } +fn looks_like_fbx(bytes: &[u8]) -> bool { + bytes.starts_with(b"Kaydara FBX Binary") || bytes[..bytes.len().min(4096)].windows(18).any(|w| w == b"FBXHeaderExtension") +} + fn looks_like_step(bytes: &[u8]) -> bool { let trimmed = bytes.iter().position(|b| !b.is_ascii_whitespace()).map(|i| &bytes[i..]).unwrap_or(&[]); trimmed.starts_with(b"ISO-10303-21;") @@ -140,6 +153,9 @@ pub fn detect_model(name: &str, bytes: &[u8]) -> Option { if threemf::is_3mf(bytes) { return Some(ModelFormat::ThreeMf); } + if looks_like_fbx(bytes) { + return Some(ModelFormat::Fbx); + } if stl::is_binary_stl(bytes) || stl::is_ascii_stl(bytes) { return Some(ModelFormat::Stl); } @@ -171,6 +187,10 @@ pub fn read_model_bytes(format: ModelFormat, bytes: &[u8], name: &str, siblings: ModelFormat::Stl => read_stl(bytes, name, watch), ModelFormat::Ply => read_ply(bytes, name, watch), ModelFormat::ThreeMf => read_3mf(bytes, name, watch), + #[cfg(not(target_arch = "wasm32"))] + ModelFormat::Fbx => read_fbx(bytes, name, siblings, watch), + #[cfg(target_arch = "wasm32")] + ModelFormat::Fbx => Err(IoError::Unsupported("FBX files are read by the desktop engine, not in the browser".into())), ModelFormat::Step | ModelFormat::Iges => Err(IoError::Unsupported(format!( "{} files are read by the CAD worker (fsh-cad), not by the mesh readers", format.extension().to_ascii_uppercase() From e1b417a19e41ccccc99749b23673f308583ac64b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:13:07 -0500 Subject: [PATCH 047/494] feat(io): ear-clip obj polygons in their best-fit plane OBJ faces with more than three corners are projected onto the plane of their Newell normal and ear-clipped, keeping the face's winding, instead of fanned from the first corner; a polygon without area or one the clipper cannot finish falls back to the fan. Ran the check program on an L shape, a ten-point star, a comb and a non-planar quad: triangle areas sum to 7, 1.1223 and 11 with no flipped triangles; 1400 damaged copies, no panic. --- native/crates/fsh-io/src/lib.rs | 1 + native/crates/fsh-io/src/obj.rs | 10 ++- native/crates/fsh-io/src/triangulate.rs | 97 +++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 native/crates/fsh-io/src/triangulate.rs diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index 3007329c..e1833f6f 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -20,6 +20,7 @@ mod png; mod raw; mod stl; mod threemf; +mod triangulate; mod watch; mod zip; diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index 0d9272eb..b87bce3b 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -1,6 +1,7 @@ use crate::error::{malformed, IoError, Result}; use crate::paths::Siblings; use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture}; +use crate::triangulate::triangulate; use crate::watch::{Stage, Watch}; use fsh_core::{Vec2, Vec3, Vec4}; use fsh_scene::TextureRole; @@ -117,8 +118,13 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> poly.push([v, vt, vn]); } let part = parts.last_mut().expect("parts is never empty"); - for i in 1..poly.len() - 1 { - part.corners.extend_from_slice(&[poly[0], poly[i], poly[i + 1]]); + if poly.len() == 3 { + part.corners.extend_from_slice(&poly); + } else { + let pts: Vec = poly.iter().map(|c| pos[c[0] as usize]).collect(); + for t in triangulate(&pts) { + part.corners.extend_from_slice(&[poly[t[0]], poly[t[1]], poly[t[2]]]); + } } } "g" | "o" => { diff --git a/native/crates/fsh-io/src/triangulate.rs b/native/crates/fsh-io/src/triangulate.rs new file mode 100644 index 00000000..ae406ef2 --- /dev/null +++ b/native/crates/fsh-io/src/triangulate.rs @@ -0,0 +1,97 @@ +use fsh_core::Vec3; + +fn newell(p: &[Vec3]) -> [f64; 3] { + let mut n = [0.0f64; 3]; + for i in 0..p.len() { + let (a, b) = (p[i], p[(i + 1) % p.len()]); + let (ax, ay, az) = (a.x as f64, a.y as f64, a.z as f64); + let (bx, by, bz) = (b.x as f64, b.y as f64, b.z as f64); + n[0] += (ay - by) * (az + bz); + n[1] += (az - bz) * (ax + bx); + n[2] += (ax - bx) * (ay + by); + } + n +} + +fn cross2(o: [f64; 2], a: [f64; 2], b: [f64; 2]) -> f64 { + (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]) +} + +fn fan(n: usize, out: &mut Vec<[usize; 3]>) { + for i in 1..n.saturating_sub(1) { + out.push([0, i, i + 1]); + } +} + +/// Triangles of a simple polygon (concave or slightly non-planar) by ear clipping in its best-fit plane; corners +/// keep the polygon's winding. Falls back to a fan when the polygon has no area or clipping gets stuck. +pub(crate) fn triangulate(p: &[Vec3]) -> Vec<[usize; 3]> { + let n = p.len(); + let mut out = Vec::with_capacity(n.saturating_sub(2)); + if n < 3 { + return out; + } + if n == 3 { + out.push([0, 1, 2]); + return out; + } + let nn = newell(p); + let len = (nn[0] * nn[0] + nn[1] * nn[1] + nn[2] * nn[2]).sqrt(); + if len <= 0.0 || !len.is_finite() { + fan(n, &mut out); + return out; + } + let nz = [nn[0] / len, nn[1] / len, nn[2] / len]; + let helper = if nz[0].abs() < 0.9 { [1.0, 0.0, 0.0] } else { [0.0, 1.0, 0.0] }; + let u = { + let c = [nz[1] * helper[2] - nz[2] * helper[1], nz[2] * helper[0] - nz[0] * helper[2], nz[0] * helper[1] - nz[1] * helper[0]]; + let l = (c[0] * c[0] + c[1] * c[1] + c[2] * c[2]).sqrt(); + [c[0] / l, c[1] / l, c[2] / l] + }; + let v = [nz[1] * u[2] - nz[2] * u[1], nz[2] * u[0] - nz[0] * u[2], nz[0] * u[1] - nz[1] * u[0]]; + let q: Vec<[f64; 2]> = p + .iter() + .map(|a| { + let a = [a.x as f64, a.y as f64, a.z as f64]; + [a[0] * u[0] + a[1] * u[1] + a[2] * u[2], a[0] * v[0] + a[1] * v[1] + a[2] * v[2]] + }) + .collect(); + let scale = q.iter().fold(0.0f64, |m, a| m.max(a[0].abs()).max(a[1].abs())).max(1e-30); + let eps = 1e-12 * scale * scale; + let mut ring: Vec = (0..n).collect(); + let mut guard = 0usize; + let mut i = 0usize; + while ring.len() > 3 { + let m = ring.len(); + let (a, b, c) = (ring[(i + m - 1) % m], ring[i % m], ring[(i + 1) % m]); + let convex = cross2(q[a], q[b], q[c]) > eps; + let ear = convex + && ring.iter().all(|&k| { + if k == a || k == b || k == c || q[k] == q[a] || q[k] == q[b] || q[k] == q[c] { + return true; + } + let (d1, d2, d3) = (cross2(q[a], q[b], q[k]), cross2(q[b], q[c], q[k]), cross2(q[c], q[a], q[k])); + !(d1 >= -eps && d2 >= -eps && d3 >= -eps) + }); + if ear { + out.push([a, b, c]); + ring.remove(i % m); + guard = 0; + if i >= ring.len() { + i = 0; + } + continue; + } + i = (i + 1) % m; + guard += 1; + if guard > m { + let k = (0..m).find(|&k| cross2(q[ring[(k + m - 1) % m]], q[ring[k]], q[ring[(k + 1) % m]]) > eps).unwrap_or(0); + out.push([ring[(k + m - 1) % m], ring[k], ring[(k + 1) % m]]); + ring.remove(k); + guard = 0; + i = 0; + } + } + out.push([ring[0], ring[1], ring[2]]); + out +} From de1d481f1a78a35103de6378acc4e7ef785ce271 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:13:45 -0500 Subject: [PATCH 048/494] feat(io): ear-clip ply polygons as obj does PLY faces with more than three corners whose indices are in range go through the same best-fit-plane ear clipper; others keep the fan so validation still reports bad indices. Ran the check program on a twelve-corner comb face (10 triangles, area 11, none flipped) and 1400 damaged copies, no panic. --- native/crates/fsh-io/src/ply.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-io/src/ply.rs b/native/crates/fsh-io/src/ply.rs index 9cb7b72f..7c48fef3 100644 --- a/native/crates/fsh-io/src/ply.rs +++ b/native/crates/fsh-io/src/ply.rs @@ -1,5 +1,6 @@ use crate::error::{malformed, IoError, Result}; use crate::raw::{RawMesh, RawNode, RawScene}; +use crate::triangulate::triangulate; use crate::watch::{Stage, Watch}; use fsh_core::{srgb_decode, Vec2, Vec3, Vec4}; @@ -279,8 +280,16 @@ pub fn read_ply(bytes: &[u8], name: &str, watch: &Watch) -> Result { } if is_face && list.len() >= 3 { let idx = |v: f64| if v >= 0.0 && v <= u32::MAX as f64 { v as u32 } else { u32::MAX }; - for i in 1..list.len() - 1 { - m.indices.extend_from_slice(&[idx(list[0]), idx(list[i]), idx(list[i + 1])]); + let ids: Vec = list.iter().map(|&v| idx(v)).collect(); + if ids.len() > 3 && ids.iter().all(|&i| (i as usize) < m.positions.len()) { + let pts: Vec = ids.iter().map(|&i| m.positions[i as usize]).collect(); + for t in triangulate(&pts) { + m.indices.extend_from_slice(&[ids[t[0]], ids[t[1]], ids[t[2]]]); + } + } else { + for i in 1..ids.len() - 1 { + m.indices.extend_from_slice(&[ids[0], ids[i], ids[i + 1]]); + } } } } From 7fb75368eb70725683f0f20072d44a8e79ec2b71 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:14:24 -0500 Subject: [PATCH 049/494] feat(io): keep obj groups as nodes with a part per material When an OBJ has more than one o or g group, each group becomes a child node of the file's node and every usemtl run inside it a part named after its material; a group seen twice reuses its node, and files with one group stay flat as before. Ran the check program on an own three-group file (a group with two materials became a group of two parts, 6 document nodes) and a one-group file, plus 1050 damaged copies, no panic. --- native/crates/fsh-io/src/obj.rs | 34 +++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index b87bce3b..03cfc080 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -158,11 +158,37 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> if any_colour { col.resize(pos.len(), Vec3::ONE); } - let mut root = RawNode::new(name, None, Vec::new()); + scene.nodes.push(RawNode::new(name, None, Vec::new())); + let mut groups: Vec<&str> = Vec::new(); + for p in parts.iter().filter(|p| !p.corners.is_empty()) { + if !groups.contains(&p.name.as_str()) { + groups.push(&p.name); + } + } + let nested = groups.len() > 1; + let multi: Vec = groups.iter().map(|g| parts.iter().filter(|p| !p.corners.is_empty() && p.name == *g).count() > 1).collect(); + let group_node: Vec = if nested { + groups + .iter() + .map(|g| { + scene.nodes.push(RawNode::new(*g, Some(0), Vec::new())); + scene.nodes.len() - 1 + }) + .collect() + } else { + vec![0] + }; + let names: Vec = groups.iter().map(|g| g.to_string()).collect(); for (pi, part) in parts.into_iter().enumerate() { if part.corners.is_empty() { continue; } + let gi = names.iter().position(|g| *g == part.name).unwrap_or(0); + let node = group_node[gi.min(group_node.len() - 1)]; + let mesh_name = match (&part.material, multi[gi]) { + (Some(m), true) => m.clone(), + _ => part.name.clone(), + }; if pi % 64 == 0 { watch.step(Stage::Reading, 1.0)?; } @@ -172,7 +198,7 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> scene.warnings.push(format!("{}: some corners lack texture coordinates; UVs dropped", part.name)); } let mut map: HashMap<[u32; 3], u32> = HashMap::new(); - let mut m = RawMesh { name: part.name.clone(), ..Default::default() }; + let mut m = RawMesh { name: mesh_name, ..Default::default() }; let mut uv = Vec::new(); for c in &part.corners { let key = [c[0], if has_uv { c[1] } else { NONE }, if has_n { c[2] } else { NONE }]; @@ -209,9 +235,9 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> m.material = Some(slot); } scene.meshes.push(m); - root.meshes.push(scene.meshes.len() - 1); + let mi = scene.meshes.len() - 1; + scene.nodes[node].meshes.push(mi); } - scene.nodes.push(root); watch.step(Stage::Reading, 1.0)?; Ok(scene) } From c3615f0996977d03bec5e936a6eeb76b7d79fd79 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:17:57 -0500 Subject: [PATCH 050/494] feat(io): generate mikktspace tangents in the clean-up pass Meshes with UVs and normals but no tangents get MikkTSpace tangents from bevy_mikktspace (Zlib and MIT or Apache-2.0, pure Rust), splitting vertices whose corners disagree; tangents travel in RawScene::tangents so RawMesh literals elsewhere still build, are welded, turned with the up axis and copied into the document mesh. Adds CleanOptions::generate_tangents, CleanReport::meshes_given_tangents and Stage::Tangents. Ran the check program: every corner of the own and ufbx cubes along dP/du, orthogonal and unit length, sphere_logo 1760 of 1764; 71 corpus files still import and round-trip. --- native/crates/fsh-io/Cargo.toml | 1 + native/crates/fsh-io/src/clean.rs | 56 +++++++++++++++++-- native/crates/fsh-io/src/convert.rs | 3 + native/crates/fsh-io/src/lib.rs | 1 + native/crates/fsh-io/src/raw.rs | 3 + native/crates/fsh-io/src/tangents.rs | 82 ++++++++++++++++++++++++++++ native/crates/fsh-io/src/watch.rs | 4 ++ 7 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 native/crates/fsh-io/src/tangents.rs diff --git a/native/crates/fsh-io/Cargo.toml b/native/crates/fsh-io/Cargo.toml index 63515018..05d029dd 100644 --- a/native/crates/fsh-io/Cargo.toml +++ b/native/crates/fsh-io/Cargo.toml @@ -10,6 +10,7 @@ fsh-core = { path = "../fsh-core" } fsh-scene = { path = "../fsh-scene" } serde_json = "1" roxmltree = "0.21" +bevy_mikktspace = "1" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] ufbx = "0.11" diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index 20c66dfd..b510e6fd 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -1,7 +1,8 @@ use crate::error::{IoError, Result}; use crate::raw::{RawMesh, RawScene, UpAxis}; use crate::watch::{Stage, Watch}; -use fsh_core::{Aabb, LengthUnit, Mat4, Vec3}; +use crate::tangents::mikktspace; +use fsh_core::{Aabb, LengthUnit, Mat4, Vec3, Vec4}; use std::collections::HashMap; /// Choices for the clean-up pass. @@ -17,6 +18,8 @@ pub struct CleanOptions { pub weld: bool, /// Fill normals for meshes that have none. pub generate_normals: bool, + /// Fill MikkTSpace tangents for meshes with UVs and normals but no tangents. + pub generate_tangents: bool, /// Replace duplicate meshes by instances of one mesh. pub detect_instances: bool, /// Lift the model so its lowest point is at height 0. @@ -33,6 +36,7 @@ impl Default for CleanOptions { smoothing_angle_deg: 30.0, weld: true, generate_normals: true, + generate_tangents: true, detect_instances: true, stand_on_floor: true, centre: false, @@ -51,6 +55,8 @@ pub struct CleanReport { pub unused_vertices_removed: usize, /// Meshes that received generated normals. pub meshes_given_normals: usize, + /// Meshes that received generated tangents. + pub meshes_given_tangents: usize, /// Meshes replaced by an instance of an equal mesh. pub instances_found: usize, /// Unit applied. @@ -72,11 +78,19 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result let mut rep = CleanReport { warnings: std::mem::take(&mut scene.warnings), ..Default::default() }; scene.add_nodes_for_loose_meshes(); validate(scene, &mut rep, watch)?; + let mut tans = std::mem::take(&mut scene.tangents); + tans.resize(scene.meshes.len(), Vec::new()); + for (m, t) in scene.meshes.iter().zip(tans.iter_mut()) { + if !t.is_empty() && (t.len() != m.positions.len() || m.normals.is_empty() || t.iter().any(|v| !v.is_finite())) { + rep.warnings.push(format!("{:?}: tangents did not match the vertices and were regenerated", m.name)); + t.clear(); + } + } let n = scene.meshes.len().max(1); if opts.weld { for i in 0..scene.meshes.len() { watch.step(Stage::Welding, i as f32 / n as f32)?; - let (welded, unused) = weld(&mut scene.meshes[i]); + let (welded, unused) = weld(&mut scene.meshes[i], &mut tans[i]); rep.vertices_welded += welded; rep.unused_vertices_removed += unused; } @@ -88,10 +102,22 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result let m = &mut scene.meshes[i]; if m.normals.is_empty() && !m.indices.is_empty() { smooth_normals(m, cos); + tans[i].clear(); rep.meshes_given_normals += 1; } } } + if opts.generate_tangents { + for i in 0..scene.meshes.len() { + watch.step(Stage::Tangents, i as f32 / n as f32)?; + let m = &mut scene.meshes[i]; + if tans[i].is_empty() && !m.uvs.is_empty() && !m.normals.is_empty() && !m.indices.is_empty() { + tans[i] = mikktspace(m); + rep.meshes_given_tangents += 1; + } + } + } + scene.tangents = tans; if opts.detect_instances { rep.instances_found = find_instances(scene, watch)?; } @@ -131,6 +157,12 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result for nrm in &mut m.normals { *nrm = r.transform_vector(*nrm).normalize_or(Vec3::Y); } + } + for t in scene.tangents.iter_mut().flatten() { + let v = r.transform_vector(Vec3::new(t.x, t.y, t.z)); + *t = Vec4::new(v.x, v.y, v.z, t.w); + } + for m in &mut scene.meshes { if let Some((_, off)) = &mut m.instance_of { *off = c.transform_vector(*off); } @@ -240,7 +272,7 @@ fn fnv(h: u64, v: u32) -> u64 { h } -fn vertex_key(m: &RawMesh, v: usize, out: &mut Vec) { +fn vertex_key(m: &RawMesh, t: &[Vec4], v: usize, out: &mut Vec) { out.clear(); let p = m.positions[v]; out.extend_from_slice(&[p.x.to_bits(), p.y.to_bits(), p.z.to_bits()]); @@ -253,9 +285,12 @@ fn vertex_key(m: &RawMesh, v: usize, out: &mut Vec) { if let Some(c) = m.colours.get(v) { out.extend_from_slice(&[c.x.to_bits(), c.y.to_bits(), c.z.to_bits(), c.w.to_bits()]); } + if let Some(c) = t.get(v) { + out.extend_from_slice(&[c.x.to_bits(), c.y.to_bits(), c.z.to_bits(), c.w.to_bits()]); + } } -fn remap(m: &mut RawMesh, order: &[u32]) { +pub(crate) fn remap(m: &mut RawMesh, order: &[u32]) { m.positions = order.iter().map(|&o| m.positions[o as usize]).collect(); if !m.normals.is_empty() { m.normals = order.iter().map(|&o| m.normals[o as usize]).collect(); @@ -268,7 +303,7 @@ fn remap(m: &mut RawMesh, order: &[u32]) { } } -fn weld(m: &mut RawMesh) -> (usize, usize) { +fn weld(m: &mut RawMesh, t: &mut Vec) -> (usize, usize) { let n = m.positions.len(); if n == 0 { return (0, 0); @@ -288,7 +323,7 @@ fn weld(m: &mut RawMesh) -> (usize, usize) { if !used[v] { continue; } - vertex_key(m, v, &mut key); + vertex_key(m, t, v, &mut key); let h = key.iter().fold(0xcbf2_9ce4_8422_2325u64, |h, &x| fnv(h, x)); let mut found = u32::MAX; let mut cur = heads.get(&h).copied().unwrap_or(u32::MAX); @@ -313,6 +348,9 @@ fn weld(m: &mut RawMesh) -> (usize, usize) { *i = new_of[*i as usize]; } remap(m, &order); + if !t.is_empty() { + *t = order.iter().map(|&o| t[o as usize]).collect(); + } (welded, unused) } @@ -456,6 +494,9 @@ fn find_instances(scene: &mut RawScene, watch: &Watch) -> Result { let list = buckets.entry(h).or_default(); let mut hit = None; for &i in list.iter() { + if scene.tangents.get(i).map(Vec::len) != scene.tangents.get(j).map(Vec::len) { + continue; + } if let Some(off) = same_shape(&scene.meshes[i], &scene.meshes[j]) { hit = Some((i, off)); break; @@ -470,6 +511,9 @@ fn find_instances(scene: &mut RawScene, watch: &Watch) -> Result { m.uvs = Vec::new(); m.colours = Vec::new(); m.indices = Vec::new(); + if let Some(t) = scene.tangents.get_mut(j) { + *t = Vec::new(); + } found += 1; } None => list.push(j), diff --git a/native/crates/fsh-io/src/convert.rs b/native/crates/fsh-io/src/convert.rs index 6ca3a5f4..420650e7 100644 --- a/native/crates/fsh-io/src/convert.rs +++ b/native/crates/fsh-io/src/convert.rs @@ -137,6 +137,9 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, mesh.normals = r.normals.clone(); mesh.uvs = r.uvs.clone(); mesh.colours = r.colours.clone(); + if let Some(t) = scene.tangents.get(mi).filter(|t| t.len() == r.positions.len()) { + mesh.tangents = t.clone(); + } mesh.validate()?; let key: MeshKey = keys.next(); mesh_key[mi] = Some(key); diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index e1833f6f..8f8a7b10 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -19,6 +19,7 @@ mod ply; mod png; mod raw; mod stl; +mod tangents; mod threemf; mod triangulate; mod watch; diff --git a/native/crates/fsh-io/src/raw.rs b/native/crates/fsh-io/src/raw.rs index 7b198c9f..3480f9f1 100644 --- a/native/crates/fsh-io/src/raw.rs +++ b/native/crates/fsh-io/src/raw.rs @@ -194,6 +194,9 @@ pub struct RawScene { pub materials: Vec, /// Texture references. pub textures: Vec, + /// Tangents per mesh, indexed like `meshes` (xyz plus handedness sign in w, one per vertex); a missing or + /// empty entry means none. Kept beside the meshes so `RawMesh` stays constructible by older callers. + pub tangents: Vec>, /// Unit the file declares, if it declares one. pub unit: Option, /// Up axis the file declares, if it declares one. diff --git a/native/crates/fsh-io/src/tangents.rs b/native/crates/fsh-io/src/tangents.rs new file mode 100644 index 00000000..9dd75268 --- /dev/null +++ b/native/crates/fsh-io/src/tangents.rs @@ -0,0 +1,82 @@ +use crate::raw::RawMesh; +use bevy_mikktspace::{generate_tangents, Geometry, TangentSpace}; +use fsh_core::{Vec3, Vec4}; +use std::collections::HashMap; + +struct Corners<'a> { + m: &'a RawMesh, + out: Vec>, +} + +impl Corners<'_> { + fn v(&self, face: usize, vert: usize) -> usize { + self.m.indices[face * 3 + vert] as usize + } +} + +impl Geometry for Corners<'_> { + fn num_faces(&self) -> usize { + self.m.indices.len() / 3 + } + + fn num_vertices_of_face(&self, _face: usize) -> usize { + 3 + } + + fn position(&self, face: usize, vert: usize) -> [f32; 3] { + let p = self.m.positions[self.v(face, vert)]; + [p.x, p.y, p.z] + } + + fn normal(&self, face: usize, vert: usize) -> [f32; 3] { + let n = self.m.normals[self.v(face, vert)]; + [n.x, n.y, n.z] + } + + fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2] { + let t = self.m.uvs[0][self.v(face, vert)]; + [t.x, t.y] + } + + fn set_tangent(&mut self, t: Option, face: usize, vert: usize) { + self.out[face * 3 + vert] = t.map(|t| t.tangent_encoded()).filter(|t| t.iter().all(|v| v.is_finite())); + } +} + +fn any_perpendicular(n: Vec3) -> Vec4 { + let h = if n.x.abs() < 0.9 { Vec3::X } else { Vec3::Y }; + let t = (h - n * n.dot(h)).normalize_or(Vec3::X); + Vec4::new(t.x, t.y, t.z, 1.0) +} + +/// MikkTSpace tangents from the first UV set; vertices whose corners disagree are split, so the mesh's vertex +/// order changes. Needs normals and at least one UV set. Returns the tangents, one per (new) vertex. +pub(crate) fn mikktspace(m: &mut RawMesh) -> Vec { + if m.uvs.is_empty() || m.normals.len() != m.positions.len() || m.indices.is_empty() { + return Vec::new(); + } + let mut g = Corners { m: &*m, out: vec![None; m.indices.len()] }; + let ok = generate_tangents(&mut g).is_ok(); + let corners = g.out; + let mut order: Vec = Vec::new(); + let mut tangents: Vec = Vec::new(); + let mut map: HashMap<(u32, [u32; 4]), u32> = HashMap::new(); + let mut idx = Vec::with_capacity(m.indices.len()); + for (k, &v) in m.indices.iter().enumerate() { + let t = match corners[k] { + Some(t) if ok => Vec4::new(t[0], t[1], t[2], if t[3] < 0.0 { -1.0 } else { 1.0 }), + _ => any_perpendicular(m.normals[v as usize]), + }; + let key = (v, [t.x.to_bits(), t.y.to_bits(), t.z.to_bits(), t.w.to_bits()]); + let next = order.len() as u32; + let id = *map.entry(key).or_insert_with(|| { + order.push(v); + tangents.push(t); + next + }); + idx.push(id); + } + m.indices = idx; + crate::clean::remap(m, &order); + tangents +} diff --git a/native/crates/fsh-io/src/watch.rs b/native/crates/fsh-io/src/watch.rs index cc410dbd..47966169 100644 --- a/native/crates/fsh-io/src/watch.rs +++ b/native/crates/fsh-io/src/watch.rs @@ -23,6 +23,8 @@ pub enum Stage { Converting = 7, /// Finished. Done = 8, + /// Generating tangents. + Tangents = 9, } impl Stage { @@ -36,6 +38,7 @@ impl Stage { 6 => Stage::Placing, 7 => Stage::Converting, 8 => Stage::Done, + 9 => Stage::Tangents, _ => Stage::Idle, } } @@ -52,6 +55,7 @@ impl Stage { Stage::Placing => "placing", Stage::Converting => "converting", Stage::Done => "done", + Stage::Tangents => "tangents", } } } From cabd4b335ad6c881d7a85308dabcfa3bce1fccce Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:19:19 -0500 Subject: [PATCH 051/494] feat(io): read gltf tangents and match their handedness glTF TANGENT attributes are read into the tangent table (so the clean-up pass keeps them instead of generating), and generated tangents now take UV v pointing up, which gives the same bitangent sign as Khronos-authored tangents. Ran the check program: the mirror test's own tangents and the generated ones on four other samples all have bitangent = cross(n, t) * w against dP/dv in the stored UVs; 1300 damaged copies, no panic. --- native/crates/fsh-io/src/gltf.rs | 9 +++++++++ native/crates/fsh-io/src/tangents.rs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-io/src/gltf.rs b/native/crates/fsh-io/src/gltf.rs index d0b38139..1fada7a1 100644 --- a/native/crates/fsh-io/src/gltf.rs +++ b/native/crates/fsh-io/src/gltf.rs @@ -722,6 +722,15 @@ fn read_mesh(r: &Reader, mj: &Value, mi: usize, scene: &mut RawScene) -> Result< scene.warnings.push(format!("{mesh_name}: missing material {mat}")); } } + if let Some(ti) = idx(attrs, "TANGENT")? { + let (f, c) = r.floats(ti)?; + if c != 4 || f.len() / 4 != n { + return malformed(format!("{mesh_name}: TANGENT must be VEC4 with one entry per vertex")); + } + let t: Vec = f.as_chunks::<4>().0.iter().map(|v| Vec4::new(v[0], v[1], v[2], if v[3] < 0.0 { -1.0 } else { 1.0 })).collect(); + scene.tangents.resize(scene.meshes.len(), Vec::new()); + scene.tangents.push(t); + } scene.meshes.push(m); out.push(scene.meshes.len() - 1); } diff --git a/native/crates/fsh-io/src/tangents.rs b/native/crates/fsh-io/src/tangents.rs index 9dd75268..a1c267ee 100644 --- a/native/crates/fsh-io/src/tangents.rs +++ b/native/crates/fsh-io/src/tangents.rs @@ -35,7 +35,7 @@ impl Geometry for Corners<'_> { fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2] { let t = self.m.uvs[0][self.v(face, vert)]; - [t.x, t.y] + [t.x, 1.0 - t.y] } fn set_tangent(&mut self, t: Option, face: usize, vert: usize) { @@ -49,7 +49,7 @@ fn any_perpendicular(n: Vec3) -> Vec4 { Vec4::new(t.x, t.y, t.z, 1.0) } -/// MikkTSpace tangents from the first UV set; vertices whose corners disagree are split, so the mesh's vertex +/// MikkTSpace tangents from the first UV set, taken with v pointing up as glTF's own tangents are; vertices whose corners disagree are split, so the mesh's vertex /// order changes. Needs normals and at least one UV set. Returns the tangents, one per (new) vertex. pub(crate) fn mikktspace(m: &mut RawMesh) -> Vec { if m.uvs.is_empty() || m.normals.len() != m.positions.len() || m.indices.is_empty() { From d526c31af55905e77d7cedf73b2c73f3e97d6d6c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:20:19 -0500 Subject: [PATCH 052/494] feat(io): report unit guess confidence and candidates The size rule is unchanged but now lives in guess_unit, which also gives a confidence (0.5 at a threshold, 0.95 a decade away) and the units that make a plausible object size, so the window can ask; CleanReport gains unit_declared, unit_confidence and unit_candidates, and a declared or given unit is never guessed (confidence 1). Ran the check program over eleven diagonals and five files: OBJ and PLY guessed cm at 0.74 and 0.92, 3MF, FBX and GLB took their declared unit. --- native/crates/fsh-io/src/clean.rs | 63 ++++++++++++++++++++++++++----- native/crates/fsh-io/src/lib.rs | 2 +- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index b510e6fd..6ddcd0a7 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -63,12 +63,57 @@ pub struct CleanReport { pub unit: LengthUnit, /// True when the unit came from the bounding-box guess. pub unit_guessed: bool, + /// Unit the file declares, if any (applied unless an option overrode it). + pub unit_declared: Option, + /// How sure the unit choice is, 0..1: 1 when given or declared, lower near a guess threshold. + pub unit_confidence: f32, + /// Units worth offering when asking, most likely first (the applied unit included). + pub unit_candidates: Vec, /// Up axis that was turned to Y. pub up_axis: UpAxis, /// Reader warnings followed by clean-up warnings. pub warnings: Vec, } +/// A unit chosen from a model's size when the file does not say. +#[derive(Clone, Debug, PartialEq)] +pub struct UnitGuess { + /// The unit the rule picks: diagonal under 0.5 is metres, under 50 centimetres, else millimetres. + pub unit: LengthUnit, + /// 0.5 at a threshold, rising to 0.95 one decade or more away from it. + pub confidence: f32, + /// Units that give a plausible object size (5 mm to 20 m), closest to a 25 cm object first; `unit` is always in. + pub candidates: Vec, +} + +/// Guesses the unit of a model from its bounding-box diagonal in file units. +pub fn guess_unit(diagonal: f32) -> UnitGuess { + let d = diagonal as f64; + if !d.is_finite() || d <= 0.0 { + return UnitGuess { unit: LengthUnit::Metre, confidence: 0.0, candidates: vec![LengthUnit::Metre] }; + } + let unit = if d < 0.5 { + LengthUnit::Metre + } else if d < 50.0 { + LengthUnit::Centimetre + } else { + LengthUnit::Millimetre + }; + let decades = [0.5f64, 50.0].iter().map(|t| (d / t).log10().abs()).fold(f64::INFINITY, f64::min); + let confidence = (0.5 + 0.45 * decades.min(1.0)) as f32; + let all = [LengthUnit::Millimetre, LengthUnit::Centimetre, LengthUnit::Inch, LengthUnit::Foot, LengthUnit::Metre]; + let mut scored: Vec<(f64, LengthUnit)> = all + .iter() + .map(|&u| (d * u.to_metres(), u)) + .filter(|(m, u)| (0.005..=20.0).contains(m) || *u == unit) + .map(|(m, u)| ((m / 0.25).log10().abs(), u)) + .collect(); + scored.sort_by(|a, b| a.0.total_cmp(&b.0)); + let mut candidates: Vec = vec![unit]; + candidates.extend(scored.into_iter().map(|(_, u)| u).filter(|u| *u != unit)); + UnitGuess { unit, confidence, candidates } +} + fn bad(msg: String) -> IoError { IoError::InvalidData(msg) } @@ -123,21 +168,21 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result } watch.step(Stage::Placing, 0.0)?; let declared = scene.unit.filter(|u| *u != LengthUnit::Unspecified); + rep.unit_declared = declared; let (unit, guessed) = match (opts.unit, declared) { (Some(u), _) => (u, false), (None, Some(u)) => (u, false), (None, None) => { - let d = world_bounds(scene).diagonal().length(); - let u = if !d.is_finite() || d < 0.5 { - LengthUnit::Metre - } else if d < 50.0 { - LengthUnit::Centimetre - } else { - LengthUnit::Millimetre - }; - (u, true) + let g = guess_unit(world_bounds(scene).diagonal().length()); + rep.unit_confidence = g.confidence; + rep.unit_candidates = g.candidates; + (g.unit, true) } }; + if !guessed { + rep.unit_confidence = 1.0; + rep.unit_candidates = vec![unit]; + } rep.unit = unit; rep.unit_guessed = guessed; if guessed { diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index 8f8a7b10..e24a29e9 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -25,7 +25,7 @@ mod triangulate; mod watch; mod zip; -pub use clean::{clean, world_bounds, CleanOptions, CleanReport}; +pub use clean::{clean, guess_unit, world_bounds, CleanOptions, CleanReport, UnitGuess}; pub use convert::{surface_params, to_import_command, ImportOptions, EMISSIVE_NITS_PER_UNIT}; pub use error::{IoError, Result}; pub use exr::write_exr; From 5a3ed26e9067f64c78a2cc523ddab6473277031b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:05 -0500 Subject: [PATCH 053/494] feat(io): find rotated and mirrored copies when instancing Meshes are relabelled by first vertex appearance, then a candidate with the same triangle list (or the reversed winding, for mirrors) is matched by its centroid and a frame of three far-apart vertices; every vertex and normal must agree within tolerance. instance_of now holds a rigid Mat4, the conversion, the GLB writer and world bounds follow it (bounds use the vertices under rotation), and CleanReport::instances_turned counts the turned ones. Ran the check program: an own file with moved, turned, mirrored and turned-mirrored copies found all five and refused scaled, bent and inside-out ones, vertices within 4e-9 m, the cube_gears samples gained turned instances, GLB round trips kept bounds; fsh-commands checks. --- native/crates/fsh-io/src/clean.rs | 232 +++++++++++++++++++++++--- native/crates/fsh-io/src/convert.rs | 10 +- native/crates/fsh-io/src/glb_write.rs | 12 +- native/crates/fsh-io/src/raw.rs | 5 +- 4 files changed, 221 insertions(+), 38 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index 6ddcd0a7..4b42ae6d 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -59,6 +59,8 @@ pub struct CleanReport { pub meshes_given_tangents: usize, /// Meshes replaced by an instance of an equal mesh. pub instances_found: usize, + /// Of those, instances that are rotated or mirrored copies rather than moved ones. + pub instances_turned: usize, /// Unit applied. pub unit: LengthUnit, /// True when the unit came from the bounding-box guess. @@ -164,7 +166,7 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result } scene.tangents = tans; if opts.detect_instances { - rep.instances_found = find_instances(scene, watch)?; + rep.instances_found = find_instances(scene, watch, &mut rep.instances_turned)?; } watch.step(Stage::Placing, 0.0)?; let declared = scene.unit.filter(|u| *u != LengthUnit::Unspecified); @@ -209,7 +211,7 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result } for m in &mut scene.meshes { if let Some((_, off)) = &mut m.instance_of { - *off = c.transform_vector(*off); + *off = c * *off * c_inv; } } for node in &mut scene.nodes { @@ -468,18 +470,38 @@ fn smooth_normals(m: &mut RawMesh, cos_limit: f32) { m.normals = normals; } -fn mesh_hash(m: &RawMesh) -> u64 { +fn mesh_hash(m: &RawMesh, indices: &[u32]) -> u64 { let mut h = 0xcbf2_9ce4_8422_2325u64; h = fnv(h, m.positions.len() as u32); h = fnv(h, m.normals.len() as u32); h = fnv(h, m.uvs.len() as u32); h = fnv(h, m.colours.len() as u32); - for &i in &m.indices { + for &i in indices { h = fnv(h, i); } h } +/// Vertices relabelled by first appearance, reading each triangle as written or with its winding reversed; +/// returns the relabelled index list and, for each new label, the old vertex. +fn canonical(indices: &[u32], vertices: usize, flip: bool) -> (Vec, Vec) { + let mut label = vec![u32::MAX; vertices]; + let mut order = Vec::with_capacity(vertices); + let mut out = Vec::with_capacity(indices.len()); + for t in indices.as_chunks::<3>().0 { + let t = if flip { [t[0], t[2], t[1]] } else { *t }; + for v in t { + let l = &mut label[v as usize]; + if *l == u32::MAX { + *l = order.len() as u32; + order.push(v); + } + out.push(*l); + } + } + (out, order) +} + fn centroid64(m: &RawMesh) -> [f64; 3] { let mut c = [0.0f64; 3]; for p in &m.positions { @@ -491,7 +513,124 @@ fn centroid64(m: &RawMesh) -> [f64; 3] { [c[0] / n, c[1] / n, c[2] / n] } -fn same_shape(a: &RawMesh, b: &RawMesh) -> Option { +type D3 = [f64; 3]; + +fn sub(a: D3, b: D3) -> D3 { + [a[0] - b[0], a[1] - b[1], a[2] - b[2]] +} + +fn dot(a: D3, b: D3) -> f64 { + a[0] * b[0] + a[1] * b[1] + a[2] * b[2] +} + +fn cross(a: D3, b: D3) -> D3 { + [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] +} + +fn unit(a: D3) -> Option { + let l = dot(a, a).sqrt(); + (l > 0.0 && l.is_finite()).then(|| [a[0] / l, a[1] / l, a[2] / l]) +} + +fn d3(p: Vec3) -> D3 { + [p.x as f64, p.y as f64, p.z as f64] +} + +fn frame_vertices(a: &[Vec3], c: D3) -> Option<[usize; 3]> { + let far = |from: D3| { + a.iter().enumerate().map(|(i, p)| (dot(sub(d3(*p), from), sub(d3(*p), from)), i)).max_by(|x, y| x.0.total_cmp(&y.0)).map(|x| x.1) + }; + let i0 = far(c)?; + let i1 = far(d3(a[i0]))?; + let e = sub(d3(a[i1]), d3(a[i0])); + let i2 = a + .iter() + .enumerate() + .map(|(i, p)| { + let x = cross(e, sub(d3(*p), d3(a[i0]))); + (dot(x, x), i) + }) + .max_by(|x, y| x.0.total_cmp(&y.0))? + .1; + let span = dot(e, e); + let x = cross(e, sub(d3(a[i2]), d3(a[i0]))); + (span > 0.0 && dot(x, x) > 1.0e-12 * span * span).then_some([i0, i1, i2]) +} + +fn basis(p: &[Vec3], f: [usize; 3]) -> Option<[D3; 3]> { + let u = unit(sub(d3(p[f[1]]), d3(p[f[0]])))?; + let w = unit(cross(u, sub(d3(p[f[2]]), d3(p[f[0]]))))?; + Some([u, cross(w, u), w]) +} + +fn rigid_candidates(a: &RawMesh, b: &RawMesh, ca: D3) -> Vec<[D3; 3]> { + let Some(f) = frame_vertices(&a.positions, ca) else { return Vec::new() }; + let (Some(fa), Some(fb)) = (basis(&a.positions, f), basis(&b.positions, f)) else { return Vec::new() }; + let rot = |fb: [D3; 3]| -> [D3; 3] { + let mut r = [[0.0; 3]; 3]; + for (i, row) in r.iter_mut().enumerate() { + for (j, v) in row.iter_mut().enumerate() { + *v = (0..3).map(|k| fb[k][i] * fa[k][j]).sum(); + } + } + r + }; + let mirrored = [fb[0], fb[1], [-fb[2][0], -fb[2][1], -fb[2][2]]]; + vec![rot(fb), rot(mirrored)] +} + +fn apply(r: &[D3; 3], v: D3) -> D3 { + [dot(r[0], v), dot(r[1], v), dot(r[2], v)] +} + +fn same_shape(a: &RawMesh, b: &RawMesh, flipped: bool) -> Option<(Mat4, bool)> { + if a.indices != b.indices + || a.positions.len() != b.positions.len() + || a.normals.len() != b.normals.len() + || a.uvs != b.uvs + || a.colours != b.colours + { + return None; + } + let (ca, cb) = (centroid64(a), centroid64(b)); + let size = Aabb::from_points(&a.positions).diagonal().length() as f64; + let far = ca.iter().chain(cb.iter()).fold(0.0f64, |m, v| m.max(v.abs())); + if !flipped { + if let Some(off) = translated_copy(a, b, ca, cb, size, far) { + return Some((Mat4::translation(off), false)); + } + } + let tol = 1.0e-5 * size + 2.0e-6 * far + 1.0e-9; + 'cand: for (k, r) in rigid_candidates(a, b, ca).into_iter().enumerate() { + if flipped != (k == 1) { + continue; + } + for (pa, pb) in a.positions.iter().zip(&b.positions) { + let d = sub(apply(&r, sub(d3(*pa), ca)), sub(d3(*pb), cb)); + if d.iter().any(|x| x.abs() > tol) { + continue 'cand; + } + } + for (na, nb) in a.normals.iter().zip(&b.normals) { + let d = sub(apply(&r, d3(*na)), d3(*nb)); + if d.iter().any(|x| x.abs() > 1.0e-3) { + continue 'cand; + } + } + let t = sub(cb, apply(&r, ca)); + let f = |v: f64| v as f32; + let m = Mat4::from_rows([ + [f(r[0][0]), f(r[0][1]), f(r[0][2]), f(t[0])], + [f(r[1][0]), f(r[1][1]), f(r[1][2]), f(t[1])], + [f(r[2][0]), f(r[2][1]), f(r[2][2]), f(t[2])], + [0.0, 0.0, 0.0, 1.0], + ]); + return Some((m, true)); + } + None +} + +fn translated_copy(a: &RawMesh, b: &RawMesh, ca: D3, cb: D3, size: f64, far: f64) -> Option { if a.indices != b.indices || a.positions.len() != b.positions.len() || a.normals.len() != b.normals.len() @@ -503,10 +642,6 @@ fn same_shape(a: &RawMesh, b: &RawMesh) -> Option { if a.uvs != b.uvs || a.colours != b.colours { return None; } - let (ca, cb) = (centroid64(a), centroid64(b)); - let ba = Aabb::from_points(&a.positions); - let size = ba.diagonal().length() as f64; - let far = ca.iter().chain(cb.iter()).fold(0.0f64, |m, v| m.max(v.abs())); let tol = 1.0e-6 * size + 1.0e-6 * far + 1.0e-9; for (pa, pb) in a.positions.iter().zip(&b.positions) { let d = [ @@ -526,27 +661,61 @@ fn same_shape(a: &RawMesh, b: &RawMesh) -> Option { Some(Vec3::new((cb[0] - ca[0]) as f32, (cb[1] - ca[1]) as f32, (cb[2] - ca[2]) as f32)) } -fn find_instances(scene: &mut RawScene, watch: &Watch) -> Result { +fn find_instances(scene: &mut RawScene, watch: &Watch, rotated: &mut usize) -> Result { let mut buckets: HashMap> = HashMap::new(); let mut found = 0; let n = scene.meshes.len(); for j in 0..n { - watch.step(Stage::Instancing, j as f32 / n.max(1) as f32)?; + watch.step(Stage::Instancing, j as f32 / n.max(1) as f32 * 0.3)?; + let m = &mut scene.meshes[j]; + if m.instance_of.is_some() || m.indices.is_empty() { + continue; + } + let (idx, order) = canonical(&m.indices, m.positions.len(), false); + m.indices = idx; + remap(m, &order); + if let Some(t) = scene.tangents.get_mut(j).filter(|t| !t.is_empty()) { + *t = order.iter().map(|&o| t[o as usize]).collect(); + } + } + for j in 0..n { + watch.step(Stage::Instancing, 0.3 + j as f32 / n.max(1) as f32 * 0.7)?; if scene.meshes[j].instance_of.is_some() || scene.meshes[j].indices.is_empty() { continue; } - let h = mesh_hash(&scene.meshes[j]); - let list = buckets.entry(h).or_default(); + let h = mesh_hash(&scene.meshes[j], &scene.meshes[j].indices); + let same_tangents = |i: usize| scene.tangents.get(i).map(Vec::len) == scene.tangents.get(j).map(Vec::len); let mut hit = None; - for &i in list.iter() { - if scene.tangents.get(i).map(Vec::len) != scene.tangents.get(j).map(Vec::len) { - continue; + for &i in buckets.get(&h).map(Vec::as_slice).unwrap_or(&[]) { + if same_tangents(i) { + if let Some(found) = same_shape(&scene.meshes[i], &scene.meshes[j], false) { + hit = Some((i, found)); + break; + } } - if let Some(off) = same_shape(&scene.meshes[i], &scene.meshes[j]) { - hit = Some((i, off)); - break; + } + if hit.is_none() { + let mj = &scene.meshes[j]; + let (idx, order) = canonical(&mj.indices, mj.positions.len(), true); + let hf = mesh_hash(mj, &idx); + if let Some(list) = buckets.get(&hf) { + let mut flipped = mj.clone(); + flipped.indices = idx; + remap(&mut flipped, &order); + for &i in list { + if same_tangents(i) { + if let Some(found) = same_shape(&scene.meshes[i], &flipped, true) { + hit = Some((i, found)); + break; + } + } + } } } + if let Some((_, (_, true))) = hit { + *rotated += 1; + } + let hit = hit.map(|(i, (off, _))| (i, off)); match hit { Some((i, off)) => { let m = &mut scene.meshes[j]; @@ -561,17 +730,17 @@ fn find_instances(scene: &mut RawScene, watch: &Watch) -> Result { } found += 1; } - None => list.push(j), + None => buckets.entry(h).or_default().push(j), } } Ok(found) } /// Local bounds of a mesh, following an instance link. -pub(crate) fn mesh_bounds(scene: &RawScene, mi: usize) -> (Aabb, Vec3) { +pub(crate) fn mesh_bounds(scene: &RawScene, mi: usize) -> (Aabb, Mat4) { match scene.meshes.get(mi).and_then(|m| m.instance_of) { - Some((src, off)) => (Aabb::from_points(&scene.meshes[src].positions), off), - None => (scene.meshes.get(mi).map(|m| Aabb::from_points(&m.positions)).unwrap_or(Aabb::EMPTY), Vec3::ZERO), + Some((src, off)) => (scene.meshes.get(src).map(|m| Aabb::from_points(&m.positions)).unwrap_or(Aabb::EMPTY), off), + None => (scene.meshes.get(mi).map(|m| Aabb::from_points(&m.positions)).unwrap_or(Aabb::EMPTY), Mat4::IDENTITY), } } @@ -588,9 +757,20 @@ pub fn world_bounds(scene: &RawScene) -> Aabb { if b.is_empty() { continue; } - let m = w * Mat4::translation(off); - for k in 0..8 { - out = out.union_point(m.transform_point(b.corner(k))); + let m = w * off; + let axis_aligned = (0..3).all(|c| (0..3).filter(|&r| m.m[r][c].abs() > 1.0e-7).count() <= 1); + let src = scene.meshes[mi].instance_of.map(|(s, _)| s).unwrap_or(mi); + match scene.meshes.get(src).filter(|_| !axis_aligned) { + Some(sm) => { + for p in &sm.positions { + out = out.union_point(m.transform_point(*p)); + } + } + None => { + for k in 0..8 { + out = out.union_point(m.transform_point(b.corner(k))); + } + } } } } diff --git a/native/crates/fsh-io/src/convert.rs b/native/crates/fsh-io/src/convert.rs index 420650e7..977d0d21 100644 --- a/native/crates/fsh-io/src/convert.rs +++ b/native/crates/fsh-io/src/convert.rs @@ -94,10 +94,10 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, } } let nm = scene.meshes.len(); - let source = |mi: usize| -> (usize, Vec3) { + let source = |mi: usize| -> (usize, Mat4) { match scene.meshes[mi].instance_of { Some((s, off)) if s < nm => (s, off), - _ => (mi, Vec3::ZERO), + _ => (mi, Mat4::IDENTITY), } }; let drawable = |mi: usize| mi < nm && !scene.meshes[source(mi).0].indices.is_empty(); @@ -211,7 +211,7 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, if parts.len() == 1 && !has_child[i] { let mi = parts[0]; let (_, off) = source(mi); - let (t, ok) = trs_or_hidden(&(n.transform * Mat4::translation(off))); + let (t, ok) = trs_or_hidden(&(n.transform * off)); let mut node = Node::new(n.name.clone(), part_of(mi)); node.transform = t; node.visible = ok; @@ -232,7 +232,9 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, for mi in parts { let (_, off) = source(mi); let mut node = Node::new(scene.meshes[mi].name.clone(), part_of(mi)); - node.transform = Trs::from_translation(off); + let (t, ok) = trs_or_hidden(&off); + node.transform = t; + node.visible = ok; node.parent = Some(gid); let id: NodeId = keys.next(); payload.nodes.push(ImportNode { id, node }); diff --git a/native/crates/fsh-io/src/glb_write.rs b/native/crates/fsh-io/src/glb_write.rs index a2d4dcc5..68db470e 100644 --- a/native/crates/fsh-io/src/glb_write.rs +++ b/native/crates/fsh-io/src/glb_write.rs @@ -1,6 +1,6 @@ use crate::error::{IoError, Result}; use crate::raw::{RawMaterial, RawScene}; -use fsh_core::{Aabb, Vec3}; +use fsh_core::{Aabb, Mat4}; use serde_json::{json, Map, Value}; use std::collections::BTreeMap; @@ -113,9 +113,9 @@ pub fn write_glb(scene: &RawScene) -> Result> { } prim_of[i] = Some(p); } - let prim = |mi: usize| -> Option<(Value, Vec3)> { + let prim = |mi: usize| -> Option<(Value, Mat4)> { let m = scene.meshes.get(mi)?; - let (src, off) = m.instance_of.unwrap_or((mi, Vec3::ZERO)); + let (src, off) = m.instance_of.unwrap_or((mi, Mat4::IDENTITY)); let mut p = prim_of.get(src)?.clone()?; match m.material.filter(|&x| x < scene.materials.len()) { Some(mat) => p["material"] = json!(mat), @@ -135,11 +135,11 @@ pub fn write_glb(scene: &RawScene) -> Result> { let mut roots = Vec::new(); for (i, n) in scene.nodes.iter().enumerate() { let mut node = json!({"name": n.name, "matrix": n.transform.to_cols_array()}); - let parts: Vec<(usize, Value, Vec3)> = n.meshes.iter().filter_map(|&mi| prim(mi).map(|(p, o)| (mi, p, o))).collect(); + let parts: Vec<(usize, Value, Mat4)> = n.meshes.iter().filter_map(|&mi| prim(mi).map(|(p, o)| (mi, p, o))).collect(); let me = nodes.len(); let mut extra_children = Vec::new(); if !parts.is_empty() { - if parts.iter().all(|(_, _, o)| *o == Vec3::ZERO) { + if parts.iter().all(|(_, _, o)| *o == Mat4::IDENTITY) { let key: Vec = parts.iter().map(|(mi, _, _)| *mi).collect(); let mesh = *mesh_cache.entry(key).or_insert_with(|| { meshes.push(json!({"name": n.name, "primitives": parts.iter().map(|(_, p, _)| p.clone()).collect::>()})); @@ -149,7 +149,7 @@ pub fn write_glb(scene: &RawScene) -> Result> { } else { for (k, (mi, p, o)) in parts.into_iter().enumerate() { meshes.push(json!({"name": scene.meshes[mi].name, "primitives": [p]})); - extra_children.push(json!({"name": format!("{} {k}", n.name), "mesh": meshes.len() - 1, "translation": [o.x, o.y, o.z]})); + extra_children.push(json!({"name": format!("{} {k}", n.name), "mesh": meshes.len() - 1, "matrix": o.to_cols_array()})); } } } diff --git a/native/crates/fsh-io/src/raw.rs b/native/crates/fsh-io/src/raw.rs index 3480f9f1..6d41fe63 100644 --- a/native/crates/fsh-io/src/raw.rs +++ b/native/crates/fsh-io/src/raw.rs @@ -83,8 +83,9 @@ pub struct RawMesh { pub indices: Vec, /// Index into `RawScene::materials`. pub material: Option, - /// Set by the clean-up pass: this mesh equals another mesh moved by an offset; its own data is cleared. - pub instance_of: Option<(usize, Vec3)>, + /// Set by the clean-up pass: this mesh equals another mesh under a rigid transform (rotation, possibly a + /// mirror, and translation) that maps the source's local coordinates to this mesh's; its own data is cleared. + pub instance_of: Option<(usize, Mat4)>, } impl RawMesh { From aa016375f40d5d13dfd5a0456f36283a8ca06541 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:59 -0500 Subject: [PATCH 054/494] feat(io): read binary stl facet colours Binary STL attribute words become vertex colours: the VisCAM and SolidView convention (bit 15 set, red in the high bits) and, when the header holds COLOR=, the Materialise one (bit 15 clear for a facet colour, the header colour otherwise); five-bit sRGB values are linearised. Ran the check program on own VisCAM, Materialise and plain files (red, blue, header grey 0.21 linear and green as written, plain stays uncoloured) and 1968 damaged copies, no panic. --- native/crates/fsh-io/src/stl.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-io/src/stl.rs b/native/crates/fsh-io/src/stl.rs index 91a7e71f..b094b407 100644 --- a/native/crates/fsh-io/src/stl.rs +++ b/native/crates/fsh-io/src/stl.rs @@ -1,7 +1,7 @@ use crate::error::{malformed, IoError, Result}; use crate::raw::{RawMesh, RawNode, RawScene}; use crate::watch::{Stage, Watch}; -use fsh_core::Vec3; +use fsh_core::{srgb_decode, Vec3, Vec4}; /// True when the size matches a binary STL's declared triangle count. pub fn is_binary_stl(bytes: &[u8]) -> bool { @@ -61,6 +61,11 @@ fn read_binary(bytes: &[u8], scene: &mut RawScene, watch: &Watch) -> Result<()> let mut m = RawMesh { name: scene.name.clone(), ..Default::default() }; m.positions.reserve(n * 3); m.indices.reserve(n * 3); + let header = &bytes[..80]; + let materialise = header.windows(6).position(|w| w == b"COLOR="); + let default = materialise.and_then(|i| header.get(i + 6..i + 10)).map(|c| [c[0], c[1], c[2], c[3]]); + let mut colours: Vec = Vec::new(); + let mut any = false; for t in 0..n { if t % 65536 == 0 { watch.step(Stage::Reading, t as f32 / n.max(1) as f32)?; @@ -68,6 +73,20 @@ fn read_binary(bytes: &[u8], scene: &mut RawScene, watch: &Watch) -> Result<()> let b = 84 + t * 50; let v = |k: usize| Vec3::new(f32_at(bytes, b + k), f32_at(bytes, b + k + 4), f32_at(bytes, b + k + 8)); push_tri(&mut m, v(0), [v(12), v(24), v(36)]); + let attr = u16::from_le_bytes([bytes[b + 48], bytes[b + 49]]); + let five = |s: u16| srgb_decode(((attr >> s) & 31) as f32 / 31.0); + let c = match materialise { + Some(_) if attr & 0x8000 == 0 => Some(Vec4::new(five(0), five(5), five(10), 1.0)), + Some(_) => default.map(|c| Vec4::new(srgb_decode(c[0] as f32 / 255.0), srgb_decode(c[1] as f32 / 255.0), srgb_decode(c[2] as f32 / 255.0), c[3] as f32 / 255.0)), + None if attr & 0x8000 != 0 => Some(Vec4::new(five(10), five(5), five(0), 1.0)), + None => None, + }; + any |= c.is_some(); + let c = c.unwrap_or(Vec4::ONE); + colours.extend_from_slice(&[c, c, c]); + } + if any { + m.colours = colours; } scene.meshes.push(m); Ok(()) From c423628a352336940028f099dfa862e38a3850e5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:31:03 -0500 Subject: [PATCH 055/494] feat(io): flag parts that use vertex colours The clean-up pass drops vertex colours that are white everywhere and counts the meshes that keep them; the conversion marks every part (instances included) whose mesh keeps colours with the node metadata key material.vertex_colours = multiply, since the document's material has no field for it yet. Ran the check program: coloured STL, PLY, OBJ, 3MF, FBX and GLB files flag their parts, an all-white OBJ drops its colours, 84 corpus files still import and round-trip. --- native/crates/fsh-io/src/clean.rs | 15 +++++++++++++++ native/crates/fsh-io/src/convert.rs | 14 ++++++++++++++ native/crates/fsh-io/src/lib.rs | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index 4b42ae6d..22f32c39 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -57,6 +57,10 @@ pub struct CleanReport { pub meshes_given_normals: usize, /// Meshes that received generated tangents. pub meshes_given_tangents: usize, + /// Meshes whose vertex colours were all white and were dropped. + pub white_colours_dropped: usize, + /// Meshes that keep vertex colours (their parts are flagged with [`crate::VERTEX_COLOURS_KEY`]). + pub meshes_with_vertex_colours: usize, /// Meshes replaced by an instance of an equal mesh. pub instances_found: usize, /// Of those, instances that are rotated or mirrored copies rather than moved ones. @@ -125,6 +129,17 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result let mut rep = CleanReport { warnings: std::mem::take(&mut scene.warnings), ..Default::default() }; scene.add_nodes_for_loose_meshes(); validate(scene, &mut rep, watch)?; + for m in &mut scene.meshes { + if m.colours.is_empty() { + continue; + } + if m.colours.iter().all(|c| c.x >= 0.999 && c.y >= 0.999 && c.z >= 0.999 && c.w >= 0.999) { + m.colours = Vec::new(); + rep.white_colours_dropped += 1; + } else { + rep.meshes_with_vertex_colours += 1; + } + } let mut tans = std::mem::take(&mut scene.tangents); tans.resize(scene.meshes.len(), Vec::new()); for (m, t) in scene.meshes.iter().zip(tans.iter_mut()) { diff --git a/native/crates/fsh-io/src/convert.rs b/native/crates/fsh-io/src/convert.rs index 977d0d21..2f5dc3ae 100644 --- a/native/crates/fsh-io/src/convert.rs +++ b/native/crates/fsh-io/src/convert.rs @@ -11,6 +11,18 @@ use std::sync::Arc; /// Luminance in nits given to an emissive colour of 1 (glTF emissiveFactor times strength). pub const EMISSIVE_NITS_PER_UNIT: f32 = 100.0; +/// Node metadata key set on parts whose mesh carries vertex colours; its value says how the material uses them. +pub const VERTEX_COLOURS_KEY: &str = "material.vertex_colours"; + +/// The value of [`VERTEX_COLOURS_KEY`]: the vertex colour multiplies the material's base colour. +pub const VERTEX_COLOURS_MULTIPLY: &str = "multiply"; + +fn flag_colours(node: &mut Node, mesh: &crate::raw::RawMesh) { + if !mesh.colours.is_empty() { + node.metadata.insert(VERTEX_COLOURS_KEY.to_string(), VERTEX_COLOURS_MULTIPLY.to_string()); + } +} + /// Where and how an import lands in the document. #[derive(Clone, Debug, Default)] pub struct ImportOptions { @@ -213,6 +225,7 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, let (_, off) = source(mi); let (t, ok) = trs_or_hidden(&(n.transform * off)); let mut node = Node::new(n.name.clone(), part_of(mi)); + flag_colours(&mut node, &scene.meshes[source(mi).0]); node.transform = t; node.visible = ok; node.parent = parent; @@ -232,6 +245,7 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, for mi in parts { let (_, off) = source(mi); let mut node = Node::new(scene.meshes[mi].name.clone(), part_of(mi)); + flag_colours(&mut node, &scene.meshes[source(mi).0]); let (t, ok) = trs_or_hidden(&off); node.transform = t; node.visible = ok; diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index e24a29e9..f87b4e24 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -26,7 +26,7 @@ mod watch; mod zip; pub use clean::{clean, guess_unit, world_bounds, CleanOptions, CleanReport, UnitGuess}; -pub use convert::{surface_params, to_import_command, ImportOptions, EMISSIVE_NITS_PER_UNIT}; +pub use convert::{surface_params, to_import_command, ImportOptions, EMISSIVE_NITS_PER_UNIT, VERTEX_COLOURS_KEY, VERTEX_COLOURS_MULTIPLY}; pub use error::{IoError, Result}; pub use exr::write_exr; pub use glb_write::write_glb; From 7c1f3e800229f7dc567ebaa97a306b4ded8e0667 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:32:44 -0500 Subject: [PATCH 056/494] feat(io): check for cancel inside long reader and clean-up loops Watch::poll checks the cancel flag every 65536 steps without touching progress; validation, welding and normal generation poll inside each mesh, glTF primitives, OBJ part assembly and 3MF property splitting poll too, on top of the per-mesh steps. Ran the check program cancelling imports of a 977k-triangle OBJ and STL, kinect_scan.3mf and ToyCar.glb after 100, 600 and 1500 ms: cancelled returns came after 1 to 25 ms on the grids, 55 to 443 ms on the 3MF (inside unzip and XML parse) and 197 ms on ToyCar (inside one tangent generation); 84 corpus files still import. --- native/crates/fsh-io/src/clean.rs | 18 +++++++++++------- native/crates/fsh-io/src/gltf.rs | 5 +++-- native/crates/fsh-io/src/obj.rs | 3 ++- native/crates/fsh-io/src/threemf.rs | 9 +++++---- native/crates/fsh-io/src/watch.rs | 9 +++++++++ 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index 22f32c39..c008af2d 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -152,7 +152,7 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result if opts.weld { for i in 0..scene.meshes.len() { watch.step(Stage::Welding, i as f32 / n as f32)?; - let (welded, unused) = weld(&mut scene.meshes[i], &mut tans[i]); + let (welded, unused) = weld(&mut scene.meshes[i], &mut tans[i], watch)?; rep.vertices_welded += welded; rep.unused_vertices_removed += unused; } @@ -163,7 +163,7 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result watch.step(Stage::Normals, i as f32 / n as f32)?; let m = &mut scene.meshes[i]; if m.normals.is_empty() && !m.indices.is_empty() { - smooth_normals(m, cos); + smooth_normals(m, cos, watch)?; tans[i].clear(); rep.meshes_given_normals += 1; } @@ -305,7 +305,8 @@ fn validate(scene: &mut RawScene, rep: &mut CleanReport, watch: &Watch) -> Resul let before = m.indices.len() / 3; let pos = &m.positions; let mut kept = Vec::with_capacity(m.indices.len()); - for t in m.indices.as_chunks::<3>().0 { + for (k, t) in m.indices.as_chunks::<3>().0.iter().enumerate() { + watch.poll(k)?; let (a, b, c) = (t[0], t[1], t[2]); if a == b || b == c || a == c { continue; @@ -365,10 +366,10 @@ pub(crate) fn remap(m: &mut RawMesh, order: &[u32]) { } } -fn weld(m: &mut RawMesh, t: &mut Vec) -> (usize, usize) { +fn weld(m: &mut RawMesh, t: &mut Vec, watch: &Watch) -> Result<(usize, usize)> { let n = m.positions.len(); if n == 0 { - return (0, 0); + return Ok((0, 0)); } let mut used = vec![false; n]; for &i in &m.indices { @@ -382,6 +383,7 @@ fn weld(m: &mut RawMesh, t: &mut Vec) -> (usize, usize) { let mut order: Vec = Vec::new(); let mut key = Vec::new(); for v in 0..n { + watch.poll(v)?; if !used[v] { continue; } @@ -413,10 +415,10 @@ fn weld(m: &mut RawMesh, t: &mut Vec) -> (usize, usize) { if !t.is_empty() { *t = order.iter().map(|&o| t[o as usize]).collect(); } - (welded, unused) + Ok((welded, unused)) } -fn smooth_normals(m: &mut RawMesh, cos_limit: f32) { +fn smooth_normals(m: &mut RawMesh, cos_limit: f32, watch: &Watch) -> Result<()> { let tris = m.indices.len() / 3; let mut face = Vec::with_capacity(tris); let mut unit = Vec::with_capacity(tris); @@ -456,6 +458,7 @@ fn smooth_normals(m: &mut RawMesh, cos_limit: f32) { let mut normals: Vec = Vec::new(); let mut new_idx = Vec::with_capacity(m.indices.len()); for (k, &v) in m.indices.iter().enumerate() { + watch.poll(k)?; let t = k / 3; let p = pid[v as usize] as usize; let mut sum = Vec3::ZERO; @@ -483,6 +486,7 @@ fn smooth_normals(m: &mut RawMesh, cos_limit: f32) { m.normals = Vec::new(); remap(m, &order); m.normals = normals; + Ok(()) } fn mesh_hash(m: &RawMesh, indices: &[u32]) -> u64 { diff --git a/native/crates/fsh-io/src/gltf.rs b/native/crates/fsh-io/src/gltf.rs index 1fada7a1..69c871e6 100644 --- a/native/crates/fsh-io/src/gltf.rs +++ b/native/crates/fsh-io/src/gltf.rs @@ -613,7 +613,7 @@ pub fn read_gltf(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) - }; if mesh_map[mi].is_none() { watch.step(Stage::Reading, done as f32 / meshes_json.len().max(1) as f32)?; - let list = read_mesh(&reader, mj, mi, &mut scene)?; + let list = read_mesh(&reader, mj, mi, &mut scene, watch)?; mesh_map[mi] = Some(list); done += 1; } @@ -640,11 +640,12 @@ pub fn read_gltf(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) - Ok(scene) } -fn read_mesh(r: &Reader, mj: &Value, mi: usize, scene: &mut RawScene) -> Result> { +fn read_mesh(r: &Reader, mj: &Value, mi: usize, scene: &mut RawScene, watch: &Watch) -> Result> { let mesh_name = mj.get("name").and_then(Value::as_str).map(str::to_string).unwrap_or_else(|| format!("Mesh {mi}")); let prims = arr(mj, "primitives"); let mut out = Vec::new(); for (pi, p) in prims.iter().enumerate() { + watch.poll(0)?; let mode = p.get("mode").and_then(Value::as_u64).unwrap_or(4); if !(4..=6).contains(&mode) { scene.warnings.push(format!("{mesh_name}: primitive {pi} draws points or lines and was skipped")); diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index 03cfc080..f59176a1 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -200,7 +200,8 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> let mut map: HashMap<[u32; 3], u32> = HashMap::new(); let mut m = RawMesh { name: mesh_name, ..Default::default() }; let mut uv = Vec::new(); - for c in &part.corners { + for (ci, c) in part.corners.iter().enumerate() { + watch.poll(ci)?; let key = [c[0], if has_uv { c[1] } else { NONE }, if has_n { c[2] } else { NONE }]; let next = m.positions.len() as u32; let id = *map.entry(key).or_insert_with(|| { diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index 84c99b79..b0e9517b 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -411,12 +411,13 @@ fn bucket_of(c: &Corner) -> Bucket { } } -fn buckets(model: &Model, obj: &Object, md: &MeshData, scale: f32, warnings: &mut Vec) -> Vec<(Bucket, RawMesh)> { +fn buckets(model: &Model, obj: &Object, md: &MeshData, scale: f32, warnings: &mut Vec, watch: &Watch) -> Result> { let mut out: Vec<(Bucket, RawMesh)> = Vec::new(); let mut slot: HashMap = HashMap::new(); let mut maps: Vec> = Vec::new(); let mut missing = false; - for t in &md.tris { + for (ti, t) in md.tris.iter().enumerate() { + watch.poll(ti)?; let (pid, p) = match (t.pid, obj.pid) { (Some(pid), _) => (Some(pid), t.p.map(|x| Some(x.unwrap_or(obj.pindex)))), (None, Some(pid)) => (Some(pid), [Some(obj.pindex); 3]), @@ -465,7 +466,7 @@ fn buckets(model: &Model, obj: &Object, md: &MeshData, scale: f32, warnings: &mu if missing { warnings.push(format!("{}: some triangles name properties that do not exist; the default material was used", obj.name)); } - out + Ok(out) } #[derive(PartialEq, Eq, Hash)] @@ -531,7 +532,7 @@ impl Reader<'_, '_> { let Some(obj) = model.objects.get(&id) else { return Ok(Vec::new()) }; let mut out = Vec::new(); if let (Some(md), false) = (&obj.mesh, obj.skipped) { - for (b, mut m) in buckets(model, obj, md, self.scale, &mut scene.warnings) { + for (b, mut m) in buckets(model, obj, md, self.scale, &mut scene.warnings, self.watch)? { let key = match b { Bucket::Plain => None, Bucket::Base(g, i) => Some(MatKey::Base(part, g, i)), diff --git a/native/crates/fsh-io/src/watch.rs b/native/crates/fsh-io/src/watch.rs index 47966169..21298f74 100644 --- a/native/crates/fsh-io/src/watch.rs +++ b/native/crates/fsh-io/src/watch.rs @@ -100,6 +100,15 @@ impl Watch { self.cancel.load(Ordering::Relaxed) } + /// For long inner loops: every 65536th `i` returns `Cancelled` if the flag is up; progress is left as it is. + pub fn poll(&self, i: usize) -> Result<()> { + if i & 0xFFFF == 0 && self.is_cancelled() { + Err(IoError::Cancelled) + } else { + Ok(()) + } + } + /// Records progress and returns `Cancelled` if the flag is up. pub fn step(&self, stage: Stage, fraction: f32) -> Result<()> { self.set(stage, fraction); From 6081de8d2fb410c5d4581e02d5375e4921e1925f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:37:21 -0500 Subject: [PATCH 057/494] fix(io): fan polygons too large to ear-clip cheaply Ear clipping costs up to the cube of the corner count, so a damaged or hostile face with hundreds of thousands of corners could hang an import; polygons over 512 corners are fanned instead. Ran the check program on an OBJ with a 200000-corner face and a 500-corner star: read in 0.2 s. --- native/crates/fsh-io/src/triangulate.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-io/src/triangulate.rs b/native/crates/fsh-io/src/triangulate.rs index ae406ef2..c4fb7b20 100644 --- a/native/crates/fsh-io/src/triangulate.rs +++ b/native/crates/fsh-io/src/triangulate.rs @@ -1,5 +1,8 @@ use fsh_core::Vec3; +/// Polygons with more corners than this are fanned: ear clipping costs up to the cube of the corner count. +pub(crate) const MAX_CLIPPED: usize = 512; + fn newell(p: &[Vec3]) -> [f64; 3] { let mut n = [0.0f64; 3]; for i in 0..p.len() { @@ -24,7 +27,8 @@ fn fan(n: usize, out: &mut Vec<[usize; 3]>) { } /// Triangles of a simple polygon (concave or slightly non-planar) by ear clipping in its best-fit plane; corners -/// keep the polygon's winding. Falls back to a fan when the polygon has no area or clipping gets stuck. +/// keep the polygon's winding. Falls back to a fan when the polygon has no area, clipping gets stuck, or it has +/// more than [`MAX_CLIPPED`] corners. pub(crate) fn triangulate(p: &[Vec3]) -> Vec<[usize; 3]> { let n = p.len(); let mut out = Vec::with_capacity(n.saturating_sub(2)); @@ -35,6 +39,10 @@ pub(crate) fn triangulate(p: &[Vec3]) -> Vec<[usize; 3]> { out.push([0, 1, 2]); return out; } + if n > MAX_CLIPPED { + fan(n, &mut out); + return out; + } let nn = newell(p); let len = (nn[0] * nn[0] + nn[1] * nn[1] + nn[2] * nn[2]).sqrt(); if len <= 0.0 || !len.is_finite() { From 54955e29f95fcf6d16fae9440e275f6649d3e2f2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:37:21 -0500 Subject: [PATCH 058/494] fix(io): cluster face normals at very busy vertices Normal smoothing compared every corner with every face around its vertex, so a vertex shared by 200000 triangles took over a minute; around vertices with more than 256 faces the faces are first merged into at most 64 normal clusters and corners sum the clusters inside the smoothing angle. Ran the check program: the 200000-triangle fan cleaned in 0.24 s instead of 74 s, and a 3000-segment UV sphere kept every normal within 0.5 degrees of its radius, poles included. --- native/crates/fsh-io/src/clean.rs | 52 ++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index c008af2d..17b9a43d 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -418,6 +418,9 @@ fn weld(m: &mut RawMesh, t: &mut Vec, watch: &Watch) -> Result<(usize, usi Ok((welded, unused)) } +const BUSY_VERTEX: usize = 256; +const MAX_CLUSTERS: usize = 64; + fn smooth_normals(m: &mut RawMesh, cos_limit: f32, watch: &Watch) -> Result<()> { let tris = m.indices.len() / 3; let mut face = Vec::with_capacity(tris); @@ -453,6 +456,33 @@ fn smooth_normals(m: &mut RawMesh, cos_limit: f32, watch: &Watch) -> Result<()> inc[fill[p] as usize] = (k / 3) as u32; fill[p] += 1; } + let mut busy: HashMap> = HashMap::new(); + for p in 0..np { + let list = &inc[start[p] as usize..start[p + 1] as usize]; + if list.len() <= BUSY_VERTEX { + continue; + } + watch.poll(0)?; + let mut clusters: Vec<(Vec3, Vec3)> = Vec::new(); + let mut last = u32::MAX; + for &g in list { + if g == last { + continue; + } + last = g; + let (u, f) = (unit[g as usize], face[g as usize]); + let near = clusters.iter().position(|c| c.0.dot(u) >= 0.9999); + match near { + Some(i) => clusters[i].1 += f, + None if clusters.len() < MAX_CLUSTERS => clusters.push((u, f)), + None => { + let best = (0..clusters.len()).max_by(|&a, &b| clusters[a].0.dot(u).total_cmp(&clusters[b].0.dot(u))).unwrap_or(0); + clusters[best].1 += f; + } + } + } + busy.insert(p, clusters); + } let mut map: HashMap<(u32, [u32; 3]), u32> = HashMap::new(); let mut order: Vec = Vec::new(); let mut normals: Vec = Vec::new(); @@ -462,14 +492,22 @@ fn smooth_normals(m: &mut RawMesh, cos_limit: f32, watch: &Watch) -> Result<()> let t = k / 3; let p = pid[v as usize] as usize; let mut sum = Vec3::ZERO; - let mut last = u32::MAX; - for &g in &inc[start[p] as usize..start[p + 1] as usize] { - if g == last { - continue; + if let Some(clusters) = busy.get(&p) { + for c in clusters { + if unit[t].dot(c.0) >= cos_limit { + sum += c.1; + } } - last = g; - if unit[t].dot(unit[g as usize]) >= cos_limit { - sum += face[g as usize]; + } else { + let mut last = u32::MAX; + for &g in &inc[start[p] as usize..start[p + 1] as usize] { + if g == last { + continue; + } + last = g; + if unit[t].dot(unit[g as usize]) >= cos_limit { + sum += face[g as usize]; + } } } let n = sum.normalize_or(unit[t]); From 5956adf0076c5b6d3d893a4c1f2a0663271d0c2e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:37:54 -0500 Subject: [PATCH 059/494] feat(io): summarise a model file without importing it fsh_io::probe reads a file and returns a Probe (format, declared unit, the size guess with its confidence and candidates, declared up axis, bounds in file units, triangles drawn, mesh, node and material counts, warnings) for the import.probe command; STEP and IGES give the CAD worker note. Ran the check program on OBJ, 3MF, FBX, GLB, STL and STEP files: counts and bounds as expected, declared units reported and not guessed. --- native/crates/fsh-io/src/lib.rs | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index f87b4e24..c7ff0ada 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -218,6 +218,58 @@ pub fn read_any(path: &Path, watch: &Watch) -> Result { read_model(path, watch) } +/// What a model file holds, read without cleaning or touching any document (for `import.probe`). +#[derive(Clone, Debug, PartialEq)] +pub struct Probe { + /// Detected format. + pub format: ModelFormat, + /// Unit the file declares, if any. + pub units_declared: Option, + /// The size-based guess (always filled, so the window can offer it even when the file declares a unit). + pub units_guess: UnitGuess, + /// True when no unit is declared, so an import would use the guess. + pub unit_guessed: bool, + /// Up axis the file declares, if any. + pub up_axis: Option, + /// World bounds in file units and file axes. + pub bounds: fsh_core::Aabb, + /// Triangles drawn by the nodes (instanced meshes counted once per use). + pub triangles: usize, + /// Meshes in the file. + pub meshes: usize, + /// Nodes in the file. + pub nodes: usize, + /// Materials in the file. + pub materials: usize, + /// Reader warnings. + pub warnings: Vec, +} + +/// Reads a model file and summarises it; STEP and IGES answer that the CAD worker reads them. +pub fn probe(path: &Path, watch: &Watch) -> Result { + let bytes = std::fs::read(path)?; + let name = path.file_name().and_then(|n| n.to_str()).unwrap_or(""); + let format = detect_model(name, &bytes).ok_or_else(|| IoError::UnknownFormat(name.to_string()))?; + let mut raw = read_model_bytes(format, &bytes, &paths::stem(path), &Siblings::of(path), watch)?; + raw.add_nodes_for_loose_meshes(); + let bounds = world_bounds(&raw); + let triangles = raw.nodes.iter().flat_map(|n| n.meshes.iter()).filter_map(|&m| raw.meshes.get(m)).map(RawMesh::triangle_count).sum(); + let units_declared = raw.unit.filter(|u| *u != fsh_core::LengthUnit::Unspecified); + Ok(Probe { + format, + units_declared, + units_guess: guess_unit(bounds.diagonal().length()), + unit_guessed: units_declared.is_none(), + up_axis: raw.up_axis, + bounds, + triangles, + meshes: raw.meshes.len(), + nodes: raw.nodes.len(), + materials: raw.materials.len(), + warnings: raw.warnings, + }) +} + /// Reads, cleans and converts a model file into one `scene.import` command plus the clean-up report. pub fn import_file( path: &Path, From b7367c02443f8ff0cbb0066ab9ac353bad886f83 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:38:46 -0500 Subject: [PATCH 060/494] style(io): satisfy clippy in the clean-up pass and 3mf reader The per-mesh weld, normal and tangent loops walk meshes and tangents together instead of indexing, and the 3MF progress check uses is_multiple_of. Ran cargo clippy -p fsh-io --all-targets -D warnings (clean), a wasm32 check of fsh-io, and the check program over 84 corpus files. --- native/crates/fsh-io/src/clean.rs | 16 +++++++--------- native/crates/fsh-io/src/threemf.rs | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index 17b9a43d..caa1b1ca 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -150,31 +150,29 @@ pub fn clean(scene: &mut RawScene, opts: &CleanOptions, watch: &Watch) -> Result } let n = scene.meshes.len().max(1); if opts.weld { - for i in 0..scene.meshes.len() { + for (i, (m, t)) in scene.meshes.iter_mut().zip(tans.iter_mut()).enumerate() { watch.step(Stage::Welding, i as f32 / n as f32)?; - let (welded, unused) = weld(&mut scene.meshes[i], &mut tans[i], watch)?; + let (welded, unused) = weld(m, t, watch)?; rep.vertices_welded += welded; rep.unused_vertices_removed += unused; } } if opts.generate_normals { let cos = opts.smoothing_angle_deg.clamp(0.0, 180.0).to_radians().cos(); - for i in 0..scene.meshes.len() { + for (i, (m, t)) in scene.meshes.iter_mut().zip(tans.iter_mut()).enumerate() { watch.step(Stage::Normals, i as f32 / n as f32)?; - let m = &mut scene.meshes[i]; if m.normals.is_empty() && !m.indices.is_empty() { smooth_normals(m, cos, watch)?; - tans[i].clear(); + t.clear(); rep.meshes_given_normals += 1; } } } if opts.generate_tangents { - for i in 0..scene.meshes.len() { + for (i, (m, t)) in scene.meshes.iter_mut().zip(tans.iter_mut()).enumerate() { watch.step(Stage::Tangents, i as f32 / n as f32)?; - let m = &mut scene.meshes[i]; - if tans[i].is_empty() && !m.uvs.is_empty() && !m.normals.is_empty() && !m.indices.is_empty() { - tans[i] = mikktspace(m); + if t.is_empty() && !m.uvs.is_empty() && !m.normals.is_empty() && !m.indices.is_empty() { + *t = mikktspace(m); rep.meshes_given_tangents += 1; } } diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index b0e9517b..a804508c 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -625,7 +625,7 @@ impl Reader<'_, '_> { scene.warnings.push(format!("{name}: support geometry was skipped")); return Ok(()); } - if scene.nodes.len() % 256 == 0 { + if scene.nodes.len().is_multiple_of(256) { self.watch.step(Stage::Reading, 0.9)?; } let meshes = self.object_meshes(part, id, scene)?; From d3c2017c5d580a8eb125fc93003ed532ffcd2341 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:57:13 -0500 Subject: [PATCH 061/494] feat(backend): fetch the cad worker from its pinned published record The cad router downloads formai-binaries' occt-8.0.1 record, checks it against a pinned SHA-256, checks the platform archive against SHA256SUMS and every unpacked file against the record, then installs into the user cache. Ran its fetch for x86_64 Linux: 7061 files verified and installed. --- backend/app/routers/cad.py | 417 ++++++++++++++++++++++++++++++++++++- 1 file changed, 415 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/cad.py b/backend/app/routers/cad.py index 4553ffea..efa94860 100644 --- a/backend/app/routers/cad.py +++ b/backend/app/routers/cad.py @@ -1,5 +1,418 @@ """FormCAD's kernel worker: whether it is here, and fetching it from formai-binaries (0.5.0).""" -from fastapi import APIRouter +import hashlib +import json +import os +import platform +import shutil +import sys +import tarfile +import tempfile +import threading +import time +import urllib.error +import urllib.request +from pathlib import Path -router = APIRouter() +from fastapi import APIRouter, HTTPException, Request +from starlette.concurrency import run_in_threadpool + +from app import window_key + +PROGRAM = "formcad-kernel" +RELEASE = "8.0.1" +TAG = f"occt-{RELEASE}" +RECORD_NAME = "occt-licence.json" +RECORD_SHA256 = "78817041308252ee544019c8f73e9663db8249975e08a1a5dacb4a85eaa0b621" +SUMS_NAME = "SHA256SUMS" +PROTOCOL = 2 +BASE = "https://github.com/nodemode-dev/formai-binaries/releases/download" +AGENT = "formshot-cad-fetch" +CHUNK = 1 << 20 + +router = APIRouter(prefix="/api/cad", tags=["cad"]) + +_lock = threading.Lock() +_job = {"state": "idle", "stage": "", "fraction": 0.0, "message": "", "tag": TAG} + + +class FetchError(RuntimeError): + pass + + +def host_triple() -> str: + machine = platform.machine().lower() + arch = "aarch64" if machine in ("arm64", "aarch64") else "x86_64" if machine in ("x86_64", "amd64") else machine + if sys.platform == "darwin": + return f"{arch}-apple-darwin" + if sys.platform.startswith("win"): + return f"{arch}-pc-windows-msvc" + return f"{arch}-unknown-linux-gnu" + + +def exe_name() -> str: + return PROGRAM + (".exe" if sys.platform.startswith("win") else "") + + +def cache_dir() -> Path: + override = os.environ.get("FORMSHOT_CACHE", "").strip() + if override: + return Path(override).expanduser() + if sys.platform == "darwin": + return Path.home() / "Library" / "Caches" + if sys.platform.startswith("win"): + return Path(os.environ.get("LOCALAPPDATA") or Path.home() / "AppData" / "Local") + xdg = os.environ.get("XDG_CACHE_HOME", "").strip() + return Path(xdg) if xdg and Path(xdg).is_absolute() else Path.home() / ".cache" + + +def workers_dir() -> Path: + return cache_dir() / "formshot" / "workers" + + +def release_base() -> str: + return (os.environ.get("FORMSHOT_CAD_RELEASE_URL", "").strip() or f"{BASE}/{TAG}").rstrip("/") + + +def sha256_file(path: Path) -> str: + digest = hashlib.sha256() + with path.open("rb") as handle: + for block in iter(lambda: handle.read(CHUNK), b""): + digest.update(block) + return digest.hexdigest() + + +def download(url: str, target: Path | None, progress=None, timeout: float = 60.0) -> tuple[bytes | None, str]: + request = urllib.request.Request(url, headers={"User-Agent": AGENT}) + digest = hashlib.sha256() + held = bytearray() + try: + with urllib.request.urlopen(request, timeout=timeout) as response: + total = int(response.headers.get("content-length") or 0) + done = 0 + handle = target.open("wb") if target is not None else None + try: + while True: + block = response.read(CHUNK) + if not block: + break + digest.update(block) + done += len(block) + if handle is not None: + handle.write(block) + else: + held.extend(block) + if progress is not None: + progress(done, total) + finally: + if handle is not None: + handle.close() + except urllib.error.HTTPError as error: + raise FetchError(f"{url} answered {error.code}.") from None + except (urllib.error.URLError, OSError, ValueError) as error: + raise FetchError(f"{url} could not be downloaded ({getattr(error, 'reason', error)}).") from None + return (None if target is not None else bytes(held)), digest.hexdigest() + + +def record_cache() -> Path: + return workers_dir() / ".records" / f"{TAG}.json" + + +def parse_record(raw: bytes, where: str) -> dict: + found = hashlib.sha256(raw).hexdigest() + if found != RECORD_SHA256: + raise FetchError(f"The record from {where} does not match the SHA-256 this FormShot pins for {TAG}. Nothing was installed.") + try: + record = json.loads(raw.decode("utf-8")) + except (UnicodeDecodeError, ValueError): + raise FetchError(f"The record from {where} is not JSON.") from None + if not isinstance(record, dict) or record.get("program") != PROGRAM or str(record.get("release")) != RELEASE: + raise FetchError(f"The record from {where} is not the {PROGRAM} {RELEASE} record.") + return record + + +def load_record(allow_network: bool = True) -> dict: + local = os.environ.get("FORMSHOT_CAD_RECORD", "").strip() + if local: + try: + return parse_record(Path(local).read_bytes(), local) + except OSError as error: + raise FetchError(f"The record {local} could not be read ({error}).") from None + cached = record_cache() + if cached.is_file(): + try: + return parse_record(cached.read_bytes(), str(cached)) + except (OSError, FetchError): + pass + if not allow_network: + raise FetchError("The published record has not been downloaded yet.") + url = f"{release_base()}/{RECORD_NAME}" + raw, _ = download(url, None) + record = parse_record(raw or b"", url) + try: + cached.parent.mkdir(parents=True, exist_ok=True) + tmp = cached.with_suffix(".tmp") + tmp.write_bytes(raw or b"") + os.replace(tmp, cached) + except OSError: + pass + return record + + +def target_of(record: dict, triple: str) -> dict: + target = (record.get("targets") or {}).get(triple) + if not isinstance(target, dict) or not target.get("files") or not target.get("archive") or not target.get("folder"): + have = ", ".join(sorted((record.get("targets") or {}).keys())) or "none" + raise FetchError(f"The published record for {TAG} has no worker for this computer ({triple}); it has {have}. Nothing was downloaded.") + return target + + +def published(allow_network: bool = True) -> dict: + triple = host_triple() + out = {"tag": TAG, "release": RELEASE, "triple": triple, "source": release_base()} + try: + target = target_of(load_record(allow_network), triple) + except FetchError as error: + out.update(available=False, reason=str(error)) + return out + files = target.get("files") or [] + out.update( + available=True, + archive=target.get("archive"), + folder=target.get("folder"), + program=(target.get("programs") or [exe_name()])[0], + protocol=target.get("protocol"), + files=len(files), + bytes=sum(int(f.get("bytes") or 0) for f in files), + minimum_os=target.get("minimum_os"), + ) + return out + + +def archive_sha256(sums: bytes, archive: str) -> str: + want = None + record_line = None + for line in sums.decode("utf-8", "replace").splitlines(): + parts = line.strip().split() + if len(parts) != 2: + continue + digest, name = parts[0].lower(), parts[1].lstrip("*") + if name == archive: + want = digest + elif name == RECORD_NAME: + record_line = digest + if record_line != RECORD_SHA256: + raise FetchError(f"{SUMS_NAME} of {TAG} does not list the pinned record. Nothing was installed.") + if not want: + raise FetchError(f"{SUMS_NAME} of {TAG} does not list {archive}. Nothing was installed.") + return want + + +def inside(root: Path, path: Path) -> bool: + try: + path.resolve().relative_to(root.resolve()) + return True + except (OSError, ValueError): + return False + + +def verify_tree(root: Path, target: dict, progress=None) -> None: + files = target.get("files") or [] + expected = {} + for entry in files: + rel = str(entry.get("path") or "") + if not rel or rel.startswith("/") or ".." in Path(rel).parts: + raise FetchError(f"The record names an unsafe path {rel!r}. Nothing was installed.") + expected[rel] = entry + present = {p.relative_to(root).as_posix() for p in root.rglob("*") if p.is_file() or p.is_symlink()} + for rel in present: + if rel not in expected: + raise FetchError(f"{rel} is in the download but not in the record. Nothing was installed.") + for i, (rel, entry) in enumerate(expected.items()): + path = root / rel + if rel not in present or not path.is_file(): + raise FetchError(f"{rel} is missing from the download. Nothing was installed.") + link = entry.get("link") + if link: + if not path.is_symlink() or os.readlink(path) != link or not inside(root, path): + raise FetchError(f"{rel} is not the link the record describes. Nothing was installed.") + elif path.is_symlink(): + raise FetchError(f"{rel} is a link the record does not describe. Nothing was installed.") + if sha256_file(path) != str(entry.get("sha256") or "").lower(): + raise FetchError(f"{rel} does not match the SHA-256 in the record. Nothing was installed.") + if progress is not None and i % 50 == 0: + progress(i, len(expected)) + + +def install(report=print) -> Path: + triple = host_triple() + report("record", 0.0, f"Reading the published record for {TAG}.") + record = load_record() + target = target_of(record, triple) + if int(target.get("protocol") or 0) != PROTOCOL: + raise FetchError(f"The published worker speaks protocol {target.get('protocol')}; this FormShot speaks {PROTOCOL}. Nothing was installed.") + archive = str(target["archive"]) + folder = str(target["folder"]) + if "/" in archive or "/" in folder or folder in ("", ".", ".."): + raise FetchError("The record names an unsafe archive or folder. Nothing was installed.") + sums, _ = download(f"{release_base()}/{SUMS_NAME}", None) + want = archive_sha256(sums or b"", archive) + root = workers_dir() + root.mkdir(parents=True, exist_ok=True) + work = Path(tempfile.mkdtemp(prefix=".fetch-", dir=root)) + try: + bundle = work / archive + report("download", 0.0, f"Downloading {archive}.") + _, got = download(f"{release_base()}/{archive}", bundle, lambda done, total: report("download", done / total if total else 0.0, f"Downloading {archive}."), timeout=120.0) + if got != want: + raise FetchError(f"{archive} does not match its SHA-256 in {SUMS_NAME}. Nothing was installed.") + report("unpack", 0.0, "Unpacking.") + unpacked = work / "u" + unpacked.mkdir() + try: + with tarfile.open(bundle) as tar: + tar.extractall(unpacked, filter="data") + except (tarfile.TarError, OSError) as error: + raise FetchError(f"{archive} could not be unpacked ({error}). Nothing was installed.") from None + bundle.unlink() + tree = unpacked / folder + if not tree.is_dir(): + raise FetchError(f"{archive} does not hold the folder {folder}. Nothing was installed.") + report("verify", 0.0, "Checking every file against the record.") + verify_tree(tree, target, lambda i, n: report("verify", i / n if n else 1.0, "Checking every file against the record.")) + program = tree / str((target.get("programs") or [exe_name()])[0]) + if not program.is_file(): + raise FetchError(f"{program.name} is not in the download. Nothing was installed.") + if not sys.platform.startswith("win"): + program.chmod(0o755) + destination = root / TAG + old = None + if destination.exists(): + old = work / "old" + os.replace(destination, old) + os.replace(tree, destination) + finally: + shutil.rmtree(work, ignore_errors=True) + report("done", 1.0, f"{TAG} is installed in {destination}.") + return destination + + +def installed() -> list[dict]: + root = workers_dir() + out = [] + if root.is_dir(): + for folder in sorted(p for p in root.iterdir() if p.is_dir() and not p.name.startswith(".")): + program = folder / exe_name() + if program.is_file(): + out.append({"tag": folder.name, "path": str(program)}) + return out + + +def _set(state: str, stage: str, fraction: float, message: str) -> None: + with _lock: + _job.update(state=state, stage=stage, fraction=round(max(0.0, min(1.0, fraction)), 4), message=message, at=time.time()) + snapshot = dict(_job) + try: + from app.agent import events + + events.publish("cad.worker", **snapshot) + except Exception: + pass + + +def _run() -> None: + last = [0.0] + + def report(stage: str, fraction: float, message: str) -> None: + now = time.monotonic() + if stage in ("done", "record") or now - last[0] > 0.25 or fraction >= 1.0: + last[0] = now + _set("running" if stage != "done" else "done", stage, fraction, message) + + try: + install(report) + except FetchError as error: + _set("failed", "", 0.0, str(error)) + except Exception as error: + _set("failed", "", 0.0, f"The worker could not be installed ({error}). Nothing was installed.") + + +def engine_status() -> dict: + try: + from app.engine import EngineError, EngineUnavailable, engine + + try: + return engine.dispatch("cad.status", {}) + except (EngineError, EngineUnavailable) as error: + return {"available": False, "reason": f"The engine could not be asked ({error})."} + except Exception as error: + return {"available": False, "reason": f"The engine could not be asked ({error})."} + + +def status(allow_network: bool = True) -> dict: + with _lock: + job = dict(_job) + return { + "worker": engine_status(), + "published": published(allow_network), + "installed": installed(), + "cache": str(workers_dir()), + "fetch": job, + } + + +@router.get("/worker") +async def worker_status() -> dict: + return await run_in_threadpool(status) + + +@router.post("/worker/fetch") +async def worker_fetch(request: Request) -> dict: + window_key.require(request) + with _lock: + if _job["state"] == "running": + return {"started": False, "fetch": dict(_job)} + + def check() -> dict: + try: + return target_of(load_record(), host_triple()) + except FetchError as error: + raise HTTPException(409, str(error)) from None + + await run_in_threadpool(check) + with _lock: + if _job["state"] == "running": + return {"started": False, "fetch": dict(_job)} + _job.update(state="running", stage="record", fraction=0.0, message="Starting.") + threading.Thread(target=_run, name="cad-worker-fetch", daemon=True).start() + with _lock: + return {"started": True, "fetch": dict(_job)} + + +def main(argv: list[str]) -> int: + command = argv[0] if argv else "fetch" + if command == "status": + print(json.dumps({"published": published(), "installed": installed(), "cache": str(workers_dir())}, indent=2)) + return 0 + if command != "fetch": + print("usage: cad_worker [fetch|status]", file=sys.stderr) + return 2 + shown = {"stage": None, "tenth": -1} + + def report(stage: str, fraction: float, message: str) -> None: + tenth = int(fraction * 10) + if stage != shown["stage"] or tenth != shown["tenth"]: + shown.update(stage=stage, tenth=tenth) + print(f"[formshot] {stage:8} {fraction * 100:5.1f}% {message}", flush=True) + + try: + where = install(report) + except FetchError as error: + print(f"[formshot] error: {error}", file=sys.stderr) + return 1 + print(f"[formshot] worker ready: {where / exe_name()}") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) From 9be44fc6929e1d721e18cc2f0cde8f344dec7e7c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:57:13 -0500 Subject: [PATCH 062/494] feat(setup): add cad_worker to fetch the worker from the command line The script runs the service's fetch with the backend venv, or with a system Python that has FastAPI. Ran it with XDG_CACHE_HOME pointing at a scratch cache; the worker installed and answered hello. --- setup/cad_worker | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 setup/cad_worker diff --git a/setup/cad_worker b/setup/cad_worker new file mode 100755 index 00000000..5f89deb3 --- /dev/null +++ b/setup/cad_worker @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e +source "$(dirname "$0")/lib.sh" +cd "$FSH_ROOT/backend" 2>/dev/null || fsh_die "backend/ is missing" +if fsh_has_venv; then + fsh_venv + py=python +else + py="$(fsh_python)" || fsh_die "Python 3.12 or newer is required" + "$py" -c 'import fastapi, starlette' 2>/dev/null || fsh_die "backend venv missing, run ./formshot install" +fi +exec "$py" -m app.routers.cad "$@" From 9a757fdf1fa8ee343fd2cf076848935783553363 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:59:05 -0500 Subject: [PATCH 063/494] feat(cad): add the fsh-cad crate and find the cad worker New native crate with its error type and the worker search: FORMSHOT_CAD_WORKER, beside the running program, then the newest tag under the user cache folder with each platform's cache rules. cargo clippy -p fsh-cad -D warnings is clean. --- native/Cargo.toml | 2 + native/crates/fsh-cad/Cargo.toml | 11 +++ native/crates/fsh-cad/src/error.rs | 71 ++++++++++++++++ native/crates/fsh-cad/src/lib.rs | 9 ++ native/crates/fsh-cad/src/locate.rs | 123 ++++++++++++++++++++++++++++ 5 files changed, 216 insertions(+) create mode 100644 native/crates/fsh-cad/Cargo.toml create mode 100644 native/crates/fsh-cad/src/error.rs create mode 100644 native/crates/fsh-cad/src/lib.rs create mode 100644 native/crates/fsh-cad/src/locate.rs diff --git a/native/Cargo.toml b/native/Cargo.toml index 3602ad2c..eb2cf32c 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/fsh-accel", "crates/fsh-materials", "crates/fsh-io", + "crates/fsh-cad", "crates/fsh-format", "crates/fsh-render-cpu", "crates/fsh-render-gpu", @@ -20,6 +21,7 @@ default-members = [ "crates/fsh-accel", "crates/fsh-materials", "crates/fsh-io", + "crates/fsh-cad", "crates/fsh-format", "crates/fsh-render-cpu", "crates/fsh-render-gpu", diff --git a/native/crates/fsh-cad/Cargo.toml b/native/crates/fsh-cad/Cargo.toml new file mode 100644 index 00000000..4c1ac88d --- /dev/null +++ b/native/crates/fsh-cad/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fsh-cad" +version = "0.4.0" +edition = "2021" +license = "Apache-2.0" +publish = false + +[dependencies] +fsh-core = { path = "../fsh-core" } +fsh-io = { path = "../fsh-io" } +serde_json = "1" diff --git a/native/crates/fsh-cad/src/error.rs b/native/crates/fsh-cad/src/error.rs new file mode 100644 index 00000000..f8c2a517 --- /dev/null +++ b/native/crates/fsh-cad/src/error.rs @@ -0,0 +1,71 @@ +use fsh_io::IoError; +use std::fmt; + +/// Everything that can go wrong between FormShot and the CAD worker. +#[derive(Debug, Clone, PartialEq)] +pub enum CadError { + /// No worker program was found; the text says where FormShot looked. + Missing(String), + /// The worker could not be started. + Start(String), + /// The worker stopped while FormShot waited for an answer. + Exited(String), + /// The worker did not answer in time and was stopped. + Timeout(String), + /// The worker answered with something that is not the protocol. + Protocol(String), + /// The worker reported an error for a request. + Worker(String), + /// The file could not be used (wrong extension, unreadable, no geometry). + File(String), + /// The watch's cancel flag was raised; the worker was stopped. + Cancelled, +} + +impl CadError { + /// Stable snake_case code for scripting and the UI. + pub fn code(&self) -> &'static str { + match self { + CadError::Missing(_) => "cad_worker_missing", + CadError::Start(_) => "cad_worker_start", + CadError::Exited(_) => "cad_worker_exited", + CadError::Timeout(_) => "cad_worker_timeout", + CadError::Protocol(_) => "cad_worker_protocol", + CadError::Worker(_) => "cad_worker_error", + CadError::File(_) => "cad_file", + CadError::Cancelled => "cancelled", + } + } +} + +impl fmt::Display for CadError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + CadError::Missing(s) => write!(f, "the CAD worker is not installed: {s}"), + CadError::Start(s) => write!(f, "the CAD worker could not be started: {s}"), + CadError::Exited(s) => write!(f, "the CAD worker stopped: {s}"), + CadError::Timeout(s) => write!(f, "the CAD worker did not answer in time: {s}"), + CadError::Protocol(s) => write!(f, "the CAD worker answered outside its protocol: {s}"), + CadError::Worker(s) => write!(f, "the CAD worker reported: {s}"), + CadError::File(s) => write!(f, "{s}"), + CadError::Cancelled => write!(f, "cancelled"), + } + } +} + +impl std::error::Error for CadError {} + +impl From for IoError { + fn from(e: CadError) -> Self { + match e { + CadError::Cancelled => IoError::Cancelled, + CadError::Missing(_) => IoError::Unsupported(e.to_string()), + CadError::File(s) => IoError::InvalidData(s), + CadError::Worker(_) => IoError::Malformed(e.to_string()), + other => IoError::Io(other.to_string()), + } + } +} + +/// Result with a [`CadError`]. +pub type Result = std::result::Result; diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs new file mode 100644 index 00000000..0fe1dd85 --- /dev/null +++ b/native/crates/fsh-cad/src/lib.rs @@ -0,0 +1,9 @@ +//! FormShot's client for FormCAD's kernel worker: finds the worker, starts it as a child process, speaks its +//! JSON-lines protocol, opens STEP and IGES files, tessellates them and returns an `fsh_io::RawScene`. +//! Native only: the engine never downloads the worker, the service or `setup/cad_worker` does. + +mod error; +mod locate; + +pub use error::{CadError, Result}; +pub use locate::{cache_dir, installed, locate, workers_dir, Located, Origin, CACHE_ENV, PROGRAM, WORKER_ENV}; diff --git a/native/crates/fsh-cad/src/locate.rs b/native/crates/fsh-cad/src/locate.rs new file mode 100644 index 00000000..d0196ecc --- /dev/null +++ b/native/crates/fsh-cad/src/locate.rs @@ -0,0 +1,123 @@ +use crate::error::{CadError, Result}; +use std::ffi::OsString; +use std::path::{Path, PathBuf}; + +/// Environment variable naming a worker program (or a `.py` worker script) to use before any other. +pub const WORKER_ENV: &str = "FORMSHOT_CAD_WORKER"; +/// Environment variable replacing the platform's user cache folder. +pub const CACHE_ENV: &str = "FORMSHOT_CACHE"; +/// File name of the worker program on this platform. +pub const PROGRAM: &str = if cfg!(windows) { "formcad-kernel.exe" } else { "formcad-kernel" }; + +/// Where the worker was found. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Origin { + /// From `FORMSHOT_CAD_WORKER`. + Env, + /// Beside the running program. + App, + /// In the user cache folder, installed by the service or `setup/cad_worker`. + Cache, +} + +impl Origin { + /// Short name: env, app or cache. + pub fn as_str(self) -> &'static str { + match self { + Origin::Env => "env", + Origin::App => "app", + Origin::Cache => "cache", + } + } +} + +/// A worker that can be started. +#[derive(Clone, Debug, PartialEq)] +pub struct Located { + /// The program, or the script for a `.py` worker. + pub path: PathBuf, + /// Release tag, from the cache folder name (`occt-8.0.1`); none for the other origins. + pub tag: Option, + /// Where it was found. + pub origin: Origin, + /// Program and arguments that start it. + pub command: Vec, +} + +/// The platform's user cache folder (`FORMSHOT_CACHE` replaces it). +pub fn cache_dir() -> Option { + let env = |k: &str| std::env::var_os(k).filter(|v| !v.is_empty()).map(PathBuf::from); + if let Some(p) = env(CACHE_ENV) { + return Some(p); + } + let home = env("HOME").or_else(|| env("USERPROFILE")); + if cfg!(windows) { + return env("LOCALAPPDATA").or_else(|| home.map(|h| h.join("AppData").join("Local"))); + } + if cfg!(target_os = "macos") { + return home.map(|h| h.join("Library").join("Caches")); + } + env("XDG_CACHE_HOME").filter(|p| p.is_absolute()).or_else(|| home.map(|h| h.join(".cache"))) +} + +/// `/formshot/workers`, where installed workers live, one folder per release tag. +pub fn workers_dir() -> Option { + cache_dir().map(|c| c.join("formshot").join("workers")) +} + +fn tag_key(tag: &str) -> Vec { + tag.split(|c: char| !c.is_ascii_digit()).filter(|s| !s.is_empty()).map(|s| s.parse().unwrap_or(0)).collect() +} + +fn script_command(script: &Path) -> Vec { + let folder = script.parent().unwrap_or(Path::new(".")); + let venv = [folder.join("venv").join("bin").join("python"), folder.join("venv").join("Scripts").join("python.exe")]; + let python = venv.into_iter().find(|p| p.is_file()).map(PathBuf::into_os_string).unwrap_or_else(|| { + OsString::from(if cfg!(windows) { "python" } else { "python3" }) + }); + vec![python, script.as_os_str().to_owned()] +} + +fn from_file(path: PathBuf, origin: Origin, tag: Option) -> Located { + let is_script = path.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("py")); + let command = if is_script { script_command(&path) } else { vec![path.clone().into_os_string()] }; + Located { path, tag, origin, command } +} + +/// Installed tags in the cache folder, newest first. +pub fn installed() -> Vec<(String, PathBuf)> { + let Some(root) = workers_dir() else { return Vec::new() }; + let Ok(entries) = std::fs::read_dir(&root) else { return Vec::new() }; + let mut found: Vec<(String, PathBuf)> = entries + .filter_map(|e| e.ok()) + .filter_map(|e| { + let name = e.file_name().to_str()?.to_string(); + let program = e.path().join(PROGRAM); + (!name.starts_with('.') && program.is_file()).then_some((name, program)) + }) + .collect(); + found.sort_by(|a, b| tag_key(&b.0).cmp(&tag_key(&a.0)).then_with(|| b.0.cmp(&a.0))); + found +} + +/// Finds the worker: `FORMSHOT_CAD_WORKER`, then beside the running program, then the newest tag in the cache. +pub fn locate() -> Result { + if let Some(raw) = std::env::var_os(WORKER_ENV).filter(|v| !v.is_empty()) { + let path = PathBuf::from(&raw); + if path.is_file() { + return Ok(from_file(path, Origin::Env, None)); + } + return Err(CadError::Missing(format!("{WORKER_ENV} names {}, which is not a file", path.display()))); + } + let beside = std::env::current_exe().ok().and_then(|e| e.parent().map(|d| d.join(PROGRAM))); + if let Some(p) = beside.as_ref().filter(|p| p.is_file()) { + return Ok(from_file(p.clone(), Origin::App, None)); + } + if let Some((tag, program)) = installed().into_iter().next() { + return Ok(from_file(program, Origin::Cache, Some(tag))); + } + let cache = workers_dir().map(|d| d.display().to_string()).unwrap_or_else(|| "no user cache folder".into()); + Err(CadError::Missing(format!( + "no {PROGRAM} in {WORKER_ENV}, beside the app or in {cache}; fetch it with ./formshot cad fetch or from the window" + ))) +} From 7bc62360f64518d0cae3ae9093d88fc2f073edeb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:43 -0500 Subject: [PATCH 064/494] feat(cad): speak the worker's json-lines protocol Worker starts the child with piped stdin and stdout, waits for hello and checks protocol 2, matches replies by id, skips stray lines, caps a reply line at 256 MiB and kills the child on cancel, timeout or a broken pipe. Ran against the fetched occt-8.0.1 worker: hello in 1.9 s, unknown method and unknown shape came back as worker errors. --- native/crates/fsh-cad/src/client.rs | 226 ++++++++++++++++++++++++++++ native/crates/fsh-cad/src/lib.rs | 2 + 2 files changed, 228 insertions(+) create mode 100644 native/crates/fsh-cad/src/client.rs diff --git a/native/crates/fsh-cad/src/client.rs b/native/crates/fsh-cad/src/client.rs new file mode 100644 index 00000000..7a403a18 --- /dev/null +++ b/native/crates/fsh-cad/src/client.rs @@ -0,0 +1,226 @@ +use crate::error::{CadError, Result}; +use crate::locate::Located; +use fsh_io::Watch; +use serde_json::{json, Map, Value}; +use std::io::{BufRead, BufReader, Read, Write}; +use std::process::{Child, ChildStdin, Command, Stdio}; +use std::sync::mpsc::{self, Receiver, RecvTimeoutError}; +use std::thread; +use std::time::{Duration, Instant}; + +/// Protocol version this client speaks (the worker's `hello` reports it). +pub const PROTOCOL: u64 = 2; +/// Longest reply line accepted, in bytes. +pub const MAX_LINE: u64 = 256 << 20; +const POLL: Duration = Duration::from_millis(40); + +enum Line { + Text(Vec), + TooLong, + Closed(String), +} + +/// What the worker said to `hello`. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Hello { + /// OpenCascade version. + pub occt: String, + /// Protocol version (0 when the worker does not say). + pub protocol: u64, + /// Methods the worker answers. + pub methods: Vec, + /// The whole reply. + pub raw: Value, +} + +impl Hello { + /// True when the worker lists `method`. + pub fn has(&self, method: &str) -> bool { + self.methods.iter().any(|m| m == method) + } +} + +/// A running worker; dropping it asks the worker to stop and kills it if it does not. +pub struct Worker { + child: Child, + stdin: Option, + lines: Receiver, + next: u64, + hello: Hello, +} + +fn spawn_reader(out: impl Read + Send + 'static) -> Receiver { + let (tx, rx) = mpsc::channel(); + thread::Builder::new() + .name("cad-worker-reader".into()) + .spawn(move || { + let mut reader = BufReader::new(out); + loop { + let mut buf = Vec::new(); + match reader.by_ref().take(MAX_LINE + 1).read_until(b'\n', &mut buf) { + Ok(0) => { + let _ = tx.send(Line::Closed("its output ended".into())); + return; + } + Ok(_) if buf.len() as u64 > MAX_LINE => { + let _ = tx.send(Line::TooLong); + return; + } + Ok(_) => { + if tx.send(Line::Text(buf)).is_err() { + return; + } + } + Err(e) => { + let _ = tx.send(Line::Closed(e.to_string())); + return; + } + } + } + }) + .ok(); + rx +} + +impl Worker { + /// Starts the worker and waits for its `hello` (at most `timeout`), honouring the watch's cancel flag. + pub fn start(located: &Located, timeout: Duration, watch: Option<&Watch>) -> Result { + let (program, args) = located.command.split_first().ok_or_else(|| CadError::Start("empty command".into()))?; + let mut cmd = Command::new(program); + cmd.args(args).stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::null()); + if let Some(dir) = located.path.parent() { + cmd.current_dir(dir); + } + let mut child = cmd.spawn().map_err(|e| CadError::Start(format!("{}: {e}", located.path.display())))?; + let stdin = child.stdin.take(); + let Some(stdout) = child.stdout.take() else { + let _ = child.kill(); + let _ = child.wait(); + return Err(CadError::Start("no output pipe".into())); + }; + let lines = spawn_reader(stdout); + let mut worker = Worker { child, stdin, lines, next: 1, hello: Hello::default() }; + let raw = worker.call("hello", json!({}), timeout, watch)?; + let methods = raw + .get("methods") + .and_then(Value::as_array) + .map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect()) + .unwrap_or_default(); + let protocol = raw.get("protocol").and_then(Value::as_u64).unwrap_or(0); + let occt = raw.get("occt").and_then(Value::as_str).unwrap_or("unknown").to_string(); + if protocol != 0 && protocol != PROTOCOL { + return Err(CadError::Protocol(format!("it speaks protocol {protocol}, FormShot speaks {PROTOCOL}"))); + } + worker.hello = Hello { occt, protocol, methods, raw }; + Ok(worker) + } + + /// What `hello` answered. + pub fn hello(&self) -> &Hello { + &self.hello + } + + fn kill(&mut self) { + self.stdin = None; + let _ = self.child.kill(); + let _ = self.child.wait(); + } + + fn exit_note(&mut self) -> String { + match self.child.try_wait() { + Ok(Some(s)) => format!("exit status {s}"), + _ => "it closed its output".into(), + } + } + + /// Sends one request and waits for its answer; on cancel or timeout the worker is killed. + pub fn call(&mut self, method: &str, params: Value, timeout: Duration, watch: Option<&Watch>) -> Result { + let id = self.next; + self.next += 1; + let mut line = serde_json::to_vec(&json!({"id": id, "method": method, "params": params})) + .map_err(|e| CadError::Protocol(format!("request could not be encoded: {e}")))?; + line.push(b'\n'); + let sent = match self.stdin.as_mut() { + Some(w) => w.write_all(&line).and_then(|_| w.flush()), + None => Err(std::io::Error::other("the worker was stopped")), + }; + if let Err(e) = sent { + let note = self.exit_note(); + self.kill(); + return Err(CadError::Exited(format!("{method} could not be sent ({e}; {note})"))); + } + let deadline = Instant::now() + timeout; + loop { + if watch.is_some_and(Watch::is_cancelled) { + self.kill(); + return Err(CadError::Cancelled); + } + let now = Instant::now(); + if now >= deadline { + self.kill(); + return Err(CadError::Timeout(format!("{method} took longer than {} s; the worker was stopped", timeout.as_secs()))); + } + let text = match self.lines.recv_timeout(POLL.min(deadline - now)) { + Ok(Line::Text(t)) => t, + Ok(Line::TooLong) => { + self.kill(); + return Err(CadError::Protocol(format!("a reply to {method} is longer than {MAX_LINE} bytes"))); + } + Ok(Line::Closed(why)) => { + let note = self.exit_note(); + self.kill(); + return Err(CadError::Exited(format!("while answering {method} ({why}; {note})"))); + } + Err(RecvTimeoutError::Timeout) => continue, + Err(RecvTimeoutError::Disconnected) => { + let note = self.exit_note(); + self.kill(); + return Err(CadError::Exited(format!("while answering {method} ({note})"))); + } + }; + let Ok(Value::Object(reply)) = serde_json::from_slice::(&text) else { continue }; + if reply.get("id").and_then(Value::as_u64) != Some(id) { + continue; + } + return answer(method, reply); + } + } + + /// Asks the worker to stop, waits briefly, then kills it. + pub fn shutdown(mut self) { + let _ = self.call("shutdown", json!({}), Duration::from_secs(3), None); + self.stop_now(); + } + + fn stop_now(&mut self) { + self.stdin = None; + let until = Instant::now() + Duration::from_secs(2); + while Instant::now() < until { + if let Ok(Some(_)) = self.child.try_wait() { + return; + } + thread::sleep(Duration::from_millis(20)); + } + self.kill(); + } +} + +fn answer(method: &str, mut reply: Map) -> Result { + if let Some(err) = reply.get("error") { + let msg = err + .get("message") + .and_then(Value::as_str) + .map(str::to_string) + .unwrap_or_else(|| format!("{method} failed without a message")); + return Err(CadError::Worker(msg)); + } + reply.remove("result").ok_or_else(|| CadError::Protocol(format!("the reply to {method} has neither result nor error"))) +} + +impl Drop for Worker { + fn drop(&mut self) { + if matches!(self.child.try_wait(), Ok(None)) { + self.stop_now(); + } + } +} diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs index 0fe1dd85..2955a56c 100644 --- a/native/crates/fsh-cad/src/lib.rs +++ b/native/crates/fsh-cad/src/lib.rs @@ -2,8 +2,10 @@ //! JSON-lines protocol, opens STEP and IGES files, tessellates them and returns an `fsh_io::RawScene`. //! Native only: the engine never downloads the worker, the service or `setup/cad_worker` does. +mod client; mod error; mod locate; +pub use client::{Hello, Worker, MAX_LINE, PROTOCOL}; pub use error::{CadError, Result}; pub use locate::{cache_dir, installed, locate, workers_dir, Located, Origin, CACHE_ENV, PROGRAM, WORKER_ENV}; From 3ac72031856062e317e8298846800f4dec54fe20 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:01:38 -0500 Subject: [PATCH 065/494] feat(cad): read worker meshes and map quality presets to deflections The .mesh parser checks magic, version, length and CRC-32 and every offset before reading; Quality maps draft, medium, high, ultra or a custom chord and angle to linear and angular deflection relative to the model diagonal. Ran on a worker cylinder: 124, 248, 456 and 792 triangles from draft to ultra; a flipped byte, a truncated file and an empty file were refused by name. --- native/crates/fsh-cad/src/lib.rs | 3 + native/crates/fsh-cad/src/mesh.rs | 122 +++++++++++++++++++++++++++ native/crates/fsh-cad/src/quality.rs | 106 +++++++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 native/crates/fsh-cad/src/mesh.rs create mode 100644 native/crates/fsh-cad/src/quality.rs diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs index 2955a56c..c7947962 100644 --- a/native/crates/fsh-cad/src/lib.rs +++ b/native/crates/fsh-cad/src/lib.rs @@ -5,7 +5,10 @@ mod client; mod error; mod locate; +pub mod mesh; +mod quality; pub use client::{Hello, Worker, MAX_LINE, PROTOCOL}; pub use error::{CadError, Result}; +pub use quality::{Quality, MIN_LINEAR_MM}; pub use locate::{cache_dir, installed, locate, workers_dir, Located, Origin, CACHE_ENV, PROGRAM, WORKER_ENV}; diff --git a/native/crates/fsh-cad/src/mesh.rs b/native/crates/fsh-cad/src/mesh.rs new file mode 100644 index 00000000..c089b19c --- /dev/null +++ b/native/crates/fsh-cad/src/mesh.rs @@ -0,0 +1,122 @@ +use crate::error::{CadError, Result}; + +/// `FCBM` in little-endian order, the first word of a worker `.mesh` file. +pub const MAGIC: u32 = 0x4D42_4346; +/// Layout version this parser reads. +pub const VERSION: u32 = 1; +/// Header size in bytes: 18 words, then the bounding box as six floats. +pub const HEADER: usize = 96; + +/// One B-rep face's run of triangles. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct FaceRun { + /// Face index in the shape's face map (0-based). + pub face: u32, + /// First triangle of the run. + pub first: u32, + /// Triangle count. + pub count: u32, + /// OpenCascade surface kind. + pub kind: u32, +} + +/// The triangles of one tessellated body, in millimetres, as the worker wrote them. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct BodyMesh { + /// Positions. + pub positions: Vec<[f32; 3]>, + /// Normals, one per position (zero where the worker had none). + pub normals: Vec<[f32; 3]>, + /// Triangle list. + pub indices: Vec, + /// Face index of each triangle. + pub tri_face: Vec, + /// Face runs. + pub faces: Vec, +} + +impl BodyMesh { + /// Number of triangles. + pub fn triangle_count(&self) -> usize { + self.indices.len() / 3 + } +} + +fn bad(msg: impl Into) -> CadError { + CadError::Protocol(format!("the tessellation file is damaged: {}", msg.into())) +} + +fn word(b: &[u8], i: usize) -> u32 { + u32::from_le_bytes([b[i * 4], b[i * 4 + 1], b[i * 4 + 2], b[i * 4 + 3]]) +} + +fn section<'a>(b: &'a [u8], offset: u32, count: usize, size: usize, what: &str) -> Result<&'a [u8]> { + let start = offset as usize; + let len = count.checked_mul(size).ok_or_else(|| bad(format!("{what} size overflows")))?; + let end = start.checked_add(len).ok_or_else(|| bad(format!("{what} size overflows")))?; + if count > 0 && (start < HEADER || !start.is_multiple_of(4) || end > b.len()) { + return Err(bad(format!("{what} lies outside the file"))); + } + Ok(if count == 0 { &[] } else { &b[start..end] }) +} + +fn floats3(s: &[u8]) -> Vec<[f32; 3]> { + s.as_chunks::<12>() + .0 + .iter() + .map(|c| { + let f = |k: usize| f32::from_le_bytes([c[k], c[k + 1], c[k + 2], c[k + 3]]); + [f(0), f(4), f(8)] + }) + .collect() +} + +fn words(s: &[u8]) -> Vec { + s.as_chunks::<4>().0.iter().map(|c| u32::from_le_bytes(*c)).collect() +} + +/// Parses a worker `.mesh` file; every count and offset is checked against the bytes before anything is read. +pub fn parse(b: &[u8]) -> Result { + if b.len() < HEADER { + return Err(bad("shorter than its header")); + } + if word(b, 0) != MAGIC { + return Err(bad("wrong magic")); + } + if word(b, 1) != VERSION { + return Err(bad(format!("layout version {} (this FormShot reads {VERSION})", word(b, 1)))); + } + if word(b, 16) as usize != b.len() { + return Err(bad(format!("header says {} bytes, file has {}", word(b, 16), b.len()))); + } + if fsh_io::deflate::crc32(&b[HEADER..]) != word(b, 17) { + return Err(bad("checksum mismatch")); + } + let nv = word(b, 2) as usize; + let nt = word(b, 3) as usize; + let nf = word(b, 4) as usize; + let off = |k: usize| word(b, 8 + k); + let positions = floats3(section(b, off(0), nv, 12, "positions")?); + let normals = floats3(section(b, off(1), nv, 12, "normals")?); + let indices = words(section(b, off(2), nt, 12, "indices")?); + let tri_face = words(section(b, off(3), nt, 4, "triangle faces")?); + let face_words = words(section(b, off(4), nf, 16, "face table")?); + if indices.iter().any(|&i| i as usize >= nv) { + return Err(bad("a triangle names a vertex that does not exist")); + } + if positions.iter().chain(normals.iter()).flatten().any(|v| !v.is_finite()) { + return Err(bad("a position or normal is not a finite number")); + } + let faces: Vec = face_words + .as_chunks::<4>() + .0 + .iter() + .map(|w| FaceRun { face: w[0], first: w[1], count: w[2], kind: w[3] }) + .collect(); + for f in &faces { + if (f.first as usize).saturating_add(f.count as usize) > nt { + return Err(bad("a face run passes the last triangle")); + } + } + Ok(BodyMesh { positions, normals, indices, tri_face, faces }) +} diff --git a/native/crates/fsh-cad/src/quality.rs b/native/crates/fsh-cad/src/quality.rs new file mode 100644 index 00000000..da115871 --- /dev/null +++ b/native/crates/fsh-cad/src/quality.rs @@ -0,0 +1,106 @@ +use serde_json::{json, Value}; + +/// Smallest chord deviation sent to the worker, in millimetres. +pub const MIN_LINEAR_MM: f64 = 1.0e-4; + +/// How finely CAD surfaces become triangles. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub enum Quality { + /// Quick look: coarse curves. + Draft, + /// The default. + #[default] + Medium, + /// Close-ups. + High, + /// Hero shots of curved parts. + Ultra, + /// `chord`: largest distance between a triangle and the surface, as a fraction of the model's + /// bounding-box diagonal; `angle`: largest angle between neighbouring triangle normals, in degrees. + Custom { chord: f64, angle: f64 }, +} + +impl Quality { + /// The named presets. + pub const PRESETS: [Quality; 4] = [Quality::Draft, Quality::Medium, Quality::High, Quality::Ultra]; + + /// Chord as a fraction of the diagonal and angle in degrees. + pub fn chord_angle(self) -> (f64, f64) { + match self { + Quality::Draft => (2.0e-3, 30.0), + Quality::Medium => (5.0e-4, 20.0), + Quality::High => (1.5e-4, 12.0), + Quality::Ultra => (5.0e-5, 6.0), + Quality::Custom { chord, angle } => (chord, angle), + } + } + + /// Worker deflections for a model whose bounding-box diagonal is `diagonal_mm`: linear in mm, angular in radians. + pub fn deflection(self, diagonal_mm: f64) -> (f64, f64) { + let (chord, angle) = self.chord_angle(); + let d = if diagonal_mm.is_finite() && diagonal_mm > 0.0 { diagonal_mm } else { 1.0 }; + ((chord * d).max(MIN_LINEAR_MM), angle.to_radians()) + } + + /// Preset name, or "custom". + pub fn name(self) -> &'static str { + match self { + Quality::Draft => "draft", + Quality::Medium => "medium", + Quality::High => "high", + Quality::Ultra => "ultra", + Quality::Custom { .. } => "custom", + } + } + + /// `"draft"` .. `"ultra"`, or `{chord, angle}` for a custom setting. + pub fn to_json(self) -> Value { + match self { + Quality::Custom { chord, angle } => json!({"chord": chord, "angle": angle}), + q => json!(q.name()), + } + } + + /// Compact text kept in node metadata: the preset name, or `chord,angle`. + pub fn to_text(self) -> String { + match self { + Quality::Custom { chord, angle } => format!("{chord},{angle}"), + q => q.name().to_string(), + } + } + + /// Reads [`Quality::to_text`] back. + pub fn from_text(s: &str) -> Option { + if let Some((c, a)) = s.split_once(',') { + return Quality::custom(c.trim().parse().ok()?, a.trim().parse().ok()?).ok(); + } + Quality::PRESETS.into_iter().find(|q| q.name() == s.trim().to_ascii_lowercase()) + } + + /// A checked custom quality: chord in (0, 0.1], angle in [1, 90] degrees. + pub fn custom(chord: f64, angle: f64) -> Result { + if !(chord.is_finite() && chord > 0.0 && chord <= 0.1) { + return Err(format!("chord {chord} must be above 0 and at most 0.1 (a fraction of the model's diagonal)")); + } + if !(angle.is_finite() && (1.0..=90.0).contains(&angle)) { + return Err(format!("angle {angle} must be 1 to 90 degrees")); + } + Ok(Quality::Custom { chord, angle }) + } + + /// Parses `"draft"`, `"medium"`, `"high"`, `"ultra"` or `{chord, angle}`; null means the default. + pub fn from_json(v: &Value) -> Result { + match v { + Value::Null => Ok(Quality::default()), + Value::String(s) => Quality::PRESETS + .into_iter() + .find(|q| q.name() == s.trim().to_ascii_lowercase()) + .ok_or_else(|| format!("cad_quality {s:?} is not draft, medium, high, ultra or {{chord, angle}}")), + Value::Object(o) => { + let num = |k: &str| o.get(k).and_then(Value::as_f64).ok_or_else(|| format!("cad_quality needs a number {k}")); + Quality::custom(num("chord")?, num("angle")?) + } + other => Err(format!("cad_quality {other} is not draft, medium, high, ultra or {{chord, angle}}")), + } + } +} From 5032e258bca453e62087d59dbf5d5917e353e42b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:47 -0500 Subject: [PATCH 066/494] feat(cad): open step and iges into a raw scene read() starts the worker, opens the file with xde_read (open_step or open_iges on older workers), tessellates every body at deflections taken from the quality and the model diagonal, and builds a Z-up metre RawScene with assembly groups, body names, one material per linear colour and shared meshes for instances whose tessellations map by one affine transform. Ran on worker-written samples: a STEP gearbox gave 11 nodes, 4 colours and 4 bolts on one mesh, 1802 to 53090 triangles from draft to ultra; the IGES copy gave 8 flat bodies. --- native/crates/fsh-cad/src/lib.rs | 2 + native/crates/fsh-cad/src/read.rs | 585 ++++++++++++++++++++++++++++++ 2 files changed, 587 insertions(+) create mode 100644 native/crates/fsh-cad/src/read.rs diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs index c7947962..197c01f1 100644 --- a/native/crates/fsh-cad/src/lib.rs +++ b/native/crates/fsh-cad/src/lib.rs @@ -7,8 +7,10 @@ mod error; mod locate; pub mod mesh; mod quality; +mod read; pub use client::{Hello, Worker, MAX_LINE, PROTOCOL}; pub use error::{CadError, Result}; pub use quality::{Quality, MIN_LINEAR_MM}; +pub use read::{is_cad_path, read, CadFormat, CadRead, MeshTag, ReadOptions, TIMEOUT_ENV}; pub use locate::{cache_dir, installed, locate, workers_dir, Located, Origin, CACHE_ENV, PROGRAM, WORKER_ENV}; diff --git a/native/crates/fsh-cad/src/read.rs b/native/crates/fsh-cad/src/read.rs new file mode 100644 index 00000000..38e3b9e1 --- /dev/null +++ b/native/crates/fsh-cad/src/read.rs @@ -0,0 +1,585 @@ +use crate::client::Worker; +use crate::error::{CadError, Result}; +use crate::locate::{locate, Located}; +use crate::mesh::{self, BodyMesh}; +use crate::quality::Quality; +use fsh_core::{LengthUnit, Mat4, Vec3}; +use fsh_io::{RawMaterial, RawMesh, RawNode, RawScene, Stage, UpAxis, Watch}; +use serde_json::{json, Value}; +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::time::Duration; + +/// Environment variable giving the per-request timeout in seconds. +pub const TIMEOUT_ENV: &str = "FORMSHOT_CAD_TIMEOUT"; +const MM: f64 = 0.001; +const RETRIES: u32 = 2; +const MAX_BODIES: usize = 5000; + +/// CAD exchange formats the worker opens. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum CadFormat { + /// ISO 10303-21 (STEP). + Step, + /// IGES 5.x. + Iges, +} + +impl CadFormat { + /// Lower-case extension the worker accepts. + pub fn extension(self) -> &'static str { + match self { + CadFormat::Step => "step", + CadFormat::Iges => "iges", + } + } + + /// Format named by a file extension (step, stp, iges, igs). + pub fn from_extension(ext: &str) -> Option { + match ext.trim_start_matches('.').to_ascii_lowercase().as_str() { + "step" | "stp" => Some(CadFormat::Step), + "iges" | "igs" => Some(CadFormat::Iges), + _ => None, + } + } + + /// Format of a file: its extension, else its first bytes. + pub fn detect(path: &Path, head: &[u8]) -> Option { + if let Some(f) = path.extension().and_then(|e| e.to_str()).and_then(CadFormat::from_extension) { + return Some(f); + } + let start = head.iter().position(|b| !b.is_ascii_whitespace()).map(|i| &head[i..]).unwrap_or(&[]); + if start.starts_with(b"ISO-10303-21") { + return Some(CadFormat::Step); + } + let first = head.split(|&b| b == b'\n').next().unwrap_or(&[]); + let first = first.strip_suffix(b"\r").unwrap_or(first); + (first.len() == 80 && first[72] == b'S').then_some(CadFormat::Iges) + } +} + +/// True when the path's extension is one of the CAD formats. +pub fn is_cad_path(path: &Path) -> bool { + path.extension().and_then(|e| e.to_str()).and_then(CadFormat::from_extension).is_some() +} + +/// How to read a CAD file. +#[derive(Clone, Debug)] +pub struct ReadOptions { + /// Tessellation quality. + pub quality: Quality, + /// Longest wait for one worker answer (the open, or one body's tessellation). + pub timeout: Duration, + /// Longest wait for the worker to start and say hello. + pub hello_timeout: Duration, + /// Worker to use; found with [`locate`] when absent. + pub worker: Option, +} + +impl Default for ReadOptions { + fn default() -> Self { + let secs = std::env::var(TIMEOUT_ENV).ok().and_then(|s| s.trim().parse::().ok()).filter(|s| *s > 0).unwrap_or(600); + Self { quality: Quality::default(), timeout: Duration::from_secs(secs), hello_timeout: Duration::from_secs(90), worker: None } + } +} + +/// Which body and colour slot a raw mesh came from; stable for the same file and worker, whatever the quality. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct MeshTag { + /// Body index in the worker's reading order. + pub body: usize, + /// Colour slot within the body (0 is the body colour; later slots are face colours). + pub slot: usize, +} + +/// A CAD file read into a raw scene, with what the reader decided. +#[derive(Clone, Debug)] +pub struct CadRead { + /// The scene: Z up, metres, one node per body under groups for its assembly path. + pub scene: RawScene, + /// One tag per mesh of `scene`. + pub tags: Vec, + /// The body each node shows, per node of `scene` (none for assembly groups). + pub node_body: Vec>, + /// Bodies the worker returned. + pub bodies: usize, + /// Bodies drawn with another body's mesh and a transform. + pub shared: usize, + /// Format read. + pub format: CadFormat, + /// Bounding-box diagonal of the model in millimetres. + pub diagonal_mm: f64, + /// Linear deflection asked of the worker, in millimetres. + pub linear_mm: f64, + /// Angular deflection asked of the worker, in radians. + pub angular_rad: f64, + /// Quality asked for. + pub quality: Quality, + /// Worker's OpenCascade version. + pub occt: String, + /// Worker release tag when it came from the cache. + pub tag: Option, +} + +#[derive(Clone, Debug, Default)] +struct Body { + id: String, + name: String, + rgb: Option<[f32; 3]>, + path: Vec, + def: String, + bbox: Option<[f64; 6]>, + face_rgb: Vec>, +} + +fn rgb_of(v: &Value) -> Option<[f32; 3]> { + let a = v.as_array()?; + if a.len() != 3 { + return None; + } + let mut out = [0.0f32; 3]; + for (o, x) in out.iter_mut().zip(a) { + let f = x.as_f64().filter(|f| f.is_finite())?; + *o = f.clamp(0.0, 1.0) as f32; + } + Some(out) +} + +fn bbox_of(v: &Value) -> Option<[f64; 6]> { + let a = v.as_array()?; + if a.len() != 6 { + return None; + } + let mut out = [0.0f64; 6]; + for (o, x) in out.iter_mut().zip(a) { + *o = x.as_f64().filter(|f| f.is_finite())?; + } + (out[0] <= out[3] && out[1] <= out[4] && out[2] <= out[5]).then_some(out) +} + +fn text(v: Option<&Value>) -> String { + v.and_then(Value::as_str).map(|s| s.chars().filter(|c| !c.is_control()).take(256).collect()).unwrap_or_default() +} + +fn parse_bodies(reply: &Value) -> Result> { + let list = reply + .get("bodies") + .and_then(Value::as_array) + .ok_or_else(|| CadError::Protocol("the open reply has no bodies list".into()))?; + let mut out = Vec::with_capacity(list.len().min(MAX_BODIES)); + for (i, b) in list.iter().take(MAX_BODIES).enumerate() { + let id = b.get("id").and_then(Value::as_str).filter(|s| !s.is_empty() && s.len() < 64); + let id = id.ok_or_else(|| CadError::Protocol(format!("body {i} has no shape id")))?.to_string(); + out.push(Body { + id, + name: text(b.get("name")), + rgb: b.get("rgb").and_then(rgb_of), + path: b + .get("path") + .and_then(Value::as_array) + .map(|a| a.iter().take(64).map(|s| text(Some(s))).filter(|s| !s.is_empty()).collect()) + .unwrap_or_default(), + def: text(b.get("def")), + bbox: b.get("summary").and_then(|s| s.get("bbox")).and_then(bbox_of), + face_rgb: b + .get("face_rgb") + .and_then(Value::as_array) + .map(|a| a.iter().take(1 << 20).map(rgb_of).collect()) + .unwrap_or_default(), + }); + } + if out.is_empty() { + return Err(CadError::File("the file holds no solids or surfaces".into())); + } + Ok(out) +} + +struct TempDir(PathBuf); + +impl TempDir { + fn new() -> Result { + static COUNTER: AtomicU64 = AtomicU64::new(0); + let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map(|d| d.as_nanos()).unwrap_or(0); + let dir = std::env::temp_dir().join(format!( + "formshot-cad-{}-{nanos}-{}", + std::process::id(), + COUNTER.fetch_add(1, Ordering::Relaxed) + )); + std::fs::create_dir_all(&dir).map_err(|e| CadError::File(format!("no scratch folder for the worker: {e}")))?; + Ok(TempDir(dir)) + } +} + +impl Drop for TempDir { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } +} + +fn srgb_hex(c: [f32; 3]) -> String { + let enc = |v: f32| { + let v = v.clamp(0.0, 1.0); + let s = if v <= 0.003_130_8 { 12.92 * v } else { 1.055 * v.powf(1.0 / 2.4) - 0.055 }; + (s * 255.0).round().clamp(0.0, 255.0) as u8 + }; + format!("#{:02X}{:02X}{:02X}", enc(c[0]), enc(c[1]), enc(c[2])) +} + +fn colour_key(c: [f32; 3]) -> [i32; 3] { + c.map(|v| (v * 10000.0).round() as i32) +} + +type M3 = [[f64; 3]; 3]; + +fn sub(a: [f64; 3], b: [f64; 3]) -> [f64; 3] { + [a[0] - b[0], a[1] - b[1], a[2] - b[2]] +} + +fn cross(a: [f64; 3], b: [f64; 3]) -> [f64; 3] { + [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] +} + +fn dot(a: [f64; 3], b: [f64; 3]) -> f64 { + a[0] * b[0] + a[1] * b[1] + a[2] * b[2] +} + +fn len(a: [f64; 3]) -> f64 { + dot(a, a).sqrt() +} + +fn cols(a: [f64; 3], b: [f64; 3], c: [f64; 3]) -> M3 { + [[a[0], b[0], c[0]], [a[1], b[1], c[1]], [a[2], b[2], c[2]]] +} + +fn inverse3(m: &M3) -> Option { + let det = m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); + if !det.is_finite() || det.abs() < 1e-300 { + return None; + } + let mut inv = [[0.0; 3]; 3]; + for (r, row) in inv.iter_mut().enumerate() { + for (c, v) in row.iter_mut().enumerate() { + let (r1, r2) = ((c + 1) % 3, (c + 2) % 3); + let (c1, c2) = ((r + 1) % 3, (r + 2) % 3); + *v = (m[r1][c1] * m[r2][c2] - m[r1][c2] * m[r2][c1]) / det; + } + } + Some(inv) +} + +fn mul3(a: &M3, b: &M3) -> M3 { + let mut o = [[0.0; 3]; 3]; + for (r, row) in o.iter_mut().enumerate() { + for (c, v) in row.iter_mut().enumerate() { + *v = (0..3).map(|k| a[r][k] * b[k][c]).sum(); + } + } + o +} + +fn p64(p: [f32; 3]) -> [f64; 3] { + [p[0] as f64, p[1] as f64, p[2] as f64] +} + +fn farthest(points: &[[f32; 3]], score: impl Fn([f64; 3]) -> f64) -> usize { + let mut best = (0usize, -1.0f64); + for (i, p) in points.iter().enumerate() { + let s = score(p64(*p)); + if s > best.1 { + best = (i, s); + } + } + best.0 +} + +fn frame(points: &[[f32; 3]], idx: [usize; 3], scale: f64) -> Option<(M3, [f64; 3])> { + let p0 = p64(*points.get(idx[0])?); + let e1 = sub(p64(*points.get(idx[1])?), p0); + let e2 = sub(p64(*points.get(idx[2])?), p0); + let n = cross(e1, e2); + let ln = len(n); + if ln <= 0.0 { + return None; + } + let e3 = n.map(|v| v / ln * scale); + Some((cols(e1, e2, e3), p0)) +} + +fn relative_transform(owner: &BodyMesh, other: &BodyMesh, tol: f64) -> Option<(M3, [f64; 3])> { + if owner.positions.len() != other.positions.len() || owner.indices != other.indices || owner.positions.len() < 3 { + return None; + } + let pts = &owner.positions; + let p0 = p64(pts[0]); + let i1 = farthest(pts, |p| len(sub(p, p0))); + let a = sub(p64(pts[i1]), p0); + let i2 = farthest(pts, |p| len(cross(a, sub(p, p0)))); + let scale = len(a).max(1e-9); + let (e, o) = frame(pts, [0, i1, i2], scale)?; + let (f, q) = frame(&other.positions, [0, i1, i2], scale)?; + let a3 = mul3(&f, &inverse3(&e)?); + let t = sub(q, [dot(a3[0], o), dot(a3[1], o), dot(a3[2], o)]); + for (p, q) in owner.positions.iter().zip(&other.positions) { + let p = p64(*p); + let mapped = [dot(a3[0], p) + t[0], dot(a3[1], p) + t[1], dot(a3[2], p) + t[2]]; + if len(sub(mapped, p64(*q))) > tol { + return None; + } + } + Some((a3, t)) +} + +fn mat_metres(a: &M3, t: [f64; 3]) -> Mat4 { + Mat4::from_rows([ + [a[0][0] as f32, a[0][1] as f32, a[0][2] as f32, (t[0] * MM) as f32], + [a[1][0] as f32, a[1][1] as f32, a[1][2] as f32, (t[1] * MM) as f32], + [a[2][0] as f32, a[2][1] as f32, a[2][2] as f32, (t[2] * MM) as f32], + [0.0, 0.0, 0.0, 1.0], + ]) +} + +fn slot_meshes(body: &Body, m: &BodyMesh) -> Vec<(Option<[f32; 3]>, Vec)> { + if body.face_rgb.iter().all(Option::is_none) { + return vec![(body.rgb, (0..m.triangle_count()).collect())]; + } + let mut slots: Vec<(Option<[f32; 3]>, Vec)> = vec![(body.rgb, Vec::new())]; + let mut by_key: HashMap<[i32; 3], usize> = HashMap::new(); + for t in 0..m.triangle_count() { + let face = m.tri_face.get(t).copied().unwrap_or(0) as usize; + match body.face_rgb.get(face).copied().flatten() { + Some(c) if body.rgb.map(colour_key) != Some(colour_key(c)) => { + let s = *by_key.entry(colour_key(c)).or_insert_with(|| { + slots.push((Some(c), Vec::new())); + slots.len() - 1 + }); + slots[s].1.push(t); + } + _ => slots[0].1.push(t), + } + } + slots +} + +fn raw_mesh(name: String, m: &BodyMesh, tris: &[usize]) -> RawMesh { + let mut remap: HashMap = HashMap::new(); + let mut positions = Vec::new(); + let mut normals = Vec::new(); + let mut indices = Vec::with_capacity(tris.len() * 3); + let mut normals_ok = true; + for &t in tris { + for k in 0..3 { + let v = m.indices[t * 3 + k]; + let id = *remap.entry(v).or_insert_with(|| { + let p = m.positions[v as usize]; + positions.push(Vec3::new((p[0] as f64 * MM) as f32, (p[1] as f64 * MM) as f32, (p[2] as f64 * MM) as f32)); + let n = m.normals.get(v as usize).copied().unwrap_or([0.0; 3]); + let n = Vec3::new(n[0], n[1], n[2]); + let l = n.length(); + if l.is_finite() && l > 1e-6 { + normals.push(n / l); + } else { + normals_ok = false; + normals.push(Vec3::Y); + } + (positions.len() - 1) as u32 + }); + indices.push(id); + } + } + RawMesh { name, positions, normals: if normals_ok { normals } else { Vec::new() }, indices, ..Default::default() } +} + +fn worker_path(path: &Path, format: CadFormat, scratch: &TempDir) -> Result { + let abs = path.canonicalize().map_err(|e| CadError::File(format!("{} cannot be opened: {e}", path.display())))?; + if is_cad_path(&abs) { + return Ok(abs); + } + let copy = scratch.0.join(format!("source.{}", format.extension())); + std::fs::copy(&abs, ©).map_err(|e| CadError::File(format!("{} cannot be copied for the worker: {e}", abs.display())))?; + Ok(copy) +} + +fn open(worker: &mut Worker, path: &Path, format: CadFormat, opts: &ReadOptions, watch: &Watch) -> Result { + let p = path.to_string_lossy().to_string(); + if worker.hello().has("xde_read") || worker.hello().methods.is_empty() { + match worker.call("xde_read", json!({"path": p, "unit": "mm", "pmi": false}), opts.timeout, Some(watch)) { + Err(CadError::Worker(m)) if m.starts_with("Unknown method") => {} + other => return other, + } + } + let method = match format { + CadFormat::Step => "open_step", + CadFormat::Iges => "open_iges", + }; + worker.call(method, json!({"path": p}), opts.timeout, Some(watch)) +} + +fn tessellate(worker: &mut Worker, id: &str, linear: f64, angular: f64, out: &Path, opts: &ReadOptions, watch: &Watch) -> Result<(BodyMesh, f64)> { + let mut lin = linear; + for attempt in 0..=RETRIES { + let params = json!({"id": id, "linear": lin, "angular": angular, "path": out.to_string_lossy()}); + match worker.call("tessellate", params, opts.timeout, Some(watch)) { + Ok(_) => { + let bytes = std::fs::read(out).map_err(|e| CadError::Protocol(format!("the worker's tessellation file is missing: {e}")))?; + let _ = std::fs::remove_file(out); + return Ok((mesh::parse(&bytes)?, lin)); + } + Err(CadError::Worker(m)) if m.contains("too fine") && attempt < RETRIES => lin *= 4.0, + Err(e) => return Err(e), + } + } + Err(CadError::Worker("the tessellation stayed too fine".into())) +} + +/// Opens a STEP or IGES file with the worker and tessellates every body at the asked quality. +pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { + watch.step(Stage::Reading, 0.0).map_err(|_| CadError::Cancelled)?; + let mut head = vec![0u8; 512]; + let n = std::fs::File::open(path) + .and_then(|mut f| std::io::Read::read(&mut f, &mut head)) + .map_err(|e| CadError::File(format!("{} cannot be read: {e}", path.display())))?; + head.truncate(n); + let format = CadFormat::detect(path, &head).ok_or_else(|| CadError::File(format!("{} is not a STEP or IGES file", path.display())))?; + let located = match &opts.worker { + Some(l) => l.clone(), + None => locate()?, + }; + let scratch = TempDir::new()?; + let source = worker_path(path, format, &scratch)?; + let mut worker = Worker::start(&located, opts.hello_timeout, Some(watch))?; + let occt = worker.hello().occt.clone(); + watch.step(Stage::Reading, 0.02).map_err(|_| CadError::Cancelled)?; + let reply = open(&mut worker, &source, format, opts, watch)?; + let bodies = parse_bodies(&reply)?; + let mut warnings: Vec = Vec::new(); + if let Some(list) = reply.get("untranslated").and_then(Value::as_array).filter(|a| !a.is_empty()) { + let names: Vec = list.iter().take(8).map(|v| text(Some(v))).collect(); + warnings.push(format!("{} entities had no geometry the worker could translate ({})", list.len(), names.join(", "))); + } + let mut lo = [f64::INFINITY; 3]; + let mut hi = [f64::NEG_INFINITY; 3]; + for b in bodies.iter().filter_map(|b| b.bbox) { + for k in 0..3 { + lo[k] = lo[k].min(b[k]); + hi[k] = hi[k].max(b[k + 3]); + } + } + let diagonal_mm = len(sub(hi, lo)); + if !diagonal_mm.is_finite() || diagonal_mm <= 0.0 { + return Err(CadError::File("the model has no usable size (check the length unit in the file)".into())); + } + let (linear, angular) = opts.quality.deflection(diagonal_mm); + let stem = path.file_stem().and_then(|s| s.to_str()).unwrap_or("CAD").to_string(); + let mut scene = RawScene::named(stem.clone()); + scene.unit = Some(LengthUnit::Metre); + scene.up_axis = Some(UpAxis::Z); + let mut tags = Vec::new(); + let mut node_body = Vec::new(); + let mut materials: HashMap<[i32; 3], usize> = HashMap::new(); + let mut groups: HashMap, usize> = HashMap::new(); + let mut owners: HashMap)>> = HashMap::new(); + let mut shared = 0usize; + let mut coarsened = 0usize; + let total = bodies.len(); + for (bi, body) in bodies.iter().enumerate() { + watch.step(Stage::Reading, 0.1 + 0.9 * bi as f32 / total as f32).map_err(|_| CadError::Cancelled)?; + let out = scratch.0.join(format!("b{bi}.mesh")); + let (m, used) = tessellate(&mut worker, &body.id, linear, angular, &out, opts, watch)?; + if used > linear { + coarsened += 1; + } + let mut parent = None; + for depth in 1..=body.path.len() { + let key = body.path[..depth].to_vec(); + let idx = match groups.get(&key) { + Some(&g) => g, + None => { + scene.nodes.push(RawNode::new(key[depth - 1].clone(), parent, Vec::new())); + node_body.push(None); + groups.insert(key, scene.nodes.len() - 1); + scene.nodes.len() - 1 + } + }; + parent = Some(idx); + } + let name = if body.name.is_empty() { format!("{stem} {}", bi + 1) } else { body.name.clone() }; + let tol = (diagonal_mm * 1e-6).max(1e-6) + used * 1e-3; + let reuse = if body.def.is_empty() { + None + } else { + owners.get(&body.def).and_then(|list| { + list.iter().find_map(|(ob, om, meshes)| { + let same_colour = bodies[*ob].rgb.map(colour_key) == body.rgb.map(colour_key) && bodies[*ob].face_rgb == body.face_rgb; + if !same_colour { + return None; + } + relative_transform(om, &m, tol).map(|(a, t)| (meshes.clone(), mat_metres(&a, t))) + }) + }) + }; + let mut node = RawNode::new(name.clone(), parent, Vec::new()); + if let Some((meshes, xf)) = reuse { + node.meshes = meshes; + node.transform = xf; + shared += 1; + } else { + let slots = slot_meshes(body, &m); + let several = slots.iter().filter(|s| !s.1.is_empty()).count() > 1; + let mut ids = Vec::new(); + for (si, (colour, tris)) in slots.iter().enumerate() { + if tris.is_empty() { + continue; + } + let mesh_name = match (several, colour) { + (true, Some(c)) => format!("{name} {}", srgb_hex(*c)), + _ => name.clone(), + }; + let mut raw = raw_mesh(mesh_name, &m, tris); + if let Some(c) = colour { + let next = scene.materials.len(); + let mi = *materials.entry(colour_key(*c)).or_insert(next); + if mi == next { + scene.materials.push(RawMaterial { + name: format!("Colour {}", srgb_hex(*c)), + base_colour: *c, + roughness: 0.4, + ..RawMaterial::default() + }); + } + raw.material = Some(mi); + } + scene.meshes.push(raw); + tags.push(MeshTag { body: bi, slot: si }); + ids.push(scene.meshes.len() - 1); + } + node.meshes = ids.clone(); + if !body.def.is_empty() { + owners.entry(body.def.clone()).or_default().push((bi, m, ids)); + } + } + scene.nodes.push(node); + node_body.push(Some(bi)); + } + worker.shutdown(); + if coarsened > 0 { + warnings.push(format!("{coarsened} bodies were too fine at this quality and were tessellated coarser")); + } + scene.warnings = warnings; + watch.set(Stage::Reading, 1.0); + Ok(CadRead { + scene, + tags, + node_body, + bodies: total, + shared, + format, + diagonal_mm, + linear_mm: linear, + angular_rad: angular, + quality: opts.quality, + occt, + tag: located.tag.clone(), + }) +} From 8fee3470d415131cd9c260b234c00455b4c8df45 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:05:42 -0500 Subject: [PATCH 067/494] fix(cad): name the worker's exit status when its output ends The client now waits up to half a second for the child's status before reporting that the worker stopped. Ran a stand-in worker that exits with 3 during xde_read: the error reads exit status 3; stray lines, wrong ids, a damaged mesh, a missing result, a wrong protocol, a timeout and a cancel at 0.8 s were all refused by name. --- native/crates/fsh-cad/src/client.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-cad/src/client.rs b/native/crates/fsh-cad/src/client.rs index 7a403a18..4f75fbe5 100644 --- a/native/crates/fsh-cad/src/client.rs +++ b/native/crates/fsh-cad/src/client.rs @@ -127,9 +127,13 @@ impl Worker { } fn exit_note(&mut self) -> String { - match self.child.try_wait() { - Ok(Some(s)) => format!("exit status {s}"), - _ => "it closed its output".into(), + let until = Instant::now() + Duration::from_millis(500); + loop { + match self.child.try_wait() { + Ok(Some(s)) => return format!("{s}"), + Ok(None) if Instant::now() < until => thread::sleep(Duration::from_millis(10)), + _ => return "it closed its output".into(), + } } } From 5237b0825f0b3e4350b2ad32255c16fd303960be Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:07:36 -0500 Subject: [PATCH 068/494] feat(format): keep original cad files as sources members Project::keep_source stores a file of at most 64 MiB as sources/., listed in a manifest sources field only when present; loading checks the name, size and content hash. Ran against the base commit's writer: a project without sources saved byte-identical, base files and a saved file from another worktree resaved identically, a kept STEP round-tripped, and the 0.4.0 reader kept the member through its own resave. --- native/crates/fsh-format/src/lib.rs | 6 +- native/crates/fsh-format/src/project.rs | 101 +++++++++++++++++++++++- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/native/crates/fsh-format/src/lib.rs b/native/crates/fsh-format/src/lib.rs index c00be0cf..accc6a36 100644 --- a/native/crates/fsh-format/src/lib.rs +++ b/native/crates/fsh-format/src/lib.rs @@ -15,9 +15,9 @@ pub use error::{FormatError, Result}; pub use platform::{now_ms, process_id, set_wall_clock, HAS_FILE_SYSTEM}; pub use journal::{replay, replay_editor, Journal, JournalEntry, JournalHeader}; pub use project::{ - atomic_write, fingerprint, load_bytes, load_file, material_member, mesh_member, save_bytes, save_file, LoadReport, - Preserved, Project, SaveOptions, EMBED_SCHEME, EXTENSION, FORMAT_NAME, MANIFEST_MEMBER, PREVIEW_MEMBER, - PROJECT_FILE_NAME, SCENE_MEMBER, + atomic_write, fingerprint, load_bytes, load_file, material_member, mesh_member, save_bytes, save_file, source_member, + LoadReport, Preserved, Project, SaveOptions, EMBED_SCHEME, EXTENSION, FORMAT_NAME, MANIFEST_MEMBER, MAX_SOURCE_BYTES, + PREVIEW_MEMBER, PROJECT_FILE_NAME, SCENE_MEMBER, SOURCES_PREFIX, }; pub use session::{recover, RecoverableSession, Recovered, RecoveryStrategy, Session, SnapshotDone, SnapshotJob}; pub use version::{Migration, MigrationInput, Version, FORMAT_VERSION, MIGRATIONS}; diff --git a/native/crates/fsh-format/src/project.rs b/native/crates/fsh-format/src/project.rs index cdc2c557..032123fa 100644 --- a/native/crates/fsh-format/src/project.rs +++ b/native/crates/fsh-format/src/project.rs @@ -44,9 +44,41 @@ pub fn material_member(k: MaterialKey) -> String { format!("materials/{}.json", k.raw()) } -/// Content that a newer writer put in the file and this build does not understand; written back unchanged. +/// Largest original CAD file kept inside a project; larger sources are referenced by path. +pub const MAX_SOURCE_BYTES: usize = 64 << 20; +/// Folder of kept source files inside a project. +pub const SOURCES_PREFIX: &str = "sources/"; + +/// Member path a source file is kept under: `sources/.`. +pub fn source_member(bytes: &[u8], ext: &str) -> Option { + let ext = sanitize_ext(ext)?; + Some(format!("{SOURCES_PREFIX}{:016x}.{ext}", hash_bytes(bytes))) +} + +fn check_source_member(name: &str, data: &[u8]) -> core::result::Result<(), String> { + let rest = name.strip_prefix(SOURCES_PREFIX).ok_or("is not under sources/")?; + let (hash, ext) = rest.split_once('.').ok_or("has no extension")?; + if sanitize_ext(ext).as_deref() != Some(ext) { + return Err("has an invalid extension".into()); + } + if hash.len() != 16 || !hash.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()) { + return Err("is not named by a 16-digit lowercase hex hash".into()); + } + if data.len() > MAX_SOURCE_BYTES { + return Err(format!("holds {} bytes, more than the 64 MiB a kept source may have", data.len())); + } + if format!("{:016x}", hash_bytes(data)) != hash { + return Err("content does not match the hash in its name (the source file is damaged)".into()); + } + Ok(()) +} + +/// Content kept for the next save: what a newer writer put in the file and this build does not understand +/// (written back unchanged), and the original CAD files the document was imported from. #[derive(Clone, Debug, Default, PartialEq)] pub struct Preserved { + /// Kept source files by member path (`sources/.`), at most 64 MiB each. + pub sources: BTreeMap>, /// Unknown top-level fields of `manifest.json`. pub manifest_fields: Map, /// Unknown top-level fields of `scene.json`. @@ -138,6 +170,39 @@ impl Project { pub fn texture_bytes(&self, path: &str) -> Option<&[u8]> { path.strip_prefix(EMBED_SCHEME).and_then(|m| self.textures.get(m)).map(|v| v.as_slice()) } + + /// Keeps an original source file (a CAD model) by content hash and returns its reference + /// (`fshot:sources/.`); refuses files above [`MAX_SOURCE_BYTES`]. + pub fn keep_source(&mut self, bytes: Vec, ext: &str) -> Result { + if bytes.len() > MAX_SOURCE_BYTES { + return Err(FormatError::Document(format!("a kept source may hold at most 64 MiB; this one has {} bytes", bytes.len()))); + } + let name = source_member(&bytes, ext) + .ok_or_else(|| FormatError::Document(format!("source extension {ext:?} is not 1 to 8 letters or digits")))?; + self.preserved.sources.entry(name.clone()).or_insert(bytes); + Ok(format!("{EMBED_SCHEME}{name}")) + } + + /// Bytes of a kept source by its reference (`fshot:sources/...`) or member path. + pub fn source_bytes(&self, reference: &str) -> Option<&[u8]> { + let member = reference.strip_prefix(EMBED_SCHEME).unwrap_or(reference); + self.preserved.sources.get(member).map(|v| v.as_slice()) + } + + /// Drops kept sources that no node of `doc` names in its metadata; returns how many were dropped. + pub fn prune_sources(&mut self, doc: &Document) -> usize { + let used: BTreeSet = doc + .nodes() + .values() + .flat_map(|n| n.metadata.values()) + .filter_map(|v| v.strip_prefix(EMBED_SCHEME)) + .filter(|m| m.starts_with(SOURCES_PREFIX)) + .map(str::to_string) + .collect(); + let before = self.preserved.sources.len(); + self.preserved.sources.retain(|k, _| used.contains(k)); + before - self.preserved.sources.len() + } } fn keys_of(v: &T) -> BTreeSet { @@ -209,6 +274,15 @@ pub(crate) fn encode(project: &Project, opts: &SaveOptions, strict: bool) -> Res Value::Array(data.materials.keys().map(|k| Value::from(k.raw().to_string())).collect()), ); manifest.insert("textures".into(), Value::Array(embedded.iter().map(|m| Value::from(m.as_str())).collect())); + for (name, bytes) in &project.preserved.sources { + check_source_member(name, bytes).map_err(|r| FormatError::member(name, r))?; + } + if !project.preserved.sources.is_empty() { + manifest.insert( + "sources".into(), + Value::Array(project.preserved.sources.keys().map(|m| Value::from(m.as_str())).collect()), + ); + } manifest.insert( "preview".into(), if project.preview_png.is_some() { Value::from(PREVIEW_MEMBER) } else { Value::Null }, @@ -238,6 +312,9 @@ pub(crate) fn encode(project: &Project, opts: &SaveOptions, strict: bool) -> Res for m in &embedded { add(&mut z, m, &project.textures[m])?; } + for (name, bytes) in &project.preserved.sources { + add(&mut z, name, bytes)?; + } if let Some(p) = &project.preview_png { add(&mut z, PREVIEW_MEMBER, p)?; } @@ -394,6 +471,24 @@ pub(crate) fn decode(bytes: &[u8], strict: bool) -> Result<(Project, LoadReport) } Some(_) => return Err(FormatError::member(MANIFEST_MEMBER, "textures is not a list")), } + let mut sources = BTreeMap::new(); + match manifest_obj.get("sources") { + None | Some(Value::Null) => {} + Some(Value::Array(a)) => { + for s in a { + let name = s + .as_str() + .ok_or_else(|| FormatError::member(MANIFEST_MEMBER, "sources holds a value that is not a member path"))?; + let b = zip.read(name).ok_or_else(|| FormatError::member(name, "is listed in the manifest but missing"))?; + check_source_member(name, b).map_err(|r| FormatError::member(name, r))?; + if sources.insert(name.to_string(), b.to_vec()).is_some() { + return Err(FormatError::member(MANIFEST_MEMBER, format!("sources lists {name} twice"))); + } + expected.insert(name.to_string()); + } + } + Some(_) => return Err(FormatError::member(MANIFEST_MEMBER, "sources is not a list")), + } let preview_png = match manifest_obj.get("preview") { None | Some(Value::Null) => None, Some(Value::String(p)) if p == PREVIEW_MEMBER => { @@ -406,7 +501,7 @@ pub(crate) fn decode(bytes: &[u8], strict: bool) -> Result<(Project, LoadReport) } Some(_) => return Err(FormatError::member(MANIFEST_MEMBER, format!("preview must be null or \"{PREVIEW_MEMBER}\""))), }; - let mut preserved = Preserved::default(); + let mut preserved = Preserved { sources, ..Preserved::default() }; for e in zip.entries() { if e.is_dir || expected.contains(&e.name) { continue; @@ -430,7 +525,7 @@ pub(crate) fn decode(bytes: &[u8], strict: bool) -> Result<(Project, LoadReport) .unwrap_or("unknown") .to_string(); let manifest_known: BTreeSet<&str> = - ["format", "format_version", "writer", "scene", "meshes", "materials", "textures", "preview"].into(); + ["format", "format_version", "writer", "scene", "meshes", "materials", "textures", "sources", "preview"].into(); for (k, v) in object(MANIFEST_MEMBER, manifest_v)? { if !manifest_known.contains(k.as_str()) { warnings.push(format!("kept unknown manifest field {k}")); From 6d44174d2aed28d57983d1ef1fcfa1adb03e8137 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:26:35 -0500 Subject: [PATCH 069/494] feat(commands): import step and iges through the cad worker file.import sends .step, .stp, .iges and .igs to ext/cad.rs, which reads with cad_quality, cleans, adds one undo step, tags nodes with source.* and cad.* metadata and keeps the file as a sources member; cad.status reports the worker, and group command names now reach ext dispatch. Ran formshot-engine dispatch: cad.status with and without a worker, a STEP gearbox import of 11 nodes, undo to empty and redo, save, reopen and resave byte-identical with the source member equal to the STEP file. --- native/crates/fsh-commands/Cargo.toml | 1 + native/crates/fsh-commands/src/engine.rs | 3 + native/crates/fsh-commands/src/ext/cad.rs | 348 +++++++++++++++++++++- native/crates/fsh-commands/src/ext/mod.rs | 2 +- 4 files changed, 349 insertions(+), 5 deletions(-) diff --git a/native/crates/fsh-commands/Cargo.toml b/native/crates/fsh-commands/Cargo.toml index 4f105fa6..c08563d3 100644 --- a/native/crates/fsh-commands/Cargo.toml +++ b/native/crates/fsh-commands/Cargo.toml @@ -15,5 +15,6 @@ fsh-render-cpu = { path = "../fsh-render-cpu" } serde_json = "1" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +fsh-cad = { path = "../fsh-cad" } fsh-render-gpu = { path = "../fsh-render-gpu" } pollster = "1" diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index 9a2c80a9..3718d7b6 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -942,6 +942,9 @@ impl Engine { } pub(crate) fn import(&self, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { + if crate::ext::cad::is_cad(path) { + return crate::ext::cad::import(self, st, path, args, frame); + } let empty = json!({}); let opts = args.get("options").unwrap_or(&empty); let clean = clean_options(opts)?; diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 0cdfe7d9..e23b534b 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -3,10 +3,350 @@ use super::ExtCommand; use crate::engine::{Engine, State}; use crate::error::Result; -use serde_json::Value; +use crate::util::get_bool; +use fsh_io::{RawScene, Watch}; +use fsh_scene::ChangeLevel; +use serde_json::{json, Value}; +use std::path::Path; -pub(super) static COMMANDS: &[ExtCommand] = &[]; +pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { + name: "cad.status", + description: "Whether the CAD worker that opens STEP and IGES files is installed, where, and which release; probe starts it once to check.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: status_schema, +}]; -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { - None +fn status_schema() -> Value { + json!({ + "type": "object", + "properties": {"probe": {"type": "boolean", "description": "Start the worker and ask its version (takes a few seconds)"}}, + "required": [] + }) +} + +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { + match name { + "cad.status" => Some(Ok(native::status(get_bool(args, "probe").unwrap_or(false)))), + _ => None, + } +} + +/// True for the extensions the CAD worker opens: .step, .stp, .iges, .igs. +pub(crate) fn is_cad(path: &Path) -> bool { + path.extension() + .and_then(|e| e.to_str()) + .is_some_and(|e| matches!(e.to_ascii_lowercase().as_str(), "step" | "stp" | "iges" | "igs")) +} + +/// Reads a STEP or IGES file into a raw scene (Z up, metres) at `quality`: "draft", "medium", "high", "ultra", +/// `{chord, angle}`, or null for medium. Progress and cancel go through `watch`; cancel stops the worker. +#[allow(dead_code)] +pub(crate) fn read_cad(path: &Path, quality: &Value, watch: &Watch) -> fsh_io::Result { + native::read_cad(path, quality, watch) +} + +/// `file.import` for a STEP or IGES file: read, clean, one undo step, kept source, `source.*` and `cad.*` metadata. +pub(crate) fn import(engine: &Engine, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { + #[cfg(not(target_arch = "wasm32"))] + { + let prepared: Prepared = prepare(path, args, &Watch::new())?; + apply(engine, st, prepared, args, frame) + } + #[cfg(target_arch = "wasm32")] + native::import(engine, st, path, args, frame) +} + +#[cfg(not(target_arch = "wasm32"))] +pub(crate) use native::{apply, prepare, Prepared}; + +#[cfg(not(target_arch = "wasm32"))] +mod native { + use crate::engine::{Engine, State}; + use crate::error::{EngineError, Result}; + use crate::util::get_str; + use crate::view; + use fsh_cad::{locate, CadError, MeshTag, Quality, ReadOptions, Worker, PROTOCOL}; + use fsh_core::{LengthUnit, NodeId}; + use fsh_io::{CleanOptions, CleanReport, ImportOptions, RawScene, UpAxis, Watch}; + use fsh_scene::{ChangeLevel, Command, NodeKind, Outcome}; + use serde_json::{json, Value}; + use std::collections::HashMap; + use std::path::{Path, PathBuf}; + use std::time::Duration; + + pub(super) fn cad_error(e: CadError) -> EngineError { + EngineError::Io { code: e.code(), message: e.to_string() } + } + + fn opt<'a>(args: &'a Value, key: &str) -> Option<&'a Value> { + args.get(key).filter(|v| !v.is_null()).or_else(|| args.get("options").and_then(|o| o.get(key)).filter(|v| !v.is_null())) + } + + fn opt_str<'a>(args: &'a Value, key: &str) -> Option<&'a str> { + opt(args, key).and_then(Value::as_str) + } + + fn opt_bool(args: &Value, key: &str) -> Option { + opt(args, key).and_then(Value::as_bool) + } + + pub(super) fn quality_of(args: &Value, key: &str) -> Result { + Quality::from_json(opt(args, key).unwrap_or(&Value::Null)).map_err(EngineError::args) + } + + pub(super) fn read_cad(path: &Path, quality: &Value, watch: &Watch) -> fsh_io::Result { + let quality = Quality::from_json(quality).map_err(fsh_io::IoError::InvalidData)?; + let opts = ReadOptions { quality, ..ReadOptions::default() }; + Ok(fsh_cad::read(path, &opts, watch)?.scene) + } + + fn clean_options(args: &Value) -> Result { + let mut c = CleanOptions { detect_instances: false, ..CleanOptions::default() }; + if let Some(u) = opt_str(args, "units").or_else(|| opt_str(args, "unit")).filter(|u| *u != "auto") { + c.unit = Some(u.parse::().map_err(|e| EngineError::args(e.to_string()))?); + } + if let Some(a) = opt_str(args, "up_axis").filter(|a| *a != "auto") { + c.up_axis = Some(UpAxis::parse(a).ok_or_else(|| EngineError::args(format!("unknown up axis \"{a}\"")))?); + } + if let Some(b) = opt_bool(args, "stand_on_floor") { + c.stand_on_floor = b; + } + if let Some(b) = opt_bool(args, "center").or_else(|| opt_bool(args, "centre")) { + c.centre = b; + } + Ok(c) + } + + /// A CAD file read and cleaned off the session, ready for [`apply`]. + pub(crate) struct Prepared { + path: PathBuf, + raw: RawScene, + tags: Vec, + report: CleanReport, + read: Value, + quality: Quality, + source: Option<(Vec, String)>, + } + + /// Reads and cleans a CAD file without touching the session; safe on a worker thread. + pub(crate) fn prepare(path: &Path, args: &Value, watch: &Watch) -> Result { + let quality = quality_of(args, "cad_quality")?; + let clean = clean_options(args)?; + let abs = path.canonicalize().map_err(|e| EngineError::File(format!("{} cannot be opened: {e}", path.display())))?; + let read = fsh_cad::read(&abs, &ReadOptions { quality, ..ReadOptions::default() }, watch).map_err(cad_error)?; + let mut raw = read.scene; + let report = fsh_io::clean(&mut raw, &clean, watch)?; + let ext = abs.extension().and_then(|e| e.to_str()).unwrap_or("step").to_ascii_lowercase(); + let size = std::fs::metadata(&abs).map(|m| m.len()).unwrap_or(u64::MAX); + let source = if size <= fsh_format::MAX_SOURCE_BYTES as u64 { + Some((std::fs::read(&abs).map_err(|e| EngineError::File(format!("{} cannot be read: {e}", abs.display())))?, ext)) + } else { + None + }; + let info = json!({ + "format": read.format.extension(), + "bodies": read.bodies, + "shared": read.shared, + "quality": read.quality.to_json(), + "linear_mm": read.linear_mm, + "angular_deg": read.angular_rad.to_degrees(), + "diagonal_mm": read.diagonal_mm, + "occt": read.occt, + "worker_tag": read.tag, + }); + Ok(Prepared { path: abs, raw, tags: read.tags, report, read: info, quality, source }) + } + + fn tag_payload(cmd: &mut Command, p: &Prepared, wrap: bool, reference: &str) { + let Command::Import(imp) = cmd else { return }; + let raw = &p.raw; + let mut referenced = vec![false; raw.meshes.len()]; + for n in &raw.nodes { + for &m in &n.meshes { + if let Some(r) = referenced.get_mut(m) { + *r = true; + } + } + } + let emitted: Vec = (0..raw.meshes.len()).filter(|&i| referenced[i] && !raw.meshes[i].indices.is_empty()).collect(); + let mesh_tag: HashMap = if emitted.len() == imp.payload.meshes.len() { + imp.payload.meshes.iter().zip(&emitted).filter_map(|(m, &i)| p.tags.get(i).map(|t| (m.key.raw(), *t))).collect() + } else { + HashMap::new() + }; + let source_path = p.path.to_string_lossy().to_string(); + let wrap_id = wrap.then(|| imp.payload.nodes.first().map(|n| n.id)).flatten(); + let mut paths: HashMap = HashMap::new(); + for n in &mut imp.payload.nodes { + let own = n.node.name.clone(); + let inside = match n.node.parent.and_then(|q| paths.get(&q)) { + Some(up) if !up.is_empty() => format!("{up}/{own}"), + _ if Some(n.id) == wrap_id => String::new(), + _ => own, + }; + paths.insert(n.id, inside.clone()); + let meta = &mut n.node.metadata; + meta.insert("source.path".into(), source_path.clone()); + meta.insert("source.node".into(), inside); + if let NodeKind::Part { mesh, .. } = n.node.kind { + meta.insert("source.cad".into(), reference.to_string()); + meta.insert("cad.quality".into(), p.quality.to_text()); + meta.insert("cad.unit".into(), p.report.unit.as_str().into()); + meta.insert("cad.up".into(), p.report.up_axis.as_str().into()); + if let Some(t) = mesh_tag.get(&mesh.raw()) { + meta.insert("cad.mesh".into(), format!("{}:{}", t.body, t.slot)); + } + } + } + } + + fn frame_camera(st: &mut State) -> Result<()> { + let snap = st.editor.snapshot(); + let doc = st.editor.document(); + let Ok(b) = view::bounds(doc, &snap, None) else { return Ok(()) }; + let values = view::frame_values(doc.active_camera(), &b, 0.8, doc.render_settings().aspect()); + let index = doc.active_camera_index(); + let out = st.editor.dispatch("camera.set", json!({"index": index, "values": values}))?; + st.note(&out); + Ok(()) + } + + /// Adds a prepared CAD import to the document as one undo step and keeps its source in the project. + pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, args: &Value, frame: Option) -> Result { + let wrap = opt_bool(args, "merge").or_else(|| opt_bool(args, "wrap_in_group")).unwrap_or(true); + let roots = p.raw.nodes.iter().filter(|n| n.parent.is_none()).count(); + let watch = Watch::new(); + let mut cmd = fsh_io::to_import_command(&p.raw, st.editor.document(), &ImportOptions { parent: None, wrap_in_group: wrap }, &watch)?; + let reference = match &p.source { + Some((bytes, ext)) => fsh_format::source_member(bytes, ext) + .map(|m| format!("{}{m}", fsh_format::EMBED_SCHEME)) + .unwrap_or_else(|| p.path.to_string_lossy().to_string()), + None => p.path.to_string_lossy().to_string(), + }; + tag_payload(&mut cmd, &p, wrap && roots > 1, &reference); + let was_empty = !st.editor.document().nodes().values().any(|n| matches!(n.kind, NodeKind::Part { .. })); + let stem = p.path.file_stem().and_then(|s| s.to_str()).unwrap_or("CAD").to_string(); + let label = format!("Import {}", get_str(args, "name").filter(|n| !n.is_empty()).unwrap_or(&stem)); + st.editor.begin_group(&label); + st.note_begin(&label); + let result = (|| -> Result { + let out = st.editor.execute(cmd)?; + st.note(&out); + if let Some(name) = get_str(args, "name").filter(|n| !n.is_empty()) { + let roots: Vec = out + .created + .iter() + .copied() + .filter(|k| st.editor.document().node(NodeId::new(*k)).is_some_and(|n| n.parent.is_none() && n.name == stem)) + .collect(); + for r in roots { + let renamed = st.editor.dispatch("scene.rename", json!({"id": r, "name": name}))?; + st.note(&renamed); + } + } + if frame.unwrap_or(was_empty) { + frame_camera(st)?; + } + Ok(out) + })(); + let out = match result { + Ok(o) => { + st.editor.end_group()?; + st.note_end(); + o + } + Err(e) => { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } + return Err(e); + } + }; + let kept = match p.source { + Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), + None => false, + }; + let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); + reply["name"] = json!("file.import"); + reply["report"] = json!({ + "triangles_dropped": p.report.triangles_dropped, + "vertices_welded": p.report.vertices_welded, + "unused_vertices_removed": p.report.unused_vertices_removed, + "meshes_given_normals": p.report.meshes_given_normals, + "instances_found": p.report.instances_found, + "unit": p.report.unit.as_str(), + "unit_guessed": p.report.unit_guessed, + "up_axis": p.report.up_axis.as_str(), + "warnings": p.report.warnings, + }); + let mut cad = p.read; + cad["source"] = json!(reference); + cad["kept"] = json!(kept); + cad["triangles"] = json!(p.raw.triangle_count()); + reply["cad"] = cad; + Ok(reply) + } + + + pub(super) fn status(probe: bool) -> Value { + let cache = fsh_cad::workers_dir().map(|p| p.to_string_lossy().to_string()); + let installed: Vec = + fsh_cad::installed().into_iter().map(|(t, p)| json!({"tag": t, "path": p.to_string_lossy()})).collect(); + let located = match locate() { + Ok(l) => l, + Err(e) => { + return json!({"available": false, "reason": e.to_string(), "code": e.code(), "cache": cache, "installed": installed, "protocol": PROTOCOL}) + } + }; + let mut out = json!({ + "available": true, + "path": located.path.to_string_lossy(), + "tag": located.tag, + "origin": located.origin.as_str(), + "cache": cache, + "installed": installed, + "protocol": PROTOCOL, + }); + if probe { + match Worker::start(&located, Duration::from_secs(90), None) { + Ok(w) => { + out["occt"] = json!(w.hello().occt); + out["worker_protocol"] = json!(w.hello().protocol); + out["methods"] = json!(w.hello().methods.len()); + w.shutdown(); + } + Err(e) => { + out["available"] = json!(false); + out["reason"] = json!(e.to_string()); + out["code"] = json!(e.code()); + } + } + } + out + } +} + +#[cfg(target_arch = "wasm32")] +mod native { + use crate::engine::{Engine, State}; + use crate::error::Result; + use fsh_io::{IoError, RawScene, Watch}; + use serde_json::{json, Value}; + use std::path::Path; + + const NO_WORKER: &str = "this build has no CAD worker; STEP and IGES open in the desktop app and the service"; + + pub(super) fn status(_probe: bool) -> Value { + json!({"available": false, "reason": NO_WORKER, "code": "cad_unsupported"}) + } + + pub(super) fn read_cad(_path: &Path, _quality: &Value, _watch: &Watch) -> fsh_io::Result { + Err(IoError::Unsupported(NO_WORKER.into())) + } + + pub(super) fn import(_engine: &Engine, _st: &mut State, _path: &Path, _args: &Value, _frame: Option) -> Result { + Err(IoError::Unsupported(NO_WORKER.into()).into()) + } } diff --git a/native/crates/fsh-commands/src/ext/mod.rs b/native/crates/fsh-commands/src/ext/mod.rs index d8cb0a32..c0bf16b1 100644 --- a/native/crates/fsh-commands/src/ext/mod.rs +++ b/native/crates/fsh-commands/src/ext/mod.rs @@ -6,7 +6,7 @@ use crate::error::Result; use fsh_scene::ChangeLevel; use serde_json::Value; -mod cad; +pub(crate) mod cad; mod handoff; mod import; mod library; From 90d19c77f3c5e435982981950064c8e114a367db Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:07 -0500 Subject: [PATCH 070/494] feat(commands): re-tessellate cad parts from their kept source scene.retessellate {nodes?, quality} re-reads each kept source (or the file on disk when it was too large to keep), cleans it with the stored unit and up axis, and swaps each part for one on the new mesh at the same place among its siblings with its name, transform, material, visibility, rays, colour, pivot and metadata, all in one undo step. Ran on a draft gearbox with an assigned material, a hidden bolt, a renamed shaft and a moved knob: 1800 to 53088 triangles at ultra with every property kept, undo restored the draft, a Fasteners-only custom pass touched 4 parts, and a reopened project re-tessellated after the original STEP was deleted. --- native/crates/fsh-commands/src/ext/cad.rs | 274 +++++++++++++++++++++- 1 file changed, 265 insertions(+), 9 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index e23b534b..36049e63 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -9,14 +9,45 @@ use fsh_scene::ChangeLevel; use serde_json::{json, Value}; use std::path::Path; -pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { - name: "cad.status", - description: "Whether the CAD worker that opens STEP and IGES files is installed, where, and which release; probe starts it once to check.", - level: ChangeLevel::None, - mutates: false, - read_only: true, - schema: status_schema, -}]; +pub(super) static COMMANDS: &[ExtCommand] = &[ + ExtCommand { + name: "cad.status", + description: "Whether the CAD worker that opens STEP and IGES files is installed, where, and which release; probe starts it once to check.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: status_schema, + }, + ExtCommand { + name: "scene.retessellate", + description: "Rebuild the meshes of CAD parts from their kept STEP or IGES source at a new quality, keeping names, placement, materials and visibility; one undo step.", + level: ChangeLevel::Full, + mutates: true, + read_only: false, + schema: retessellate_schema, + }, +]; + +fn quality_schema() -> Value { + json!({ + "description": "Tessellation of STEP and IGES surfaces: a preset, or chord (fraction of the model's diagonal) and angle (degrees)", + "oneOf": [ + {"type": "string", "enum": ["draft", "medium", "high", "ultra"]}, + {"type": "object", "properties": {"chord": {"type": "number", "exclusiveMinimum": 0, "maximum": 0.1}, "angle": {"type": "number", "minimum": 1, "maximum": 90}}, "required": ["chord", "angle"]} + ] + }) +} + +fn retessellate_schema() -> Value { + json!({ + "type": "object", + "properties": { + "nodes": {"type": "array", "items": {"type": ["string", "integer"]}, "description": "Parts or groups whose CAD parts are rebuilt; every CAD part when absent"}, + "quality": quality_schema() + }, + "required": ["quality"] + }) +} fn status_schema() -> Value { json!({ @@ -26,9 +57,10 @@ fn status_schema() -> Value { }) } -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { +pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { match name { "cad.status" => Some(Ok(native::status(get_bool(args, "probe").unwrap_or(false)))), + "scene.retessellate" => Some(native::retessellate(engine, st, args)), _ => None, } } @@ -289,6 +321,226 @@ mod native { Ok(reply) } + struct Scratch(Option); + + impl Drop for Scratch { + fn drop(&mut self) { + if let Some(d) = self.0.take() { + let _ = std::fs::remove_dir_all(d); + } + } + } + + fn source_file(st: &State, reference: &str, fallback: Option<&str>, scratch: &mut Scratch, n: usize) -> Result { + if let Some(bytes) = st.kept.source_bytes(reference).filter(|_| reference.starts_with(fsh_format::EMBED_SCHEME)) { + let ext = reference.rsplit('.').next().unwrap_or("step"); + let dir = match &scratch.0 { + Some(d) => d.clone(), + None => { + let d = std::env::temp_dir().join(format!("formshot-retessellate-{}-{}", std::process::id(), st.revision)); + std::fs::create_dir_all(&d).map_err(|e| EngineError::File(format!("no scratch folder for the CAD source: {e}")))?; + scratch.0 = Some(d.clone()); + d + } + }; + let file = dir.join(format!("source{n}.{ext}")); + std::fs::write(&file, bytes).map_err(|e| EngineError::File(format!("the kept CAD source could not be written out: {e}")))?; + return Ok(file); + } + let direct = (!reference.starts_with(fsh_format::EMBED_SCHEME)).then(|| PathBuf::from(reference)); + if let Some(p) = direct.into_iter().chain(fallback.map(PathBuf::from)).find(|p| p.is_file()) { + return Ok(p); + } + Err(EngineError::state(format!( + "the CAD source {reference} is neither kept in this project nor on disk{}", + fallback.map(|f| format!(" (nor at {f})")).unwrap_or_default() + ))) + } + + fn parse_tag(s: &str) -> Option<(usize, usize)> { + let (b, k) = s.split_once(':')?; + Some((b.trim().parse().ok()?, k.trim().parse().ok()?)) + } + + struct Target { + id: NodeId, + node: fsh_scene::Node, + mesh: fsh_core::MeshKey, + material: Option, + tag: (usize, usize), + } + + pub(super) fn retessellate(engine: &Engine, st: &mut State, args: &Value) -> Result { + use fsh_scene::{AddPart, Mesh, MeshAdd, MeshRef, NodeList, RayVisibility}; + use std::collections::{BTreeMap, BTreeSet}; + use std::sync::Arc; + + if opt(args, "quality").is_none() { + return Err(EngineError::args("scene.retessellate needs quality: draft, medium, high, ultra or {chord, angle}")); + } + let quality = quality_of(args, "quality")?; + let doc = st.editor.document(); + let scope: Option> = match args.get("nodes") { + None | Some(Value::Null) => None, + Some(Value::Array(a)) => { + let mut set = BTreeSet::new(); + for v in a { + let id = crate::util::key_of(v).map(NodeId::new).ok_or_else(|| EngineError::args(format!("nodes holds {v}, which is not a node id")))?; + doc.get_node(id)?; + set.extend(doc.subtree(id)); + } + Some(set) + } + Some(_) => return Err(EngineError::args("nodes must be a list of node ids")), + }; + let mut warnings = Vec::new(); + let mut groups: BTreeMap<(String, String, String, String), Vec> = BTreeMap::new(); + for (id, n) in doc.nodes() { + if scope.as_ref().is_some_and(|s| !s.contains(id)) { + continue; + } + let NodeKind::Part { mesh, material } = n.kind else { continue }; + let (Some(reference), Some(tag)) = (n.metadata.get("source.cad"), n.metadata.get("cad.mesh").and_then(|t| parse_tag(t))) else { + continue; + }; + if doc.is_locked(*id) { + warnings.push(format!("{} ({id}) is locked and was left as it is", n.name)); + continue; + } + let unit = n.metadata.get("cad.unit").cloned().unwrap_or_else(|| "m".into()); + let up = n.metadata.get("cad.up").cloned().unwrap_or_else(|| "z".into()); + let fallback = n.metadata.get("source.path").cloned().unwrap_or_default(); + groups.entry((reference.clone(), unit, up, fallback)).or_default().push(Target { id: *id, node: n.clone(), mesh, material, tag }); + } + if groups.is_empty() { + return Err(EngineError::state("there are no CAD parts to re-tessellate (parts imported from STEP or IGES carry source.cad)")); + } + let mut scratch = Scratch(None); + let mut new_meshes: BTreeMap> = BTreeMap::new(); + let mut plan: Vec = Vec::new(); + let mut triangles_before = 0usize; + let mut triangles_after = 0usize; + let watch = Watch::new(); + for (i, ((reference, unit, up, fallback), targets)) in groups.into_iter().enumerate() { + let file = source_file(st, &reference, Some(fallback.as_str()).filter(|f| !f.is_empty()), &mut scratch, i)?; + let read = fsh_cad::read(&file, &ReadOptions { quality, ..ReadOptions::default() }, &watch).map_err(cad_error)?; + let clean = CleanOptions { + unit: Some(unit.parse::().map_err(|e| EngineError::args(e.to_string()))?), + up_axis: Some(UpAxis::parse(&up).unwrap_or(UpAxis::Z)), + detect_instances: false, + stand_on_floor: false, + centre: false, + ..CleanOptions::default() + }; + let mut raw = read.scene; + fsh_io::clean(&mut raw, &clean, &watch)?; + let index: HashMap<(usize, usize), usize> = read.tags.iter().enumerate().map(|(i, t)| ((t.body, t.slot), i)).collect(); + for t in targets { + if let std::collections::btree_map::Entry::Vacant(slot) = new_meshes.entry(t.mesh.raw()) { + let Some(r) = index.get(&t.tag).and_then(|&i| raw.meshes.get(i)).filter(|r| !r.indices.is_empty()) else { + warnings.push(format!("{} ({}) has no body {}:{} in its source any more and was left as it is", t.node.name, t.id, t.tag.0, t.tag.1)); + continue; + }; + let old = st.editor.document().mesh(t.mesh); + triangles_before += old.map(|m| m.indices.len() / 3).unwrap_or(0); + let name = old.map(|m| m.name.clone()).unwrap_or_else(|| r.name.clone()); + let mut mesh = Mesh::new(name, r.positions.clone(), r.indices.clone())?; + mesh.normals = r.normals.clone(); + mesh.validate()?; + triangles_after += mesh.indices.len() / 3; + slot.insert(Arc::new(mesh)); + } + plan.push(t); + } + } + if plan.is_empty() { + return Err(EngineError::state(format!("nothing was re-tessellated: {}", warnings.join("; ")))); + } + let label = format!("Re-tessellate {} CAD parts ({})", plan.len(), quality.name()); + st.editor.begin_group(&label); + st.note_begin(&label); + let mut replaced = Vec::new(); + let result = (|| -> Result { + let mut swapped: BTreeMap = BTreeMap::new(); + let mut last = None; + for (old, mesh) in &new_meshes { + let out = st.editor.execute(Command::MeshAdd(MeshAdd { key: None, mesh: mesh.clone() }))?; + st.note(&out); + let key = out.created.first().copied().ok_or_else(|| EngineError::state("mesh.add created no key"))?; + swapped.insert(*old, fsh_core::MeshKey::new(key)); + } + for t in &plan { + let Some(&mesh) = swapped.get(&t.mesh.raw()) else { continue }; + let doc = st.editor.document(); + let index = doc.children_of(t.node.parent).iter().position(|c| *c == t.id); + let add = AddPart { id: None, name: t.node.name.clone(), parent: t.node.parent, index, transform: t.node.transform, mesh, material: t.material }; + let out = st.editor.execute(Command::AddPart(add))?; + st.note(&out); + let new_id = out.created.first().copied().ok_or_else(|| EngineError::state("scene.add_part created no node"))?; + let mut steps: Vec<(&str, Value)> = Vec::new(); + if !t.node.visible { + steps.push(("scene.set_visible", json!({"ids": [new_id], "visible": false}))); + } + if t.node.rays != RayVisibility::ALL { + steps.push(("scene.set_ray_visibility", json!({"ids": [new_id], "rays": t.node.rays}))); + } + if t.node.colour.is_some() { + steps.push(("scene.set_part_colour", json!({"ids": [new_id], "colour": t.node.colour.map(|c| [c.r, c.g, c.b])}))); + } + if let Some(p) = t.node.pivot { + steps.push(("scene.set_pivot", json!({"id": new_id, "pivot": [p.x, p.y, p.z]}))); + } + for (k, v) in &t.node.metadata { + let v = if k == "cad.quality" { quality.to_text() } else { v.clone() }; + steps.push(("scene.set_metadata", json!({"id": new_id, "key": k, "value": v}))); + } + for (name, a) in steps { + let out = st.editor.dispatch(name, a)?; + st.note(&out); + } + let out = st.editor.execute(Command::Remove(NodeList { ids: vec![t.id] }))?; + st.note(&out); + replaced.push(json!({"old": t.id.raw().to_string(), "new": new_id.to_string(), "name": t.node.name})); + last = Some(out); + } + for old in new_meshes.keys() { + let key = fsh_core::MeshKey::new(*old); + if st.editor.document().mesh(key).is_some() && st.editor.document().parts_using_mesh(key).is_empty() { + let out = st.editor.execute(Command::MeshRemove(MeshRef { key }))?; + st.note(&out); + } + } + last.ok_or_else(|| EngineError::state("nothing was re-tessellated")) + })(); + let out = match result { + Ok(o) => { + st.editor.end_group()?; + st.note_end(); + o + } + Err(e) => { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } + return Err(e); + } + }; + let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); + reply["name"] = json!("scene.retessellate"); + reply["quality"] = quality.to_json(); + reply["parts"] = json!(replaced.len()); + reply["meshes"] = json!(new_meshes.len()); + reply["triangles_before"] = json!(triangles_before); + reply["triangles_after"] = json!(triangles_after); + reply["replaced"] = json!(replaced); + if !warnings.is_empty() { + let mut all: Vec = reply.get("warnings").and_then(Value::as_array).cloned().unwrap_or_default(); + all.extend(warnings.into_iter().map(Value::from)); + reply["warnings"] = json!(all); + } + Ok(reply) + } + pub(super) fn status(probe: bool) -> Value { let cache = fsh_cad::workers_dir().map(|p| p.to_string_lossy().to_string()); @@ -349,4 +601,8 @@ mod native { pub(super) fn import(_engine: &Engine, _st: &mut State, _path: &Path, _args: &Value, _frame: Option) -> Result { Err(IoError::Unsupported(NO_WORKER.into()).into()) } + + pub(super) fn retessellate(_engine: &Engine, _st: &mut State, _args: &Value) -> Result { + Err(IoError::Unsupported(NO_WORKER.into()).into()) + } } From 51c55d152f4e549632f008d043050f06e60ce65c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:29:33 -0500 Subject: [PATCH 071/494] fix(cad): name the argument a bad quality came from Quality errors no longer say cad_quality for scene.retessellate's quality; the engine prefixes the argument name. Ran four refusals through formshot-engine dispatch: an unknown preset, a chord of 0.5, a missing angle and a re-tessellation with no CAD parts, each named. --- native/crates/fsh-cad/src/quality.rs | 6 +++--- native/crates/fsh-commands/src/ext/cad.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-cad/src/quality.rs b/native/crates/fsh-cad/src/quality.rs index da115871..f784360b 100644 --- a/native/crates/fsh-cad/src/quality.rs +++ b/native/crates/fsh-cad/src/quality.rs @@ -95,12 +95,12 @@ impl Quality { Value::String(s) => Quality::PRESETS .into_iter() .find(|q| q.name() == s.trim().to_ascii_lowercase()) - .ok_or_else(|| format!("cad_quality {s:?} is not draft, medium, high, ultra or {{chord, angle}}")), + .ok_or_else(|| format!("{s:?} is not draft, medium, high, ultra or {{chord, angle}}")), Value::Object(o) => { - let num = |k: &str| o.get(k).and_then(Value::as_f64).ok_or_else(|| format!("cad_quality needs a number {k}")); + let num = |k: &str| o.get(k).and_then(Value::as_f64).ok_or_else(|| format!("a custom quality needs a number {k}")); Quality::custom(num("chord")?, num("angle")?) } - other => Err(format!("cad_quality {other} is not draft, medium, high, ultra or {{chord, angle}}")), + other => Err(format!("{other} is not draft, medium, high, ultra or {{chord, angle}}")), } } } diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 36049e63..ad976bee 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -125,7 +125,7 @@ mod native { } pub(super) fn quality_of(args: &Value, key: &str) -> Result { - Quality::from_json(opt(args, key).unwrap_or(&Value::Null)).map_err(EngineError::args) + Quality::from_json(opt(args, key).unwrap_or(&Value::Null)).map_err(|m| EngineError::args(format!("{key}: {m}"))) } pub(super) fn read_cad(path: &Path, quality: &Value, watch: &Watch) -> fsh_io::Result { From d69ff53660e011919bbaba39250acaef543ac89f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:31:34 -0500 Subject: [PATCH 072/494] fix(cad): refuse files with nothing to draw and skip surface-less bodies Bodies that tessellate to no triangles (curves or points) are left out with a warning, and a file with no surfaces at all is refused by name instead of importing an empty group. Ran on trimesh's MIT two_color_lines.STEP (curves only): refused as cad_file; the other five trimesh samples still read at every quality. --- native/crates/fsh-cad/src/read.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/native/crates/fsh-cad/src/read.rs b/native/crates/fsh-cad/src/read.rs index 38e3b9e1..93f8e43f 100644 --- a/native/crates/fsh-cad/src/read.rs +++ b/native/crates/fsh-cad/src/read.rs @@ -482,6 +482,7 @@ pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { let mut owners: HashMap)>> = HashMap::new(); let mut shared = 0usize; let mut coarsened = 0usize; + let mut empty = 0usize; let total = bodies.len(); for (bi, body) in bodies.iter().enumerate() { watch.step(Stage::Reading, 0.1 + 0.9 * bi as f32 / total as f32).map_err(|_| CadError::Cancelled)?; @@ -490,6 +491,10 @@ pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { if used > linear { coarsened += 1; } + if m.triangle_count() == 0 { + empty += 1; + continue; + } let mut parent = None; for depth in 1..=body.path.len() { let key = body.path[..depth].to_vec(); @@ -563,6 +568,14 @@ pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { node_body.push(Some(bi)); } worker.shutdown(); + if scene.meshes.is_empty() { + return Err(CadError::File(format!( + "the file holds no surfaces to draw: its {total} bodies are curves or points only" + ))); + } + if empty > 0 { + warnings.push(format!("{empty} bodies have no surfaces (curves or points only) and were left out")); + } if coarsened > 0 { warnings.push(format!("{coarsened} bodies were too fine at this quality and were tessellated coarser")); } From 9e148d186d18778b7260b11fe606d100629047e7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:32:12 -0500 Subject: [PATCH 073/494] feat(setup): route ./formshot cad to the worker script ./formshot cad fetch and ./formshot cad status run setup/cad_worker. Ran ./formshot cad status against the scratch cache: the published x86_64 Linux archive (7061 files, 1002 MB unpacked) and the installed occt-8.0.1 were listed; an unknown subcommand printed the usage and exited 2. --- formshot | 1 + 1 file changed, 1 insertion(+) diff --git a/formshot b/formshot index 95a0ccde..9c84f036 100755 --- a/formshot +++ b/formshot @@ -54,6 +54,7 @@ case "$cmd" in build) exec setup/build_frontend "$@" ;; serve) exec setup/serve "$@" ;; freeze) exec setup/freeze_backend "$@" ;; + cad) exec setup/cad_worker "$@" ;; desktop) sub="${1:-dev}" [ $# -gt 0 ] && shift From 72077fb28996a79cee40756283c8b63ee2650890 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:34:02 -0500 Subject: [PATCH 074/494] fix(backend): publish every fetch stage change as an event The progress throttle swallowed the unpack stage; a new stage is now always published. Ran the service on 127.0.0.1:8397 with a fresh FORMSHOT_CACHE: POST without the window key was refused 403, with it the fetch installed occt-8.0.1 and the engine's cad.status found it at once, /api/events carried 34 cad.worker events; a patched aarch64 Linux triple got a plain 409 and the script exited 1. --- backend/app/routers/cad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/cad.py b/backend/app/routers/cad.py index efa94860..9ff0527c 100644 --- a/backend/app/routers/cad.py +++ b/backend/app/routers/cad.py @@ -321,12 +321,12 @@ def _set(state: str, stage: str, fraction: float, message: str) -> None: def _run() -> None: - last = [0.0] + last = {"at": 0.0, "stage": ""} def report(stage: str, fraction: float, message: str) -> None: now = time.monotonic() - if stage in ("done", "record") or now - last[0] > 0.25 or fraction >= 1.0: - last[0] = now + if stage != last["stage"] or now - last["at"] > 0.25 or fraction >= 1.0: + last.update(at=now, stage=stage) _set("running" if stage != "done" else "done", stage, fraction, message) try: From 23ee4f94dce75b8ceab70d8eced097335ae9698d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:39:15 -0500 Subject: [PATCH 075/494] fix(commands): keep a cad part's children when it is re-tessellated Removing the old part removed its subtree; children are now moved under the new part, which has the same transform, before the old one goes. Ran a point light parented to the Knob of a draft gearbox: after re-tessellating at medium it sat under the new Knob, and undo put it back under the old one. --- native/crates/fsh-commands/src/ext/cad.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index ad976bee..d2417a4b 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -498,6 +498,11 @@ mod native { let out = st.editor.dispatch(name, a)?; st.note(&out); } + let children: Vec = st.editor.document().node(t.id).map(|n| n.children.iter().map(|c| c.raw()).collect()).unwrap_or_default(); + if !children.is_empty() { + let out = st.editor.dispatch("scene.reparent", json!({"ids": children, "parent": new_id, "keep_world": false}))?; + st.note(&out); + } let out = st.editor.execute(Command::Remove(NodeList { ids: vec![t.id] }))?; st.note(&out); replaced.push(json!({"old": t.id.raw().to_string(), "new": new_id.to_string(), "name": t.node.name})); From 670665cb16341054b07a0e60bf3e50b76eb3ee91 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:39:54 -0500 Subject: [PATCH 076/494] fix(commands): carry the selection over to re-tessellated parts Selected parts that scene.retessellate replaces are swapped for their new ids, keeping the active node. Ran with the Knob and the Fasteners group selected: after a medium pass the selection held the new Knob id and the same group, with the group still active. --- native/crates/fsh-commands/src/ext/cad.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index d2417a4b..7c23dd95 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -460,6 +460,9 @@ mod native { st.editor.begin_group(&label); st.note_begin(&label); let mut replaced = Vec::new(); + let mut renumbered: HashMap = HashMap::new(); + let selected: Vec = st.editor.selection().nodes().to_vec(); + let active = st.editor.selection().active(); let result = (|| -> Result { let mut swapped: BTreeMap = BTreeMap::new(); let mut last = None; @@ -506,6 +509,7 @@ mod native { let out = st.editor.execute(Command::Remove(NodeList { ids: vec![t.id] }))?; st.note(&out); replaced.push(json!({"old": t.id.raw().to_string(), "new": new_id.to_string(), "name": t.node.name})); + renumbered.insert(t.id, NodeId::new(new_id)); last = Some(out); } for old in new_meshes.keys() { @@ -530,6 +534,13 @@ mod native { return Err(e); } }; + if selected.iter().any(|id| renumbered.contains_key(id)) { + let map = |id: &NodeId| renumbered.get(id).copied().unwrap_or(*id); + let mut ids: Vec = selected.iter().filter(|id| Some(**id) != active).map(map).collect(); + ids.extend(active.iter().map(map)); + let (sel, doc) = st.editor.selection_mut(); + sel.select(doc, &ids, fsh_scene::SelectMode::Replace); + } let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("scene.retessellate"); reply["quality"] = quality.to_json(); From 83e4c12346d1c658c3d2d662fcf10eb98dda175a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:40:34 -0500 Subject: [PATCH 077/494] fix(backend): bound the status record wait and clear stale fetch folders GET /api/cad/worker waits at most 15 s for an uncached record, and a fetch removes .fetch- scratch folders older than an hour left by an interrupted run. Ran install against a local mirror through FORMSHOT_CAD_RELEASE_URL with no archive: the 404 was named, a three-hour-old scratch folder was removed and a fresh one kept. --- backend/app/routers/cad.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/app/routers/cad.py b/backend/app/routers/cad.py index 9ff0527c..bf038c5a 100644 --- a/backend/app/routers/cad.py +++ b/backend/app/routers/cad.py @@ -131,7 +131,7 @@ def parse_record(raw: bytes, where: str) -> dict: return record -def load_record(allow_network: bool = True) -> dict: +def load_record(allow_network: bool = True, timeout: float = 60.0) -> dict: local = os.environ.get("FORMSHOT_CAD_RECORD", "").strip() if local: try: @@ -147,7 +147,7 @@ def load_record(allow_network: bool = True) -> dict: if not allow_network: raise FetchError("The published record has not been downloaded yet.") url = f"{release_base()}/{RECORD_NAME}" - raw, _ = download(url, None) + raw, _ = download(url, None, timeout=timeout) record = parse_record(raw or b"", url) try: cached.parent.mkdir(parents=True, exist_ok=True) @@ -171,7 +171,7 @@ def published(allow_network: bool = True) -> dict: triple = host_triple() out = {"tag": TAG, "release": RELEASE, "triple": triple, "source": release_base()} try: - target = target_of(load_record(allow_network), triple) + target = target_of(load_record(allow_network, timeout=15.0), triple) except FetchError as error: out.update(available=False, reason=str(error)) return out @@ -259,6 +259,9 @@ def install(report=print) -> Path: want = archive_sha256(sums or b"", archive) root = workers_dir() root.mkdir(parents=True, exist_ok=True) + for stale in root.glob(".fetch-*"): + if stale.is_dir() and time.time() - stale.stat().st_mtime > 3600: + shutil.rmtree(stale, ignore_errors=True) work = Path(tempfile.mkdtemp(prefix=".fetch-", dir=root)) try: bundle = work / archive @@ -286,10 +289,8 @@ def install(report=print) -> Path: if not sys.platform.startswith("win"): program.chmod(0o755) destination = root / TAG - old = None if destination.exists(): - old = work / "old" - os.replace(destination, old) + os.replace(destination, work / "old") os.replace(tree, destination) finally: shutil.rmtree(work, ignore_errors=True) From 1caef9abd75b55f290f2eaad5ec07397d14228d2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:41:43 -0500 Subject: [PATCH 078/494] feat(cad): quote the worker's last stderr line when it stops The worker's stderr is drained on a thread that keeps its last six lines, and an exit error now ends with the last one, so a worker that cannot load a system library says which. Ran a stand-in that prints an ImportError for libGL.so.1 and exits 3: the error quoted it; real worker reads of box_sides.STEP at all four qualities were unchanged. --- native/crates/fsh-cad/src/client.rs | 53 ++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/native/crates/fsh-cad/src/client.rs b/native/crates/fsh-cad/src/client.rs index 4f75fbe5..af1aead7 100644 --- a/native/crates/fsh-cad/src/client.rs +++ b/native/crates/fsh-cad/src/client.rs @@ -4,7 +4,9 @@ use fsh_io::Watch; use serde_json::{json, Map, Value}; use std::io::{BufRead, BufReader, Read, Write}; use std::process::{Child, ChildStdin, Command, Stdio}; +use std::collections::VecDeque; use std::sync::mpsc::{self, Receiver, RecvTimeoutError}; +use std::sync::{Arc, Mutex}; use std::thread; use std::time::{Duration, Instant}; @@ -47,6 +49,40 @@ pub struct Worker { lines: Receiver, next: u64, hello: Hello, + errors: Arc>>, +} + +const KEPT_ERROR_LINES: usize = 6; + +fn spawn_error_tail(err: impl Read + Send + 'static) -> Arc>> { + let tail = Arc::new(Mutex::new(VecDeque::new())); + let keep = tail.clone(); + thread::Builder::new() + .name("cad-worker-stderr".into()) + .spawn(move || { + let mut reader = BufReader::new(err); + let mut buf = Vec::new(); + loop { + buf.clear(); + match reader.by_ref().take(64 << 10).read_until(b'\n', &mut buf) { + Ok(0) | Err(_) => return, + Ok(_) => { + let line: String = String::from_utf8_lossy(&buf).trim().chars().filter(|c| !c.is_control()).take(300).collect(); + if line.is_empty() { + continue; + } + if let Ok(mut t) = keep.lock() { + if t.len() == KEPT_ERROR_LINES { + t.pop_front(); + } + t.push_back(line); + } + } + } + } + }) + .ok(); + tail } fn spawn_reader(out: impl Read + Send + 'static) -> Receiver { @@ -87,7 +123,7 @@ impl Worker { pub fn start(located: &Located, timeout: Duration, watch: Option<&Watch>) -> Result { let (program, args) = located.command.split_first().ok_or_else(|| CadError::Start("empty command".into()))?; let mut cmd = Command::new(program); - cmd.args(args).stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::null()); + cmd.args(args).stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::piped()); if let Some(dir) = located.path.parent() { cmd.current_dir(dir); } @@ -98,8 +134,9 @@ impl Worker { let _ = child.wait(); return Err(CadError::Start("no output pipe".into())); }; + let errors = child.stderr.take().map(spawn_error_tail).unwrap_or_default(); let lines = spawn_reader(stdout); - let mut worker = Worker { child, stdin, lines, next: 1, hello: Hello::default() }; + let mut worker = Worker { child, stdin, lines, next: 1, hello: Hello::default(), errors }; let raw = worker.call("hello", json!({}), timeout, watch)?; let methods = raw .get("methods") @@ -128,12 +165,18 @@ impl Worker { fn exit_note(&mut self) -> String { let until = Instant::now() + Duration::from_millis(500); - loop { + let status = loop { match self.child.try_wait() { - Ok(Some(s)) => return format!("{s}"), + Ok(Some(s)) => break format!("{s}"), Ok(None) if Instant::now() < until => thread::sleep(Duration::from_millis(10)), - _ => return "it closed its output".into(), + _ => break "it closed its output".into(), } + }; + thread::sleep(Duration::from_millis(50)); + let tail: Vec = self.errors.lock().map(|t| t.iter().cloned().collect()).unwrap_or_default(); + match tail.last() { + Some(last) => format!("{status}; it last said: {last}"), + None => status, } } From ba6e55a0ba06dd26e6867e1fb5a38329a351a143 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:42:24 -0500 Subject: [PATCH 079/494] fix(commands): name a kept source by the format the worker read The sources member takes its extension from the detected format (step or iges) instead of the file's own extension, so re-tessellation always hands the worker a name it accepts. Ran file.import of an IGES copy named .IGS: kept as sources/600c4a845d0b96e1.iges, and scene.retessellate at medium rebuilt its 8 parts from that member. --- native/crates/fsh-commands/src/ext/cad.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 7c23dd95..16821326 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -170,7 +170,7 @@ mod native { let read = fsh_cad::read(&abs, &ReadOptions { quality, ..ReadOptions::default() }, watch).map_err(cad_error)?; let mut raw = read.scene; let report = fsh_io::clean(&mut raw, &clean, watch)?; - let ext = abs.extension().and_then(|e| e.to_str()).unwrap_or("step").to_ascii_lowercase(); + let ext = read.format.extension().to_string(); let size = std::fs::metadata(&abs).map(|m| m.len()).unwrap_or(u64::MAX); let source = if size <= fsh_format::MAX_SOURCE_BYTES as u64 { Some((std::fs::read(&abs).map_err(|e| EngineError::File(format!("{} cannot be read: {e}", abs.display())))?, ext)) From 33887bec201f1ffcb95f847c273a7c169106bb2e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:42:42 -0500 Subject: [PATCH 080/494] fix(cad): word the nothing-to-draw refusal for one body The refusal reads its one body or all N of its bodies. Ran file.import of trimesh's curves-only two_color_lines.STEP through formshot-engine dispatch: refused as cad_file with the new wording and the document stayed empty. --- native/crates/fsh-cad/src/read.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-cad/src/read.rs b/native/crates/fsh-cad/src/read.rs index 93f8e43f..27b26962 100644 --- a/native/crates/fsh-cad/src/read.rs +++ b/native/crates/fsh-cad/src/read.rs @@ -569,9 +569,8 @@ pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { } worker.shutdown(); if scene.meshes.is_empty() { - return Err(CadError::File(format!( - "the file holds no surfaces to draw: its {total} bodies are curves or points only" - ))); + let what = if total == 1 { "its one body is".to_string() } else { format!("all {total} of its bodies are") }; + return Err(CadError::File(format!("the file holds no surfaces to draw: {what} curves or points only"))); } if empty > 0 { warnings.push(format!("{empty} bodies have no surfaces (curves or points only) and were left out")); From 0a79eb1fa9c265af6179954d56831b0a2585de88 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:06:23 -0500 Subject: [PATCH 081/494] feat(commands): read the new import options in the import module file.import now reads units, up_axis, stand_on_floor, center, merge and cad_quality in ext/import, which owns the read, clean-up and apply steps that engine.import delegates to; the old options object still works. Ran five old-style imports through the release dispatch before and after: document JSON and replies identical, and each new option checked by hand. --- native/crates/fsh-commands/src/catalogue.rs | 28 +-- native/crates/fsh-commands/src/engine.rs | 70 +------ native/crates/fsh-commands/src/ext/import.rs | 23 +++ .../fsh-commands/src/ext/import/options.rs | 173 ++++++++++++++++++ .../crates/fsh-commands/src/ext/import/run.rs | 118 ++++++++++++ native/crates/fsh-commands/src/ext/mod.rs | 2 +- 6 files changed, 322 insertions(+), 92 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/options.rs create mode 100644 native/crates/fsh-commands/src/ext/import/run.rs diff --git a/native/crates/fsh-commands/src/catalogue.rs b/native/crates/fsh-commands/src/catalogue.rs index f97bac87..af49a3d6 100644 --- a/native/crates/fsh-commands/src/catalogue.rs +++ b/native/crates/fsh-commands/src/catalogue.rs @@ -34,7 +34,7 @@ pub(crate) const ENGINE_COMMANDS: &[EngineCommand] = &[ cmd("file.new", Full, true, false, "Start a new document, empty or from a template (empty-studio, product-white, studio-light, studio-dark, spheres, turntable, daylight, sample)."), cmd("file.open", Full, true, false, "Open a .fshot project, or a model file as a new document."), cmd("file.save", Nothing, false, false, "Save the document as .fshot to path, or to its own path."), - cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step."), + cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional."), cmd("file.close", Full, true, false, "Close the document, leaving an empty one, and stop rendering."), cmd("file.export_image", Nothing, false, false, "Write the latest progressive frame to png, hdr or exr."), cmd("file.export_model", Nothing, false, false, "Write the visible document as a binary glTF (.glb)."), @@ -109,31 +109,7 @@ pub(crate) fn engine_schema(name: &str) -> Value { ), "file.open" => obj(vec![("path", s("A .fshot project or a model file"))], &["path"]), "file.save" => obj(vec![("path", s("Target .fshot; the document's own path when absent"))], &[]), - "file.import" => obj( - vec![ - ("path", s("Model file: glb, gltf, obj, stl or ply")), - ("name", s("Name for the imported group (the original file name)")), - ("frame", b("Frame the camera on the result (default: only when the document was empty)")), - ( - "options", - obj( - vec![ - ("unit", json!({"type": "string", "enum": ["m", "cm", "mm", "in", "ft"], "description": "Unit the file is in"})), - ("up_axis", json!({"type": "string", "enum": ["y", "z", "x", "-y", "-z", "-x"]})), - ("smoothing_angle_deg", json!({"type": "number", "default": 30})), - ("weld", json!({"type": "boolean", "default": true})), - ("generate_normals", json!({"type": "boolean", "default": true})), - ("detect_instances", json!({"type": "boolean", "default": true})), - ("stand_on_floor", json!({"type": "boolean", "default": true})), - ("centre", json!({"type": "boolean", "default": false})), - ("wrap_in_group", json!({"type": "boolean", "default": true})), - ], - &[], - ), - ), - ], - &["path"], - ), + "file.import" => crate::ext::import::file_import_schema(), "file.export_image" => obj(vec![("path", s("Target file")), ("format", picture_format()), ("denoise", b("Denoise first"))], &["path"]), "file.export_model" => obj(vec![("path", s("Target .glb"))], &["path"]), "render.start" => obj( diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index 3718d7b6..e442b10d 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -11,7 +11,7 @@ use crate::util::{base64, get_bool, get_f32, get_str, get_u32, key_of, numeric_k use crate::view; use fsh_core::{DocKey, LengthUnit, NodeId, Rgb, Vec3}; use fsh_format::{Project, SaveOptions}; -use fsh_io::{CleanOptions, FloatPicture, ImportOptions, UpAxis, Watch}; +use fsh_io::{CleanOptions, FloatPicture, UpAxis}; use crate::device::{self, PreviewRenderer, RegionReset}; use fsh_render_cpu::{EnvImage, Image, STUDIO_PATH}; use fsh_scene::{ @@ -207,7 +207,7 @@ fn parse_unit(s: &str) -> Result { s.parse::().map_err(|e| EngineError::args(e.to_string())) } -fn clean_options(o: &Value) -> Result { +pub(crate) fn clean_options(o: &Value) -> Result { let mut c = CleanOptions::default(); if let Some(u) = get_str(o, "unit") { c.unit = Some(parse_unit(u)?); @@ -232,7 +232,7 @@ fn clean_options(o: &Value) -> Result { Ok(c) } -fn has_parts(doc: &Document) -> bool { +pub(crate) fn has_parts(doc: &Document) -> bool { doc.nodes().values().any(|n| matches!(n.kind, NodeKind::Part { .. })) } @@ -241,7 +241,7 @@ fn is_model(path: &Path) -> bool { fsh_io::ModelFormat::from_extension(&ext).is_some() } -fn title_from(path: &Path) -> String { +pub(crate) fn title_from(path: &Path) -> String { path.file_stem().and_then(|s| s.to_str()).unwrap_or("Untitled").to_string() } @@ -945,67 +945,7 @@ impl Engine { if crate::ext::cad::is_cad(path) { return crate::ext::cad::import(self, st, path, args, frame); } - let empty = json!({}); - let opts = args.get("options").unwrap_or(&empty); - let clean = clean_options(opts)?; - let import = ImportOptions { parent: None, wrap_in_group: get_bool(opts, "wrap_in_group").unwrap_or(true) }; - let was_empty = !has_parts(st.editor.document()); - let (cmd, report) = fsh_io::import_file(path, st.editor.document(), &clean, &import, &Watch::new())?; - let label = format!("Import {}", get_str(args, "name").map(str::to_string).unwrap_or_else(|| title_from(path))); - st.editor.begin_group(&label); - st.note_begin(&label); - let result = (|| -> Result { - let out = st.editor.execute(cmd)?; - st.note(&out); - if let Some(name) = get_str(args, "name").filter(|n| !n.is_empty()) { - let stem = title_from(Path::new(name)); - let roots: Vec = out - .created - .iter() - .copied() - .filter(|k| st.editor.document().node(NodeId::from_raw(*k)).is_some_and(|n| n.parent.is_none() && n.name == title_from(path))) - .collect(); - for r in roots { - let renamed = st.editor.dispatch("scene.rename", json!({"id": r, "name": stem}))?; - st.note(&renamed); - } - } - if frame.unwrap_or(was_empty) { - if let Ok(values) = frame_values(st.editor.document(), 1.15) { - let index = st.editor.document().active_camera_index(); - let framed = st.editor.dispatch("camera.set", json!({"index": index, "values": values}))?; - st.note(&framed); - } - } - Ok(out) - })(); - let out = match result { - Ok(o) => { - st.editor.end_group()?; - st.note_end(); - o - } - Err(e) => { - if let Ok(back) = st.editor.abandon_group() { - st.note(&back); - } - return Err(e); - } - }; - let mut reply = self.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); - reply["name"] = json!("file.import"); - reply["report"] = json!({ - "triangles_dropped": report.triangles_dropped, - "vertices_welded": report.vertices_welded, - "unused_vertices_removed": report.unused_vertices_removed, - "meshes_given_normals": report.meshes_given_normals, - "instances_found": report.instances_found, - "unit": report.unit.as_str(), - "unit_guessed": report.unit_guessed, - "up_axis": report.up_axis.as_str(), - "warnings": report.warnings, - }); - Ok(reply) + crate::ext::import::import_now(self, st, path, args, frame) } fn render_start(&self, st: &mut State, args: &Value) -> Result { diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index d526716d..6c9cec11 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -3,10 +3,33 @@ use super::ExtCommand; use crate::engine::{Engine, State}; use crate::error::Result; +use fsh_io::Watch; use serde_json::Value; +use std::path::Path; + +mod options; +mod run; + +use options::ImportArgs; pub(super) static COMMANDS: &[ExtCommand] = &[]; +fn object(props: serde_json::Map, required: &[&str]) -> Value { + serde_json::json!({"type": "object", "properties": props, "required": required}) +} + +/// The `file.import` argument schema (the catalogue's engine table asks for it). +pub(crate) fn file_import_schema() -> Value { + object(options::properties(), &["path"]) +} + +/// `file.import` (and `file.open` of a model): reads the options, imports now, one undo step. +pub(crate) fn import_now(engine: &Engine, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { + let a = ImportArgs::parse(args, frame)?; + let prepared = run::prepare(path, &a, st.editor.document(), &Watch::new())?; + run::apply(engine, st, prepared, &a) +} + pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { None } diff --git a/native/crates/fsh-commands/src/ext/import/options.rs b/native/crates/fsh-commands/src/ext/import/options.rs new file mode 100644 index 00000000..fc0cc312 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/options.rs @@ -0,0 +1,173 @@ +use crate::engine::clean_options; +use crate::error::{EngineError, Result}; +use crate::util::{get_bool, get_f32, get_str}; +use fsh_core::LengthUnit; +use fsh_io::{CleanOptions, ImportOptions, UpAxis}; +use serde_json::{json, Map, Value}; + +pub(crate) const UNITS: &[&str] = &["auto", "mm", "cm", "m", "in", "ft"]; +pub(crate) const UP_AXES: &[&str] = &["auto", "y", "z"]; +pub(crate) const CAD_QUALITIES: &[&str] = &["draft", "medium", "high", "ultra"]; + +#[derive(Clone, Debug, PartialEq)] +pub(crate) enum CadQuality { + Preset(String), + Custom { chord: f32, angle: f32 }, +} + +impl CadQuality { + fn parse(v: &Value) -> Result { + match v { + Value::String(s) if CAD_QUALITIES.contains(&s.as_str()) => Ok(CadQuality::Preset(s.clone())), + Value::Object(_) => { + let need = |k: &str| { + get_f32(v, k)? + .filter(|x| x.is_finite() && *x > 0.0) + .ok_or_else(|| EngineError::args(format!("cad_quality.{k} must be a number above 0"))) + }; + Ok(CadQuality::Custom { chord: need("chord")?, angle: need("angle")? }) + } + _ => Err(EngineError::args("cad_quality must be draft, medium, high, ultra or {chord, angle}")), + } + } + + pub(crate) fn json(&self) -> Value { + match self { + CadQuality::Preset(s) => json!(s), + CadQuality::Custom { chord, angle } => json!({"chord": chord, "angle": angle}), + } + } +} + +/// Everything `file.import`, `import.start` and `file.reimport` read from their arguments. +#[derive(Clone, Debug)] +pub(crate) struct ImportArgs { + pub clean: CleanOptions, + pub place: ImportOptions, + pub merge: bool, + pub cad_quality: Option, + pub frame: Option, + pub name: Option, +} + +fn unit(s: &str) -> Result> { + if s == "auto" { + return Ok(None); + } + if !UNITS.contains(&s) { + return Err(EngineError::args(format!("unknown units \"{s}\" (auto, mm, cm, m, in or ft)"))); + } + s.parse::().map(Some).map_err(|e| EngineError::args(e.to_string())) +} + +fn up_axis(s: &str) -> Result> { + if s == "auto" { + return Ok(None); + } + UpAxis::parse(s).map(Some).ok_or_else(|| EngineError::args(format!("unknown up_axis \"{s}\" (auto, y or z)"))) +} + +fn flag(args: &Value, k: &str) -> Result> { + match args.get(k) { + None | Some(Value::Null) => Ok(None), + Some(Value::Bool(b)) => Ok(Some(*b)), + Some(_) => Err(EngineError::args(format!("{k} must be true or false"))), + } +} + +impl ImportArgs { + /// Reads the options: the original `options` object first, then the top-level ones, which win. + pub(crate) fn parse(args: &Value, frame: Option) -> Result { + let empty = json!({}); + let legacy = args.get("options").filter(|o| o.is_object()).unwrap_or(&empty); + let mut clean = clean_options(legacy)?; + let place = ImportOptions { wrap_in_group: get_bool(legacy, "wrap_in_group").unwrap_or(true), ..ImportOptions::default() }; + if let Some(u) = get_str(args, "units") { + clean.unit = unit(u)?.or(clean.unit); + } + if let Some(a) = get_str(args, "up_axis") { + clean.up_axis = up_axis(a)?.or(clean.up_axis); + } + if let Some(b) = flag(args, "stand_on_floor")? { + clean.stand_on_floor = b; + } + if let Some(b) = flag(args, "center")? { + clean.centre = b; + } + let merge = flag(args, "merge")?.unwrap_or(false); + let cad_quality = match args.get("cad_quality") { + None | Some(Value::Null) => None, + Some(v) => Some(CadQuality::parse(v)?), + }; + Ok(ImportArgs { + clean, + place, + merge, + cad_quality, + frame, + name: get_str(args, "name").filter(|n| !n.is_empty()).map(str::to_string), + }) + } + + /// The options as the reply reports them. + pub(crate) fn json(&self) -> Value { + json!({ + "units": self.clean.unit.map(|u| u.as_str()).unwrap_or("auto"), + "up_axis": self.clean.up_axis.map(|a| a.as_str()).unwrap_or("auto"), + "stand_on_floor": self.clean.stand_on_floor, + "center": self.clean.centre, + "merge": self.merge, + "cad_quality": self.cad_quality.as_ref().map(CadQuality::json), + }) + } +} + +fn enum_of(values: &[&str], desc: &str) -> Value { + json!({"type": "string", "enum": values, "description": desc}) +} + +/// Schema properties shared by `file.import` and `import.start`. +pub(crate) fn properties() -> Map { + let mut p = Map::new(); + p.insert("path".into(), json!({"type": "string", "description": "Model file: glb, gltf, obj, stl, ply (3mf, fbx, step, iges where the readers support them)"})); + p.insert("name".into(), json!({"type": "string", "description": "Name for the imported group (the original file name)"})); + p.insert("units".into(), enum_of(UNITS, "Unit the file is in; auto takes what the file declares, else a guess from its size")); + p.insert("up_axis".into(), enum_of(UP_AXES, "Axis that points up in the file; auto takes what the file declares, else y")); + p.insert("stand_on_floor".into(), json!({"type": "boolean", "default": true, "description": "Lift the model so its lowest point rests at height 0"})); + p.insert("center".into(), json!({"type": "boolean", "default": false, "description": "Move the model's footprint centre to the origin"})); + p.insert("frame".into(), json!({"type": "boolean", "description": "Frame the camera on the result (default: only when the document had no parts)"})); + p.insert("merge".into(), json!({"type": "boolean", "default": false, "description": "Put everything the file holds under one group"})); + p.insert( + "cad_quality".into(), + json!({ + "description": "Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle}", + "oneOf": [ + {"type": "string", "enum": CAD_QUALITIES}, + {"type": "object", "properties": { + "chord": {"type": "number", "exclusiveMinimum": 0, "description": "Largest distance between the surface and its triangles, in metres"}, + "angle": {"type": "number", "exclusiveMinimum": 0, "description": "Largest angle between neighbouring triangle normals, in degrees"} + }, "required": ["chord", "angle"]} + ] + }), + ); + p.insert( + "options".into(), + json!({ + "type": "object", + "description": "Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here)", + "properties": { + "unit": {"type": "string", "enum": ["m", "cm", "mm", "in", "ft"], "description": "Unit the file is in"}, + "up_axis": {"type": "string", "enum": ["y", "z", "x", "-y", "-z", "-x"]}, + "smoothing_angle_deg": {"type": "number", "default": 30}, + "weld": {"type": "boolean", "default": true}, + "generate_normals": {"type": "boolean", "default": true}, + "detect_instances": {"type": "boolean", "default": true}, + "stand_on_floor": {"type": "boolean", "default": true}, + "centre": {"type": "boolean", "default": false}, + "wrap_in_group": {"type": "boolean", "default": true} + }, + "required": [] + }), + ); + p +} diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs new file mode 100644 index 00000000..f5eb46cc --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -0,0 +1,118 @@ +use super::options::ImportArgs; +use crate::engine::{frame_values, has_parts, title_from, Engine, State}; +use crate::error::Result; +use fsh_core::{DocKey, NodeId}; +use fsh_io::{CleanReport, Stage, Watch}; +use fsh_scene::{ChangeLevel, Command, Document, ImportNode, ImportPayload, Node, NodeKind, Outcome}; +use serde_json::{json, Value}; +use std::path::{Path, PathBuf}; + +/// A model read, cleaned and converted, ready to apply to a document. +pub(crate) struct Prepared { + pub path: PathBuf, + pub cmd: Command, + pub report: CleanReport, +} + +/// Reads, cleans and converts `path`; touches no document (`doc` only seeds the payload's keys). +pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch) -> Result { + watch.set(Stage::Reading, 0.0); + let mut raw = fsh_io::read_model(path, watch)?; + let report = fsh_io::clean(&mut raw, &a.clean, watch)?; + let mut cmd = fsh_io::to_import_command(&raw, doc, &a.place, watch)?; + if a.merge { + merge_under_group(&mut cmd, &raw.name); + } + Ok(Prepared { path: path.to_path_buf(), cmd, report }) +} + +fn payload_max_key(p: &ImportPayload) -> u64 { + let meshes = p.meshes.iter().map(|m| m.key.raw()); + let materials = p.materials.iter().map(|m| m.key.raw()); + let textures = p.textures.iter().map(|t| t.key.raw()); + let nodes = p.nodes.iter().map(|n| n.id.raw()); + meshes.chain(materials).chain(textures).chain(nodes).max().unwrap_or(0) +} + +/// Makes one group hold everything the import adds (a group named after the file when the file has no single +/// top group). +fn merge_under_group(cmd: &mut Command, name: &str) { + let Command::Import(imp) = cmd else { return }; + let p = &mut imp.payload; + let tops: Vec = p.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); + if tops.is_empty() || (tops.len() == 1 && matches!(p.nodes[tops[0]].node.kind, NodeKind::Group)) { + return; + } + let id = NodeId::from_raw(payload_max_key(p) + 1); + for &t in &tops { + p.nodes[t].node.parent = Some(id); + } + p.nodes.insert(0, ImportNode { id, node: Node::new(name, NodeKind::Group) }); +} + +pub(crate) fn report_json(report: &CleanReport) -> Value { + json!({ + "triangles_dropped": report.triangles_dropped, + "vertices_welded": report.vertices_welded, + "unused_vertices_removed": report.unused_vertices_removed, + "meshes_given_normals": report.meshes_given_normals, + "instances_found": report.instances_found, + "unit": report.unit.as_str(), + "unit_guessed": report.unit_guessed, + "up_axis": report.up_axis.as_str(), + "warnings": report.warnings, + }) +} + +/// Applies a prepared import as one history group: the import, the root rename, framing. +pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, a: &ImportArgs) -> Result { + let path = p.path.as_path(); + let was_empty = !has_parts(st.editor.document()); + let label = format!("Import {}", a.name.clone().unwrap_or_else(|| title_from(path))); + st.editor.begin_group(&label); + st.note_begin(&label); + let cmd = p.cmd; + let result = (|| -> Result { + let out = st.editor.execute(cmd)?; + st.note(&out); + if let Some(name) = a.name.as_deref() { + let stem = title_from(Path::new(name)); + let roots: Vec = out + .created + .iter() + .copied() + .filter(|k| st.editor.document().node(NodeId::from_raw(*k)).is_some_and(|n| n.parent.is_none() && n.name == title_from(path))) + .collect(); + for r in roots { + let renamed = st.editor.dispatch("scene.rename", json!({"id": r, "name": stem}))?; + st.note(&renamed); + } + } + if a.frame.unwrap_or(was_empty) { + if let Ok(values) = frame_values(st.editor.document(), 1.15) { + let index = st.editor.document().active_camera_index(); + let framed = st.editor.dispatch("camera.set", json!({"index": index, "values": values}))?; + st.note(&framed); + } + } + Ok(out) + })(); + let out = match result { + Ok(o) => { + st.editor.end_group()?; + st.note_end(); + o + } + Err(e) => { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } + return Err(e); + } + }; + let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); + reply["name"] = json!("file.import"); + reply["report"] = report_json(&p.report); + reply["options"] = a.json(); + Ok(reply) +} diff --git a/native/crates/fsh-commands/src/ext/mod.rs b/native/crates/fsh-commands/src/ext/mod.rs index c0bf16b1..325cb074 100644 --- a/native/crates/fsh-commands/src/ext/mod.rs +++ b/native/crates/fsh-commands/src/ext/mod.rs @@ -8,7 +8,7 @@ use serde_json::Value; pub(crate) mod cad; mod handoff; -mod import; +pub(crate) mod import; mod library; mod materials; From 0247b7ad0cb015bfb57a1a6e604a29a07c35c9cb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:09:18 -0500 Subject: [PATCH 082/494] feat(commands): add import.probe and route group commands import.probe reads a model and reports format, declared and guessed units, up axis, bounds in file units and counts without touching the document. Engine dispatch now sends names listed by the ext groups to engine_command, which before this answered unknown_command for every group command. Probed four generated models through the release dispatch; the document and content_revision stayed the same. --- native/crates/fsh-commands/src/ext/import.rs | 37 ++++++++++--- .../fsh-commands/src/ext/import/probe.rs | 54 +++++++++++++++++++ 2 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/probe.rs diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 6c9cec11..591fa175 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -2,20 +2,40 @@ use super::ExtCommand; use crate::engine::{Engine, State}; -use crate::error::Result; +use crate::error::{EngineError, Result}; +use crate::util::get_str; use fsh_io::Watch; -use serde_json::Value; -use std::path::Path; +use fsh_scene::ChangeLevel; +use serde_json::{json, Value}; +use std::path::{Path, PathBuf}; mod options; +mod probe; mod run; use options::ImportArgs; -pub(super) static COMMANDS: &[ExtCommand] = &[]; +pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { + name: "import.probe", + description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units, triangles, meshes, nodes, materials, warnings}.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: probe_schema, +}]; + +fn probe_schema() -> Value { + let mut p = serde_json::Map::new(); + p.insert("path".into(), json!({"type": "string", "description": "Model file to read"})); + object(p, &["path"]) +} + +fn need_path(args: &Value, command: &str) -> Result { + get_str(args, "path").filter(|p| !p.is_empty()).map(PathBuf::from).ok_or_else(|| EngineError::args(format!("{command} needs path"))) +} fn object(props: serde_json::Map, required: &[&str]) -> Value { - serde_json::json!({"type": "object", "properties": props, "required": required}) + json!({"type": "object", "properties": props, "required": required}) } /// The `file.import` argument schema (the catalogue's engine table asks for it). @@ -30,6 +50,9 @@ pub(crate) fn import_now(engine: &Engine, st: &mut State, path: &Path, args: &Va run::apply(engine, st, prepared, &a) } -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { - None +pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { + Some(match name { + "import.probe" => need_path(args, name).and_then(|p| probe::probe(&p)), + _ => return None, + }) } diff --git a/native/crates/fsh-commands/src/ext/import/probe.rs b/native/crates/fsh-commands/src/ext/import/probe.rs new file mode 100644 index 00000000..ca5599b7 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/probe.rs @@ -0,0 +1,54 @@ +use crate::error::{EngineError, Result}; +use crate::util::vec3_json; +use fsh_core::LengthUnit; +use fsh_io::{IoError, RawScene, Siblings, UpAxis, Watch}; +use serde_json::{json, Value}; +use std::path::Path; + +/// The unit an automatic import would apply to a file of this size, as the clean-up pass guesses it. +fn guess_unit(raw: &RawScene) -> LengthUnit { + let d = fsh_io::world_bounds(raw).diagonal().length(); + if !d.is_finite() || d < 0.5 { + LengthUnit::Metre + } else if d < 50.0 { + LengthUnit::Centimetre + } else { + LengthUnit::Millimetre + } +} + +/// Reads a model file and describes it without touching any document. +pub(crate) fn probe(path: &Path) -> Result { + let bytes = std::fs::read(path).map_err(|e| EngineError::from(IoError::from(e)))?; + let file = path.file_name().and_then(|n| n.to_str()).unwrap_or(""); + let format = fsh_io::detect_model(file, &bytes).ok_or_else(|| IoError::UnknownFormat(file.to_string()))?; + let stem = path.file_stem().and_then(|s| s.to_str()).unwrap_or("model"); + let mut raw = fsh_io::read_model_bytes(format, &bytes, stem, &Siblings::of(path), &Watch::new())?; + raw.add_nodes_for_loose_meshes(); + let declared = raw.unit.filter(|u| *u != LengthUnit::Unspecified); + let unit = declared.unwrap_or_else(|| guess_unit(&raw)); + let b = fsh_io::world_bounds(&raw); + let bounds = if b.is_empty() { + Value::Null + } else { + json!({"min": vec3_json(b.min), "max": vec3_json(b.max), "size": vec3_json(b.max - b.min)}) + }; + Ok(json!({ + "path": path.to_string_lossy(), + "bytes": bytes.len(), + "name": raw.name, + "format": format.extension(), + "units_declared": declared.map(|u| u.as_str()), + "units_guess": unit.as_str(), + "unit_guessed": declared.is_none(), + "up_axis": raw.up_axis.unwrap_or(UpAxis::Y).as_str(), + "up_axis_declared": raw.up_axis.is_some(), + "bounds": bounds, + "triangles": raw.triangle_count(), + "meshes": raw.meshes.len(), + "nodes": raw.nodes.len(), + "materials": raw.materials.len(), + "textures": raw.textures.len(), + "warnings": raw.warnings, + })) +} From efcba9dbc041f6b2ca3bff9f6d5bc2ff217d7ffa Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:15:20 -0500 Subject: [PATCH 083/494] feat(commands): run imports as background jobs with status and cancel import.start reads and cleans the model on a worker thread with a Watch, import.status reports stage and overall fraction, import.cancel drops the job, and the engine applies a finished job as one history group before the next command (never inside an open group). Release dispatch: a job import undone to the same document as a synchronous one, a 1.8 million triangle OBJ cancelled at 23 percent left the document unchanged, two jobs applied in turn, and a killed session recovered the import as one journal command. --- native/crates/fsh-commands/src/engine.rs | 1 + native/crates/fsh-commands/src/ext/import.rs | 84 +++++++- .../fsh-commands/src/ext/import/jobs.rs | 199 ++++++++++++++++++ 3 files changed, 274 insertions(+), 10 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/jobs.rs diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index e442b10d..fdc867ae 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -308,6 +308,7 @@ impl Engine { _ => return Err(EngineError::args("arguments must be a JSON object")), }; let mut st = lock(&self.state); + crate::ext::import::pump(self, &mut st); let (name, mut args) = alias::translate(name, args, st.editor.document())?; numeric_keys(&mut args); if ENGINE_COMMANDS.iter().any(|c| c.name == name) || crate::ext::commands().any(|c| c.name == name) { diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 591fa175..eda293ee 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -3,26 +3,53 @@ use super::ExtCommand; use crate::engine::{Engine, State}; use crate::error::{EngineError, Result}; -use crate::util::get_str; +use crate::util::{get_bool, get_str}; use fsh_io::Watch; use fsh_scene::ChangeLevel; use serde_json::{json, Value}; use std::path::{Path, PathBuf}; +mod jobs; mod options; mod probe; mod run; use options::ImportArgs; -pub(super) static COMMANDS: &[ExtCommand] = &[ExtCommand { - name: "import.probe", - description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units, triangles, meshes, nodes, materials, warnings}.", - level: ChangeLevel::None, - mutates: false, - read_only: true, - schema: probe_schema, -}]; +pub(super) static COMMANDS: &[ExtCommand] = &[ + ExtCommand { + name: "import.probe", + description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units, triangles, meshes, nodes, materials, warnings}.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: probe_schema, + }, + ExtCommand { + name: "import.start", + description: "Start importing a model in the background with the file.import options and return {job}; the read and clean-up run on a worker, and the document changes (one undo step) on the first engine call after the worker finishes. Follow it with import.status.", + level: ChangeLevel::Full, + mutates: true, + read_only: false, + schema: file_import_schema, + }, + ExtCommand { + name: "import.status", + description: "An import job's progress: {job, state (running, done, failed, cancelled), stage, fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: job_schema_optional, + }, + ExtCommand { + name: "import.cancel", + description: "Cancel a running import job; the document stays exactly as it was. Answers the job's status with cancelled true when it was still running.", + level: ChangeLevel::None, + mutates: false, + read_only: false, + schema: job_schema, + }, +]; fn probe_schema() -> Value { let mut p = serde_json::Map::new(); @@ -30,6 +57,24 @@ fn probe_schema() -> Value { object(p, &["path"]) } +fn job_props() -> serde_json::Map { + let mut p = serde_json::Map::new(); + p.insert("job".into(), json!({"type": ["integer", "string"], "description": "Job id from import.start"})); + p +} + +fn job_schema() -> Value { + object(job_props(), &["job"]) +} + +fn job_schema_optional() -> Value { + object(job_props(), &[]) +} + +fn job_of(args: &Value) -> Option { + args.get("job").and_then(crate::util::key_of) +} + fn need_path(args: &Value, command: &str) -> Result { get_str(args, "path").filter(|p| !p.is_empty()).map(PathBuf::from).ok_or_else(|| EngineError::args(format!("{command} needs path"))) } @@ -50,9 +95,28 @@ pub(crate) fn import_now(engine: &Engine, st: &mut State, path: &Path, args: &Va run::apply(engine, st, prepared, &a) } -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, name: &str, args: &Value) -> Option> { +/// Applies finished background imports; the engine calls it before every command. +pub(crate) fn pump(engine: &Engine, st: &mut State) { + jobs::pump(engine, st); +} + +fn start(engine: &Engine, args: &Value) -> Result { + let path = need_path(args, "import.start")?; + let a = ImportArgs::parse(args, get_bool(args, "frame"))?; + let job = jobs::start(engine, path, a)?; + Ok(json!({"ok": true, "change": "none", "job": job, "state": "running"})) +} + +pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { + if !name.starts_with("import.") { + return None; + } + jobs::pump(engine, st); Some(match name { "import.probe" => need_path(args, name).and_then(|p| probe::probe(&p)), + "import.start" => start(engine, args), + "import.status" => jobs::status(engine, job_of(args)), + "import.cancel" => job_of(args).ok_or_else(|| EngineError::args("import.cancel needs job")).and_then(|j| jobs::cancel(engine, j)), _ => return None, }) } diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs new file mode 100644 index 00000000..37a990f9 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -0,0 +1,199 @@ +use super::options::ImportArgs; +use super::run::{self, Prepared}; +use crate::clock::Moment; +use crate::engine::{Engine, State}; +use crate::error::{EngineError, Result}; +use fsh_io::{Stage, Watch}; +use fsh_scene::Document; +use serde_json::{json, Value}; +use std::collections::BTreeMap; +use std::path::PathBuf; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::{mpsc, Arc, Mutex, MutexGuard}; + +const KEEP_FINISHED: usize = 64; + +enum JobState { + Running(mpsc::Receiver>), + Done(Value), + Failed(EngineError), + Cancelled, +} + +struct Job { + owner: usize, + path: PathBuf, + args: ImportArgs, + watch: Arc, + state: JobState, + started: Moment, + seconds: Option, +} + +static JOBS: Mutex> = Mutex::new(BTreeMap::new()); +static NEXT: AtomicU64 = AtomicU64::new(1); + +fn jobs() -> MutexGuard<'static, BTreeMap> { + JOBS.lock().unwrap_or_else(|p| p.into_inner()) +} + +fn owner(engine: &Engine) -> usize { + engine as *const Engine as usize +} + +fn weight(stage: Stage) -> (f32, f32) { + match stage { + Stage::Idle => (0.0, 0.0), + Stage::Reading => (0.0, 0.40), + Stage::Validating => (0.40, 0.45), + Stage::Welding => (0.45, 0.60), + Stage::Normals => (0.60, 0.75), + Stage::Instancing => (0.75, 0.80), + Stage::Placing => (0.80, 0.82), + Stage::Converting => (0.82, 0.97), + Stage::Done => (0.97, 0.97), + } +} + +fn overall(watch: &Watch) -> f32 { + let (a, b) = weight(watch.stage()); + a + (b - a) * watch.fraction() +} + +/// Starts reading, cleaning and converting `path` on a worker thread (inline on wasm32) and returns the job id. +pub(crate) fn start(engine: &Engine, path: PathBuf, args: ImportArgs) -> Result { + if !path.is_file() { + return Err(EngineError::File(format!("{}: no such file", path.display()))); + } + let id = NEXT.fetch_add(1, Ordering::Relaxed); + let watch = Arc::new(Watch::new()); + let (tx, rx) = mpsc::channel(); + let work = { + let (path, args, watch) = (path.clone(), args.clone(), Arc::clone(&watch)); + move || { + let r = run::prepare(&path, &args, &Document::default(), &watch); + if r.is_ok() { + watch.set(Stage::Done, 1.0); + } + let _ = tx.send(r); + } + }; + jobs().insert(id, Job { owner: owner(engine), path, args, watch, state: JobState::Running(rx), started: Moment::now(), seconds: None }); + if cfg!(target_arch = "wasm32") { + work(); + } else { + std::thread::Builder::new() + .name(format!("formshot-import-{id}")) + .spawn(work) + .map_err(|e| EngineError::state(format!("the import thread could not start: {e}")))?; + } + Ok(id) +} + +/// Applies every finished job of this engine, oldest first, each as one history step. Nothing is applied while a +/// history group is open, so an import never lands inside someone else's group. +pub(crate) fn pump(engine: &Engine, st: &mut State) { + if st.editor.history().group_depth() > 0 { + return; + } + let me = owner(engine); + let ready: Vec<(u64, Result)> = { + let mut all = jobs(); + let mut out = Vec::new(); + for (id, job) in all.iter_mut().filter(|(_, j)| j.owner == me) { + let JobState::Running(rx) = &job.state else { continue }; + match rx.try_recv() { + Ok(r) => out.push((*id, r)), + Err(mpsc::TryRecvError::Empty) => {} + Err(mpsc::TryRecvError::Disconnected) => { + out.push((*id, Err(EngineError::state("the import thread stopped without a result")))); + } + } + } + out + }; + for (id, r) in ready { + let args = match jobs().get(&id) { + Some(j) => j.args.clone(), + None => continue, + }; + let state = match r.and_then(|p| run::apply(engine, st, p, &args)) { + Ok(mut reply) => { + reply["job"] = json!(id); + JobState::Done(reply) + } + Err(e) if e.code() == "cancelled" => JobState::Cancelled, + Err(e) => JobState::Failed(e), + }; + if let Some(j) = jobs().get_mut(&id) { + j.seconds = Some(j.started.elapsed().as_secs_f64()); + j.state = state; + } + } + prune(); +} + +fn prune() { + let mut all = jobs(); + let finished: Vec = all.iter().filter(|(_, j)| !matches!(j.state, JobState::Running(_))).map(|(id, _)| *id).collect(); + if finished.len() > KEEP_FINISHED { + for id in &finished[..finished.len() - KEEP_FINISHED] { + all.remove(id); + } + } +} + +fn status_json(id: u64, j: &Job) -> Value { + let (state, stage, fraction) = match &j.state { + JobState::Running(_) => ("running", j.watch.stage().as_str(), overall(&j.watch)), + JobState::Done(_) => ("done", "done", 1.0), + JobState::Failed(_) => ("failed", j.watch.stage().as_str(), overall(&j.watch)), + JobState::Cancelled => ("cancelled", j.watch.stage().as_str(), overall(&j.watch)), + }; + let mut v = json!({ + "job": id, + "state": state, + "stage": stage, + "fraction": crate::util::num(fraction), + "path": j.path.to_string_lossy(), + "seconds": j.seconds.unwrap_or_else(|| j.started.elapsed().as_secs_f64()), + }); + match &j.state { + JobState::Done(r) => v["result"] = r.clone(), + JobState::Failed(e) => v["error"] = json!({"message": e.to_string(), "code": e.code()}), + _ => {} + } + v +} + +fn unknown(id: u64) -> EngineError { + EngineError::args(format!("no import job {id} in this session")) +} + +/// One job's status, or every job of this engine when `id` is absent. +pub(crate) fn status(engine: &Engine, id: Option) -> Result { + let me = owner(engine); + let all = jobs(); + match id { + Some(id) => all.get(&id).filter(|j| j.owner == me).map(|j| status_json(id, j)).ok_or_else(|| unknown(id)), + None => Ok(json!({"jobs": all.iter().filter(|(_, j)| j.owner == me).map(|(id, j)| status_json(*id, j)).collect::>()})), + } +} + +/// Stops a running job; its result, if it arrives, is dropped and the document stays as it was. +pub(crate) fn cancel(engine: &Engine, id: u64) -> Result { + let me = owner(engine); + let mut all = jobs(); + let j = all.get_mut(&id).filter(|j| j.owner == me).ok_or_else(|| unknown(id))?; + let was_running = matches!(j.state, JobState::Running(_)); + if was_running { + j.watch.cancel(); + j.state = JobState::Cancelled; + j.seconds = Some(j.started.elapsed().as_secs_f64()); + } + let mut v = status_json(id, j); + v["ok"] = json!(true); + v["change"] = json!("none"); + v["cancelled"] = json!(was_running); + Ok(v) +} From 33d5100da735f6b22d586974cedbd1f143b891fa Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:20:03 -0500 Subject: [PATCH 084/494] feat(commands): record each imported node's source file and path Every node an import makes carries source.path (absolute) and source.node (names joined by slashes, empty for the group that holds the whole file); the import's top nodes also keep the geometry options as source.options for a later re-import. Old-style imports through the release dispatch still match the earlier documents once the source keys are left out; glb, obj and stl jobs showed the expected keys. --- native/crates/fsh-commands/src/catalogue.rs | 2 +- native/crates/fsh-commands/src/ext/import.rs | 1 + .../fsh-commands/src/ext/import/options.rs | 12 +++++ .../crates/fsh-commands/src/ext/import/run.rs | 18 +++++-- .../fsh-commands/src/ext/import/source.rs | 47 +++++++++++++++++++ 5 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/source.rs diff --git a/native/crates/fsh-commands/src/catalogue.rs b/native/crates/fsh-commands/src/catalogue.rs index af49a3d6..4d68eac9 100644 --- a/native/crates/fsh-commands/src/catalogue.rs +++ b/native/crates/fsh-commands/src/catalogue.rs @@ -34,7 +34,7 @@ pub(crate) const ENGINE_COMMANDS: &[EngineCommand] = &[ cmd("file.new", Full, true, false, "Start a new document, empty or from a template (empty-studio, product-white, studio-light, studio-dark, spheres, turntable, daylight, sample)."), cmd("file.open", Full, true, false, "Open a .fshot project, or a model file as a new document."), cmd("file.save", Nothing, false, false, "Save the document as .fshot to path, or to its own path."), - cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional."), + cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional, and every node made carries source.path and source.node metadata."), cmd("file.close", Full, true, false, "Close the document, leaving an empty one, and stop rendering."), cmd("file.export_image", Nothing, false, false, "Write the latest progressive frame to png, hdr or exr."), cmd("file.export_model", Nothing, false, false, "Write the visible document as a binary glTF (.glb)."), diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index eda293ee..18309b77 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -13,6 +13,7 @@ mod jobs; mod options; mod probe; mod run; +mod source; use options::ImportArgs; diff --git a/native/crates/fsh-commands/src/ext/import/options.rs b/native/crates/fsh-commands/src/ext/import/options.rs index fc0cc312..d44820ad 100644 --- a/native/crates/fsh-commands/src/ext/import/options.rs +++ b/native/crates/fsh-commands/src/ext/import/options.rs @@ -48,8 +48,11 @@ pub(crate) struct ImportArgs { pub cad_quality: Option, pub frame: Option, pub name: Option, + pub geometry: Map, } +const GEOMETRY_KEYS: &[&str] = &["options", "units", "up_axis", "stand_on_floor", "center", "merge", "cad_quality"]; + fn unit(s: &str) -> Result> { if s == "auto" { return Ok(None); @@ -106,9 +109,18 @@ impl ImportArgs { cad_quality, frame, name: get_str(args, "name").filter(|n| !n.is_empty()).map(str::to_string), + geometry: GEOMETRY_KEYS + .iter() + .filter_map(|k| args.get(*k).filter(|v| !v.is_null()).map(|v| ((*k).to_string(), v.clone()))) + .collect(), }) } + /// The options that shape the geometry, as kept in `source.options`; `None` when every one is the default. + pub(crate) fn geometry_json(&self) -> Option { + (!self.geometry.is_empty()).then(|| Value::Object(self.geometry.clone()).to_string()) + } + /// The options as the reply reports them. pub(crate) fn json(&self) -> Value { json!({ diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index f5eb46cc..5dce8464 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -1,4 +1,5 @@ use super::options::ImportArgs; +use super::source; use crate::engine::{frame_values, has_parts, title_from, Engine, State}; use crate::error::Result; use fsh_core::{DocKey, NodeId}; @@ -19,10 +20,18 @@ pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch watch.set(Stage::Reading, 0.0); let mut raw = fsh_io::read_model(path, watch)?; let report = fsh_io::clean(&mut raw, &a.clean, watch)?; + let roots = raw.nodes.iter().filter(|n| n.parent.is_none()).count(); let mut cmd = fsh_io::to_import_command(&raw, doc, &a.place, watch)?; + let mut whole = Vec::new(); + if let Command::Import(imp) = &cmd { + if a.place.wrap_in_group && roots > 1 { + whole.extend(imp.payload.nodes.first().map(|n| n.id)); + } + } if a.merge { - merge_under_group(&mut cmd, &raw.name); + whole.extend(merge_under_group(&mut cmd, &raw.name)); } + source::annotate(&mut cmd, path, &whole, a.geometry_json().as_deref()); Ok(Prepared { path: path.to_path_buf(), cmd, report }) } @@ -36,18 +45,19 @@ fn payload_max_key(p: &ImportPayload) -> u64 { /// Makes one group hold everything the import adds (a group named after the file when the file has no single /// top group). -fn merge_under_group(cmd: &mut Command, name: &str) { - let Command::Import(imp) = cmd else { return }; +fn merge_under_group(cmd: &mut Command, name: &str) -> Option { + let Command::Import(imp) = cmd else { return None }; let p = &mut imp.payload; let tops: Vec = p.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); if tops.is_empty() || (tops.len() == 1 && matches!(p.nodes[tops[0]].node.kind, NodeKind::Group)) { - return; + return None; } let id = NodeId::from_raw(payload_max_key(p) + 1); for &t in &tops { p.nodes[t].node.parent = Some(id); } p.nodes.insert(0, ImportNode { id, node: Node::new(name, NodeKind::Group) }); + Some(id) } pub(crate) fn report_json(report: &CleanReport) -> Value { diff --git a/native/crates/fsh-commands/src/ext/import/source.rs b/native/crates/fsh-commands/src/ext/import/source.rs new file mode 100644 index 00000000..0fbb5ce5 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/source.rs @@ -0,0 +1,47 @@ +use fsh_core::NodeId; +use fsh_scene::Command; +use std::collections::BTreeMap; +use std::path::{Path, PathBuf}; + +/// Absolute path of the file a node came from. +pub(crate) const PATH: &str = "source.path"; +/// The node's path inside that file: names from the file's top joined by `/`; empty for a group the import made +/// to hold the whole file. +pub(crate) const NODE: &str = "source.node"; +/// The geometry options the import used (JSON), kept on the import's top nodes so a re-import reads alike. +pub(crate) const OPTIONS: &str = "source.options"; + +/// The absolute form of `path` (canonical when the file exists). +pub(crate) fn absolute(path: &Path) -> PathBuf { + std::fs::canonicalize(path).unwrap_or_else(|_| std::env::current_dir().map(|d| d.join(path)).unwrap_or_else(|_| path.to_path_buf())) +} + +pub(crate) fn join(parent: &str, name: &str) -> String { + if parent.is_empty() { + name.to_string() + } else { + format!("{parent}/{name}") + } +} + +/// Writes `source.path` and `source.node` on every node of an import payload; `whole` lists the groups that hold +/// the whole file (their path is empty). `options` goes on the top nodes when given. +pub(crate) fn annotate(cmd: &mut Command, path: &Path, whole: &[NodeId], options: Option<&str>) { + let Command::Import(imp) = cmd else { return }; + let file = absolute(path).to_string_lossy().into_owned(); + let mut paths: BTreeMap = BTreeMap::new(); + for n in imp.payload.nodes.iter_mut() { + let inside = if whole.contains(&n.id) { + String::new() + } else { + let parent = n.node.parent.and_then(|p| paths.get(&p)).map(String::as_str).unwrap_or(""); + join(parent, &n.node.name) + }; + paths.insert(n.id, inside.clone()); + n.node.metadata.insert(PATH.to_string(), file.clone()); + n.node.metadata.insert(NODE.to_string(), inside); + if let Some(o) = options.filter(|_| n.node.parent.is_none()) { + n.node.metadata.insert(OPTIONS.to_string(), o.to_string()); + } + } +} From f6812b9ce30203a2c11590998b1a62a63d413fd7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:26:02 -0500 Subject: [PATCH 085/494] feat(commands): add file.reimport to read imported files again Each import's top node keeps the resolved unit and up axis, so a re-read cleans alike; parts match by source.node, then unique name, then identical shape, keep their material and transform, take the new shape (as a new part in the same place), new parts arrive under their matched parent, and vanished ones are hidden with source.missing, all in one history group. Release dispatch on an OBJ with one part reshaped, one renamed, one added and one removed: matched 3, added 1, hidden 1, updated 1, the user material and offset kept, undo restored the document, and restoring the part showed it again. --- native/crates/fsh-commands/src/ext/import.rs | 18 +- .../fsh-commands/src/ext/import/options.rs | 6 - .../fsh-commands/src/ext/import/reimport.rs | 390 ++++++++++++++++++ .../crates/fsh-commands/src/ext/import/run.rs | 5 +- .../fsh-commands/src/ext/import/source.rs | 31 +- 5 files changed, 441 insertions(+), 9 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/reimport.rs diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 18309b77..f820b6ff 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -12,6 +12,7 @@ use std::path::{Path, PathBuf}; mod jobs; mod options; mod probe; +mod reimport; mod run; mod source; @@ -50,8 +51,22 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ read_only: false, schema: job_schema, }, + ExtCommand { + name: "file.reimport", + description: "Read the source files of the given imported nodes again (every imported node when none): parts match by source.node, then by unique name, then by identical shape; matched parts keep their materials and transforms and take the new shape, new parts are added, parts gone from the file are hidden (marked source.missing), all as one undo step. Answers {matched, added, hidden, updated, files: [{path, matched, added, hidden, updated, warnings, error?}]}.", + level: ChangeLevel::Full, + mutates: true, + read_only: false, + schema: reimport_schema, + }, ]; +fn reimport_schema() -> Value { + let mut p = serde_json::Map::new(); + p.insert("nodes".into(), json!({"type": "array", "items": {"type": ["string", "integer"]}, "description": "Imported nodes (or groups holding them) whose files to read again; every imported node when absent"})); + object(p, &[]) +} + fn probe_schema() -> Value { let mut p = serde_json::Map::new(); p.insert("path".into(), json!({"type": "string", "description": "Model file to read"})); @@ -109,11 +124,12 @@ fn start(engine: &Engine, args: &Value) -> Result { } pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { - if !name.starts_with("import.") { + if !name.starts_with("import.") && name != "file.reimport" { return None; } jobs::pump(engine, st); Some(match name { + "file.reimport" => crate::view::node_list(st.editor.document(), args).and_then(|nodes| reimport::reimport(engine, st, nodes)), "import.probe" => need_path(args, name).and_then(|p| probe::probe(&p)), "import.start" => start(engine, args), "import.status" => jobs::status(engine, job_of(args)), diff --git a/native/crates/fsh-commands/src/ext/import/options.rs b/native/crates/fsh-commands/src/ext/import/options.rs index d44820ad..c77981e8 100644 --- a/native/crates/fsh-commands/src/ext/import/options.rs +++ b/native/crates/fsh-commands/src/ext/import/options.rs @@ -115,12 +115,6 @@ impl ImportArgs { .collect(), }) } - - /// The options that shape the geometry, as kept in `source.options`; `None` when every one is the default. - pub(crate) fn geometry_json(&self) -> Option { - (!self.geometry.is_empty()).then(|| Value::Object(self.geometry.clone()).to_string()) - } - /// The options as the reply reports them. pub(crate) fn json(&self) -> Value { json!({ diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs new file mode 100644 index 00000000..8cae896f --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -0,0 +1,390 @@ +use super::options::ImportArgs; +use super::run; +use super::source; +use crate::engine::{Engine, State}; +use crate::error::{EngineError, Result}; +use fsh_core::{DocKey, MaterialKey, MeshKey, NodeId}; +use fsh_io::Watch; +use fsh_scene::{ + ChangeLevel, Command, Document, Import, ImportMaterial, ImportMesh, ImportNode, ImportPayload, ImportTexture, Mesh, + Node, NodeKind, Outcome, +}; +use serde_json::{json, Value}; +use std::collections::{BTreeMap, BTreeSet, VecDeque}; +use std::path::Path; +use std::sync::Arc; + +/// What one re-read file changed. +#[derive(Default)] +struct FileReport { + matched: usize, + added: usize, + hidden: usize, + updated: usize, + warnings: Vec, + error: Option, +} + +fn same_shape(a: &Mesh, b: &Mesh) -> bool { + a.positions == b.positions && a.indices == b.indices && a.normals == b.normals && a.uvs == b.uvs && a.colours == b.colours +} + +fn part_of(n: &Node) -> Option<(MeshKey, Option)> { + match n.kind { + NodeKind::Part { mesh, material } => Some((mesh, material)), + _ => None, + } +} + +/// The import tops to re-read: those of the given nodes and of imported nodes under them, or every import. +fn tops(doc: &Document, nodes: Option<&[NodeId]>) -> Vec { + let candidates: Vec = match nodes { + Some(list) => list.iter().flat_map(|id| doc.subtree(*id)).collect(), + None => doc.nodes().keys().copied().collect(), + }; + let set: BTreeSet = candidates.into_iter().filter_map(|id| source::import_top(doc, id)).collect(); + set.into_iter().collect() +} + +/// The new file's nodes, matched against one import's nodes in the document. +struct Plan { + payload: ImportPayload, + by_new: BTreeMap, + matched_doc: BTreeSet, + new_order: Vec, +} + +fn payload_of(cmd: Command) -> Result { + match cmd { + Command::Import(i) => Ok(i.payload), + _ => Err(EngineError::state("the reader did not produce an import")), + } +} + +fn plan(doc: &Document, top: NodeId, payload: ImportPayload) -> Result { + let top_node = doc.get_node(top)?; + let file = source::source_path(top_node).unwrap_or_default().to_string(); + let pnodes: BTreeMap = payload.nodes.iter().map(|n| (n.id, &n.node)).collect(); + let tops_new: Vec = payload.nodes.iter().filter(|n| n.node.parent.is_none()).map(|n| n.id).collect(); + let pick = if tops_new.len() == 1 { + tops_new.first().copied() + } else { + tops_new + .iter() + .copied() + .find(|t| source::source_node(pnodes[t]) == source::source_node(top_node)) + .or_else(|| { + let same: Vec = tops_new.iter().copied().filter(|t| pnodes[t].name == source::file_name(top_node)).collect(); + (same.len() == 1).then(|| same[0]) + }) + }; + let Some(ptop) = pick else { + return Err(EngineError::state(format!("{file}: the file no longer has a top node that matches {}", top_node.name))); + }; + let mut inside: BTreeSet = BTreeSet::from([ptop]); + let mut new_order = vec![ptop]; + for n in &payload.nodes { + if n.node.parent.is_some_and(|p| inside.contains(&p)) && inside.insert(n.id) { + new_order.push(n.id); + } + } + let docs: Vec = doc.subtree(top).into_iter().filter(|id| doc.node(*id).and_then(source::source_path) == Some(file.as_str())).collect(); + let is_part = |n: &Node| matches!(n.kind, NodeKind::Part { .. }); + let mut by_new: BTreeMap = BTreeMap::from([(ptop, top)]); + let mut matched_doc: BTreeSet = BTreeSet::from([top]); + + let mut by_path: BTreeMap<&str, VecDeque> = BTreeMap::new(); + for id in docs.iter().filter(|id| **id != top) { + by_path.entry(source::source_node(&doc.nodes()[id])).or_default().push_back(*id); + } + for nid in new_order.iter().skip(1) { + let n = pnodes[nid]; + if let Some(q) = by_path.get_mut(source::source_node(n)) { + if let Some(pos) = q.iter().position(|d| is_part(&doc.nodes()[d]) == is_part(n)) { + let d = q.remove(pos).unwrap_or(top); + by_new.insert(*nid, d); + matched_doc.insert(d); + } + } + } + + let free_doc = |matched: &BTreeSet| -> Vec { docs.iter().copied().filter(|d| !matched.contains(d)).collect() }; + let free_new = |by_new: &BTreeMap| -> Vec { new_order.iter().copied().filter(|n| !by_new.contains_key(n)).collect() }; + + let (fd, fnew) = (free_doc(&matched_doc), free_new(&by_new)); + let mut doc_names: BTreeMap<(&str, bool), Vec> = BTreeMap::new(); + for d in &fd { + let n = &doc.nodes()[d]; + doc_names.entry((source::file_name(n), is_part(n))).or_default().push(*d); + } + let mut new_names: BTreeMap<(&str, bool), Vec> = BTreeMap::new(); + for nid in &fnew { + let n = pnodes[nid]; + new_names.entry((n.name.as_str(), is_part(n))).or_default().push(*nid); + } + for (k, ns) in &new_names { + if let (1, Some(ds)) = (ns.len(), doc_names.get(k)) { + if ds.len() == 1 { + by_new.insert(ns[0], ds[0]); + matched_doc.insert(ds[0]); + } + } + } + + let meshes: BTreeMap> = payload.meshes.iter().map(|m| (m.key, &m.mesh)).collect(); + let (fd, fnew) = (free_doc(&matched_doc), free_new(&by_new)); + let doc_mesh = |d: &NodeId| part_of(&doc.nodes()[d]).and_then(|(m, _)| doc.mesh(m)); + let new_mesh = |n: &NodeId| part_of(pnodes[n]).and_then(|(m, _)| meshes.get(&m).copied()); + for nid in &fnew { + let Some(nm) = new_mesh(nid) else { continue }; + let ds: Vec = fd.iter().copied().filter(|d| !matched_doc.contains(d) && doc_mesh(d).is_some_and(|m| same_shape(m, nm))).collect(); + let twins = fnew.iter().filter(|o| new_mesh(o).is_some_and(|m| same_shape(m, nm))).count(); + if ds.len() == 1 && twins == 1 { + by_new.insert(*nid, ds[0]); + matched_doc.insert(ds[0]); + } + } + Ok(Plan { payload, by_new, matched_doc, new_order }) +} + +fn exec(st: &mut State, cmd: Command, outs: &mut Vec) -> Result<()> { + let out = st.editor.execute(cmd)?; + st.note(&out); + outs.push(out); + Ok(()) +} + +fn dispatch(st: &mut State, name: &str, args: Value, outs: &mut Vec) -> Result<()> { + let out = st.editor.dispatch(name, args)?; + st.note(&out); + outs.push(out); + Ok(()) +} + +/// A sub-payload holding `nodes` (parents first) and the meshes, materials and textures they use; materials found in +/// `reuse` point at document materials instead. +fn subset(p: &ImportPayload, nodes: Vec, reuse: &BTreeMap) -> ImportPayload { + let mut out = ImportPayload { nodes, ..ImportPayload::default() }; + let mut meshes = BTreeSet::new(); + let mut materials = BTreeSet::new(); + for n in out.nodes.iter_mut() { + if let NodeKind::Part { mesh, material } = &mut n.node.kind { + meshes.insert(*mesh); + if let Some(m) = material { + match reuse.get(m) { + Some(doc_key) => *m = *doc_key, + None => { + materials.insert(*m); + } + } + } + } + } + out.meshes = p.meshes.iter().filter(|m| meshes.contains(&m.key)).cloned().collect(); + out.materials = p.materials.iter().filter(|m| materials.contains(&m.key)).cloned().collect::>(); + let textures: BTreeSet<_> = out.materials.iter().flat_map(|m| m.material.textures.iter().copied()).collect(); + out.textures = p.textures.iter().filter(|t| textures.contains(&t.key)).cloned().collect::>(); + out +} + +fn index_in_parent(doc: &Document, id: NodeId) -> Option { + let parent = doc.node(id)?.parent; + doc.children_of(parent).iter().position(|c| *c == id) +} + +/// Replaces a part's mesh by the re-read one, keeping its place, name, material, transform and every other setting. +/// The part gets a new id (the document has no command that swaps a part's mesh in place). +fn replace_mesh(st: &mut State, d: NodeId, mesh: &ImportMesh, outs: &mut Vec) -> Result { + let doc = st.editor.document(); + let old = doc.get_node(d)?.clone(); + let Some((old_mesh, material)) = part_of(&old) else { return Ok(d) }; + let index = index_in_parent(doc, d); + let fresh = doc.next_key().max(1); + let (mkey, nid) = (MeshKey::from_raw(fresh), NodeId::from_raw(fresh + 1)); + let mut node = old.clone(); + node.parent = None; + node.children.clear(); + node.kind = NodeKind::Part { mesh: mkey, material }; + let payload = ImportPayload { meshes: vec![ImportMesh { key: mkey, mesh: Arc::clone(&mesh.mesh) }], nodes: vec![ImportNode { id: nid, node }], ..ImportPayload::default() }; + exec(st, Command::Import(Import { parent: old.parent, payload }), outs)?; + let new_id = outs.last().and_then(|o| o.created.first().copied()).map(NodeId::from_raw).unwrap_or(nid); + dispatch(st, "scene.reparent", json!({"ids": [new_id.raw()], "parent": old.parent.map(|p| p.raw()), "index": index, "keep_world": false}), outs)?; + dispatch(st, "scene.remove", json!({"ids": [d.raw()]}), outs)?; + if st.editor.document().parts_using_mesh(old_mesh).is_empty() { + dispatch(st, "mesh.remove", json!({"key": old_mesh.raw()}), outs)?; + } + Ok(new_id) +} + +fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileReport) -> Result<()> { + let doc = st.editor.document(); + let top_node = doc.get_node(top)?; + let file = source::source_path(top_node).unwrap_or_default().to_string(); + let stored: Value = top_node.metadata.get(source::OPTIONS).and_then(|s| serde_json::from_str(s).ok()).unwrap_or_else(|| json!({})); + let a = ImportArgs::parse(&stored, Some(false))?; + let prepared = run::prepare(Path::new(&file), &a, doc, &Watch::new())?; + rep.warnings.extend(prepared.report.warnings.iter().cloned()); + let p = plan(doc, top, payload_of(prepared.cmd)?)?; + let pnodes: BTreeMap = p.payload.nodes.iter().map(|n| (n.id, n)).collect(); + let meshes: BTreeMap = p.payload.meshes.iter().map(|m| (m.key, m)).collect(); + + let mut reuse: BTreeMap = BTreeMap::new(); + let mut renames = Vec::new(); + let mut paths = Vec::new(); + let mut swaps = Vec::new(); + let mut returned = Vec::new(); + for (nid, d) in &p.by_new { + let (new, old) = (&pnodes[nid].node, &doc.nodes()[d]); + rep.matched += 1; + if old.metadata.contains_key(source::MISSING) { + returned.push(*d); + } + if old.name == source::file_name(old) && new.name != old.name && *d != top { + renames.push((*d, new.name.clone())); + } + if source::source_node(new) != source::source_node(old) { + paths.push((*d, source::source_node(new).to_string())); + } + if let (Some((nm, nmat)), Some((om, omat))) = (part_of(new), part_of(old)) { + if let (Some(n), Some(o)) = (nmat, omat) { + reuse.entry(n).or_insert(o); + } + let Some(fresh) = meshes.get(&nm) else { continue }; + if doc.mesh(om).is_some_and(|m| same_shape(m, &fresh.mesh)) { + continue; + } + if doc.is_locked(*d) || !old.children.is_empty() { + rep.warnings.push(format!("{} kept its old shape: it is locked or has children", old.name)); + } else { + swaps.push((*d, (*fresh).clone())); + } + } + } + let mut added: BTreeMap, Vec> = BTreeMap::new(); + let mut taken: BTreeSet = BTreeSet::new(); + for nid in &p.new_order { + if p.by_new.contains_key(nid) { + continue; + } + let n = pnodes[nid]; + let Some(parent) = n.node.parent else { continue }; + let mut node = (*n).clone(); + let target = if taken.contains(&parent) { + Some(parent) + } else { + node.node.parent = None; + p.by_new.get(&parent).copied() + }; + let Some(doc_parent) = target else { continue }; + if !taken.contains(&parent) && doc.is_locked(doc_parent) { + rep.warnings.push(format!("{} was not added: {} is locked", n.node.name, doc.nodes()[&doc_parent].name)); + continue; + } + if taken.contains(&parent) { + if let Some(list) = added.values_mut().find(|l| l.iter().any(|x| x.id == parent)) { + list.push(node); + } + } else { + added.entry(Some(doc_parent)).or_default().push(node); + } + taken.insert(*nid); + rep.added += 1; + } + let has_matched_below = |id: NodeId| doc.subtree(id).iter().any(|x| p.matched_doc.contains(x)); + let vanished: Vec = doc + .subtree(top) + .into_iter() + .filter(|id| doc.node(*id).and_then(source::source_path) == Some(file.as_str())) + .filter(|id| !has_matched_below(*id)) + .collect(); + rep.hidden = vanished.iter().filter(|id| !doc.nodes()[*id].metadata.contains_key(source::MISSING)).count(); + let hide: Vec = vanished.iter().filter(|id| doc.node(**id).is_some_and(|n| n.visible)).map(|id| id.raw()).collect(); + + for (d, name) in renames { + dispatch(st, "scene.rename", json!({"id": d.raw(), "name": name}), outs)?; + } + for (d, path) in paths { + dispatch(st, "scene.set_metadata", json!({"id": d.raw(), "key": source::NODE, "value": path}), outs)?; + } + for (d, mesh) in swaps { + replace_mesh(st, d, &mesh, outs)?; + rep.updated += 1; + } + for (parent, nodes) in added { + let payload = subset(&p.payload, nodes, &reuse); + exec(st, Command::Import(Import { parent, payload }), outs)?; + } + if !hide.is_empty() { + dispatch(st, "scene.set_visible", json!({"ids": hide, "visible": false}), outs)?; + for id in &hide { + dispatch(st, "scene.set_metadata", json!({"id": id, "key": source::MISSING, "value": "true"}), outs)?; + } + } + if !returned.is_empty() { + let ids: Vec = returned.iter().map(|d| d.raw()).collect(); + dispatch(st, "scene.set_visible", json!({"ids": ids, "visible": true}), outs)?; + for id in ids { + dispatch(st, "scene.set_metadata", json!({"id": id, "key": source::MISSING, "value": null}), outs)?; + } + } + Ok(()) +} + +fn abandon(st: &mut State) { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } +} + +/// `file.reimport`: re-reads the source files of the given nodes (every imported node when none), as one undo step. +pub(crate) fn reimport(engine: &Engine, st: &mut State, nodes: Option>) -> Result { + let list = tops(st.editor.document(), nodes.as_deref()); + if list.is_empty() { + return Err(EngineError::state("no imported nodes to re-import (nodes made by an import carry source.path)")); + } + let label = "Re-import"; + st.editor.begin_group(label); + st.note_begin(label); + let mut outs = Vec::new(); + let mut files: Vec<(String, FileReport)> = Vec::new(); + for top in list { + let Some(file) = st.editor.document().node(top).and_then(source::source_path).map(str::to_string) else { continue }; + let mut rep = FileReport::default(); + let before = outs.len(); + if let Err(e) = reread(st, top, &mut outs, &mut rep) { + if outs.len() > before { + abandon(st); + return Err(e); + } + rep = FileReport { error: Some(e), ..FileReport::default() }; + } + files.push((file, rep)); + } + let changed = !outs.is_empty(); + st.editor.end_group()?; + st.note_end(); + let total = |f: fn(&FileReport) -> usize| files.iter().map(|(_, r)| f(r)).sum::(); + let files_json: Vec = files + .iter() + .map(|(path, r)| { + let mut v = json!({"path": path, "matched": r.matched, "added": r.added, "hidden": r.hidden, "updated": r.updated, "warnings": r.warnings}); + if let Some(e) = &r.error { + v["error"] = json!({"message": e.to_string(), "code": e.code()}); + } + v + }) + .collect(); + let created: Vec = outs.iter().filter(|o| o.name == "scene.import").flat_map(|o| o.created.iter().copied()).collect(); + let mut reply = if changed { + engine.changed(st, &Outcome { name: "file.reimport".into(), level: ChangeLevel::Full, created, merged: false, command: None }, false) + } else { + json!({"ok": true, "change": "none", "revision": st.revision}) + }; + reply["name"] = json!("file.reimport"); + reply["matched"] = json!(total(|r| r.matched)); + reply["added"] = json!(total(|r| r.added)); + reply["hidden"] = json!(total(|r| r.hidden)); + reply["updated"] = json!(total(|r| r.updated)); + reply["files"] = json!(files_json); + Ok(reply) +} diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index 5dce8464..f2f97d23 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -31,7 +31,10 @@ pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch if a.merge { whole.extend(merge_under_group(&mut cmd, &raw.name)); } - source::annotate(&mut cmd, path, &whole, a.geometry_json().as_deref()); + let mut kept = a.geometry.clone(); + kept.insert("units".into(), json!(report.unit.as_str())); + kept.insert("up_axis".into(), json!(report.up_axis.as_str())); + source::annotate(&mut cmd, path, &whole, Some(&Value::Object(kept).to_string())); Ok(Prepared { path: path.to_path_buf(), cmd, report }) } diff --git a/native/crates/fsh-commands/src/ext/import/source.rs b/native/crates/fsh-commands/src/ext/import/source.rs index 0fbb5ce5..1ff8328f 100644 --- a/native/crates/fsh-commands/src/ext/import/source.rs +++ b/native/crates/fsh-commands/src/ext/import/source.rs @@ -1,5 +1,5 @@ use fsh_core::NodeId; -use fsh_scene::Command; +use fsh_scene::{Command, Document, Node}; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; @@ -8,6 +8,8 @@ pub(crate) const PATH: &str = "source.path"; /// The node's path inside that file: names from the file's top joined by `/`; empty for a group the import made /// to hold the whole file. pub(crate) const NODE: &str = "source.node"; +/// Set on a node a re-import hid because its file no longer has it; cleared when it comes back. +pub(crate) const MISSING: &str = "source.missing"; /// The geometry options the import used (JSON), kept on the import's top nodes so a re-import reads alike. pub(crate) const OPTIONS: &str = "source.options"; @@ -45,3 +47,30 @@ pub(crate) fn annotate(cmd: &mut Command, path: &Path, whole: &[NodeId], options } } } + +pub(crate) fn source_path(n: &Node) -> Option<&str> { + n.metadata.get(PATH).map(String::as_str) +} + +pub(crate) fn source_node(n: &Node) -> &str { + n.metadata.get(NODE).map(String::as_str).unwrap_or("") +} + +/// The name a node had in its file: the last part of `source.node`. +pub(crate) fn file_name(n: &Node) -> &str { + let p = source_node(n); + p.rsplit('/').next().unwrap_or(p) +} + +/// The top node of the import that made `id`: its highest ancestor from the same file. +pub(crate) fn import_top(doc: &Document, id: NodeId) -> Option { + let file = source_path(doc.node(id)?)?; + let mut top = id; + while let Some(p) = doc.node(top).and_then(|n| n.parent) { + if doc.node(p).and_then(source_path) != Some(file) { + break; + } + top = p; + } + Some(top) +} From e1e48d1b74f857ad056f3f3661caf8ec378f0702 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:30:03 -0500 Subject: [PATCH 086/494] feat(cli): pass import options on render and convert render and convert take --units, --up, --floor, --center and --merge (flags also accept =yes or =no) and hand them to file.open as file.import options; projects and the sample note that the options do not apply. Ran convert with each option on the STL and PLY models and checked the bounds with info, rendered the z-up PLY, and saw the usage errors for a bad unit and a bad switch value. --- native/crates/fsh-cli/src/main.rs | 88 ++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 14 deletions(-) diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 11b0a62e..2966f95c 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -22,8 +22,15 @@ Usage: --transparent transparent background (straight alpha) --device D cpu (default), gpu (the best adapter) or gpu: from devices; a GPU that cannot render this scene falls back to the CPU and the output says why + and the import options below formshot-engine info what a model or .fshot project holds - formshot-engine convert + formshot-engine convert [import options] + import options (render, convert and info, for model files): + --units U unit the model is in: auto (default: declared, else guessed from its size), mm, cm, m, in, ft + --up A axis that points up in the model: auto (default), y or z + --floor[=no] stand the model on the floor (default yes) + --center[=yes] move the model's footprint centre to the origin (default no) + --merge[=yes] put everything the model holds under one group (default no) formshot-engine devices [--json] the CPU and every GPU adapter on this machine formshot-engine bench [options] time each device to a fixed sample count on the sample scene, count its rays and compare its picture with the CPU's @@ -98,7 +105,13 @@ struct Parsed { options: Vec<(String, Option)>, } -const FLAGS: &[&str] = &["denoise", "transparent", "json"]; +const FLAGS: &[&str] = &["denoise", "transparent", "json", "floor", "center", "merge"]; + +const IMPORT_OPTIONS: &[&str] = &["units", "up", "floor", "center", "merge"]; + +fn with_import_options(known: &[&'static str]) -> Vec<&'static str> { + known.iter().chain(IMPORT_OPTIONS).copied().collect() +} fn parse(args: &[String], known: &[&str]) -> Result { let mut p = Parsed { positional: Vec::new(), options: Vec::new() }; @@ -114,7 +127,7 @@ fn parse(args: &[String], known: &[&str]) -> Result { return Err(Failure::Usage(format!("unknown option --{name}"))); } if FLAGS.contains(&name.as_str()) { - p.options.push((name, None)); + p.options.push((name, inline)); } else if let Some(v) = inline { p.options.push((name, Some(v))); } else { @@ -139,6 +152,39 @@ impl Parsed { self.options.iter().any(|(n, _)| n == name) } + /// A flag that may also be written `--name=yes` or `--name=no`; `None` when absent. + fn switch(&self, name: &str) -> Result, Failure> { + let Some((_, v)) = self.options.iter().rev().find(|(n, _)| n == name) else { return Ok(None) }; + match v.as_deref().map(str::to_ascii_lowercase).as_deref() { + None | Some("yes") | Some("true") | Some("on") | Some("1") => Ok(Some(true)), + Some("no") | Some("false") | Some("off") | Some("0") => Ok(Some(false)), + Some(other) => Err(Failure::Usage(format!("--{name} takes yes or no, got \"{other}\""))), + } + } + + /// The import options given on the command line, as `file.import` and `import.probe` arguments. + fn import_args(&self) -> Result { + let mut a = json!({}); + if let Some(u) = self.value("units") { + if !["auto", "mm", "cm", "m", "in", "ft"].contains(&u) { + return Err(Failure::Usage(format!("--units must be auto, mm, cm, m, in or ft, got \"{u}\""))); + } + a["units"] = json!(u); + } + if let Some(up) = self.value("up") { + if !["auto", "y", "z"].contains(&up) { + return Err(Failure::Usage(format!("--up must be auto, y or z, got \"{up}\""))); + } + a["up_axis"] = json!(up); + } + for (flag, key) in [("floor", "stand_on_floor"), ("center", "center"), ("merge", "merge")] { + if let Some(b) = self.switch(flag)? { + a[key] = json!(b); + } + } + Ok(a) + } + fn number(&self, name: &str) -> Result, Failure> { match self.value(name) { None => Ok(None), @@ -151,27 +197,40 @@ fn run(engine: &Engine, name: &str, args: Value) -> Result { engine.dispatch_value(name, args).map_err(|e| Failure::Run(format!("{name}: {e}"))) } -fn load(engine: &Engine, input: &str) -> Result<(), Failure> { - if input == "sample" { - run(engine, "file.new", json!({"template": "sample", "title": "Sample"}))?; - return Ok(()); +fn is_project(input: &str) -> bool { + Path::new(input).extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("fshot")) +} + +/// Opens `input` (a model, a project or the word sample); `import` holds the import options for models. +fn load(engine: &Engine, input: &str, import: &Value) -> Result { + let given = import.as_object().is_some_and(|o| !o.is_empty()); + if input == "sample" || is_project(input) { + if given { + eprintln!("formshot-engine: note: --units, --up, --floor, --center and --merge apply to model files only"); + } + if input == "sample" { + return run(engine, "file.new", json!({"template": "sample", "title": "Sample"})); + } } let path = Path::new(input); if !path.is_file() { return Err(Failure::Run(format!("{input}: no such file"))); } - run(engine, "file.open", json!({"path": input}))?; - Ok(()) + let mut args = import.clone(); + args["path"] = json!(input); + run(engine, "file.open", args) } fn render(args: &[String]) -> Outcome { - let p = parse(args, &["samples", "width", "height", "threads", "seed", "exposure", "tonemap", "denoise", "environment", "transparent", "device"])?; + let known = with_import_options(&["samples", "width", "height", "threads", "seed", "exposure", "tonemap", "denoise", "environment", "transparent", "device"]); + let p = parse(args, &known)?; let [input, output] = p.positional.as_slice() else { return Err(Failure::Usage("render needs and ".into())); }; + let import = p.import_args()?; let threads: usize = p.number("threads")?.unwrap_or(0); let engine = Engine::with_options(EngineOptions { threaded: false, threads }); - load(&engine, input)?; + load(&engine, input, &import)?; let selected = select_device(&engine, p.value("device").unwrap_or("cpu"))?; if let Some(env) = p.value("environment") { match env { @@ -290,7 +349,7 @@ fn bench(args: &[String]) -> Outcome { continue; } let engine = Engine::with_options(EngineOptions { threaded: false, threads }); - load(&engine, "sample")?; + load(&engine, "sample", &json!({}))?; let selected = select_device(&engine, &id)?; let opts = StillOptions { path: tmp.clone(), @@ -457,12 +516,13 @@ fn info(args: &[String]) -> Outcome { } fn convert(args: &[String]) -> Outcome { - let p = parse(args, &[])?; + let p = parse(args, IMPORT_OPTIONS)?; let [input, output] = p.positional.as_slice() else { return Err(Failure::Usage("convert needs and ".into())); }; + let import = p.import_args()?; let engine = Engine::with_options(EngineOptions { threaded: false, threads: 0 }); - load(&engine, input)?; + load(&engine, input, &import)?; let ext = Path::new(output).extension().and_then(|e| e.to_str()).map(str::to_ascii_lowercase).unwrap_or_default(); let reply = match ext.as_str() { "fshot" => run(&engine, "file.save", json!({"path": output}))?, From 65eef8f3fd8b033b7a15e8d947bfdff9a17090e2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:32:32 -0500 Subject: [PATCH 087/494] feat(cli): show the probe in info and add a probe command info takes the import options, imports with them and prints the options used and the import.probe result (also in --json as probe and import_options); probe prints the probe alone. Ran info on the OBJ with --units cm --merge, probe on a CC0 glTF with sibling buffers and textures, probe on an unreadable STEP (exit 1 with the reader's message) and info --json on the STL. --- native/crates/fsh-cli/src/main.rs | 64 +++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 2966f95c..3877e261 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -23,7 +23,11 @@ Usage: --device D cpu (default), gpu (the best adapter) or gpu: from devices; a GPU that cannot render this scene falls back to the CPU and the output says why and the import options below - formshot-engine info what a model or .fshot project holds + formshot-engine info [import options] [--json] + what a model or .fshot project holds; for a model, also the + probe result and the options the import used + formshot-engine probe [--json] read a model without importing it: format, declared and guessed + units, up axis, bounds in file units, counts and warnings formshot-engine convert [import options] import options (render, convert and info, for model files): --units U unit the model is in: auto (default: declared, else guessed from its size), mm, cm, m, in, ft @@ -83,6 +87,7 @@ fn main() -> ExitCode { Some("bench") => bench(&args[1..]), Some("render") => render(&args[1..]), Some("info") => info(&args[1..]), + Some("probe") => probe(&args[1..]), Some("convert") => convert(&args[1..]), Some("dispatch") => dispatch(&args[1..]), Some(other) => Err(Failure::Usage(format!("unknown command \"{other}\""))), @@ -438,17 +443,55 @@ fn mean_abs_difference(a: &fsh_io::FloatPicture, b: &fsh_io::FloatPicture) -> Op Some(sum / (pixels * 3) as f64) } -fn info(args: &[String]) -> Outcome { +fn print_probe(r: &Value) { + println!("format: {}", r["format"].as_str().unwrap_or("")); + let declared = r["units_declared"].as_str().map(|u| format!("declared {u}")).unwrap_or_else(|| "not declared".into()); + let used = r["units_guess"].as_str().unwrap_or(""); + println!("units: {declared}; auto import uses {used}{}", if r["unit_guessed"] == true { " (guessed from the size)" } else { "" }); + println!("up axis: {}{}", r["up_axis"].as_str().unwrap_or(""), if r["up_axis_declared"] == true { " (declared)" } else { " (assumed)" }); + if !r["bounds"].is_null() { + println!("file bounds: min {} max {} size {} (file units)", r["bounds"]["min"], r["bounds"]["max"], r["bounds"]["size"]); + } + println!( + "contents: {} triangles, {} meshes, {} nodes, {} materials, {} textures", + r["triangles"], r["meshes"], r["nodes"], r["materials"], r["textures"] + ); + for w in r["warnings"].as_array().into_iter().flatten() { + println!("warning: {}", w.as_str().unwrap_or("")); + } +} + +fn probe(args: &[String]) -> Outcome { let p = parse(args, &["json"])?; + let [input] = p.positional.as_slice() else { + return Err(Failure::Usage("probe needs ".into())); + }; + let engine = Engine::with_options(EngineOptions { threaded: false, threads: 0 }); + let r = run(&engine, "import.probe", json!({"path": input}))?; + if p.flag("json") { + println!("{}", serde_json::to_string_pretty(&r).unwrap_or_default()); + return Ok(()); + } + println!("file: {} ({} bytes)", input, r["bytes"]); + print_probe(&r); + Ok(()) +} + +fn info(args: &[String]) -> Outcome { + let p = parse(args, &with_import_options(&["json"]))?; let [input] = p.positional.as_slice() else { return Err(Failure::Usage("info needs ".into())); }; + let import = p.import_args()?; let path = Path::new(input); let bytes = std::fs::metadata(path).map_err(|e| Failure::Run(format!("{input}: {e}")))?.len(); let engine = Engine::with_options(EngineOptions { threaded: false, threads: 0 }); let mut out = json!({"file": input, "bytes": bytes}); let ext = path.extension().and_then(|e| e.to_str()).map(str::to_ascii_lowercase).unwrap_or_default(); if ext == "fshot" { + if import.as_object().is_some_and(|o| !o.is_empty()) { + eprintln!("formshot-engine: note: --units, --up, --floor, --center and --merge apply to model files only"); + } let (project, report) = files::load_file(path).map_err(|e| Failure::Run(e.to_string()))?; out["kind"] = json!("project"); out["format_version"] = json!(report.version.to_string()); @@ -458,11 +501,13 @@ fn info(args: &[String]) -> Outcome { out["preview"] = json!(project.preview_png.is_some()); engine.set_document(project.document, Some(path.to_path_buf())); } else { + out["probe"] = run(&engine, "import.probe", json!({"path": input}))?; let start = Instant::now(); - let reply = run(&engine, "file.open", json!({"path": input}))?; + let reply = load(&engine, input, &import)?; out["kind"] = json!("model"); - out["format"] = json!(ext); + out["format"] = out["probe"]["format"].clone(); out["import"] = reply["import"]["report"].clone(); + out["import_options"] = reply["import"]["options"].clone(); out["import_seconds"] = json!(start.elapsed().as_secs_f64()); } let s = run(&engine, "scene.summary", json!({}))?; @@ -506,6 +551,17 @@ fn info(args: &[String]) -> Outcome { r["instances_found"], r["triangles_dropped"] ); + let o = &out["import_options"]; + println!( + "options: units {}, up {}, floor {}, center {}, merge {}", + o["units"].as_str().unwrap_or(""), + o["up_axis"].as_str().unwrap_or(""), + o["stand_on_floor"], + o["center"], + o["merge"] + ); + println!("the file as read (import.probe):"); + print_probe(&out["probe"]); } if let Some(ws) = out["warnings"].as_array().or(out["import"]["warnings"].as_array()) { for w in ws { From 8a1e53038f4630dfbc2252b837f2ffe06238ac68 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:40:20 -0500 Subject: [PATCH 088/494] fix(commands): follow part and group changes when re-importing The reader collapses a file node with one mesh into a part, so a file that drops to one object, or grows from one, changed the top's kind and lost every match; the re-import now splits such a part into its group and part, or wraps the document's part in a group in its place. A part that comes back reshaped is shown again before its shape is swapped, which before failed on the removed id. Release dispatch: one to two objects and back, a returning reshaped part, the earlier edit script and the edge script all gave the expected counts, and undo restored the document. --- .../fsh-commands/src/ext/import/reimport.rs | 74 +++++++++++++++++-- .../crates/fsh-commands/src/ext/import/run.rs | 2 +- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index 8cae896f..70c83273 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -216,6 +216,52 @@ fn replace_mesh(st: &mut State, d: NodeId, mesh: &ImportMesh, outs: &mut Vec) -> Result { + let doc = st.editor.document(); + let old = doc.get_node(top)?.clone(); + if doc.is_locked(top) { + return Err(EngineError::state(format!("{} is locked, and the file now holds a group in its place", old.name))); + } + let mesh_name = part_of(&old).and_then(|(m, _)| doc.mesh(m)).map(|m| m.name.clone()).filter(|n| !n.is_empty()).unwrap_or_else(|| old.name.clone()); + let index = index_in_parent(doc, top); + let transform = serde_json::to_value(old.transform).map_err(|e| EngineError::state(e.to_string()))?; + dispatch(st, "scene.add_group", json!({"name": old.name, "parent": old.parent.map(|p| p.raw()), "index": index, "transform": transform}), outs)?; + let group = outs.last().and_then(|o| o.created.first().copied()).ok_or_else(|| EngineError::state("the group was not made"))?; + let mut meta: Vec<(&str, Value)> = vec![(source::PATH, json!(source::source_path(&old))), (source::NODE, json!(top_path))]; + if let Some(o) = old.metadata.get(source::OPTIONS) { + meta.push((source::OPTIONS, json!(o))); + } + for (k, v) in meta { + dispatch(st, "scene.set_metadata", json!({"id": group, "key": k, "value": v}), outs)?; + } + dispatch(st, "scene.reparent", json!({"ids": [top.raw()], "parent": group, "keep_world": true}), outs)?; + dispatch(st, "scene.set_metadata", json!({"id": top.raw(), "key": source::OPTIONS, "value": null}), outs)?; + dispatch(st, "scene.set_metadata", json!({"id": top.raw(), "key": source::NODE, "value": source::join(&top_path, &mesh_name)}), outs)?; + if old.name == source::file_name(&old) && mesh_name != old.name { + dispatch(st, "scene.rename", json!({"id": top.raw(), "name": mesh_name}), outs)?; + } + Ok(NodeId::from_raw(group)) +} + fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileReport) -> Result<()> { let doc = st.editor.document(); let top_node = doc.get_node(top)?; @@ -224,7 +270,19 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe let a = ImportArgs::parse(&stored, Some(false))?; let prepared = run::prepare(Path::new(&file), &a, doc, &Watch::new())?; rep.warnings.extend(prepared.report.warnings.iter().cloned()); - let p = plan(doc, top, payload_of(prepared.cmd)?)?; + let mut payload = payload_of(prepared.cmd)?; + let top_is_part = part_of(top_node).is_some(); + let new_tops: Vec = payload.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); + let mut top = top; + if let [i] = new_tops[..] { + match (top_is_part, part_of(&payload.nodes[i].node).is_some()) { + (false, true) => expand_top(&mut payload, i), + (true, false) => top = wrap_top(st, top, source::source_node(&payload.nodes[i].node).to_string(), outs)?, + _ => {} + } + } + let doc = st.editor.document(); + let p = plan(doc, top, payload)?; let pnodes: BTreeMap = p.payload.nodes.iter().map(|n| (n.id, n)).collect(); let meshes: BTreeMap = p.payload.meshes.iter().map(|m| (m.key, m)).collect(); @@ -306,6 +364,13 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe for (d, path) in paths { dispatch(st, "scene.set_metadata", json!({"id": d.raw(), "key": source::NODE, "value": path}), outs)?; } + if !returned.is_empty() { + let ids: Vec = returned.iter().map(|d| d.raw()).collect(); + dispatch(st, "scene.set_visible", json!({"ids": ids, "visible": true}), outs)?; + for id in ids { + dispatch(st, "scene.set_metadata", json!({"id": id, "key": source::MISSING, "value": null}), outs)?; + } + } for (d, mesh) in swaps { replace_mesh(st, d, &mesh, outs)?; rep.updated += 1; @@ -320,13 +385,6 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe dispatch(st, "scene.set_metadata", json!({"id": id, "key": source::MISSING, "value": "true"}), outs)?; } } - if !returned.is_empty() { - let ids: Vec = returned.iter().map(|d| d.raw()).collect(); - dispatch(st, "scene.set_visible", json!({"ids": ids, "visible": true}), outs)?; - for id in ids { - dispatch(st, "scene.set_metadata", json!({"id": id, "key": source::MISSING, "value": null}), outs)?; - } - } Ok(()) } diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index f2f97d23..f1ec79a5 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -38,7 +38,7 @@ pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch Ok(Prepared { path: path.to_path_buf(), cmd, report }) } -fn payload_max_key(p: &ImportPayload) -> u64 { +pub(crate) fn payload_max_key(p: &ImportPayload) -> u64 { let meshes = p.meshes.iter().map(|m| m.key.raw()); let materials = p.materials.iter().map(|m| m.key.raw()); let textures = p.textures.iter().map(|t| t.key.raw()); From 7185ad5ebe8d014c594b1cafca2fb83b8574f536 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:43:01 -0500 Subject: [PATCH 089/494] fix(commands): keep selection and cutaways on reshaped parts A part whose shape a re-import replaces gets a new id, so cutaways that targeted the old part now target the new one and a selected part stays selected. Release dispatch: a selected, cut-away sphere reshaped in its OBJ came back as node 10, selected, and the cutaway's targets read [10]. --- .../fsh-commands/src/ext/import/reimport.rs | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index 70c83273..b8dd05a8 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -7,7 +7,7 @@ use fsh_core::{DocKey, MaterialKey, MeshKey, NodeId}; use fsh_io::Watch; use fsh_scene::{ ChangeLevel, Command, Document, Import, ImportMaterial, ImportMesh, ImportNode, ImportPayload, ImportTexture, Mesh, - Node, NodeKind, Outcome, + Node, NodeKind, Outcome, SelectMode, }; use serde_json::{json, Value}; use std::collections::{BTreeMap, BTreeSet, VecDeque}; @@ -209,7 +209,27 @@ fn replace_mesh(st: &mut State, d: NodeId, mesh: &ImportMesh, outs: &mut Vec)> = st + .editor + .document() + .nodes() + .iter() + .filter_map(|(id, n)| match &n.kind { + NodeKind::Cutaway { cutaway } if cutaway.targets.contains(&d) => { + Some((*id, cutaway.targets.iter().map(|t| if *t == d { new_id.raw() } else { t.raw() }).collect())) + } + _ => None, + }) + .collect(); + for (c, targets) in cutaways { + dispatch(st, "scene.set_cutaway", json!({"id": c.raw(), "values": {"targets": targets}}), outs)?; + } + let selected = st.editor.selection().nodes().contains(&d); dispatch(st, "scene.remove", json!({"ids": [d.raw()]}), outs)?; + if selected { + let (sel, doc) = st.editor.selection_mut(); + sel.select(doc, &[new_id], SelectMode::Add); + } if st.editor.document().parts_using_mesh(old_mesh).is_empty() { dispatch(st, "mesh.remove", json!({"key": old_mesh.raw()}), outs)?; } From 7ec6906a9d3e48768fa17f036e4b1bd6abbb4744 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:43:01 -0500 Subject: [PATCH 090/494] feat(commands): give the probed size in metres import.probe's bounds carry size_m, the size at the unit an automatic import would use, so a window can show what the guess means before importing; the CLI probe prints it. Ran probe on the generated OBJ: 120 by 140 by 60 file units, 0.12 by 0.14 by 0.06 metres at mm. --- native/crates/fsh-cli/src/main.rs | 1 + native/crates/fsh-commands/src/ext/import.rs | 2 +- native/crates/fsh-commands/src/ext/import/probe.rs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 3877e261..249e935a 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -451,6 +451,7 @@ fn print_probe(r: &Value) { println!("up axis: {}{}", r["up_axis"].as_str().unwrap_or(""), if r["up_axis_declared"] == true { " (declared)" } else { " (assumed)" }); if !r["bounds"].is_null() { println!("file bounds: min {} max {} size {} (file units)", r["bounds"]["min"], r["bounds"]["max"], r["bounds"]["size"]); + println!("size: {} metres at {}", r["bounds"]["size_m"], r["units_guess"].as_str().unwrap_or("")); } println!( "contents: {} triangles, {} meshes, {} nodes, {} materials, {} textures", diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index f820b6ff..ad112804 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -21,7 +21,7 @@ use options::ImportArgs; pub(super) static COMMANDS: &[ExtCommand] = &[ ExtCommand { name: "import.probe", - description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units, triangles, meshes, nodes, materials, warnings}.", + description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units and size_m (the size in metres at units_guess), triangles, meshes, nodes, materials, warnings}.", level: ChangeLevel::None, mutates: false, read_only: true, diff --git a/native/crates/fsh-commands/src/ext/import/probe.rs b/native/crates/fsh-commands/src/ext/import/probe.rs index ca5599b7..e6d9e45e 100644 --- a/native/crates/fsh-commands/src/ext/import/probe.rs +++ b/native/crates/fsh-commands/src/ext/import/probe.rs @@ -31,7 +31,8 @@ pub(crate) fn probe(path: &Path) -> Result { let bounds = if b.is_empty() { Value::Null } else { - json!({"min": vec3_json(b.min), "max": vec3_json(b.max), "size": vec3_json(b.max - b.min)}) + let size = b.max - b.min; + json!({"min": vec3_json(b.min), "max": vec3_json(b.max), "size": vec3_json(size), "size_m": vec3_json(size * unit.to_metres_f32())}) }; Ok(json!({ "path": path.to_string_lossy(), From bf9393720315918ac5a0aa7140f1cdaa572634de Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:43:57 -0500 Subject: [PATCH 091/494] feat(cli): import models as a job and show progress render, convert and info now start a new document and import a model with import.start, printing each stage on stderr once the import takes over a second. convert of five models with --units cm wrote byte-identical .fshot files before and after; the 1.8 million triangle OBJ showed its stages, and an unreadable STEP still exits 1 with the reader's message. --- native/crates/fsh-cli/src/main.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 249e935a..10402944 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -223,7 +223,29 @@ fn load(engine: &Engine, input: &str, import: &Value) -> Result } let mut args = import.clone(); args["path"] = json!(input); - run(engine, "file.open", args) + if is_project(input) { + return run(engine, "file.open", args); + } + let title = path.file_stem().and_then(|s| s.to_str()).unwrap_or("Untitled"); + run(engine, "file.new", json!({"title": title}))?; + args["frame"] = json!(true); + let job = run(engine, "import.start", args)?["job"].clone(); + let start = Instant::now(); + let mut shown = String::new(); + loop { + let s = run(engine, "import.status", json!({"job": job}))?; + match s["state"].as_str() { + Some("done") => return Ok(json!({"import": s["result"]})), + Some("running") => {} + _ => return Err(Failure::Run(format!("{input}: {}", s["error"]["message"].as_str().unwrap_or("the import stopped")))), + } + let stage = s["stage"].as_str().unwrap_or("").to_string(); + if start.elapsed().as_secs_f64() > 1.0 && stage != shown { + eprintln!("formshot-engine: importing {input}: {stage}, {:.0}%", s["fraction"].as_f64().unwrap_or(0.0) * 100.0); + shown = stage; + } + std::thread::sleep(std::time::Duration::from_millis(50)); + } } fn render(args: &[String]) -> Outcome { From 186cdb9b54ddd3f78efd4e8a21f5adacc3cd6da2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:45:14 -0500 Subject: [PATCH 092/494] feat(commands): answer the absolute source path in import replies file.import and finished import jobs reply with source, the canonical path written into source.path, so a window can show and later re-import exactly that file. Imported a relative path with dot-dot segments through the release dispatch: source and the node metadata gave the same canonical path. --- native/crates/fsh-commands/src/ext/import/run.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index f1ec79a5..d24fab3e 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -127,5 +127,6 @@ pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, a: &ImportArgs reply["name"] = json!("file.import"); reply["report"] = report_json(&p.report); reply["options"] = a.json(); + reply["source"] = json!(source::absolute(path).to_string_lossy()); Ok(reply) } From f8558ed9caffc87046c5802eed626c8336f1f505 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:46:12 -0500 Subject: [PATCH 093/494] feat(commands): include each re-read file's clean-up report file.reimport's files entries carry report, the same clean-up report file.import answers, so the unit and up axis a re-read used are visible. An OBJ imported with units cm re-read as cm, not guessed, and the edge script still gave its earlier counts. --- native/crates/fsh-commands/src/ext/import.rs | 2 +- native/crates/fsh-commands/src/ext/import/reimport.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index ad112804..b163cb43 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -53,7 +53,7 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ }, ExtCommand { name: "file.reimport", - description: "Read the source files of the given imported nodes again (every imported node when none): parts match by source.node, then by unique name, then by identical shape; matched parts keep their materials and transforms and take the new shape, new parts are added, parts gone from the file are hidden (marked source.missing), all as one undo step. Answers {matched, added, hidden, updated, files: [{path, matched, added, hidden, updated, warnings, error?}]}.", + description: "Read the source files of the given imported nodes again (every imported node when none): parts match by source.node, then by unique name, then by identical shape; matched parts keep their materials and transforms and take the new shape, new parts are added, parts gone from the file are hidden (marked source.missing), all as one undo step. Answers {matched, added, hidden, updated, files: [{path, matched, added, hidden, updated, warnings, report (the clean-up report of the re-read), error?}]}.", level: ChangeLevel::Full, mutates: true, read_only: false, diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index b8dd05a8..d748c805 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -23,6 +23,7 @@ struct FileReport { updated: usize, warnings: Vec, error: Option, + report: Option, } fn same_shape(a: &Mesh, b: &Mesh) -> bool { @@ -290,6 +291,7 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe let a = ImportArgs::parse(&stored, Some(false))?; let prepared = run::prepare(Path::new(&file), &a, doc, &Watch::new())?; rep.warnings.extend(prepared.report.warnings.iter().cloned()); + rep.report = Some(run::report_json(&prepared.report)); let mut payload = payload_of(prepared.cmd)?; let top_is_part = part_of(top_node).is_some(); let new_tops: Vec = payload.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); @@ -446,6 +448,9 @@ pub(crate) fn reimport(engine: &Engine, st: &mut State, nodes: Option Date: Wed, 2 Dec 2026 13:47:23 -0500 Subject: [PATCH 094/494] feat(commands): report waiting for a finished job held by a group A job whose worker is done but whose document change waits for an open history group now reports stage waiting instead of done while still running. Release dispatch: a job started inside a group read running and waiting, and after end_group it was done with Import gadget as the undo label. --- native/crates/fsh-commands/src/ext/import.rs | 2 +- native/crates/fsh-commands/src/ext/import/jobs.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index b163cb43..5046ce94 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -37,7 +37,7 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ }, ExtCommand { name: "import.status", - description: "An import job's progress: {job, state (running, done, failed, cancelled), stage, fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session.", + description: "An import job's progress: {job, state (running, done, failed, cancelled), stage (reading, validating, welding, normals, instancing, placing, converting, then waiting while a history group is open, done), fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session.", level: ChangeLevel::None, mutates: false, read_only: true, diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index 37a990f9..20996862 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -145,6 +145,7 @@ fn prune() { fn status_json(id: u64, j: &Job) -> Value { let (state, stage, fraction) = match &j.state { + JobState::Running(_) if j.watch.stage() == Stage::Done => ("running", "waiting", overall(&j.watch)), JobState::Running(_) => ("running", j.watch.stage().as_str(), overall(&j.watch)), JobState::Done(_) => ("done", "done", 1.0), JobState::Failed(_) => ("failed", j.watch.stage().as_str(), overall(&j.watch)), From aef3b45f9db1cf0cc08ebfbe0c8b7f1d2f4c83b7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:47:23 -0500 Subject: [PATCH 095/494] feat(cli): add a reimport command for projects reimport [output.fshot] opens a project, runs file.reimport on every imported model and saves over the project or to the output, printing per-file counts (or the reply with --json). A project converted from an OBJ reported nothing changed, then after the OBJ lost one object and gained another it reported 2 matched, 1 added, 1 hidden and saved; a model path is refused with usage. --- native/crates/fsh-cli/src/main.rs | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 10402944..4983ad93 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -28,6 +28,9 @@ Usage: probe result and the options the import used formshot-engine probe [--json] read a model without importing it: format, declared and guessed units, up axis, bounds in file units, counts and warnings + formshot-engine reimport [output.fshot] [--json] + read every imported model of a project again (file.reimport) + and save the result over the project or to output formshot-engine convert [import options] import options (render, convert and info, for model files): --units U unit the model is in: auto (default: declared, else guessed from its size), mm, cm, m, in, ft @@ -88,6 +91,7 @@ fn main() -> ExitCode { Some("render") => render(&args[1..]), Some("info") => info(&args[1..]), Some("probe") => probe(&args[1..]), + Some("reimport") => reimport(&args[1..]), Some("convert") => convert(&args[1..]), Some("dispatch") => dispatch(&args[1..]), Some(other) => Err(Failure::Usage(format!("unknown command \"{other}\""))), @@ -500,6 +504,46 @@ fn probe(args: &[String]) -> Outcome { Ok(()) } +fn reimport(args: &[String]) -> Outcome { + let p = parse(args, &["json"])?; + let (input, output) = match p.positional.as_slice() { + [i] => (i, i), + [i, o] => (i, o), + _ => return Err(Failure::Usage("reimport needs [output.fshot]".into())), + }; + if !is_project(input) || !is_project(output) { + return Err(Failure::Usage("reimport reads and writes .fshot projects".into())); + } + let engine = Engine::with_options(EngineOptions { threaded: false, threads: 0 }); + load(&engine, input, &json!({}))?; + let r = run(&engine, "file.reimport", json!({}))?; + if r["change"] != "none" || output != input { + run(&engine, "file.save", json!({"path": output}))?; + } + if p.flag("json") { + println!("{}", serde_json::to_string_pretty(&r).unwrap_or_default()); + return Ok(()); + } + for f in r["files"].as_array().into_iter().flatten() { + match f["error"]["message"].as_str() { + Some(e) => println!("{}: not read: {e}", f["path"].as_str().unwrap_or("")), + None => println!( + "{}: {} matched, {} added, {} hidden, {} reshaped", + f["path"].as_str().unwrap_or(""), + f["matched"], + f["added"], + f["hidden"], + f["updated"] + ), + } + for w in f["warnings"].as_array().into_iter().flatten() { + println!(" warning: {}", w.as_str().unwrap_or("")); + } + } + println!("{}", if r["change"] == "none" { format!("{input}: nothing changed") } else { format!("{output}: saved") }); + Ok(()) +} + fn info(args: &[String]) -> Outcome { let p = parse(args, &with_import_options(&["json"]))?; let [input] = p.positional.as_slice() else { From a97473443516d99f29deee8527bde2575ee4a3be Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:49:17 -0500 Subject: [PATCH 096/494] fix(commands): weigh the tangent stage in import progress The readers gained a tangent stage while the import jobs were written, so the progress weights no longer covered every stage. Tangents now take the last part of the normals share. Ran cargo clippy on the workspace with -D warnings. --- native/crates/fsh-commands/src/ext/import/jobs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index 20996862..d8ea570e 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -47,7 +47,8 @@ fn weight(stage: Stage) -> (f32, f32) { Stage::Reading => (0.0, 0.40), Stage::Validating => (0.40, 0.45), Stage::Welding => (0.45, 0.60), - Stage::Normals => (0.60, 0.75), + Stage::Normals => (0.60, 0.70), + Stage::Tangents => (0.70, 0.75), Stage::Instancing => (0.75, 0.80), Stage::Placing => (0.80, 0.82), Stage::Converting => (0.82, 0.97), From 6cb8d9b2b38547870ee095a41a818c83bfda6f74 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:50:58 -0500 Subject: [PATCH 097/494] feat(frontend): reserve a module for the cad worker and retessellation An empty cad module is mounted with the others so the worker settings and the retessellate dialog land in their own folder. Ran npx tsc --noEmit. --- frontend/src/modules.ts | 2 ++ frontend/src/ui/cad/index.ts | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 frontend/src/ui/cad/index.ts diff --git a/frontend/src/modules.ts b/frontend/src/modules.ts index 70b9d136..00b3f39a 100644 --- a/frontend/src/modules.ts +++ b/frontend/src/modules.ts @@ -6,6 +6,7 @@ import { mount as dock } from './shell/dock-adapter'; import { mount as home } from './shell/home'; import { mount as importer } from './ui/import/index'; import { mount as handoff } from './ui/handoff/index'; +import { mount as cad } from './ui/cad/index'; export const MODULES: readonly ShellModule[] = [ { id: 'workspace', mount: workspace }, @@ -15,4 +16,5 @@ export const MODULES: readonly ShellModule[] = [ { id: 'home', mount: home }, { id: 'import', mount: importer }, { id: 'handoff', mount: handoff }, + { id: 'cad', mount: cad }, ]; diff --git a/frontend/src/ui/cad/index.ts b/frontend/src/ui/cad/index.ts new file mode 100644 index 00000000..64a1dab9 --- /dev/null +++ b/frontend/src/ui/cad/index.ts @@ -0,0 +1,3 @@ +import type { ModuleContext } from '../../shell/app-shell'; + +export function mount(_ctx: ModuleContext): void {} From 9e46cd1ecbbd8c843fcee5a094f552c55d1ae86c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:57:53 -0500 Subject: [PATCH 098/494] feat(imports): sweep upload folders older than a day Folders in .imports with nothing newer than 24 hours are removed at service start and hourly, through the router's own lifespan. Ran the service on a spare port: the old folder went, the new one and a non-id folder stayed. --- backend/app/routers/imports.py | 56 +++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/backend/app/routers/imports.py b/backend/app/routers/imports.py index 759e17da..cb08f77e 100644 --- a/backend/app/routers/imports.py +++ b/backend/app/routers/imports.py @@ -1,17 +1,71 @@ """Model files sent by the window for import (0.5.0).""" +import asyncio import re import secrets import shutil +import time import unicodedata +from contextlib import asynccontextmanager from pathlib import Path from fastapi import APIRouter, HTTPException, Request +from starlette.concurrency import run_in_threadpool from app import project_library as library from app import window_key -router = APIRouter() +KEEP_SECONDS = 24 * 3600 +SWEEP_EVERY = 3600 + + +def newest(folder: Path) -> float: + stamp = folder.stat().st_mtime + try: + for child in folder.rglob("*"): + stamp = max(stamp, child.lstat().st_mtime) + except OSError: + pass + return stamp + + +def sweep(now: float | None = None) -> int: + base = library.PROJECTS / FOLDER + if base.is_symlink() or not base.is_dir(): + return 0 + cutoff = (time.time() if now is None else now) - KEEP_SECONDS + removed = 0 + for entry in base.iterdir(): + try: + if entry.is_symlink() or not entry.is_dir() or not ID.match(entry.name): + continue + if newest(entry) < cutoff: + shutil.rmtree(entry, ignore_errors=True) + removed += 1 + except OSError: + continue + return removed + + +async def sweep_forever() -> None: + while True: + try: + await run_in_threadpool(sweep) + except Exception: + pass + await asyncio.sleep(SWEEP_EVERY) + + +@asynccontextmanager +async def lifespan(_app): + task = asyncio.create_task(sweep_forever()) + try: + yield + finally: + task.cancel() + + +router = APIRouter(lifespan=lifespan) FOLDER = ".imports" ID = re.compile(r"^[a-f0-9]{16}\Z") From c96b12a5c1ed7eee7e387613b96353c96b6ed2f7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:59:51 -0500 Subject: [PATCH 099/494] feat(import): open files given to the desktop app The window listens for formshot://open-paths and drains take_pending_opens: a .fshot opens through workspace.load (asking first when the open project has unsaved changes), models go to the import sheet, into the open project or a new one named after the file. Type-check and i18n check pass; the event itself is simulated in the next steps. --- frontend/src/i18n/modules/import/cs.json | 5 ++ frontend/src/i18n/modules/import/da.json | 5 ++ frontend/src/i18n/modules/import/de.json | 5 ++ frontend/src/i18n/modules/import/es.json | 5 ++ frontend/src/i18n/modules/import/fi.json | 5 ++ frontend/src/i18n/modules/import/fr.json | 5 ++ frontend/src/i18n/modules/import/hu.json | 5 ++ frontend/src/i18n/modules/import/id.json | 5 ++ frontend/src/i18n/modules/import/it.json | 5 ++ frontend/src/i18n/modules/import/ja.json | 5 ++ frontend/src/i18n/modules/import/ko.json | 5 ++ frontend/src/i18n/modules/import/nb.json | 5 ++ frontend/src/i18n/modules/import/nl.json | 5 ++ frontend/src/i18n/modules/import/pl.json | 5 ++ frontend/src/i18n/modules/import/pt-BR.json | 5 ++ frontend/src/i18n/modules/import/ru.json | 5 ++ frontend/src/i18n/modules/import/strings.json | 5 ++ frontend/src/i18n/modules/import/sv.json | 5 ++ frontend/src/i18n/modules/import/th.json | 5 ++ frontend/src/i18n/modules/import/tr.json | 5 ++ frontend/src/i18n/modules/import/uk.json | 5 ++ frontend/src/i18n/modules/import/vi.json | 5 ++ frontend/src/i18n/modules/import/zh-CN.json | 5 ++ frontend/src/i18n/modules/import/zh-TW.json | 5 ++ frontend/src/ui/import/desktop.ts | 20 ++++++ frontend/src/ui/import/index.ts | 63 ++++++++++++++++++- 26 files changed, 201 insertions(+), 2 deletions(-) diff --git a/frontend/src/i18n/modules/import/cs.json b/frontend/src/i18n/modules/import/cs.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/cs.json +++ b/frontend/src/i18n/modules/import/cs.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/da.json b/frontend/src/i18n/modules/import/da.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/da.json +++ b/frontend/src/i18n/modules/import/da.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/de.json b/frontend/src/i18n/modules/import/de.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/de.json +++ b/frontend/src/i18n/modules/import/de.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/es.json b/frontend/src/i18n/modules/import/es.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/es.json +++ b/frontend/src/i18n/modules/import/es.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/fi.json b/frontend/src/i18n/modules/import/fi.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/fi.json +++ b/frontend/src/i18n/modules/import/fi.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/fr.json b/frontend/src/i18n/modules/import/fr.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/fr.json +++ b/frontend/src/i18n/modules/import/fr.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/hu.json b/frontend/src/i18n/modules/import/hu.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/hu.json +++ b/frontend/src/i18n/modules/import/hu.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/id.json b/frontend/src/i18n/modules/import/id.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/id.json +++ b/frontend/src/i18n/modules/import/id.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/it.json b/frontend/src/i18n/modules/import/it.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/it.json +++ b/frontend/src/i18n/modules/import/it.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/ja.json b/frontend/src/i18n/modules/import/ja.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/ja.json +++ b/frontend/src/i18n/modules/import/ja.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/ko.json b/frontend/src/i18n/modules/import/ko.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/ko.json +++ b/frontend/src/i18n/modules/import/ko.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/nb.json b/frontend/src/i18n/modules/import/nb.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/nb.json +++ b/frontend/src/i18n/modules/import/nb.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/nl.json b/frontend/src/i18n/modules/import/nl.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/nl.json +++ b/frontend/src/i18n/modules/import/nl.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/pl.json b/frontend/src/i18n/modules/import/pl.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/pl.json +++ b/frontend/src/i18n/modules/import/pl.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/pt-BR.json b/frontend/src/i18n/modules/import/pt-BR.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/pt-BR.json +++ b/frontend/src/i18n/modules/import/pt-BR.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/ru.json b/frontend/src/i18n/modules/import/ru.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/ru.json +++ b/frontend/src/i18n/modules/import/ru.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/strings.json b/frontend/src/i18n/modules/import/strings.json index 73feedd0..7dbdf376 100644 --- a/frontend/src/i18n/modules/import/strings.json +++ b/frontend/src/i18n/modules/import/strings.json @@ -9,13 +9,16 @@ "Clear Recent Imports", "Could not import the file: {reason}", "Could not import {name}: {reason}", + "Could not open {name}: {reason}", "Could not read the file: {reason}", "Could not reimport: {reason}", "Could not send the file: {reason}", + "Discard unsaved changes?", "Draft", "Drop to import into the scene", "Feet (ft)", "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import", "High", "Import", @@ -39,6 +42,7 @@ "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.", "Options", "Parts", "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces", "The engine decides from the file.", "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.", "The import failed", "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/sv.json b/frontend/src/i18n/modules/import/sv.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/sv.json +++ b/frontend/src/i18n/modules/import/sv.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/th.json b/frontend/src/i18n/modules/import/th.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/th.json +++ b/frontend/src/i18n/modules/import/th.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/tr.json b/frontend/src/i18n/modules/import/tr.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/tr.json +++ b/frontend/src/i18n/modules/import/tr.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/uk.json b/frontend/src/i18n/modules/import/uk.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/uk.json +++ b/frontend/src/i18n/modules/import/uk.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/vi.json b/frontend/src/i18n/modules/import/vi.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/vi.json +++ b/frontend/src/i18n/modules/import/vi.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/zh-CN.json b/frontend/src/i18n/modules/import/zh-CN.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/zh-CN.json +++ b/frontend/src/i18n/modules/import/zh-CN.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/i18n/modules/import/zh-TW.json b/frontend/src/i18n/modules/import/zh-TW.json index b9546484..ac317572 100644 --- a/frontend/src/i18n/modules/import/zh-TW.json +++ b/frontend/src/i18n/modules/import/zh-TW.json @@ -9,13 +9,16 @@ "Clear Recent Imports": "Clear Recent Imports", "Could not import the file: {reason}": "Could not import the file: {reason}", "Could not import {name}: {reason}": "Could not import {name}: {reason}", + "Could not open {name}: {reason}": "Could not open {name}: {reason}", "Could not read the file: {reason}": "Could not read the file: {reason}", "Could not reimport: {reason}": "Could not reimport: {reason}", "Could not send the file: {reason}": "Could not send the file: {reason}", + "Discard unsaved changes?": "Discard unsaved changes?", "Draft": "Draft", "Drop to import into the scene": "Drop to import into the scene", "Feet (ft)": "Feet (ft)", "Format": "Format", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", "Frame the view after import": "Frame the view after import", "High": "High", "Import": "Import", @@ -39,6 +42,7 @@ "No warnings.": "No warnings.", "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", "One file beside it": "One file beside it", + "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", "Options": "Options", "Parts": "Parts", "Placing in the scene": "Placing in the scene", @@ -55,6 +59,7 @@ "Tessellating CAD surfaces": "Tessellating CAD surfaces", "The engine decides from the file.": "The engine decides from the file.", "The engine did not start an import job": "The engine did not start an import job", + "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", "The file says it is in {unit}.": "The file says it is in {unit}.", "The import failed": "The import failed", "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", diff --git a/frontend/src/ui/import/desktop.ts b/frontend/src/ui/import/desktop.ts index 5b39e39e..f9a4c7a2 100644 --- a/frontend/src/ui/import/desktop.ts +++ b/frontend/src/ui/import/desktop.ts @@ -11,6 +11,26 @@ export type NativeDrop = export const desktop = (): boolean => inTauri(); +const OPEN_EVENT = 'formshot://open-paths'; + +export async function listenOpens(fn: (paths: string[]) => void): Promise<() => void> { + if (!desktop()) return () => undefined; + const strings = (raw: unknown): string[] => (Array.isArray(raw) ? raw.filter((p): p is string => typeof p === 'string' && p !== '') : []); + try { + const { listen } = await import('@tauri-apps/api/event'); + const { invoke } = await import('@tauri-apps/api/core'); + const off = await listen(OPEN_EVENT, (e) => { + const paths = strings(e.payload); + if (paths.length) fn(paths); + }); + const waiting = strings(await invoke('take_pending_opens')); + if (waiting.length) fn(waiting); + return off; + } catch { + return () => undefined; + } +} + export async function pickPaths(): Promise { if (!desktop()) return null; try { diff --git a/frontend/src/ui/import/index.ts b/frontend/src/ui/import/index.ts index 09e5635d..a8971900 100644 --- a/frontend/src/ui/import/index.ts +++ b/frontend/src/ui/import/index.ts @@ -4,8 +4,9 @@ import { api } from '../../shell/api'; import type { CommandSpec, MenuEntry } from '../../shell/registry'; import { t } from '../../i18n'; import { catalogue, COMMANDS, errorText, resultCounts, type Outcome } from './engine'; -import { acceptList, baseName, isModel, stemOf } from './formats'; -import { desktop, expandPaths, pickPaths } from './desktop'; +import { acceptList, baseName, extOf, isModel, stemOf } from './formats'; +import { desktop, expandPaths, listenOpens, pickPaths } from './desktop'; +import { confirmDialog } from '../../shell/dialog'; import { mountDropZone } from './drop'; import { forgetImports, recentImports, rememberImport } from './recent'; import { ImportSheet, type Source } from './sheet'; @@ -161,4 +162,62 @@ export function mount(ctx: ModuleContext): void { void registry.callCommand('file.new', { title: stemOf(paths[0]) }).then(() => importer.paths(paths)).catch((err: unknown) => ctx.toast(errorText(err), 'error')); }, }); + + const engineReady = (): Promise => new Promise((resolve) => { + if (catalogue.state === 'ready') { resolve(true); return; } + const stop = (ok: boolean): void => { off(); window.clearTimeout(timer); resolve(ok); }; + const off = catalogue.onChange(() => { if (catalogue.state === 'ready') stop(true); }); + const timer = window.setTimeout(() => stop(false), 60000); + }); + + const documentState = async (): Promise<{ hasDocument: boolean; title: string; dirty: boolean }> => { + try { + const out = await registry.callCommand('workspace.state'); + const s = out.result && typeof out.result === 'object' ? out.result as Record : {}; + return { hasDocument: s.hasDocument === true, title: typeof s.title === 'string' ? s.title : '', dirty: s.dirty === true }; + } catch { + return { hasDocument: false, title: '', dirty: false }; + } + }; + + const openGiven = async (given: readonly string[]): Promise => { + const projects = given.filter((p) => extOf(p) === 'fshot'); + const models = given.filter(isModel); + if (projects.length > 1) ctx.toast(t('FormShot opens one project at a time; {n} other project files were left unopened.', { n: projects.length - 1 })); + if (projects.length) { + const path = projects[0]; + const state = await documentState(); + const sure = !state.hasDocument || !state.dirty || await confirmDialog(t('Discard unsaved changes?'), t('Opening {name} will close the open project and discard its unsaved changes.', { name: baseName(path) })); + if (!sure) return; + try { + await registry.callCommand('workspace.load', { path, title: stemOf(path), saved: true }); + } catch (err) { + ctx.toast(t('Could not open {name}: {reason}', { name: baseName(path), reason: errorText(err) }), 'error'); + return; + } + } + if (!models.length) return; + const state = await documentState(); + if (state.hasDocument) { + if (document.documentElement.classList.contains('fsh-home-open')) events.emit({ type: 'ui.workspace.loaded', title: state.title, path: '' }); + } else { + try { + await registry.callCommand('file.new', { title: stemOf(models[0]) }); + } catch (err) { + ctx.toast(errorText(err), 'error'); + return; + } + } + await importer.paths(models); + }; + + let opening: Promise = Promise.resolve(); + ctx.onReady(() => { + void listenOpens((paths) => { + opening = opening.then(async () => { + if (!await engineReady()) { ctx.toast(t('The engine did not start in time, so the files FormShot was given were not opened.'), 'error'); return; } + await openGiven(paths); + }).catch((err: unknown) => ctx.toast(errorText(err), 'error')); + }); + }); } From 65120a2a3b27a8c9e806d63f8d61d250ec1c59be Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:02:00 -0500 Subject: [PATCH 100/494] feat(launcher): list the cad subcommand in both launchers formshot help now shows cad with one line of help; formshot.bat gains the same subcommand running app.routers.cad from the backend folder. Ran ./formshot help and the module under the shared venv; the batch file was not run (no Windows here). --- formshot | 1 + formshot.bat | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/formshot b/formshot index 9c84f036..b3664a70 100755 --- a/formshot +++ b/formshot @@ -22,6 +22,7 @@ usage: ./formshot [command] [options] freeze freeze the backend into the Tauri sidecar (src-tauri/binaries/formshot-engine-backend-*) desktop dev|build run or bundle the desktop app; extra arguments such as --config FILE go to tauri app [flags] build the installable desktop app start to finish (same as ./build_app) + cad [fetch|status] download and verify the STEP and IGES reader (OpenCASCADE worker), or show whether it is installed mcp formshot over MCP's stdio transport, bridged to the running service's /mcp i18n extract|check collect the English interface strings, or check each language table against strings.json agents sync|check|install [--dry-run] write agents/manifest.json and the skill's tool reference (sync), validate diff --git a/formshot.bat b/formshot.bat index 75c80b05..b18db75a 100644 --- a/formshot.bat +++ b/formshot.bat @@ -21,6 +21,7 @@ if /i "%CMD%"=="desktop" goto desktop if /i "%CMD%"=="app" goto app if /i "%CMD%"=="doctor" goto doctor if /i "%CMD%"=="mcp" goto mcp +if /i "%CMD%"=="cad" goto cad if /i "%CMD%"=="i18n" goto i18n if /i "%CMD%"=="agents" goto agents if /i "%CMD%"=="notices" goto notices @@ -248,6 +249,14 @@ exit /b %FAIL% :mcp python -I mcp\server.py %2 %3 %4 %5 %6 %7 %8 %9 exit /b %errorlevel% +:cad +set "PY=python" +if exist backend\venv\Scripts\python.exe set "PY=backend\venv\Scripts\python.exe" +pushd backend +"%PY%" -m app.routers.cad %2 %3 %4 %5 %6 %7 %8 %9 +set "CADRC=%errorlevel%" +popd +exit /b %CADRC% :i18n python -I setup\i18n.py %2 %3 %4 %5 %6 %7 %8 %9 exit /b %errorlevel% @@ -270,6 +279,6 @@ exit /b 0 echo usage: formshot [command] echo boot ^| install ^| install-desktop ^| backend ^| frontend ^| build ^| serve ^| freeze echo engine [build^|check^|wasm] ^| render IN OUT [flags] ^| cli [args] ^| desktop dev^|build ^| app [flags] -echo mcp ^| i18n extract^|check ^| agents sync^|check^|install ^| notices [--check] ^| doctor ^| clean [--all] ^| help +echo cad [fetch^|status] ^| mcp ^| i18n extract^|check ^| agents sync^|check^|install ^| notices [--check] ^| doctor ^| clean [--all] ^| help :end endlocal From dae6d9a52ee072139f61e39a13af200883a82a15 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:07:49 -0500 Subject: [PATCH 101/494] feat(tauri): pass 3mf, fbx, step and iges files to the window Files given to the desktop app at launch or while it runs reach the window only when their extension is on the openable list, which still held the 0.4.0 formats. The new readers' extensions are added. Ran cargo check --locked in src-tauri. --- src-tauri/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 59a4bf57..54511a4f 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -16,7 +16,7 @@ mod traffic_lights; #[cfg(windows)] mod win_job; -const OPENABLE_EXTS: &[&str] = &["fshot", "glb", "gltf", "obj", "stl", "ply"]; +const OPENABLE_EXTS: &[&str] = &["fshot", "glb", "gltf", "obj", "stl", "ply", "3mf", "fbx", "step", "stp", "iges", "igs"]; const EXIT_EVENT: &str = "formshot://exit-requested"; const OPEN_EVENT: &str = "formshot://open-paths"; const ENGINE_GONE: &str = "The FormShot engine stopped while the app was running, so the window can no longer save, render or export. FormShot will close now; start it again to continue from the last saved project."; From 0c0cd717890ebc6da6d085c744dfcd3df2db1d69 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:02:37 -0500 Subject: [PATCH 102/494] feat(cad): add the cad quality presets and the default preference Presets draft to ultra with their chord and angle, custom values checked against the engine's limits, and the default kept in localStorage formshot.cad.quality. Ran npx tsc --noEmit. --- frontend/src/ui/cad/quality.ts | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 frontend/src/ui/cad/quality.ts diff --git a/frontend/src/ui/cad/quality.ts b/frontend/src/ui/cad/quality.ts new file mode 100644 index 00000000..ddf36134 --- /dev/null +++ b/frontend/src/ui/cad/quality.ts @@ -0,0 +1,75 @@ +import { events } from '../../shell/events'; +import { t } from '../../i18n'; + +export type Preset = 'draft' | 'medium' | 'high' | 'ultra'; +export interface Custom { chord: number; angle: number } +export type Quality = Preset | Custom; + +export const PRESETS: readonly Preset[] = ['draft', 'medium', 'high', 'ultra']; +export const PRESET_VALUES: Readonly> = { + draft: { chord: 0.002, angle: 30 }, + medium: { chord: 0.0005, angle: 20 }, + high: { chord: 0.00015, angle: 12 }, + ultra: { chord: 0.00005, angle: 6 }, +}; +export const PRESET_LABELS: Readonly> = { draft: 'Draft', medium: 'Medium', high: 'High', ultra: 'Ultra' }; + +export const CHORD_MIN_PERCENT = 0.001; +export const CHORD_MAX_PERCENT = 10; +export const ANGLE_MIN = 1; +export const ANGLE_MAX = 90; + +const KEY = 'formshot.cad.quality'; +export const DEFAULT_QUALITY: Quality = 'medium'; +export const QUALITY_EVENT = 'ui.cad.quality'; + +export const isPreset = (v: unknown): v is Preset => typeof v === 'string' && (PRESETS as readonly string[]).includes(v); + +export function validCustom(v: unknown): Custom | null { + if (!v || typeof v !== 'object') return null; + const o = v as Record; + const chord = Number(o.chord), angle = Number(o.angle); + if (!Number.isFinite(chord) || !Number.isFinite(angle)) return null; + if (chord <= 0 || chord > CHORD_MAX_PERCENT / 100 || angle < ANGLE_MIN || angle > ANGLE_MAX) return null; + return { chord, angle }; +} + +export function parseQuality(v: unknown): Quality | null { + if (isPreset(v)) return v; + if (typeof v === 'string') { + const [c, a] = v.split(','); + return validCustom({ chord: c, angle: a }); + } + return validCustom(v); +} + +export function defaultQuality(): Quality { + try { + return parseQuality(JSON.parse(localStorage.getItem(KEY) ?? 'null')) ?? DEFAULT_QUALITY; + } catch { + return DEFAULT_QUALITY; + } +} + +export function setDefaultQuality(q: Quality): void { + try { localStorage.setItem(KEY, JSON.stringify(q)); } catch { return; } + events.emit({ type: QUALITY_EVENT, quality: q }); +} + +export const valuesOf = (q: Quality): Custom => (isPreset(q) ? PRESET_VALUES[q] : q); + +const fmt = (v: number, digits = 4): string => new Intl.NumberFormat(undefined, { maximumSignificantDigits: digits }).format(v); + +export const chordPercent = (chord: number): number => Number((chord * 100).toPrecision(4)); + +export function valuesText(q: Quality): string { + const v = valuesOf(q); + return t('Chord {chord}% of the model size, angle {angle} degrees', { chord: fmt(chordPercent(v.chord)), angle: fmt(v.angle, 3) }); +} + +export function qualityName(q: Quality): string { + if (isPreset(q)) return t(PRESET_LABELS[q]); + return t('Custom ({chord}%, {angle} degrees)', { chord: fmt(chordPercent(q.chord)), angle: fmt(q.angle, 3) }); +} + +export const toEngine = (q: Quality): string | Custom => (isPreset(q) ? q : { chord: q.chord, angle: q.angle }); From 513f290607108dd039b8854429aaa52aff41a366 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:02:37 -0500 Subject: [PATCH 103/494] feat(cad): add a client for the cad worker status and fetch routes One shared store reads GET /api/cad/worker, starts POST /api/cad/worker/fetch and follows the cad.worker events, so the settings page and the import sheet show the same state. Ran npx tsc --noEmit. --- frontend/src/ui/cad/service.ts | 200 +++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 frontend/src/ui/cad/service.ts diff --git a/frontend/src/ui/cad/service.ts b/frontend/src/ui/cad/service.ts new file mode 100644 index 00000000..39eee939 --- /dev/null +++ b/frontend/src/ui/cad/service.ts @@ -0,0 +1,200 @@ +import { api, ApiError } from '../../shell/api'; +import { events, type EngineEvent } from '../../shell/events'; +import { t } from '../../i18n'; + +export interface WorkerStatus { + available: boolean; + path?: string; + tag?: string; + origin?: string; + cache?: string; + installed?: { tag: string; path: string }[]; + protocol?: number; + reason?: string; + code?: string; + occt?: string; + worker_protocol?: number; +} + +export interface Published { + tag: string; + release?: string; + triple: string; + source?: string; + available: boolean; + reason?: string; + archive?: string; + files?: number; + bytes?: number; + minimum_os?: string; +} + +export type FetchState = 'idle' | 'running' | 'done' | 'failed' | 'cancelled'; + +export interface FetchJob { + state: FetchState; + stage: string; + fraction: number; + message: string; + tag?: string; + done?: number; + total?: number; + cancellable?: boolean; +} + +export interface Status { + worker: WorkerStatus; + published: Published; + installed: { tag: string; path: string }[]; + cache: string; + fetch: FetchJob; +} + +export const STATUS_ROUTE = '/api/cad/worker'; +export const FETCH_ROUTE = '/api/cad/worker/fetch'; +export const WORKER_EVENT = 'cad.worker'; + +const STAGES: Record = { + record: 'Reading the published record', + download: 'Downloading', + unpack: 'Unpacking', + verify: 'Checking every file', + done: 'Installed', +}; + +export function stageText(stage: string): string { + const known = STAGES[stage]; + if (known) return t(known); + return stage ? stage.charAt(0).toUpperCase() + stage.slice(1) : t('Starting'); +} + +export function bytesText(n: number): string { + if (!Number.isFinite(n) || n <= 0) return ''; + const units = ['B', 'KB', 'MB', 'GB']; + let v = n, i = 0; + while (v >= 1024 && i < units.length - 1) { v /= 1024; i++; } + return `${v >= 100 || i === 0 ? Math.round(v) : v.toFixed(1)} ${units[i]}`; +} + +export function errorText(err: unknown): string { + if (err instanceof ApiError) { + if (err.status === 0) return t('The FormShot service is not reachable.'); + if (err.status === 403) return t('The service refused the request from this window.'); + return err.message; + } + return err instanceof Error ? err.message : String(err); +} + +const obj = (v: unknown): Record => (v && typeof v === 'object' && !Array.isArray(v) ? v as Record : {}); +const num = (v: unknown): number | undefined => (typeof v === 'number' && Number.isFinite(v) ? v : undefined); + +function fetchOf(v: unknown): FetchJob { + const o = obj(v); + const state = typeof o.state === 'string' && ['idle', 'running', 'done', 'failed', 'cancelled'].includes(o.state) ? o.state as FetchState : 'idle'; + return { + state, + stage: typeof o.stage === 'string' ? o.stage : '', + fraction: Math.min(1, Math.max(0, num(o.fraction) ?? 0)), + message: typeof o.message === 'string' ? o.message : '', + tag: typeof o.tag === 'string' ? o.tag : undefined, + done: num(o.done) ?? num(o.bytes_done), + total: num(o.total) ?? num(o.bytes_total), + cancellable: o.cancellable === true, + }; +} + +type Listener = () => void; + +class WorkerStore { + status: Status | null = null; + error = ''; + fetch: FetchJob = { state: 'idle', stage: '', fraction: 0, message: '' }; + probe: WorkerStatus | null = null; + probing = false; + private loading: Promise | null = null; + private readonly fns = new Set(); + private wired = false; + + onChange(fn: Listener): () => void { + this.fns.add(fn); + this.wire(); + return () => { this.fns.delete(fn); }; + } + + private changed(): void { for (const fn of this.fns) fn(); } + + private wire(): void { + if (this.wired) return; + this.wired = true; + events.on(WORKER_EVENT, (e) => this.take(e)); + events.on('resync', () => { if (this.status) void this.refresh(); }); + } + + get installed(): boolean { return this.status?.worker.available === true; } + get running(): boolean { return this.fetch.state === 'running'; } + + refresh(): Promise { + if (this.loading) return this.loading; + this.loading = api.get(STATUS_ROUTE, { timeoutMs: 30000 }).then((s) => { + this.status = { ...s, worker: obj(s.worker) as unknown as WorkerStatus, published: obj(s.published) as unknown as Published, installed: Array.isArray(s.installed) ? s.installed : [] }; + const job = fetchOf(s.fetch); + if (!(this.running && job.state !== 'running')) this.fetch = job; + this.error = ''; + }).catch((err: unknown) => { + this.error = errorText(err); + }).finally(() => { + this.loading = null; + this.changed(); + }); + return this.loading; + } + + private take(e: EngineEvent): void { + const before = this.fetch.state; + this.fetch = fetchOf(e); + this.changed(); + if (before === 'running' && this.fetch.state !== 'running') { + this.probe = null; + void this.refresh(); + } + } + + async start(): Promise { + if (this.running) return; + this.fetch = { state: 'running', stage: 'record', fraction: 0, message: '' }; + this.changed(); + try { + const reply = obj(await api.post(FETCH_ROUTE, {}, { timeoutMs: 60000 })); + const job = fetchOf(reply.fetch); + if (job.state !== 'idle' && this.fetch.state === 'running' && this.fetch.stage === 'record' && this.fetch.fraction === 0) this.fetch = job; + } catch (err) { + this.fetch = { state: 'failed', stage: '', fraction: 0, message: errorText(err) }; + } + this.changed(); + } + + async cancel(): Promise { + if (!this.running || !this.fetch.cancellable) return; + try { + await api.del(FETCH_ROUTE, { timeoutMs: 15000 }); + } catch (err) { + this.fetch = { ...this.fetch, message: errorText(err) }; + this.changed(); + } + } + + async check(): Promise { + if (this.probing) return; + this.probing = true; + this.changed(); + try { + this.probe = obj(await api.dispatch('cad.status', { probe: true }, { timeoutMs: 120000 })) as unknown as WorkerStatus; + } catch (err) { + this.probe = { available: false, reason: errorText(err) }; + } + this.probing = false; + this.changed(); + } +} + +export const worker = new WorkerStore(); From 4322460ed81fb18beaf82e76e4d511e03f01c903 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:04:06 -0500 Subject: [PATCH 104/494] feat(cad): add a quality picker with presets and custom chord and angle Segmented presets plus custom chord (percent of the model size) and angle (degrees) fields that stay in place and only enable for Custom. Ran npx tsc --noEmit. --- frontend/src/ui/cad/picker.ts | 95 +++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 frontend/src/ui/cad/picker.ts diff --git a/frontend/src/ui/cad/picker.ts b/frontend/src/ui/cad/picker.ts new file mode 100644 index 00000000..4009a562 --- /dev/null +++ b/frontend/src/ui/cad/picker.ts @@ -0,0 +1,95 @@ +import { el, q, setChecked, setClass, setDisabled, setText, setValue } from '../../shell/dom'; +import { t } from '../../i18n'; +import { + ANGLE_MAX, ANGLE_MIN, CHORD_MAX_PERCENT, CHORD_MIN_PERCENT, PRESET_LABELS, PRESETS, + chordPercent, isPreset, valuesOf, valuesText, validCustom, type Quality, +} from './quality'; + +let seq = 0; + +export class QualityPicker { + readonly el: HTMLElement; + private readonly radios: HTMLInputElement[]; + private readonly chord: HTMLInputElement; + private readonly angle: HTMLInputElement; + private readonly line: HTMLElement; + private current: Quality; + + constructor(initial: Quality, private readonly changed: (q: Quality | null) => void, label = 'Quality') { + const name = `fsh-cad-q${++seq}`; + this.el = el(`
      +
      +
      + + +
      +

      +
      `); + const group = q(this.el, '.fsh-cad-presets'); + for (const v of [...PRESETS, 'custom']) { + const text = v === 'custom' ? t('Custom') : t(PRESET_LABELS[v as keyof typeof PRESET_LABELS]); + const r = el(``); + group.appendChild(r); + } + this.radios = Array.from(group.querySelectorAll('input')); + this.chord = q(this.el, '[data-v="chord"]'); + this.angle = q(this.el, '[data-v="angle"]'); + this.line = q(this.el, '.fsh-cad-quality-line'); + this.chord.setAttribute('aria-label', t('Chord as a percentage of the model size')); + this.angle.setAttribute('aria-label', t('Angle in degrees')); + this.current = initial; + group.addEventListener('change', () => { + const v = this.radios.find((r) => r.checked)?.value ?? 'medium'; + if (isPreset(v)) this.current = v; + else this.current = validCustom({ chord: Number(this.chord.value) / 100, angle: Number(this.angle.value) }) ?? { ...valuesOf(this.current) }; + this.paint(); + this.changed(this.value()); + }); + const edit = (): void => { + const v = this.value(); + if (v) this.current = v; + this.paint(true); + this.changed(this.value()); + }; + this.chord.addEventListener('input', edit); + this.angle.addEventListener('input', edit); + this.paint(); + } + + value(): Quality | null { + if (this.custom()) return validCustom({ chord: Number(this.chord.value) / 100, angle: Number(this.angle.value) }); + return this.current; + } + + set(qv: Quality): void { + this.current = qv; + this.paint(); + } + + setDisabled(off: boolean): void { + for (const r of this.radios) setDisabled(r, off); + setDisabled(this.chord, off || !this.custom()); + setDisabled(this.angle, off || !this.custom()); + } + + private custom(): boolean { return this.radios.find((r) => r.checked)?.value === 'custom'; } + + private paint(typing = false): void { + const cur = this.current; + const key = isPreset(cur) ? cur : 'custom'; + for (const r of this.radios) setChecked(r, r.value === key); + const custom = key === 'custom'; + setDisabled(this.chord, !custom); + setDisabled(this.angle, !custom); + if (!typing) { + const v = valuesOf(cur); + setValue(this.chord, String(chordPercent(v.chord))); + setValue(this.angle, String(v.angle)); + } + const val = this.value(); + setClass(this.line, 'is-error', val === null); + setText(this.line, val === null + ? t('Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.', { max: CHORD_MAX_PERCENT, min: ANGLE_MIN, amax: ANGLE_MAX }) + : valuesText(val)); + } +} From 39b8ca2b1e51612ee3466da4a60ce88fa1c07411 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:04:07 -0500 Subject: [PATCH 105/494] feat(cad): add the cad import settings page Registered like the hand-off page: worker status, download with stage and percentage from the cad.worker events, a check that starts the worker once, and the default CAD quality. Ran npx tsc --noEmit. --- frontend/src/ui/cad/cad.css | 44 +++++++++++ frontend/src/ui/cad/index.ts | 28 ++++++- frontend/src/ui/cad/settings.ts | 125 ++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/cad/cad.css create mode 100644 frontend/src/ui/cad/settings.ts diff --git a/frontend/src/ui/cad/cad.css b/frontend/src/ui/cad/cad.css new file mode 100644 index 00000000..1a4caedd --- /dev/null +++ b/frontend/src/ui/cad/cad.css @@ -0,0 +1,44 @@ +.fsh-cad-settings { display: grid; gap: var(--space-4); color: var(--text-primary); font-size: var(--fs-12); } +.fsh-cad-settings .fsh-note { margin: 0; line-height: var(--lh); } +.fsh-cad-block { display: grid; gap: var(--space-2); } +.fsh-cad-head { margin: 0; color: var(--text-secondary); font-size: var(--fs-11); font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase; } + +.fsh-cad-facts { display: grid; margin: 0; } +.fsh-cad-facts > div { display: grid; grid-template-columns: 14ch minmax(0, 1fr); align-items: center; gap: var(--space-3); height: 26px; border-bottom: 1px solid var(--line-1); } +.fsh-cad-facts dt { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-facts dd { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-path { display: block; font-family: var(--font-mono); font-size: var(--fs-11); direction: rtl; text-align: left; } +.fsh-cad-dot { flex: none; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--text-faint); } +.fsh-cad-dot[data-state="ok"] { background: var(--ok); } +.fsh-cad-dot[data-state="off"] { background: var(--warn); } + +.fsh-cad-reason { height: calc(var(--fs-12) * var(--lh) * 2); margin: 0; overflow: hidden; color: var(--text-muted); line-height: var(--lh); } +.fsh-cad-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--ctl-md); } +.fsh-cad-actions [data-a="fetch"] { min-width: 26ch; } +.fsh-cad-actions [data-a="refresh"] { margin-left: auto; } + +.fsh-cad-progress { display: grid; grid-template-columns: 22ch minmax(0, 1fr) 5ch; align-items: center; gap: var(--space-3); height: 22px; visibility: hidden; } +.fsh-cad-progress.is-on { visibility: visible; } +.fsh-cad-stage { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-bar { position: relative; height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--line-2); } +.fsh-cad-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--accent-color); transform: scaleX(var(--fsh-cad-fraction, 0)); transform-origin: left center; transition: transform var(--dur-fast) linear; } +.fsh-cad-pct { color: var(--text-muted); text-align: right; } +.fsh-cad-detail { height: 1.5em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-result { min-height: calc(var(--fs-12) * var(--lh) * 2); margin: 0; color: var(--text-secondary); line-height: var(--lh); overflow-wrap: anywhere; } +.fsh-cad-result.is-error { color: var(--danger-text); } +.fsh-cad-result.is-ok { color: var(--ok); } + +.fsh-cad-quality { display: grid; gap: var(--space-2); } +.fsh-cad-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-field); } +.fsh-cad-preset { position: relative; display: flex; align-items: center; justify-content: center; height: var(--ctl-sm); border-radius: var(--radius); color: var(--text-secondary); cursor: pointer; } +.fsh-cad-preset input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; } +.fsh-cad-preset:has(input:checked) { background: var(--accent-soft); color: var(--accent-color); } +.fsh-cad-preset:has(input:focus-visible) { outline: 2px solid var(--accent-color); outline-offset: 1px; } +.fsh-cad-preset:has(input:disabled) { opacity: 0.5; cursor: default; } +.fsh-cad-custom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } +.fsh-cad-field { display: grid; grid-template-columns: auto 10ch minmax(0, 1fr); align-items: center; gap: var(--space-2); height: var(--ctl-md); color: var(--text-secondary); } +.fsh-cad-field input { width: 100%; text-align: right; } +.fsh-cad-field input:disabled { opacity: 0.6; } +.fsh-cad-unit { overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-quality-line { height: 1.5em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-quality-line.is-error { color: var(--danger-text); } diff --git a/frontend/src/ui/cad/index.ts b/frontend/src/ui/cad/index.ts index 64a1dab9..32042ed7 100644 --- a/frontend/src/ui/cad/index.ts +++ b/frontend/src/ui/cad/index.ts @@ -1,3 +1,29 @@ +import './cad.css'; import type { ModuleContext } from '../../shell/app-shell'; +import { worker } from './service'; +import { settingsPage } from './settings'; -export function mount(_ctx: ModuleContext): void {} +const SETTINGS_PAGE = 'cad'; + +export function mount(ctx: ModuleContext): void { + const { registry } = ctx; + registry.registerSettingsPage({ + id: SETTINGS_PAGE, title: 'CAD Import', icon: 'import', order: 62, group: 'Files', + keywords: ['STEP', 'IGES', 'STP', 'IGS', 'CAD', 'worker', 'OpenCascade', 'tessellation', 'quality', 'chord', 'angle'], + mount: settingsPage, + }); + registry.registerCommands([ + { + id: 'cad.settings', label: 'CAD Import Settings...', group: 'File', icon: 'settings', + description: 'The CAD worker that opens STEP and IGES files, and the default CAD quality.', + run: () => registry.runCommand('app.settings', { page: SETTINGS_PAGE }), + }, + { + id: 'cad.fetchWorker', label: 'Download the CAD Worker', group: 'File', icon: 'import', + description: 'Download and check the program that opens STEP and IGES files.', + enabled: () => !worker.running, + run: () => { registry.runCommand('app.settings', { page: SETTINGS_PAGE }); return worker.start(); }, + }, + ]); + worker.onChange(() => registry.refreshState()); +} diff --git a/frontend/src/ui/cad/settings.ts b/frontend/src/ui/cad/settings.ts new file mode 100644 index 00000000..5ac3468f --- /dev/null +++ b/frontend/src/ui/cad/settings.ts @@ -0,0 +1,125 @@ +import { el, q, setAttr, setClass, setDisabled, setStyleVar, setText, setTitle } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import { QualityPicker } from './picker'; +import { defaultQuality, setDefaultQuality } from './quality'; +import { bytesText, stageText, worker } from './service'; + +const ORIGINS: Record = { + env: 'Named by FORMSHOT_CAD_WORKER', + app: 'Beside the FormShot engine', + cache: 'Downloaded into the cache folder', +}; + +const number = (n: number): string => new Intl.NumberFormat().format(n); + +export function settingsPage(host: HTMLElement): () => void { + const root = el(`
      +

      STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.

      +
      +

      CAD worker

      +
      +
      Status
      +
      Version
      +
      Program
      +
      Found
      +
      This computer
      +
      Published
      +
      +

      +
      + + + + +
      +
      +

      +

      +
      +
      +

      Default CAD quality

      +

      How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.

      +
      +
      +
      `); + const fetchBtn = q(root, '[data-a="fetch"]'); + const cancelBtn = q(root, '[data-a="cancel"]'); + const checkBtn = q(root, '[data-a="check"]'); + const refreshBtn = q(root, '[data-a="refresh"]'); + const progress = q(root, '.fsh-cad-progress'); + const field = (name: string): HTMLElement => q(root, `[data-f="${name}"]`); + + const picker = new QualityPicker(defaultQuality(), (v) => { if (v) setDefaultQuality(v); }, 'Default CAD quality'); + q(root, '.fsh-cad-picker').appendChild(picker.el); + + fetchBtn.addEventListener('click', () => void worker.start()); + cancelBtn.addEventListener('click', () => void worker.cancel()); + checkBtn.addEventListener('click', () => void worker.check()); + refreshBtn.addEventListener('click', () => void worker.refresh()); + + const paint = (): void => { + const s = worker.status; + const w = s?.worker; + const p = s?.published; + const job = worker.fetch; + const running = job.state === 'running'; + const known = s !== null; + const have = w?.available === true; + setClass(root, 'is-installed', have); + setText(q(root, '.fsh-cad-state-text'), !known ? (worker.error ? t('Unknown') : t('Reading...')) : have ? t('Installed') : t('Not installed')); + setAttr(q(root, '.fsh-cad-dot'), 'data-state', !known ? 'unknown' : have ? 'ok' : 'off'); + const probe = worker.probe; + let version = w?.tag ?? ''; + if (have && probe?.available && probe.occt) version = t('{tag}, OpenCascade {occt}, protocol {protocol}', { tag: version || probe.tag || '', occt: probe.occt, protocol: String(probe.worker_protocol ?? probe.protocol ?? '') }); + setText(field('version'), have ? version || t('Not named') : ''); + setText(field('path'), have ? w?.path ?? '' : ''); + setTitle(field('path'), have ? w?.path ?? '' : ''); + setText(field('origin'), have && w?.origin ? t(ORIGINS[w.origin] ?? w.origin) : ''); + setText(field('platform'), p?.triple ?? ''); + let pub = ''; + if (p?.available) pub = t('{tag}: {files} files, {size} unpacked', { tag: p.tag, files: number(p.files ?? 0), size: bytesText(p.bytes ?? 0) }); + else if (p) pub = t('{tag}: none for this computer', { tag: p.tag }); + setText(field('published'), pub); + + let reason = ''; + if (worker.error) reason = t('The status could not be read: {reason}', { reason: worker.error }); + else if (known && !have) reason = w?.reason ? t('Not available: {reason}', { reason: w.reason }) : t('Not available.'); + if (!reason && known && p && !p.available && !have) reason = p.reason ?? ''; + if (probe && !probe.available && probe.reason) reason = t('The worker did not answer: {reason}', { reason: probe.reason }); + setText(q(root, '.fsh-cad-reason'), reason); + + setText(q(root, '.fsh-cad-fetch-label'), have ? t('Download the CAD worker again') : t('Download the CAD worker')); + setDisabled(fetchBtn, running || !known || p?.available === false); + setTitle(fetchBtn, p?.available === false ? p.reason ?? '' : ''); + setDisabled(cancelBtn, !running || !job.cancellable); + setTitle(cancelBtn, running && !job.cancellable ? t('The service cannot stop a download once it has started.') : ''); + setDisabled(checkBtn, !have || running || worker.probing); + setAttr(checkBtn, 'aria-busy', worker.probing ? 'true' : null); + setDisabled(refreshBtn, running); + + setClass(progress, 'is-on', running); + setText(q(progress, '.fsh-cad-stage'), running ? stageText(job.stage) : ''); + setStyleVar(progress, '--fsh-cad-fraction', String(running ? job.fraction : 0)); + setText(q(progress, '.fsh-cad-pct'), running ? `${Math.round(job.fraction * 100)}%` : ''); + let detail = ''; + if (running && job.done !== undefined) detail = job.total ? t('{done} of {total}', { done: bytesText(job.done), total: bytesText(job.total) }) : bytesText(job.done); + else if (running) detail = job.message; + setText(q(root, '.fsh-cad-detail'), detail); + + const result = q(root, '.fsh-cad-result'); + let text = ''; + if (job.state === 'done') text = job.message || t('The CAD worker is installed.'); + else if (job.state === 'failed') text = t('The download failed: {reason}', { reason: job.message || t('no reason was given') }); + else if (job.state === 'cancelled') text = t('The download was cancelled. Nothing was installed.'); + setClass(result, 'is-error', job.state === 'failed'); + setClass(result, 'is-ok', job.state === 'done'); + setText(result, text); + }; + + const off = worker.onChange(paint); + host.appendChild(root); + paint(); + void worker.refresh(); + return off; +} From ac2e98ba6fc8544ff59f4a5c145fa010fcc1f87e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:05:39 -0500 Subject: [PATCH 106/494] feat(cad): offer the worker download inside the import sheet The cad.sheet command sets the sheet's CAD quality to the stored default (adding a Custom entry when needed) and places a reserved line under it that offers the download for STEP and IGES files while the worker is missing. Ran npx tsc --noEmit. --- frontend/src/ui/cad/cad.css | 11 +++++ frontend/src/ui/cad/index.ts | 8 ++++ frontend/src/ui/cad/offer.ts | 81 ++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 frontend/src/ui/cad/offer.ts diff --git a/frontend/src/ui/cad/cad.css b/frontend/src/ui/cad/cad.css index 1a4caedd..982d07c7 100644 --- a/frontend/src/ui/cad/cad.css +++ b/frontend/src/ui/cad/cad.css @@ -42,3 +42,14 @@ .fsh-cad-unit { overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } .fsh-cad-quality-line { height: 1.5em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } .fsh-cad-quality-line.is-error { color: var(--danger-text); } + +.fsh-cad-offer { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-2); overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-1); color: var(--text-secondary); font-size: var(--fs-11); line-height: var(--lh-tight); visibility: hidden; } +.fsh-cad-offer.is-on { visibility: visible; } +.fsh-cad-offer-icon { display: inline-flex; color: var(--warn); } +.fsh-cad-offer.is-ok .fsh-cad-offer-icon { color: var(--ok); } +.fsh-cad-offer.is-error .fsh-cad-offer-icon { color: var(--danger); } +.fsh-cad-offer-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } +.fsh-cad-offer-btn { min-width: 12ch; } +.fsh-cad-offer-btn[data-hidden] { visibility: hidden; } +.fsh-cad-offer-bar { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; visibility: hidden; } +.fsh-cad-offer.is-running .fsh-cad-offer-bar { visibility: visible; } diff --git a/frontend/src/ui/cad/index.ts b/frontend/src/ui/cad/index.ts index 32042ed7..82e0f825 100644 --- a/frontend/src/ui/cad/index.ts +++ b/frontend/src/ui/cad/index.ts @@ -1,5 +1,6 @@ import './cad.css'; import type { ModuleContext } from '../../shell/app-shell'; +import { attachSheet } from './offer'; import { worker } from './service'; import { settingsPage } from './settings'; @@ -24,6 +25,13 @@ export function mount(ctx: ModuleContext): void { enabled: () => !worker.running, run: () => { registry.runCommand('app.settings', { page: SETTINGS_PAGE }); return worker.start(); }, }, + { + id: 'cad.sheet', label: 'CAD Options in the Import Sheet', group: 'File', palette: false, + run: (args) => { + const select = args?.select, row = args?.row; + if (select instanceof HTMLSelectElement && row instanceof HTMLElement) attachSheet(select, row); + }, + }, ]); worker.onChange(() => registry.refreshState()); } diff --git a/frontend/src/ui/cad/offer.ts b/frontend/src/ui/cad/offer.ts new file mode 100644 index 00000000..b190269f --- /dev/null +++ b/frontend/src/ui/cad/offer.ts @@ -0,0 +1,81 @@ +import { el, q, setAttr, setClass, setDisabled, setStyleVar, setText, setTitle } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import { defaultQuality, isPreset, qualityName, toEngine, valuesText } from './quality'; +import { bytesText, stageText, worker } from './service'; + +export const CUSTOM_OPTION = 'custom'; + +function applyDefault(select: HTMLSelectElement): void { + const qv = defaultQuality(); + if (isPreset(qv)) { + if (Array.from(select.options).some((o) => o.value === qv)) select.value = qv; + return; + } + const opt = document.createElement('option'); + opt.value = CUSTOM_OPTION; + opt.textContent = qualityName(qv); + opt.dataset.quality = JSON.stringify(toEngine(qv)); + opt.title = valuesText(qv); + opt.setAttribute('data-no-i18n', ''); + select.appendChild(opt); + select.value = CUSTOM_OPTION; +} + +export function attachSheet(select: HTMLSelectElement, row: HTMLElement): void { + applyDefault(select); + const offer = el(`
      +${icon('warning', 14)} + + + +
      `); + const btn = q(offer, 'button'); + btn.addEventListener('click', () => void worker.start()); + row.after(offer); + let started = false; + let asked = false; + + const paint = (): void => { + if (!row.isConnected) { off(); observer.disconnect(); return; } + const cad = !row.classList.contains('is-off'); + const job = worker.fetch; + const running = job.state === 'running'; + if (running) started = true; + if (cad && !worker.status && !asked) { asked = true; void worker.refresh(); } + const missing = worker.status !== null && !worker.installed; + const show = cad && (missing || running || (started && job.state !== 'idle')); + setClass(offer, 'is-on', show); + setClass(offer, 'is-running', running); + setClass(offer, 'is-ok', !running && worker.installed); + setClass(offer, 'is-error', !running && job.state === 'failed'); + let text = '', label = '', title = ''; + if (running) { + text = t('Downloading the CAD worker: {stage}, {pct}%', { stage: stageText(job.stage), pct: Math.round(job.fraction * 100) }); + label = t('Downloading'); + } else if (worker.installed) { + text = t('The CAD worker is installed. You can import this file now.'); + } else if (job.state === 'failed' && started) { + text = t('The download failed: {reason}', { reason: job.message || t('no reason was given') }); + label = t('Try Again'); + } else { + const p = worker.status?.published; + text = p && !p.available + ? t('STEP and IGES files need the CAD worker, and none is published for this computer.') + : t('STEP and IGES files need the CAD worker, which is not installed yet.'); + label = t('Download'); + title = p?.available ? t('{tag}, {size} unpacked, checked file by file', { tag: p.tag, size: bytesText(p.bytes ?? 0) }) : p?.reason ?? ''; + } + setText(q(offer, '.fsh-cad-offer-text'), text); + setText(btn, label); + setAttr(btn, 'data-hidden', label ? null : 'true'); + setTitle(btn, title); + setDisabled(btn, running || worker.status?.published.available === false); + setStyleVar(offer, '--fsh-cad-fraction', String(running ? job.fraction : 0)); + }; + + const off = worker.onChange(paint); + const observer = new MutationObserver(paint); + observer.observe(row, { attributes: true, attributeFilter: ['class'] }); + paint(); +} From b79dd6930a6bca800b2f290ca89df6c3e78b6ce3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:05:39 -0500 Subject: [PATCH 107/494] feat(import): take the default cad quality from the cad module The sheet runs cad.sheet when it opens and sends a custom chord and angle when that entry is chosen; the edit is the CAD quality region plus its registry import. Ran npx tsc --noEmit. --- frontend/src/ui/import/sheet.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/import/sheet.ts b/frontend/src/ui/import/sheet.ts index 1ac81a0c..540e7073 100644 --- a/frontend/src/ui/import/sheet.ts +++ b/frontend/src/ui/import/sheet.ts @@ -2,6 +2,7 @@ import { Dialog } from '../../shell/dialog'; import { el, q, setAttr, setDisabled, setStyleVar, setText, setValue, setChecked } from '../../shell/dom'; import { icon } from '../../shell/icons'; import { toast } from '../../shell/toast'; +import { runCommand } from '../../shell/registry'; import { t } from '../../i18n'; import { catalogue, COMMANDS, CAD_QUALITIES, errorText, ImportJob, probe, resultCounts, UNITS, @@ -158,18 +159,20 @@ export class ImportSheet { this.dialog.open(); this.show(0); this.units.focus(); + runCommand('cad.sheet', { select: this.cad, row: q(this.root, '.fsh-imp-cad') }); } private options(): ImportOptions { const units = isUnit(this.units.value) ? this.units.value : 'auto'; const up = this.up.value === 'y' || this.up.value === 'z' ? this.up.value : 'auto'; + const custom = this.cad.selectedOptions[0]?.dataset.quality; const cad = (CAD_QUALITIES as readonly string[]).includes(this.cad.value) ? this.cad.value as CadQuality : 'medium'; const o: ImportOptions = { units, up_axis: up, stand_on_floor: this.boxes.stand_on_floor.checked, center: this.boxes.center.checked, frame: this.boxes.frame.checked, merge: this.boxes.merge.checked, }; - if (isCad(this.sources[this.index].name)) o.cad_quality = cad; + if (isCad(this.sources[this.index].name)) o.cad_quality = custom ? JSON.parse(custom) : cad; keep({ up_axis: up, stand_on_floor: o.stand_on_floor, center: o.center, frame: o.frame, merge: o.merge, cad_quality: cad }); return o; } From 63bcad2aefd850f542f6862a16030b0a22633b38 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:08:01 -0500 Subject: [PATCH 108/494] feat(cad): index the cad parts of the document from its snapshot scene.summary has no node metadata, so the module reads scene.json from the project snapshot and keeps the parts that carry source.cad, refetching only when the set of parts changes. Ran npx tsc --noEmit. --- frontend/src/ui/cad/parts.ts | 187 +++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 frontend/src/ui/cad/parts.ts diff --git a/frontend/src/ui/cad/parts.ts b/frontend/src/ui/cad/parts.ts new file mode 100644 index 00000000..3df35809 --- /dev/null +++ b/frontend/src/ui/cad/parts.ts @@ -0,0 +1,187 @@ +import { api } from '../../shell/api'; +import { events } from '../../shell/events'; +import { parseQuality, type Quality } from './quality'; + +export interface CadPart { + id: string; + name: string; + source: string; + file: string; + quality: Quality | null; + qualityText: string; + triangles: number; +} + +export interface SceneNode { id: string; name: string; kind: string; parent: string | null; triangles: number } + +const SNAPSHOT_ROUTE = '/api/engine/snapshot'; +const SNAPSHOT_COMMAND = 'file.snapshot'; +const SUMMARY = 'scene.summary'; +const SCENE_MEMBER = 'scene.json'; +const REFRESH_EVENTS = ['scene.changed', 'document.changed', 'history.changed', 'selection.changed', 'hello', 'resync', 'ui.import.done', 'ui.cad.retessellated']; +const DEBOUNCE_MS = 250; + +type Obj = Record; +const obj = (v: unknown): Obj => (v && typeof v === 'object' && !Array.isArray(v) ? v as Obj : {}); +const idText = (v: unknown): string => (typeof v === 'string' ? v : typeof v === 'number' ? String(v) : ''); + +function u16(b: Uint8Array, at: number): number { return b[at] | (b[at + 1] << 8); } +function u32(b: Uint8Array, at: number): number { return (b[at] | (b[at + 1] << 8) | (b[at + 2] << 16) | (b[at + 3] << 24)) >>> 0; } + +export function zipMember(bytes: Uint8Array, wanted: string): Uint8Array | null { + const stop = Math.max(0, bytes.length - 65557); + let end = -1; + for (let i = bytes.length - 22; i >= stop; i--) if (u32(bytes, i) === 0x06054b50) { end = i; break; } + if (end < 0) return null; + const count = u16(bytes, end + 10); + let at = u32(bytes, end + 16); + const names = new TextDecoder(); + for (let n = 0; n < count && at + 46 <= bytes.length; n++) { + if (u32(bytes, at) !== 0x02014b50) return null; + const method = u16(bytes, at + 10); + const size = u32(bytes, at + 20); + const nameLen = u16(bytes, at + 28), extraLen = u16(bytes, at + 30), commentLen = u16(bytes, at + 32); + const local = u32(bytes, at + 42); + const name = names.decode(bytes.subarray(at + 46, at + 46 + nameLen)); + if (name === wanted) { + if (method !== 0 || u32(bytes, local) !== 0x04034b50) return null; + const start = local + 30 + u16(bytes, local + 26) + u16(bytes, local + 28); + return start + size <= bytes.length ? bytes.subarray(start, start + size) : null; + } + at += 46 + nameLen + extraLen + commentLen; + } + return null; +} + +async function snapshot(): Promise { + const res = await fetch(api.url(SNAPSHOT_ROUTE), { cache: 'no-store' }); + if (res.ok) return new Uint8Array(await res.arrayBuffer()); + const o = obj(await api.dispatch(SNAPSHOT_COMMAND, {}, { timeoutMs: 60000 })); + const b64 = typeof o.fshot_b64 === 'string' ? o.fshot_b64 : ''; + const raw = atob(b64); + const out = new Uint8Array(raw.length); + for (let i = 0; i < raw.length; i++) out[i] = raw.charCodeAt(i); + return out; +} + +function nodeEntries(nodes: unknown): Array<[string, Obj]> { + if (Array.isArray(nodes)) { + return nodes.map((v): [string, Obj] => (Array.isArray(v) ? [idText(v[0]), obj(v[1])] : [idText(obj(v).id), obj(v)])); + } + return Object.entries(obj(nodes)).map(([k, v]) => [k, obj(v)]); +} + +const baseName = (p: string): string => p.split(/[\\/]/).pop() ?? p; + +function readParts(sceneJson: Uint8Array): Map { + const doc = obj(JSON.parse(new TextDecoder().decode(sceneJson))); + const out = new Map(); + for (const [id, n] of nodeEntries(doc.nodes ?? obj(doc.document).nodes)) { + const meta = obj(n.metadata); + const source = typeof meta['source.cad'] === 'string' ? meta['source.cad'] : ''; + if (!id || !source) continue; + const path = typeof meta['source.path'] === 'string' ? meta['source.path'] : ''; + const text = typeof meta['cad.quality'] === 'string' ? meta['cad.quality'] : ''; + out.set(id, { + id, name: typeof n.name === 'string' ? n.name : '', source, + file: baseName(path || source), quality: parseQuality(text), qualityText: text, triangles: 0, + }); + } + return out; +} + +export type IndexState = 'unknown' | 'ready' | 'failed'; + +class CadIndex { + state: IndexState = 'unknown'; + error = ''; + parts = new Map(); + nodes = new Map(); + selection: string[] = []; + private signature = ''; + private timer = 0; + private running: Promise | null = null; + private again = false; + private readonly fns = new Set<() => void>(); + private wired = false; + + onChange(fn: () => void): () => void { + this.fns.add(fn); + this.wire(); + return () => { this.fns.delete(fn); }; + } + + private wire(): void { + if (this.wired) return; + this.wired = true; + for (const type of REFRESH_EVENTS) events.on(type, () => this.schedule()); + this.schedule(); + } + + schedule(): void { + window.clearTimeout(this.timer); + this.timer = window.setTimeout(() => void this.refresh(), DEBOUNCE_MS); + } + + refresh(): Promise { + if (this.running) { this.again = true; return this.running; } + this.running = this.load().finally(() => { + this.running = null; + for (const fn of this.fns) fn(); + if (this.again) { this.again = false; void this.refresh(); } + }); + return this.running; + } + + private async load(): Promise { + let summary: Obj; + try { + summary = obj(await api.dispatch(SUMMARY, {}, { timeoutMs: 15000 })); + } catch (err) { + this.state = 'failed'; + this.error = err instanceof Error ? err.message : String(err); + return; + } + const nodes = new Map(); + for (const raw of Array.isArray(summary.nodes) ? summary.nodes : []) { + const n = obj(raw); + const id = idText(n.id); + if (!id) continue; + nodes.set(id, { id, name: typeof n.name === 'string' ? n.name : '', kind: typeof n.kind === 'string' ? n.kind : '', parent: idText(n.parent) || null, triangles: typeof n.triangles === 'number' ? n.triangles : 0 }); + } + this.nodes = nodes; + this.selection = (Array.isArray(summary.selection) ? summary.selection : []).map(idText).filter(Boolean); + const sig = [...nodes.values()].filter((n) => n.kind === 'part').map((n) => `${n.id}:${n.triangles}`).join(',') + `|${idText(obj(summary.document).path)}`; + if (sig !== this.signature || this.state !== 'ready') { + try { + const scene = zipMember(await snapshot(), SCENE_MEMBER); + if (!scene) throw new Error('scene.json is not in the project snapshot'); + this.parts = readParts(scene); + this.signature = sig; + this.state = 'ready'; + this.error = ''; + } catch (err) { + this.state = 'failed'; + this.error = err instanceof Error ? err.message : String(err); + return; + } + } + for (const p of this.parts.values()) p.triangles = nodes.get(p.id)?.triangles ?? 0; + for (const id of [...this.parts.keys()]) if (!nodes.has(id)) this.parts.delete(id); + } + + under(ids: readonly string[]): CadPart[] { + if (!ids.length) return []; + const chosen = new Set(ids); + const inside = (id: string): boolean => { + for (let cur: string | null = id, guard = 0; cur && guard < 4096; cur = this.nodes.get(cur)?.parent ?? null, guard++) if (chosen.has(cur)) return true; + return false; + }; + return [...this.parts.values()].filter((p) => inside(p.id)); + } + + selected(): CadPart[] { return this.under(this.selection); } + all(): CadPart[] { return [...this.parts.values()]; } +} + +export const cadIndex = new CadIndex(); From 03880839af953184e34bba0d045782796391c43c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:08:01 -0500 Subject: [PATCH 109/494] feat(cad): add the re-tessellate dialog and command scene.retessellate opens a dialog with the scope, current quality and triangles, the quality picker and an elapsed-time progress row; it sits in the Scene menu and is disabled with the reason when the selection has no CAD source. Ran npx tsc --noEmit. --- frontend/src/ui/cad/cad.css | 14 +++ frontend/src/ui/cad/index.ts | 45 ++++++++ frontend/src/ui/cad/retess.ts | 190 ++++++++++++++++++++++++++++++++++ 3 files changed, 249 insertions(+) create mode 100644 frontend/src/ui/cad/retess.ts diff --git a/frontend/src/ui/cad/cad.css b/frontend/src/ui/cad/cad.css index 982d07c7..dcf71fcc 100644 --- a/frontend/src/ui/cad/cad.css +++ b/frontend/src/ui/cad/cad.css @@ -53,3 +53,17 @@ .fsh-cad-offer-btn[data-hidden] { visibility: hidden; } .fsh-cad-offer-bar { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; visibility: hidden; } .fsh-cad-offer.is-running .fsh-cad-offer-bar { visibility: visible; } + +.fsh-cad-dialog { width: min(520px, calc(100vw - 48px)); } +.fsh-cad-retess { display: grid; gap: var(--space-2); color: var(--text-primary); font-size: var(--fs-12); } +.fsh-cad-scope { display: grid; gap: 0; margin: 0; padding: 0; border: 0; } +.fsh-cad-scope legend { margin-bottom: var(--space-1); padding: 0; } +.fsh-cad-scope-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); height: var(--ctl-md); cursor: pointer; } +.fsh-cad-scope-row input { margin: 0; accent-color: var(--accent-color); } +.fsh-cad-scope-row:has(input:disabled) { color: var(--text-muted); cursor: default; } +.fsh-cad-scope-count { min-width: 10ch; color: var(--text-muted); text-align: right; } +.fsh-cad-scope-why { height: 1.5em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-now { margin-bottom: var(--space-2); } +.fsh-cad-estimate { height: 1.5em; margin: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-cad-progress.is-indeterminate .fsh-cad-fill { width: 30%; transform: none; animation: fsh-cad-slide calc(var(--dur-slow) * 3) ease-in-out infinite; } +@keyframes fsh-cad-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } } diff --git a/frontend/src/ui/cad/index.ts b/frontend/src/ui/cad/index.ts index 82e0f825..01a362f0 100644 --- a/frontend/src/ui/cad/index.ts +++ b/frontend/src/ui/cad/index.ts @@ -1,6 +1,9 @@ import './cad.css'; import type { ModuleContext } from '../../shell/app-shell'; +import { t } from '../../i18n'; import { attachSheet } from './offer'; +import { cadIndex } from './parts'; +import { ESTIMATE, openRetessellate, RETESSELLATE } from './retess'; import { worker } from './service'; import { settingsPage } from './settings'; @@ -34,4 +37,46 @@ export function mount(ctx: ModuleContext): void { }, ]); worker.onChange(() => registry.refreshState()); + + const engine = new Set(); + let catalogueRead = false; + const readCatalogue = (): void => { + void ctx.api.catalogue({ timeoutMs: 8000 }).then((c) => { + engine.clear(); + for (const cmd of c.commands) if (typeof cmd.name === 'string') engine.add(cmd.name); + catalogueRead = true; + update(); + }, () => undefined); + }; + const why = (): string => { + if (catalogueRead && !engine.has(RETESSELLATE)) return t('This engine cannot re-tessellate CAD parts.'); + if (cadIndex.state !== 'ready') return ''; + if (!cadIndex.parts.size) return t('Nothing in this document came from a STEP or IGES file.'); + if (cadIndex.selection.length && !cadIndex.selected().length) return t('None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.'); + return ''; + }; + const DESCRIPTION = 'Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.'; + const update = (): void => { + const cmd = registry.getCommand(RETESSELLATE); + if (cmd) cmd.description = why() || DESCRIPTION; + registry.refreshState(); + }; + registry.registerCommand({ + id: RETESSELLATE, label: 'Re-tessellate CAD Parts...', group: 'Scene', icon: 'refresh', description: DESCRIPTION, + enabled: () => why() === '', + run: () => openRetessellate(() => engine.has(ESTIMATE)), + }); + registry.registerMenu({ id: 'scene', items: [{ command: RETESSELLATE, section: 3 }] }); + registry.registerMenu({ id: 'context.part', items: [{ command: RETESSELLATE, section: 5 }] }); + registry.registerMenu({ id: 'file', items: [{ command: 'cad.settings', section: 2 }] }); + if (!registry.getCommand('file.importCad')) registry.registerCommand({ + id: 'file.importCad', label: 'Import CAD (STEP, IGES)...', group: 'File', icon: 'import', + description: 'Choose STEP or IGES files to import; they open through the CAD worker.', + enabled: () => registry.getCommand('file.import') !== undefined, + run: () => registry.runCommand('file.import'), + }); + cadIndex.onChange(update); + ctx.events.on('hello', readCatalogue); + ctx.events.on('resync', readCatalogue); + ctx.onReady(readCatalogue); } diff --git a/frontend/src/ui/cad/retess.ts b/frontend/src/ui/cad/retess.ts new file mode 100644 index 00000000..916a2dac --- /dev/null +++ b/frontend/src/ui/cad/retess.ts @@ -0,0 +1,190 @@ +import { api } from '../../shell/api'; +import { Dialog } from '../../shell/dialog'; +import { el, q, setChecked, setClass, setDisabled, setText, setTitle } from '../../shell/dom'; +import { events } from '../../shell/events'; +import { runCommand } from '../../shell/registry'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import { cadIndex, type CadPart } from './parts'; +import { QualityPicker } from './picker'; +import { defaultQuality, qualityName, toEngine, type Quality } from './quality'; +import { errorText } from './service'; + +export const RETESSELLATE = 'scene.retessellate'; +export const ESTIMATE = 'cad.estimate'; + +type Scope = 'selected' | 'all'; +type Obj = Record; +const obj = (v: unknown): Obj => (v && typeof v === 'object' && !Array.isArray(v) ? v as Obj : {}); +const count = (v: unknown): number | null => (typeof v === 'number' && Number.isFinite(v) ? v : Array.isArray(v) ? v.length : null); +const number = (n: number): string => new Intl.NumberFormat().format(n); + +let open: Dialog | null = null; + +function qualityLine(parts: readonly CadPart[]): string { + const texts = new Set(parts.map((p) => p.qualityText)); + if (texts.size > 1) return t('Mixed'); + const p = parts[0]; + if (!p) return ''; + return p.quality ? qualityName(p.quality) : p.qualityText || t('Not recorded'); +} + +function sourcesLine(parts: readonly CadPart[]): string { + const files = [...new Set(parts.map((p) => p.file))]; + if (files.length === 1) return files[0]; + return t('{n} files', { n: files.length }); +} + +export function openRetessellate(hasEstimate: () => boolean): void { + if (open) return; + const d = new Dialog('Re-tessellate CAD Parts'); + open = d; + d.scrim.querySelector('.fsh-dialog')?.classList.add('fsh-cad-dialog'); + const root = el(`
      +
      +Parts + + +

      +
      +
      +
      Source
      +
      Quality now
      +
      Triangles now
      +
      +

      New quality

      +
      +

      +
      +

      +
      `); + d.body.appendChild(root); + const radios = Array.from(root.querySelectorAll('input[name="fsh-cad-scope"]')); + const progress = q(root, '.fsh-cad-progress'); + const result = q(root, '.fsh-cad-result'); + let scope: Scope | null = null; + let running = false; + let started = 0; + let tick = 0; + let estimateSeq = 0; + + const picker = new QualityPicker(defaultQuality(), () => { sync(); estimate(); }, 'New quality'); + q(root, '.fsh-cad-picker').appendChild(picker.el); + const closeBtn = d.action('Cancel', () => d.close()); + const applyBtn = d.action('Apply', () => void apply(), 'primary'); + + const inScope = (): CadPart[] => (scope === 'selected' ? cadIndex.selected() : cadIndex.all()); + + const estimate = (): void => { + const line = q(root, '.fsh-cad-estimate'); + const qv = picker.value(); + const parts = inScope(); + if (!hasEstimate() || !qv || !parts.length) { + setText(line, cadIndex.state === 'ready' && parts.length ? t('The engine gives no estimate; finer qualities take longer and make more triangles.') : ''); + return; + } + const seq = ++estimateSeq; + const args: Obj = { quality: toEngine(qv) }; + if (scope === 'selected') args.nodes = cadIndex.selection; + void api.dispatch(ESTIMATE, args, { timeoutMs: 30000 }).then((raw) => { + if (seq !== estimateSeq) return; + const n = count(obj(raw).triangles); + setText(line, n === null ? '' : t('About {n} triangles afterwards.', { n: number(n) })); + }, () => { if (seq === estimateSeq) setText(line, ''); }); + }; + + const sync = (): void => { + const selected = cadIndex.selected(); + const all = cadIndex.all(); + const known = cadIndex.state === 'ready'; + if (scope === null && known) scope = selected.length ? 'selected' : 'all'; + if (scope === 'selected' && !selected.length && known) scope = 'all'; + for (const r of radios) { + setChecked(r, r.value === scope); + setDisabled(r, running || (r.value === 'selected' ? !selected.length : !all.length)); + } + const parts = (n: number): string => (n === 1 ? t('1 part') : t('{n} parts', { n: number(n) })); + setText(q(root, '[data-s="selected"]'), known ? parts(selected.length) : ''); + setText(q(root, '[data-s="all"]'), known ? parts(all.length) : ''); + let why = ''; + if (cadIndex.state === 'failed') why = t('The parts could not be read: {reason}', { reason: cadIndex.error }); + else if (known && !all.length) why = t('Nothing in this document came from a STEP or IGES file.'); + else if (known && !selected.length && cadIndex.selection.length) why = t('None of the selected parts came from a STEP or IGES file.'); + else if (known && !selected.length) why = t('Nothing is selected, so every CAD part is rebuilt.'); + setText(q(root, '.fsh-cad-scope-why'), why); + const list = inScope(); + setText(q(root, '[data-f="source"]'), sourcesLine(list)); + setText(q(root, '[data-f="quality"]'), qualityLine(list)); + setText(q(root, '[data-f="triangles"]'), list.length ? number(list.reduce((s, p) => s + p.triangles, 0)) : ''); + picker.setDisabled(running); + const qv = picker.value(); + setDisabled(applyBtn, running || !qv || !list.length); + setTitle(applyBtn, !list.length && why ? why : ''); + setText(closeBtn, running ? t('Close') : t('Cancel')); + }; + + const paintProgress = (): void => { + setClass(progress, 'is-on', running); + const secs = Math.round((performance.now() - started) / 1000); + setText(q(progress, '.fsh-cad-stage'), running ? t('Re-tessellating') : ''); + setText(q(progress, '.fsh-cad-pct'), running ? `${secs} s` : ''); + }; + + const apply = async (): Promise => { + const qv: Quality | null = picker.value(); + const list = inScope(); + if (running || !qv || !list.length) return; + running = true; + started = performance.now(); + setText(result, ''); + setClass(result, 'is-error', false); + tick = window.setInterval(paintProgress, 500); + paintProgress(); + sync(); + const args: Obj = { quality: toEngine(qv) }; + if (scope === 'selected') args.nodes = cadIndex.selection; + try { + const reply = obj(await api.dispatch(RETESSELLATE, args, { timeoutMs: 900000 })); + const partsDone = count(reply.parts) ?? list.length; + const before = count(reply.triangles_before), after = count(reply.triangles_after); + const warnings = Array.isArray(reply.warnings) ? reply.warnings.filter((w) => typeof w === 'string') as string[] : []; + let text = before !== null && after !== null + ? t('Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.', { parts: partsDone, quality: qualityName(qv), before: number(before), after: number(after) }) + : t('Re-tessellated {parts} CAD parts at {quality}.', { parts: partsDone, quality: qualityName(qv) }); + if (warnings.length) text = `${text} ${warnings.join(' ')}`; + for (const type of ['scene.changed', 'document.changed']) events.emit({ type }); + events.emit({ type: 'ui.cad.retessellated', parts: partsDone, quality: toEngine(qv) }); + toast(text, 'info', { label: 'Undo', run: () => { runCommand('edit.undo'); } }); + running = false; + window.clearInterval(tick); + d.close(); + return; + } catch (err) { + setClass(result, 'is-error', true); + setText(result, t('Could not re-tessellate: {reason}', { reason: errorText(err) })); + } + running = false; + window.clearInterval(tick); + paintProgress(); + sync(); + }; + + root.addEventListener('change', (e) => { + const target = e.target as HTMLElement; + if (!(target instanceof HTMLInputElement) || target.name !== 'fsh-cad-scope') return; + scope = target.value === 'selected' ? 'selected' : 'all'; + sync(); + estimate(); + }); + const off = cadIndex.onChange(() => { if (!running) { sync(); estimate(); } }); + d.onClose = () => { + off(); + if (!running) window.clearInterval(tick); + open = null; + }; + sync(); + paintProgress(); + estimate(); + d.open(); + void cadIndex.refresh(); +} From a0ff1adaab85c2e44f09da1666a147b2b3adfee7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:13:52 -0500 Subject: [PATCH 110/494] fix(cad): name the worker origin row found in The bare word Found already exists in the settings namespace with another sense, so the row label is distinct. Ran npx tsc --noEmit and vite build. --- frontend/src/ui/cad/settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/cad/settings.ts b/frontend/src/ui/cad/settings.ts index 5ac3468f..337cf7eb 100644 --- a/frontend/src/ui/cad/settings.ts +++ b/frontend/src/ui/cad/settings.ts @@ -22,7 +22,7 @@ export function settingsPage(host: HTMLElement): () => void {
      Status
      Version
      Program
      -
      Found
      +
      Found in
      This computer
      Published
      From b12f4fa6ebe8762eb654040a843ca7a35d4b7599 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:51:13 -0500 Subject: [PATCH 111/494] fix(cad): keep the settings page still after a download The download button keeps one label so the buttons beside it no longer move when the worker arrives, the program path truncates from the left without moving its slash, and a missing worker gets a plain sentence naming the folder. Seen in headless Chrome against a real fetch. --- frontend/src/ui/cad/cad.css | 2 +- frontend/src/ui/cad/settings.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/ui/cad/cad.css b/frontend/src/ui/cad/cad.css index dcf71fcc..2c1a6d32 100644 --- a/frontend/src/ui/cad/cad.css +++ b/frontend/src/ui/cad/cad.css @@ -7,7 +7,7 @@ .fsh-cad-facts > div { display: grid; grid-template-columns: 14ch minmax(0, 1fr); align-items: center; gap: var(--space-3); height: 26px; border-bottom: 1px solid var(--line-1); } .fsh-cad-facts dt { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } .fsh-cad-facts dd { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; } -.fsh-cad-path { display: block; font-family: var(--font-mono); font-size: var(--fs-11); direction: rtl; text-align: left; } +.fsh-cad-facts dd.fsh-cad-path { display: block; font-family: var(--font-mono); font-size: var(--fs-11); direction: rtl; text-align: left; } .fsh-cad-dot { flex: none; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--text-faint); } .fsh-cad-dot[data-state="ok"] { background: var(--ok); } .fsh-cad-dot[data-state="off"] { background: var(--warn); } diff --git a/frontend/src/ui/cad/settings.ts b/frontend/src/ui/cad/settings.ts index 337cf7eb..15fbd504 100644 --- a/frontend/src/ui/cad/settings.ts +++ b/frontend/src/ui/cad/settings.ts @@ -21,7 +21,7 @@ export function settingsPage(host: HTMLElement): () => void {
      Status
      Version
      -
      Program
      +
      Program
      Found in
      This computer
      Published
      @@ -84,12 +84,12 @@ export function settingsPage(host: HTMLElement): () => void { let reason = ''; if (worker.error) reason = t('The status could not be read: {reason}', { reason: worker.error }); + else if (known && !have && w?.code === 'cad_worker_missing') reason = t('Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.', { folder: w.cache ?? s.cache }); else if (known && !have) reason = w?.reason ? t('Not available: {reason}', { reason: w.reason }) : t('Not available.'); if (!reason && known && p && !p.available && !have) reason = p.reason ?? ''; if (probe && !probe.available && probe.reason) reason = t('The worker did not answer: {reason}', { reason: probe.reason }); setText(q(root, '.fsh-cad-reason'), reason); - setText(q(root, '.fsh-cad-fetch-label'), have ? t('Download the CAD worker again') : t('Download the CAD worker')); setDisabled(fetchBtn, running || !known || p?.available === false); setTitle(fetchBtn, p?.available === false ? p.reason ?? '' : ''); setDisabled(cancelBtn, !running || !job.cancellable); From 674707ce3c2de1f94d4ec6f5740ae4ed71d9c609 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:17 -0500 Subject: [PATCH 112/494] fix(cad): show the installed worker as soon as the download ends The sheet's offer line treats a finished download as installed while the status is read again, and the custom quality name is short enough for the sheet's select. Seen in headless Chrome after a real download from the sheet. --- frontend/src/ui/cad/offer.ts | 7 ++++--- frontend/src/ui/cad/quality.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/cad/offer.ts b/frontend/src/ui/cad/offer.ts index b190269f..bc2090a6 100644 --- a/frontend/src/ui/cad/offer.ts +++ b/frontend/src/ui/cad/offer.ts @@ -43,17 +43,18 @@ export function attachSheet(select: HTMLSelectElement, row: HTMLElement): void { const running = job.state === 'running'; if (running) started = true; if (cad && !worker.status && !asked) { asked = true; void worker.refresh(); } - const missing = worker.status !== null && !worker.installed; + const have = worker.installed || (started && job.state === 'done'); + const missing = worker.status !== null && !have; const show = cad && (missing || running || (started && job.state !== 'idle')); setClass(offer, 'is-on', show); setClass(offer, 'is-running', running); - setClass(offer, 'is-ok', !running && worker.installed); + setClass(offer, 'is-ok', !running && have); setClass(offer, 'is-error', !running && job.state === 'failed'); let text = '', label = '', title = ''; if (running) { text = t('Downloading the CAD worker: {stage}, {pct}%', { stage: stageText(job.stage), pct: Math.round(job.fraction * 100) }); label = t('Downloading'); - } else if (worker.installed) { + } else if (have) { text = t('The CAD worker is installed. You can import this file now.'); } else if (job.state === 'failed' && started) { text = t('The download failed: {reason}', { reason: job.message || t('no reason was given') }); diff --git a/frontend/src/ui/cad/quality.ts b/frontend/src/ui/cad/quality.ts index ddf36134..59879e75 100644 --- a/frontend/src/ui/cad/quality.ts +++ b/frontend/src/ui/cad/quality.ts @@ -69,7 +69,7 @@ export function valuesText(q: Quality): string { export function qualityName(q: Quality): string { if (isPreset(q)) return t(PRESET_LABELS[q]); - return t('Custom ({chord}%, {angle} degrees)', { chord: fmt(chordPercent(q.chord)), angle: fmt(q.angle, 3) }); + return t('Custom ({chord}%, {angle}°)', { chord: fmt(chordPercent(q.chord)), angle: fmt(q.angle, 3) }); } export const toEngine = (q: Quality): string | Custom => (isPreset(q) ? q : { chord: q.chord, angle: q.angle }); From 234e7027a446b3af25bd9d5a07afd9171f7f5b84 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:10:58 -0500 Subject: [PATCH 113/494] fix(cad): say the download stage once in the sheet's offer line While the worker downloads, the line reads CAD worker: stage, percent and the button steps aside instead of repeating the word. Seen in headless Chrome. --- frontend/src/ui/cad/offer.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/ui/cad/offer.ts b/frontend/src/ui/cad/offer.ts index bc2090a6..7ab1170d 100644 --- a/frontend/src/ui/cad/offer.ts +++ b/frontend/src/ui/cad/offer.ts @@ -52,8 +52,7 @@ export function attachSheet(select: HTMLSelectElement, row: HTMLElement): void { setClass(offer, 'is-error', !running && job.state === 'failed'); let text = '', label = '', title = ''; if (running) { - text = t('Downloading the CAD worker: {stage}, {pct}%', { stage: stageText(job.stage), pct: Math.round(job.fraction * 100) }); - label = t('Downloading'); + text = t('CAD worker: {stage}, {pct}%', { stage: stageText(job.stage), pct: Math.round(job.fraction * 100) }); } else if (have) { text = t('The CAD worker is installed. You can import this file now.'); } else if (job.state === 'failed' && started) { From 58253026ba6099f6a5724a20e086be95e21d32c5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:19:36 -0500 Subject: [PATCH 114/494] fix(cad): read the selection again when the menu asks The service publishes no events for the window's own engine calls, so the re-tessellate command now re-reads the summary when a menu evaluates it and more than 0.8 s have passed, and after any registry command; the shell is told only when the reason changes. Found with a non-CAD part selected in headless Chrome. --- frontend/src/ui/cad/index.ts | 9 +++++++-- frontend/src/ui/cad/parts.ts | 11 +++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/cad/index.ts b/frontend/src/ui/cad/index.ts index 01a362f0..c9d4f7b4 100644 --- a/frontend/src/ui/cad/index.ts +++ b/frontend/src/ui/cad/index.ts @@ -56,14 +56,18 @@ export function mount(ctx: ModuleContext): void { return ''; }; const DESCRIPTION = 'Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.'; + let shown = ''; const update = (): void => { + const reason = why(); + if (reason === shown) return; + shown = reason; const cmd = registry.getCommand(RETESSELLATE); - if (cmd) cmd.description = why() || DESCRIPTION; + if (cmd) cmd.description = reason || DESCRIPTION; registry.refreshState(); }; registry.registerCommand({ id: RETESSELLATE, label: 'Re-tessellate CAD Parts...', group: 'Scene', icon: 'refresh', description: DESCRIPTION, - enabled: () => why() === '', + enabled: () => { cadIndex.touch(); return why() === ''; }, run: () => openRetessellate(() => engine.has(ESTIMATE)), }); registry.registerMenu({ id: 'scene', items: [{ command: RETESSELLATE, section: 3 }] }); @@ -76,6 +80,7 @@ export function mount(ctx: ModuleContext): void { run: () => registry.runCommand('file.import'), }); cadIndex.onChange(update); + registry.onCommandRun((cmd) => { if (cmd.id !== RETESSELLATE && !cmd.id.startsWith('cad.')) cadIndex.schedule(); }); ctx.events.on('hello', readCatalogue); ctx.events.on('resync', readCatalogue); ctx.onReady(readCatalogue); diff --git a/frontend/src/ui/cad/parts.ts b/frontend/src/ui/cad/parts.ts index 3df35809..05348c81 100644 --- a/frontend/src/ui/cad/parts.ts +++ b/frontend/src/ui/cad/parts.ts @@ -20,6 +20,7 @@ const SUMMARY = 'scene.summary'; const SCENE_MEMBER = 'scene.json'; const REFRESH_EVENTS = ['scene.changed', 'document.changed', 'history.changed', 'selection.changed', 'hello', 'resync', 'ui.import.done', 'ui.cad.retessellated']; const DEBOUNCE_MS = 250; +const STALE_MS = 800; type Obj = Record; const obj = (v: unknown): Obj => (v && typeof v === 'object' && !Array.isArray(v) ? v as Obj : {}); @@ -99,6 +100,7 @@ class CadIndex { nodes = new Map(); selection: string[] = []; private signature = ''; + private loadedAt = -Infinity; private timer = 0; private running: Promise | null = null; private again = false; @@ -118,15 +120,20 @@ class CadIndex { this.schedule(); } - schedule(): void { + schedule(delay = DEBOUNCE_MS): void { window.clearTimeout(this.timer); - this.timer = window.setTimeout(() => void this.refresh(), DEBOUNCE_MS); + this.timer = window.setTimeout(() => void this.refresh(), delay); + } + + touch(): void { + if (!this.running && performance.now() - this.loadedAt > STALE_MS) this.schedule(0); } refresh(): Promise { if (this.running) { this.again = true; return this.running; } this.running = this.load().finally(() => { this.running = null; + this.loadedAt = performance.now(); for (const fn of this.fns) fn(); if (this.again) { this.again = false; void this.refresh(); } }); From 7148f644e73880493f733424811c1fb2b82e7990 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:19:36 -0500 Subject: [PATCH 115/494] fix(cad): let the dialog scope follow the selection until it is chosen The scope picks Selected CAD parts whenever the fresh selection holds one and the person has not chosen, the toast says 1 CAD part in the singular, and the footer buttons keep their width when Cancel becomes Close. Ran npx tsc --noEmit. --- frontend/src/ui/cad/cad.css | 1 + frontend/src/ui/cad/retess.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/cad/cad.css b/frontend/src/ui/cad/cad.css index 2c1a6d32..84638394 100644 --- a/frontend/src/ui/cad/cad.css +++ b/frontend/src/ui/cad/cad.css @@ -55,6 +55,7 @@ .fsh-cad-offer.is-running .fsh-cad-offer-bar { visibility: visible; } .fsh-cad-dialog { width: min(520px, calc(100vw - 48px)); } +.fsh-cad-dialog .fsh-dialog-foot .fsh-btn { min-width: 96px; } .fsh-cad-retess { display: grid; gap: var(--space-2); color: var(--text-primary); font-size: var(--fs-12); } .fsh-cad-scope { display: grid; gap: 0; margin: 0; padding: 0; border: 0; } .fsh-cad-scope legend { margin-bottom: var(--space-1); padding: 0; } diff --git a/frontend/src/ui/cad/retess.ts b/frontend/src/ui/cad/retess.ts index 916a2dac..3218baab 100644 --- a/frontend/src/ui/cad/retess.ts +++ b/frontend/src/ui/cad/retess.ts @@ -63,6 +63,7 @@ export function openRetessellate(hasEstimate: () => boolean): void { const progress = q(root, '.fsh-cad-progress'); const result = q(root, '.fsh-cad-result'); let scope: Scope | null = null; + let chosen = false; let running = false; let started = 0; let tick = 0; @@ -97,7 +98,7 @@ export function openRetessellate(hasEstimate: () => boolean): void { const selected = cadIndex.selected(); const all = cadIndex.all(); const known = cadIndex.state === 'ready'; - if (scope === null && known) scope = selected.length ? 'selected' : 'all'; + if (!chosen && known) scope = selected.length ? 'selected' : 'all'; if (scope === 'selected' && !selected.length && known) scope = 'all'; for (const r of radios) { setChecked(r, r.value === scope); @@ -148,9 +149,11 @@ export function openRetessellate(hasEstimate: () => boolean): void { const partsDone = count(reply.parts) ?? list.length; const before = count(reply.triangles_before), after = count(reply.triangles_after); const warnings = Array.isArray(reply.warnings) ? reply.warnings.filter((w) => typeof w === 'string') as string[] : []; - let text = before !== null && after !== null - ? t('Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.', { parts: partsDone, quality: qualityName(qv), before: number(before), after: number(after) }) - : t('Re-tessellated {parts} CAD parts at {quality}.', { parts: partsDone, quality: qualityName(qv) }); + const vars = { parts: partsDone, quality: qualityName(qv), before: number(before ?? 0), after: number(after ?? 0) }; + const counted = before !== null && after !== null; + let text = partsDone === 1 + ? (counted ? t('Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.', vars) : t('Re-tessellated 1 CAD part at {quality}.', vars)) + : (counted ? t('Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.', vars) : t('Re-tessellated {parts} CAD parts at {quality}.', vars)); if (warnings.length) text = `${text} ${warnings.join(' ')}`; for (const type of ['scene.changed', 'document.changed']) events.emit({ type }); events.emit({ type: 'ui.cad.retessellated', parts: partsDone, quality: toEngine(qv) }); @@ -173,6 +176,7 @@ export function openRetessellate(hasEstimate: () => boolean): void { const target = e.target as HTMLElement; if (!(target instanceof HTMLInputElement) || target.name !== 'fsh-cad-scope') return; scope = target.value === 'selected' ? 'selected' : 'all'; + chosen = true; sync(); estimate(); }); From 2ba5f722dd314911d17907188e531c8a7d03b059 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:29:44 -0500 Subject: [PATCH 116/494] feat(i18n): add the cad namespace with every language table 89 strings of the cad module, English placeholders in the 23 language tables and empty es-MX and fr-CA tables as in the other namespaces; strings already defined elsewhere are not repeated. Ran npx tsc --noEmit and vite build. --- frontend/src/i18n/modules/cad/cs.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/da.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/de.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/es-MX.json | 1 + frontend/src/i18n/modules/cad/es.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/fi.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/fr-CA.json | 1 + frontend/src/i18n/modules/cad/fr.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/hu.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/id.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/it.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/ja.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/ko.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/nb.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/nl.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/pl.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/pt-BR.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/ru.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/strings.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/sv.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/th.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/tr.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/uk.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/vi.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/zh-CN.json | 91 ++++++++++++++++++++++ frontend/src/i18n/modules/cad/zh-TW.json | 91 ++++++++++++++++++++++ 26 files changed, 2186 insertions(+) create mode 100644 frontend/src/i18n/modules/cad/cs.json create mode 100644 frontend/src/i18n/modules/cad/da.json create mode 100644 frontend/src/i18n/modules/cad/de.json create mode 100644 frontend/src/i18n/modules/cad/es-MX.json create mode 100644 frontend/src/i18n/modules/cad/es.json create mode 100644 frontend/src/i18n/modules/cad/fi.json create mode 100644 frontend/src/i18n/modules/cad/fr-CA.json create mode 100644 frontend/src/i18n/modules/cad/fr.json create mode 100644 frontend/src/i18n/modules/cad/hu.json create mode 100644 frontend/src/i18n/modules/cad/id.json create mode 100644 frontend/src/i18n/modules/cad/it.json create mode 100644 frontend/src/i18n/modules/cad/ja.json create mode 100644 frontend/src/i18n/modules/cad/ko.json create mode 100644 frontend/src/i18n/modules/cad/nb.json create mode 100644 frontend/src/i18n/modules/cad/nl.json create mode 100644 frontend/src/i18n/modules/cad/pl.json create mode 100644 frontend/src/i18n/modules/cad/pt-BR.json create mode 100644 frontend/src/i18n/modules/cad/ru.json create mode 100644 frontend/src/i18n/modules/cad/strings.json create mode 100644 frontend/src/i18n/modules/cad/sv.json create mode 100644 frontend/src/i18n/modules/cad/th.json create mode 100644 frontend/src/i18n/modules/cad/tr.json create mode 100644 frontend/src/i18n/modules/cad/uk.json create mode 100644 frontend/src/i18n/modules/cad/vi.json create mode 100644 frontend/src/i18n/modules/cad/zh-CN.json create mode 100644 frontend/src/i18n/modules/cad/zh-TW.json diff --git a/frontend/src/i18n/modules/cad/cs.json b/frontend/src/i18n/modules/cad/cs.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/cs.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/da.json b/frontend/src/i18n/modules/cad/da.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/da.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/de.json b/frontend/src/i18n/modules/cad/de.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/de.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/es-MX.json b/frontend/src/i18n/modules/cad/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/cad/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/cad/es.json b/frontend/src/i18n/modules/cad/es.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/es.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/fi.json b/frontend/src/i18n/modules/cad/fi.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/fi.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/fr-CA.json b/frontend/src/i18n/modules/cad/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/cad/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/cad/fr.json b/frontend/src/i18n/modules/cad/fr.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/fr.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/hu.json b/frontend/src/i18n/modules/cad/hu.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/hu.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/id.json b/frontend/src/i18n/modules/cad/id.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/id.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/it.json b/frontend/src/i18n/modules/cad/it.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/it.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/ja.json b/frontend/src/i18n/modules/cad/ja.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/ja.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/ko.json b/frontend/src/i18n/modules/cad/ko.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/ko.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/nb.json b/frontend/src/i18n/modules/cad/nb.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/nb.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/nl.json b/frontend/src/i18n/modules/cad/nl.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/nl.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/pl.json b/frontend/src/i18n/modules/cad/pl.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/pl.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/pt-BR.json b/frontend/src/i18n/modules/cad/pt-BR.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/pt-BR.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/ru.json b/frontend/src/i18n/modules/cad/ru.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/ru.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/strings.json b/frontend/src/i18n/modules/cad/strings.json new file mode 100644 index 00000000..a3f50ed0 --- /dev/null +++ b/frontend/src/i18n/modules/cad/strings.json @@ -0,0 +1,91 @@ +[ + "% of the model size", + "About {n} triangles afterwards.", + "All CAD parts", + "Angle", + "Angle in degrees", + "Apply", + "Beside the FormShot engine", + "CAD Import", + "CAD Import Settings...", + "CAD Options in the Import Sheet", + "CAD worker", + "CAD worker: {stage}, {pct}%", + "Check the worker", + "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord", + "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}", + "Custom", + "Custom ({chord}%, {angle}°)", + "Default CAD quality", + "Download", + "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker", + "Download the CAD worker", + "Downloaded into the cache folder", + "Downloading", + "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed", + "Mixed", + "Named by FORMSHOT_CAD_WORKER", + "New quality", + "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.", + "Not available: {reason}", + "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named", + "Not recorded", + "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.", + "Published", + "Quality now", + "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating", + "Read the status again", + "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts", + "Source", + "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.", + "The download failed: {reason}", + "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.", + "The service refused the request from this window.", + "The status could not be read: {reason}", + "The worker did not answer: {reason}", + "This computer", + "This engine cannot re-tessellate CAD parts.", + "Triangles now", + "Try Again", + "Unknown", + "Unpacking", + "Version", + "degrees", + "no reason was given", + "{done} of {total}", + "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked" +] diff --git a/frontend/src/i18n/modules/cad/sv.json b/frontend/src/i18n/modules/cad/sv.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/sv.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/th.json b/frontend/src/i18n/modules/cad/th.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/th.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/tr.json b/frontend/src/i18n/modules/cad/tr.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/tr.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/uk.json b/frontend/src/i18n/modules/cad/uk.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/uk.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/vi.json b/frontend/src/i18n/modules/cad/vi.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/vi.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/zh-CN.json b/frontend/src/i18n/modules/cad/zh-CN.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/zh-CN.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} diff --git a/frontend/src/i18n/modules/cad/zh-TW.json b/frontend/src/i18n/modules/cad/zh-TW.json new file mode 100644 index 00000000..4debd1cd --- /dev/null +++ b/frontend/src/i18n/modules/cad/zh-TW.json @@ -0,0 +1,91 @@ +{ + "% of the model size": "% of the model size", + "About {n} triangles afterwards.": "About {n} triangles afterwards.", + "All CAD parts": "All CAD parts", + "Angle": "Angle", + "Angle in degrees": "Angle in degrees", + "Apply": "Apply", + "Beside the FormShot engine": "Beside the FormShot engine", + "CAD Import": "CAD Import", + "CAD Import Settings...": "CAD Import Settings...", + "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", + "CAD worker": "CAD worker", + "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", + "Check the worker": "Check the worker", + "Checking every file": "Checking every file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "Chord": "Chord", + "Chord as a percentage of the model size": "Chord as a percentage of the model size", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", + "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", + "Custom": "Custom", + "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", + "Default CAD quality": "Default CAD quality", + "Download": "Download", + "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", + "Download the CAD Worker": "Download the CAD Worker", + "Download the CAD worker": "Download the CAD worker", + "Downloaded into the cache folder": "Downloaded into the cache folder", + "Downloading": "Downloading", + "Found in": "Found in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", + "Installed": "Installed", + "Mixed": "Mixed", + "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", + "New quality": "New quality", + "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", + "Not available.": "Not available.", + "Not available: {reason}": "Not available: {reason}", + "Not installed": "Not installed", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", + "Not named": "Not named", + "Not recorded": "Not recorded", + "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", + "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", + "Published": "Published", + "Quality now": "Quality now", + "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", + "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", + "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", + "Re-tessellating": "Re-tessellating", + "Read the status again": "Read the status again", + "Reading the published record": "Reading the published record", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", + "Selected CAD parts": "Selected CAD parts", + "Source": "Source", + "The CAD worker is installed.": "The CAD worker is installed.", + "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", + "The FormShot service is not reachable.": "The FormShot service is not reachable.", + "The download failed: {reason}": "The download failed: {reason}", + "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", + "The parts could not be read: {reason}": "The parts could not be read: {reason}", + "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", + "The service refused the request from this window.": "The service refused the request from this window.", + "The status could not be read: {reason}": "The status could not be read: {reason}", + "The worker did not answer: {reason}": "The worker did not answer: {reason}", + "This computer": "This computer", + "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", + "Triangles now": "Triangles now", + "Try Again": "Try Again", + "Unknown": "Unknown", + "Unpacking": "Unpacking", + "Version": "Version", + "degrees": "degrees", + "no reason was given": "no reason was given", + "{done} of {total}": "{done} of {total}", + "{n} files": "{n} files", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", + "{tag}: none for this computer": "{tag}: none for this computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" +} From e107451a67b340868e5e3230bbd41d5d587a0132 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:03:33 -0500 Subject: [PATCH 117/494] feat(scene): add scene.set_part_mesh to swap a part's mesh in place A part can now show another existing mesh while keeping its id, name, material, transform and metadata, and its old mesh is dropped when unused, all as one undoable step that never merges. The catalogue lists its schema. Verified with cargo check -p fsh-scene. --- native/crates/fsh-scene/src/catalogue.rs | 8 ++++++ native/crates/fsh-scene/src/command.rs | 33 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/native/crates/fsh-scene/src/catalogue.rs b/native/crates/fsh-scene/src/catalogue.rs index ff3fd685..8a3b20d0 100644 --- a/native/crates/fsh-scene/src/catalogue.rs +++ b/native/crates/fsh-scene/src/catalogue.rs @@ -342,6 +342,14 @@ fn schema(name: &str) -> Value { &["id", "key"], ), "scene.set_pivot" => obj(vec![("id", key("Node")), ("pivot", opt(triple("Local pivot, null clears")))], &["id"]), + "scene.set_part_mesh" => obj( + vec![ + ("id", key("Part")), + ("mesh", key("Existing mesh the part shows from now on (add it first with mesh.add)")), + ("remove_unused", json!({"type": "boolean", "default": true, "description": "Remove the old mesh when no other part uses it"})), + ], + &["id", "mesh"], + ), "scene.set_light" => patch_node(light_schema()), "scene.set_cutaway" => patch_node(cutaway_schema()), "scene.reparent" => obj( diff --git a/native/crates/fsh-scene/src/command.rs b/native/crates/fsh-scene/src/command.rs index ba588eb1..d15c6de5 100644 --- a/native/crates/fsh-scene/src/command.rs +++ b/native/crates/fsh-scene/src/command.rs @@ -276,6 +276,21 @@ pub struct SetPivot { pub pivot: Option, } +/// `scene.set_part_mesh` arguments. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct SetPartMesh { + /// Part. + #[serde(with = "ser::key")] + pub id: NodeId, + /// Mesh the part shows from now on. + #[serde(with = "ser::key")] + pub mesh: MeshKey, + /// Remove the part's previous mesh when no other part uses it any more. + #[serde(default = "yes")] + pub remove_unused: bool, +} + /// Arguments that patch one node's block (light or cutaway). #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] @@ -592,6 +607,7 @@ commands! { SetPartColour(SetPartColour) = "scene.set_part_colour", Region, "Set or clear the per-part colour that materials may read."; SetMetadata(SetMetadata) = "scene.set_metadata", None, "Set or delete one metadata field on a node."; SetPivot(SetPivot) = "scene.set_pivot", None, "Set or clear a node's gizmo pivot (local space)."; + SetPartMesh(SetPartMesh) = "scene.set_part_mesh", Full, "Make a part show another existing mesh in place, keeping its id, name, material, transform and metadata; its old mesh is removed when nothing else uses it."; SetLight(PatchNode) = "scene.set_light", Region, "Change a light node's settings; give only the fields to change."; SetCutaway(PatchNode) = "scene.set_cutaway", Full, "Change a cutaway node's settings; give only the fields to change."; Reparent(Reparent) = "scene.reparent", Full, "Move nodes under another parent (or to the root), keeping their world placement by default."; @@ -988,6 +1004,23 @@ impl Command { tx.node_mut(a.id)?.pivot = a.pivot; Ok(Applied::at(ChangeLevel::None)) } + Command::SetPartMesh(a) => { + editable(tx.doc, a.id)?; + let NodeKind::Part { mesh: old, material } = tx.doc.get_node(a.id)?.kind else { + return Err(SceneError::WrongKind { node: a.id, expected: "part" }); + }; + if tx.doc.mesh(a.mesh).is_none() { + return Err(SceneError::UnknownMesh(a.mesh)); + } + if old == a.mesh { + return Ok(Applied::at(ChangeLevel::None)); + } + tx.node_mut(a.id)?.kind = NodeKind::Part { mesh: a.mesh, material }; + if a.remove_unused && tx.doc.mesh(old).is_some() && tx.doc.parts_using_mesh(old).is_empty() { + tx.set_mesh(old, None); + } + Ok(Applied::at(ChangeLevel::Full)) + } Command::SetLight(a) => { editable(tx.doc, a.id)?; let n = tx.doc.get_node(a.id)?; From 23b6c4c7bccc79de3c07cb924dd118d3a0f0e7fd Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:06 -0500 Subject: [PATCH 118/494] feat(cad): keep part ids through retessellation with set_part_mesh scene.retessellate now adds each new mesh and points the CAD parts at it with scene.set_part_mesh instead of rebuilding them, so ids, materials, children, selection and outside references stay as they were. Verified with cargo check -p fsh-commands; the run through the CLI follows. --- native/crates/fsh-commands/src/ext/cad.rs | 69 ++++------------------- 1 file changed, 10 insertions(+), 59 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 16821326..6a7d12d1 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -20,7 +20,7 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ }, ExtCommand { name: "scene.retessellate", - description: "Rebuild the meshes of CAD parts from their kept STEP or IGES source at a new quality, keeping names, placement, materials and visibility; one undo step.", + description: "Rebuild the meshes of CAD parts from their kept STEP or IGES source at a new quality; each part keeps its id, name, placement, material, visibility and selection (scene.set_part_mesh); one undo step.", level: ChangeLevel::Full, mutates: true, read_only: false, @@ -364,14 +364,13 @@ mod native { struct Target { id: NodeId, - node: fsh_scene::Node, + name: String, mesh: fsh_core::MeshKey, - material: Option, tag: (usize, usize), } pub(super) fn retessellate(engine: &Engine, st: &mut State, args: &Value) -> Result { - use fsh_scene::{AddPart, Mesh, MeshAdd, MeshRef, NodeList, RayVisibility}; + use fsh_scene::{Mesh, MeshAdd}; use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; @@ -399,7 +398,7 @@ mod native { if scope.as_ref().is_some_and(|s| !s.contains(id)) { continue; } - let NodeKind::Part { mesh, material } = n.kind else { continue }; + let NodeKind::Part { mesh, .. } = n.kind else { continue }; let (Some(reference), Some(tag)) = (n.metadata.get("source.cad"), n.metadata.get("cad.mesh").and_then(|t| parse_tag(t))) else { continue; }; @@ -410,7 +409,7 @@ mod native { let unit = n.metadata.get("cad.unit").cloned().unwrap_or_else(|| "m".into()); let up = n.metadata.get("cad.up").cloned().unwrap_or_else(|| "z".into()); let fallback = n.metadata.get("source.path").cloned().unwrap_or_default(); - groups.entry((reference.clone(), unit, up, fallback)).or_default().push(Target { id: *id, node: n.clone(), mesh, material, tag }); + groups.entry((reference.clone(), unit, up, fallback)).or_default().push(Target { id: *id, name: n.name.clone(), mesh, tag }); } if groups.is_empty() { return Err(EngineError::state("there are no CAD parts to re-tessellate (parts imported from STEP or IGES carry source.cad)")); @@ -438,7 +437,7 @@ mod native { for t in targets { if let std::collections::btree_map::Entry::Vacant(slot) = new_meshes.entry(t.mesh.raw()) { let Some(r) = index.get(&t.tag).and_then(|&i| raw.meshes.get(i)).filter(|r| !r.indices.is_empty()) else { - warnings.push(format!("{} ({}) has no body {}:{} in its source any more and was left as it is", t.node.name, t.id, t.tag.0, t.tag.1)); + warnings.push(format!("{} ({}) has no body {}:{} in its source any more and was left as it is", t.name, t.id, t.tag.0, t.tag.1)); continue; }; let old = st.editor.document().mesh(t.mesh); @@ -460,9 +459,6 @@ mod native { st.editor.begin_group(&label); st.note_begin(&label); let mut replaced = Vec::new(); - let mut renumbered: HashMap = HashMap::new(); - let selected: Vec = st.editor.selection().nodes().to_vec(); - let active = st.editor.selection().active(); let result = (|| -> Result { let mut swapped: BTreeMap = BTreeMap::new(); let mut last = None; @@ -474,51 +470,13 @@ mod native { } for t in &plan { let Some(&mesh) = swapped.get(&t.mesh.raw()) else { continue }; - let doc = st.editor.document(); - let index = doc.children_of(t.node.parent).iter().position(|c| *c == t.id); - let add = AddPart { id: None, name: t.node.name.clone(), parent: t.node.parent, index, transform: t.node.transform, mesh, material: t.material }; - let out = st.editor.execute(Command::AddPart(add))?; + let out = st.editor.dispatch("scene.set_part_mesh", json!({"id": t.id.raw(), "mesh": mesh.raw(), "remove_unused": true}))?; st.note(&out); - let new_id = out.created.first().copied().ok_or_else(|| EngineError::state("scene.add_part created no node"))?; - let mut steps: Vec<(&str, Value)> = Vec::new(); - if !t.node.visible { - steps.push(("scene.set_visible", json!({"ids": [new_id], "visible": false}))); - } - if t.node.rays != RayVisibility::ALL { - steps.push(("scene.set_ray_visibility", json!({"ids": [new_id], "rays": t.node.rays}))); - } - if t.node.colour.is_some() { - steps.push(("scene.set_part_colour", json!({"ids": [new_id], "colour": t.node.colour.map(|c| [c.r, c.g, c.b])}))); - } - if let Some(p) = t.node.pivot { - steps.push(("scene.set_pivot", json!({"id": new_id, "pivot": [p.x, p.y, p.z]}))); - } - for (k, v) in &t.node.metadata { - let v = if k == "cad.quality" { quality.to_text() } else { v.clone() }; - steps.push(("scene.set_metadata", json!({"id": new_id, "key": k, "value": v}))); - } - for (name, a) in steps { - let out = st.editor.dispatch(name, a)?; - st.note(&out); - } - let children: Vec = st.editor.document().node(t.id).map(|n| n.children.iter().map(|c| c.raw()).collect()).unwrap_or_default(); - if !children.is_empty() { - let out = st.editor.dispatch("scene.reparent", json!({"ids": children, "parent": new_id, "keep_world": false}))?; - st.note(&out); - } - let out = st.editor.execute(Command::Remove(NodeList { ids: vec![t.id] }))?; - st.note(&out); - replaced.push(json!({"old": t.id.raw().to_string(), "new": new_id.to_string(), "name": t.node.name})); - renumbered.insert(t.id, NodeId::new(new_id)); + let tagged = st.editor.dispatch("scene.set_metadata", json!({"id": t.id.raw(), "key": "cad.quality", "value": quality.to_text()}))?; + st.note(&tagged); + replaced.push(json!({"id": t.id.raw().to_string(), "name": t.name, "mesh": mesh.raw().to_string()})); last = Some(out); } - for old in new_meshes.keys() { - let key = fsh_core::MeshKey::new(*old); - if st.editor.document().mesh(key).is_some() && st.editor.document().parts_using_mesh(key).is_empty() { - let out = st.editor.execute(Command::MeshRemove(MeshRef { key }))?; - st.note(&out); - } - } last.ok_or_else(|| EngineError::state("nothing was re-tessellated")) })(); let out = match result { @@ -534,13 +492,6 @@ mod native { return Err(e); } }; - if selected.iter().any(|id| renumbered.contains_key(id)) { - let map = |id: &NodeId| renumbered.get(id).copied().unwrap_or(*id); - let mut ids: Vec = selected.iter().filter(|id| Some(**id) != active).map(map).collect(); - ids.extend(active.iter().map(map)); - let (sel, doc) = st.editor.selection_mut(); - sel.select(doc, &ids, fsh_scene::SelectMode::Replace); - } let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("scene.retessellate"); reply["quality"] = quality.to_json(); From 443e25b8c3799dfc9ea4ea5ffbfd228626916017 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 119/494] feat(import): reshape re-imported parts in place with set_part_mesh file.reimport swaps a reshaped part's mesh with scene.set_part_mesh, so the part keeps its id, cutaway targets and selection need no remapping, and parts with children can take the new shape too. Verified with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/import/reimport.rs | 54 ++++--------------- 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index d748c805..e3e66355 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -7,7 +7,7 @@ use fsh_core::{DocKey, MaterialKey, MeshKey, NodeId}; use fsh_io::Watch; use fsh_scene::{ ChangeLevel, Command, Document, Import, ImportMaterial, ImportMesh, ImportNode, ImportPayload, ImportTexture, Mesh, - Node, NodeKind, Outcome, SelectMode, + MeshAdd, Node, NodeKind, Outcome, }; use serde_json::{json, Value}; use std::collections::{BTreeMap, BTreeSet, VecDeque}; @@ -193,48 +193,16 @@ fn index_in_parent(doc: &Document, id: NodeId) -> Option { doc.children_of(parent).iter().position(|c| *c == id) } -/// Replaces a part's mesh by the re-read one, keeping its place, name, material, transform and every other setting. -/// The part gets a new id (the document has no command that swaps a part's mesh in place). +/// Replaces a part's mesh by the re-read one in place (`scene.set_part_mesh`): the part keeps its id, place, name, +/// material, transform, children and every other setting, and its old mesh goes when nothing else uses it. fn replace_mesh(st: &mut State, d: NodeId, mesh: &ImportMesh, outs: &mut Vec) -> Result { - let doc = st.editor.document(); - let old = doc.get_node(d)?.clone(); - let Some((old_mesh, material)) = part_of(&old) else { return Ok(d) }; - let index = index_in_parent(doc, d); - let fresh = doc.next_key().max(1); - let (mkey, nid) = (MeshKey::from_raw(fresh), NodeId::from_raw(fresh + 1)); - let mut node = old.clone(); - node.parent = None; - node.children.clear(); - node.kind = NodeKind::Part { mesh: mkey, material }; - let payload = ImportPayload { meshes: vec![ImportMesh { key: mkey, mesh: Arc::clone(&mesh.mesh) }], nodes: vec![ImportNode { id: nid, node }], ..ImportPayload::default() }; - exec(st, Command::Import(Import { parent: old.parent, payload }), outs)?; - let new_id = outs.last().and_then(|o| o.created.first().copied()).map(NodeId::from_raw).unwrap_or(nid); - dispatch(st, "scene.reparent", json!({"ids": [new_id.raw()], "parent": old.parent.map(|p| p.raw()), "index": index, "keep_world": false}), outs)?; - let cutaways: Vec<(NodeId, Vec)> = st - .editor - .document() - .nodes() - .iter() - .filter_map(|(id, n)| match &n.kind { - NodeKind::Cutaway { cutaway } if cutaway.targets.contains(&d) => { - Some((*id, cutaway.targets.iter().map(|t| if *t == d { new_id.raw() } else { t.raw() }).collect())) - } - _ => None, - }) - .collect(); - for (c, targets) in cutaways { - dispatch(st, "scene.set_cutaway", json!({"id": c.raw(), "values": {"targets": targets}}), outs)?; - } - let selected = st.editor.selection().nodes().contains(&d); - dispatch(st, "scene.remove", json!({"ids": [d.raw()]}), outs)?; - if selected { - let (sel, doc) = st.editor.selection_mut(); - sel.select(doc, &[new_id], SelectMode::Add); - } - if st.editor.document().parts_using_mesh(old_mesh).is_empty() { - dispatch(st, "mesh.remove", json!({"key": old_mesh.raw()}), outs)?; + if part_of(st.editor.document().get_node(d)?).is_none() { + return Ok(d); } - Ok(new_id) + exec(st, Command::MeshAdd(MeshAdd { key: None, mesh: Arc::clone(&mesh.mesh) }), outs)?; + let key = outs.last().and_then(|o| o.created.first().copied()).ok_or_else(|| EngineError::state("mesh.add created no key"))?; + dispatch(st, "scene.set_part_mesh", json!({"id": d.raw(), "mesh": key, "remove_unused": true}), outs)?; + Ok(d) } /// The reader turns a file node holding one mesh into a part, and one holding several into a group of parts. When @@ -333,8 +301,8 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe if doc.mesh(om).is_some_and(|m| same_shape(m, &fresh.mesh)) { continue; } - if doc.is_locked(*d) || !old.children.is_empty() { - rep.warnings.push(format!("{} kept its old shape: it is locked or has children", old.name)); + if doc.is_locked(*d) { + rep.warnings.push(format!("{} kept its old shape: it is locked", old.name)); } else { swaps.push((*d, (*fresh).clone())); } From 226d747ca4737eb6139a53f93edd51296464625c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:11 -0500 Subject: [PATCH 120/494] feat(format): copy kept cad sources into the crash journal session Session::keep_sources writes each sources/. member once into the session folder (checked like a project member), Session::start copies the base project's sources, and recovery returns them in Recovered::sources. Verified with cargo check -p fsh-commands, which builds fsh-format. --- native/crates/fsh-format/src/project.rs | 2 +- native/crates/fsh-format/src/session.rs | 41 +++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-format/src/project.rs b/native/crates/fsh-format/src/project.rs index 032123fa..d871ad20 100644 --- a/native/crates/fsh-format/src/project.rs +++ b/native/crates/fsh-format/src/project.rs @@ -55,7 +55,7 @@ pub fn source_member(bytes: &[u8], ext: &str) -> Option { Some(format!("{SOURCES_PREFIX}{:016x}.{ext}", hash_bytes(bytes))) } -fn check_source_member(name: &str, data: &[u8]) -> core::result::Result<(), String> { +pub(crate) fn check_source_member(name: &str, data: &[u8]) -> core::result::Result<(), String> { let rest = name.strip_prefix(SOURCES_PREFIX).ok_or("is not under sources/")?; let (hash, ext) = rest.split_once('.').ok_or("has no extension")?; if sanitize_ext(ext).as_deref() != Some(ext) { diff --git a/native/crates/fsh-format/src/session.rs b/native/crates/fsh-format/src/session.rs index 6ae89b7c..0fad96a8 100644 --- a/native/crates/fsh-format/src/session.rs +++ b/native/crates/fsh-format/src/session.rs @@ -3,9 +3,9 @@ use crate::error::{FormatError, Result}; use crate::journal::{apply_entries, entry_line, header_line, replay_editor, Journal, JournalEntry, JournalHeader}; use crate::json::to_canonical; -use crate::project::{atomic_write, decode, encode, fingerprint, Project, SaveOptions}; +use crate::project::{atomic_write, check_source_member, decode, encode, fingerprint, Project, SaveOptions, SOURCES_PREFIX}; use fsh_scene::{Document, Editor, Outcome}; -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use serde_json::{Map, Value}; use std::fs::{File, OpenOptions, TryLockError}; use std::io::Write; @@ -65,6 +65,7 @@ pub struct Session { large_line_bytes: usize, shadow: Shadow, textures: BTreeMap>, + sources: BTreeSet, } /// A snapshot prepared on the editing thread and written by `run` on any thread. @@ -129,11 +130,31 @@ impl Session { large_line_bytes: DEFAULT_LARGE_LINE_BYTES, shadow: Shadow::default(), textures: base.textures.clone(), + sources: BTreeSet::new(), }; s.write_origin(&base.document, 0)?; + s.keep_sources(&base.preserved.sources)?; Ok(s) } + /// Copies kept CAD sources (`sources/.` members) into the session folder once each, so recovery + /// gives them back; call after keeping a source. Names and contents are checked like a project's members. + pub fn keep_sources(&mut self, sources: &BTreeMap>) -> Result<()> { + for (name, bytes) in sources { + if self.sources.contains(name) { + continue; + } + check_source_member(name, bytes).map_err(|r| FormatError::member(name, r))?; + let path = self.dir.join(name); + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent).map_err(|e| FormatError::io(parent, e))?; + } + atomic_write(&path, bytes)?; + self.sources.insert(name.clone()); + } + Ok(()) + } + /// Replaces the embedded textures that later origins and snapshots carry (call after embedding a texture). pub fn set_textures(&mut self, textures: &BTreeMap>) { self.textures = textures.clone(); @@ -361,6 +382,8 @@ pub struct Recovered { pub notes: Vec, /// Embedded textures found in the session's origin and snapshot files. pub textures: BTreeMap>, + /// Kept CAD sources (`sources/.` members) the session copied, ready for `Preserved::sources`. + pub sources: BTreeMap>, } /// A crashed session found by `recover`; holds its lock until dropped, recovered from or discarded. @@ -425,7 +448,19 @@ impl RecoverableSession { textures.extend(p.textures); } } - Ok(Recovered { editor, strategy, notes, textures }) + let mut sources = BTreeMap::new(); + if let Ok(rd) = std::fs::read_dir(self.dir.join(SOURCES_PREFIX.trim_end_matches('/'))) { + for ent in rd.flatten() { + let name = format!("{SOURCES_PREFIX}{}", ent.file_name().to_string_lossy()); + match std::fs::read(ent.path()).map_err(|e| e.to_string()).and_then(|b| check_source_member(&name, &b).map(|_| b)) { + Ok(bytes) => { + sources.insert(name, bytes); + } + Err(e) => notes.push(format!("the kept source {name} was left out: {e}")), + } + } + } + Ok(Recovered { editor, strategy, notes, textures, sources }) } fn rebuild(&self, notes: &mut Vec) -> Result<(Editor, RecoveryStrategy)> { From c4a0c93770453e19f67c2f305bfddfc4838f3073 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:23 -0500 Subject: [PATCH 121/494] feat(engine): keep cad sources in the crash journal and recover them The crash journal starts and restarts from the whole kept project, a CAD import copies its newly kept source into the session folder, and file.recover puts the recovered sources back into the project, so retessellation after a crash reads the kept bytes. Verified with cargo check -p fsh-commands; the kill and recover run follows. --- native/crates/fsh-commands/src/engine.rs | 14 ++++++++---- native/crates/fsh-commands/src/ext/cad.rs | 3 +++ native/crates/fsh-commands/src/journal.rs | 27 +++++++++++++++++------ 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index fdc867ae..066cdf9d 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -125,6 +125,12 @@ impl State { } } + pub(crate) fn note_sources(&mut self) { + if let Some(j) = self.journal.as_mut() { + j.keep_sources(&self.kept.preserved.sources); + } + } + fn note_barrier(&mut self) { if let Some(j) = self.journal.as_mut() { j.barrier(&self.editor); @@ -337,7 +343,7 @@ impl Engine { j.close(); } let Some(root) = root else { return Ok(None) }; - let j = CrashJournal::start(root, &st.editor, &st.kept.textures, st.path.as_deref()); + let j = CrashJournal::start(root, &st.editor, &st.kept, st.path.as_deref()); if let Some(e) = j.error() { return Err(EngineError::File(format!("the crash journal could not start: {e}"))); } @@ -566,7 +572,7 @@ impl Engine { st.path = path; st.kept = Project { document: Document::default(), ..kept }; if let Some(j) = st.journal.as_mut() { - j.restart(&st.editor, &st.kept.textures, st.path.as_deref()); + j.restart(&st.editor, &st.kept, st.path.as_deref()); } st.revision += 1; st.content += 1; @@ -728,7 +734,7 @@ impl Engine { st.path = Some(path.clone()); if st.editor.history().group_depth() == 0 { if let Some(j) = st.journal.as_mut() { - j.restart(&st.editor, &st.kept.textures, st.path.as_deref()); + j.restart(&st.editor, &st.kept, st.path.as_deref()); } } st.revision += 1; @@ -838,7 +844,7 @@ impl Engine { fsh_format::RecoveryStrategy::Snapshot { slot } => json!({"kind": "snapshot", "slot": slot}), }; let path = crashed.project.clone().map(PathBuf::from); - let kept = Project { textures: rec.textures, ..Project::default() }; + let kept = Project { textures: rec.textures, preserved: fsh_format::Preserved { sources: rec.sources, ..Default::default() }, ..Project::default() }; let commands = crashed.commands; self.install_editor(st, rec.editor, path, kept); self.render.clear_frame(); diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 6a7d12d1..5df47380 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -300,6 +300,9 @@ mod native { Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), None => false, }; + if kept { + st.note_sources(); + } let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("file.import"); reply["report"] = json!({ diff --git a/native/crates/fsh-commands/src/journal.rs b/native/crates/fsh-commands/src/journal.rs index 62738618..0f3f3fa0 100644 --- a/native/crates/fsh-commands/src/journal.rs +++ b/native/crates/fsh-commands/src/journal.rs @@ -1,4 +1,4 @@ -use fsh_format::{Project, Session}; +use fsh_format::{Preserved, Project, Session}; use fsh_scene::{Editor, Outcome}; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; @@ -15,14 +15,19 @@ pub(crate) struct CrashJournal { } impl CrashJournal { - pub(crate) fn start(root: PathBuf, editor: &Editor, textures: &BTreeMap>, project: Option<&Path>) -> Self { + pub(crate) fn start(root: PathBuf, editor: &Editor, kept: &Project, project: Option<&Path>) -> Self { let mut j = Self { root, session: None, error: None, last_snapshot: 0 }; - j.open(editor, textures, project); + j.open(editor, kept, project); j } - fn open(&mut self, editor: &Editor, textures: &BTreeMap>, project: Option<&Path>) { - let base = Project { document: editor.document().clone(), textures: textures.clone(), ..Default::default() }; + fn open(&mut self, editor: &Editor, kept: &Project, project: Option<&Path>) { + let base = Project { + document: editor.document().clone(), + textures: kept.textures.clone(), + preserved: Preserved { sources: kept.preserved.sources.clone(), ..Default::default() }, + ..Default::default() + }; match Session::start(&self.root, &base, project) { Ok(s) => { self.session = Some(s); @@ -37,11 +42,19 @@ impl CrashJournal { } /// Ends the current session cleanly and starts a new one on the editor's document (new, open, save, recover). - pub(crate) fn restart(&mut self, editor: &Editor, textures: &BTreeMap>, project: Option<&Path>) { + pub(crate) fn restart(&mut self, editor: &Editor, kept: &Project, project: Option<&Path>) { if let Some(s) = self.session.take() { let _ = s.close(); } - self.open(editor, textures, project); + self.open(editor, kept, project); + } + + /// Copies newly kept CAD sources into the session folder so a recovery restores them. + pub(crate) fn keep_sources(&mut self, sources: &BTreeMap>) { + let Some(s) = self.session.as_mut() else { return }; + if let Err(e) = s.keep_sources(sources) { + self.error = Some(format!("a kept source could not be copied into the crash journal: {e}")); + } } pub(crate) fn root(&self) -> &Path { From d29c18ed81d5d889eca9c85813d3ecddeaa19ebf Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:48 -0500 Subject: [PATCH 122/494] fix(import): bind import jobs to their engine and document Jobs now live in the engine's session state instead of a process-wide table keyed by the engine's address, so they end with the engine and cannot reach another one. A job started before file.new, open, close or recover stops and reports state stale with nothing applied. Verified with cargo check -p fsh-commands; the CLI run follows. --- native/crates/fsh-commands/src/engine.rs | 3 + native/crates/fsh-commands/src/ext/import.rs | 19 ++- .../fsh-commands/src/ext/import/jobs.rs | 127 +++++++++++------- 3 files changed, 92 insertions(+), 57 deletions(-) diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index 066cdf9d..1dfbd8cf 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -104,6 +104,7 @@ pub(crate) struct State { last_reset: &'static str, last_region: Option, journal: Option, + pub(crate) jobs: crate::ext::import::Jobs, } impl State { @@ -294,6 +295,7 @@ impl Engine { last_reset: "none", last_region: None, journal: None, + jobs: Default::default(), }), render: RenderControl::new(opts.threaded, opts.threads), } @@ -574,6 +576,7 @@ impl Engine { if let Some(j) = st.journal.as_mut() { j.restart(&st.editor, &st.kept, st.path.as_deref()); } + crate::ext::import::document_changed(st); st.revision += 1; st.content += 1; st.png_cache = None; diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 5046ce94..b87e8742 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -37,7 +37,7 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ }, ExtCommand { name: "import.status", - description: "An import job's progress: {job, state (running, done, failed, cancelled), stage (reading, validating, welding, normals, instancing, placing, converting, then waiting while a history group is open, done), fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session.", + description: "An import job's progress: {job, state (running, done, failed, cancelled, or stale when the document was replaced while it ran and nothing was applied), stage (reading, validating, welding, normals, instancing, placing, converting, then waiting while a history group is open, done), fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session.", level: ChangeLevel::None, mutates: false, read_only: true, @@ -116,10 +116,17 @@ pub(crate) fn pump(engine: &Engine, st: &mut State) { jobs::pump(engine, st); } -fn start(engine: &Engine, args: &Value) -> Result { +pub(crate) use jobs::Jobs; + +/// The engine installed another document; running import jobs stop and report stale. +pub(crate) fn document_changed(st: &mut State) { + st.jobs.document_changed(); +} + +fn start(st: &mut State, args: &Value) -> Result { let path = need_path(args, "import.start")?; let a = ImportArgs::parse(args, get_bool(args, "frame"))?; - let job = jobs::start(engine, path, a)?; + let job = jobs::start(st, path, a)?; Ok(json!({"ok": true, "change": "none", "job": job, "state": "running"})) } @@ -131,9 +138,9 @@ pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value Some(match name { "file.reimport" => crate::view::node_list(st.editor.document(), args).and_then(|nodes| reimport::reimport(engine, st, nodes)), "import.probe" => need_path(args, name).and_then(|p| probe::probe(&p)), - "import.start" => start(engine, args), - "import.status" => jobs::status(engine, job_of(args)), - "import.cancel" => job_of(args).ok_or_else(|| EngineError::args("import.cancel needs job")).and_then(|j| jobs::cancel(engine, j)), + "import.start" => start(st, args), + "import.status" => jobs::status(st, job_of(args)), + "import.cancel" => job_of(args).ok_or_else(|| EngineError::args("import.cancel needs job")).and_then(|j| jobs::cancel(st, j)), _ => return None, }) } diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index d8ea570e..6232f55a 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -9,19 +9,25 @@ use serde_json::{json, Value}; use std::collections::BTreeMap; use std::path::PathBuf; use std::sync::atomic::{AtomicU64, Ordering}; -use std::sync::{mpsc, Arc, Mutex, MutexGuard}; +use std::sync::{mpsc, Arc}; const KEEP_FINISHED: usize = 64; +const STALE: &str = "the document changed (file.new, file.open, file.close or file.recover) while the job ran; nothing was applied"; + +enum Work { + Mesh(Prepared), +} enum JobState { - Running(mpsc::Receiver>), + Running(mpsc::Receiver>), Done(Value), Failed(EngineError), Cancelled, + Stale, } struct Job { - owner: usize, + generation: u64, path: PathBuf, args: ImportArgs, watch: Arc, @@ -30,17 +36,38 @@ struct Job { seconds: Option, } -static JOBS: Mutex> = Mutex::new(BTreeMap::new()); -static NEXT: AtomicU64 = AtomicU64::new(1); +/// One engine's import jobs, kept in its session state so they end with it, and the generation of the document +/// they apply to. +#[derive(Default)] +pub(crate) struct Jobs { + list: BTreeMap, + generation: u64, +} -fn jobs() -> MutexGuard<'static, BTreeMap> { - JOBS.lock().unwrap_or_else(|p| p.into_inner()) +impl Jobs { + /// The engine installed another document: running jobs stop and report stale, finished ones keep their record. + pub(crate) fn document_changed(&mut self) { + self.generation += 1; + for j in self.list.values_mut() { + if matches!(j.state, JobState::Running(_)) { + j.watch.cancel(); + j.state = JobState::Stale; + j.seconds = Some(j.started.elapsed().as_secs_f64()); + } + } + } } -fn owner(engine: &Engine) -> usize { - engine as *const Engine as usize +impl Drop for Jobs { + fn drop(&mut self) { + for j in self.list.values().filter(|j| matches!(j.state, JobState::Running(_))) { + j.watch.cancel(); + } + } } +static NEXT: AtomicU64 = AtomicU64::new(1); + fn weight(stage: Stage) -> (f32, f32) { match stage { Stage::Idle => (0.0, 0.0), @@ -62,7 +89,7 @@ fn overall(watch: &Watch) -> f32 { } /// Starts reading, cleaning and converting `path` on a worker thread (inline on wasm32) and returns the job id. -pub(crate) fn start(engine: &Engine, path: PathBuf, args: ImportArgs) -> Result { +pub(crate) fn start(st: &mut State, path: PathBuf, args: ImportArgs) -> Result { if !path.is_file() { return Err(EngineError::File(format!("{}: no such file", path.display()))); } @@ -72,14 +99,15 @@ pub(crate) fn start(engine: &Engine, path: PathBuf, args: ImportArgs) -> Result< let work = { let (path, args, watch) = (path.clone(), args.clone(), Arc::clone(&watch)); move || { - let r = run::prepare(&path, &args, &Document::default(), &watch); + let r = run::prepare(&path, &args, &Document::default(), &watch).map(Work::Mesh); if r.is_ok() { watch.set(Stage::Done, 1.0); } let _ = tx.send(r); } }; - jobs().insert(id, Job { owner: owner(engine), path, args, watch, state: JobState::Running(rx), started: Moment::now(), seconds: None }); + let generation = st.jobs.generation; + st.jobs.list.insert(id, Job { generation, path, args, watch, state: JobState::Running(rx), started: Moment::now(), seconds: None }); if cfg!(target_arch = "wasm32") { work(); } else { @@ -97,49 +125,47 @@ pub(crate) fn pump(engine: &Engine, st: &mut State) { if st.editor.history().group_depth() > 0 { return; } - let me = owner(engine); - let ready: Vec<(u64, Result)> = { - let mut all = jobs(); - let mut out = Vec::new(); - for (id, job) in all.iter_mut().filter(|(_, j)| j.owner == me) { - let JobState::Running(rx) = &job.state else { continue }; - match rx.try_recv() { - Ok(r) => out.push((*id, r)), - Err(mpsc::TryRecvError::Empty) => {} - Err(mpsc::TryRecvError::Disconnected) => { - out.push((*id, Err(EngineError::state("the import thread stopped without a result")))); - } + let mut ready: Vec<(u64, Result)> = Vec::new(); + for (id, job) in st.jobs.list.iter_mut() { + let JobState::Running(rx) = &job.state else { continue }; + match rx.try_recv() { + Ok(r) => ready.push((*id, r)), + Err(mpsc::TryRecvError::Empty) => {} + Err(mpsc::TryRecvError::Disconnected) => { + ready.push((*id, Err(EngineError::state("the import thread stopped without a result")))); } } - out - }; + } for (id, r) in ready { - let args = match jobs().get(&id) { - Some(j) => j.args.clone(), - None => continue, - }; - let state = match r.and_then(|p| run::apply(engine, st, p, &args)) { - Ok(mut reply) => { - reply["job"] = json!(id); - JobState::Done(reply) + let Some((args, generation)) = st.jobs.list.get(&id).map(|j| (j.args.clone(), j.generation)) else { continue }; + let state = if generation != st.jobs.generation { + JobState::Stale + } else { + let applied = r.and_then(|w| match w { + Work::Mesh(p) => run::apply(engine, st, p, &args), + }); + match applied { + Ok(mut reply) => { + reply["job"] = json!(id); + JobState::Done(reply) + } + Err(e) if e.code() == "cancelled" => JobState::Cancelled, + Err(e) => JobState::Failed(e), } - Err(e) if e.code() == "cancelled" => JobState::Cancelled, - Err(e) => JobState::Failed(e), }; - if let Some(j) = jobs().get_mut(&id) { + if let Some(j) = st.jobs.list.get_mut(&id) { j.seconds = Some(j.started.elapsed().as_secs_f64()); j.state = state; } } - prune(); + prune(&mut st.jobs); } -fn prune() { - let mut all = jobs(); - let finished: Vec = all.iter().filter(|(_, j)| !matches!(j.state, JobState::Running(_))).map(|(id, _)| *id).collect(); +fn prune(jobs: &mut Jobs) { + let finished: Vec = jobs.list.iter().filter(|(_, j)| !matches!(j.state, JobState::Running(_))).map(|(id, _)| *id).collect(); if finished.len() > KEEP_FINISHED { for id in &finished[..finished.len() - KEEP_FINISHED] { - all.remove(id); + jobs.list.remove(id); } } } @@ -151,6 +177,7 @@ fn status_json(id: u64, j: &Job) -> Value { JobState::Done(_) => ("done", "done", 1.0), JobState::Failed(_) => ("failed", j.watch.stage().as_str(), overall(&j.watch)), JobState::Cancelled => ("cancelled", j.watch.stage().as_str(), overall(&j.watch)), + JobState::Stale => ("stale", j.watch.stage().as_str(), overall(&j.watch)), }; let mut v = json!({ "job": id, @@ -163,6 +190,7 @@ fn status_json(id: u64, j: &Job) -> Value { match &j.state { JobState::Done(r) => v["result"] = r.clone(), JobState::Failed(e) => v["error"] = json!({"message": e.to_string(), "code": e.code()}), + JobState::Stale => v["error"] = json!({"message": STALE, "code": "stale"}), _ => {} } v @@ -173,20 +201,17 @@ fn unknown(id: u64) -> EngineError { } /// One job's status, or every job of this engine when `id` is absent. -pub(crate) fn status(engine: &Engine, id: Option) -> Result { - let me = owner(engine); - let all = jobs(); +pub(crate) fn status(st: &State, id: Option) -> Result { + let all = &st.jobs.list; match id { - Some(id) => all.get(&id).filter(|j| j.owner == me).map(|j| status_json(id, j)).ok_or_else(|| unknown(id)), - None => Ok(json!({"jobs": all.iter().filter(|(_, j)| j.owner == me).map(|(id, j)| status_json(*id, j)).collect::>()})), + Some(id) => all.get(&id).map(|j| status_json(id, j)).ok_or_else(|| unknown(id)), + None => Ok(json!({"jobs": all.iter().map(|(id, j)| status_json(*id, j)).collect::>()})), } } /// Stops a running job; its result, if it arrives, is dropped and the document stays as it was. -pub(crate) fn cancel(engine: &Engine, id: u64) -> Result { - let me = owner(engine); - let mut all = jobs(); - let j = all.get_mut(&id).filter(|j| j.owner == me).ok_or_else(|| unknown(id))?; +pub(crate) fn cancel(st: &mut State, id: u64) -> Result { + let j = st.jobs.list.get_mut(&id).ok_or_else(|| unknown(id))?; let was_running = matches!(j.state, JobState::Running(_)); if was_running { j.watch.cancel(); From 9732b994fb2768d05505124f8c021dda3d6f108e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:29:38 -0500 Subject: [PATCH 123/494] feat(import): run step and iges files through import jobs import.start on a CAD file calls fsh-cad's prepare on the job thread with the job's watch, so progress comes from the worker's body count and import.cancel kills the worker, then applies with the CAD apply (kept source, cad metadata) on the next engine call. CAD jobs give reading 90 percent of the fraction. Verified with cargo check -p fsh-commands; the CLI run follows. --- native/crates/fsh-commands/src/ext/cad.rs | 31 ++++++++----- .../fsh-commands/src/ext/import/jobs.rs | 44 ++++++++++++++++--- 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 5df47380..c22f5604 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -81,17 +81,22 @@ pub(crate) fn read_cad(path: &Path, quality: &Value, watch: &Watch) -> fsh_io::R /// `file.import` for a STEP or IGES file: read, clean, one undo step, kept source, `source.*` and `cad.*` metadata. pub(crate) fn import(engine: &Engine, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { - #[cfg(not(target_arch = "wasm32"))] - { - let prepared: Prepared = prepare(path, args, &Watch::new())?; - apply(engine, st, prepared, args, frame) - } - #[cfg(target_arch = "wasm32")] - native::import(engine, st, path, args, frame) + let prepared = prepare(path, args, &Watch::new())?; + apply(engine, st, prepared, args, frame) } -#[cfg(not(target_arch = "wasm32"))] -pub(crate) use native::{apply, prepare, Prepared}; +pub(crate) use native::Prepared; + +/// Reads and cleans a STEP or IGES file off the session (an import job's thread); progress and cancel go through +/// `watch`, and cancel stops the worker. +pub(crate) fn prepare(path: &Path, args: &Value, watch: &Watch) -> Result { + native::prepare(path, args, watch) +} + +/// Adds a prepared CAD read to the document as one undo step and keeps its source. +pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, args: &Value, frame: Option) -> Result { + native::apply(engine, st, p, args, frame) +} #[cfg(not(target_arch = "wasm32"))] mod native { @@ -568,7 +573,13 @@ mod native { Err(IoError::Unsupported(NO_WORKER.into())) } - pub(super) fn import(_engine: &Engine, _st: &mut State, _path: &Path, _args: &Value, _frame: Option) -> Result { + pub(crate) struct Prepared; + + pub(super) fn prepare(_path: &Path, _args: &Value, _watch: &Watch) -> Result { + Err(IoError::Unsupported(NO_WORKER.into()).into()) + } + + pub(super) fn apply(_engine: &Engine, _st: &mut State, _p: Prepared, _args: &Value, _frame: Option) -> Result { Err(IoError::Unsupported(NO_WORKER.into()).into()) } diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index 6232f55a..8ec214ae 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -16,6 +16,7 @@ const STALE: &str = "the document changed (file.new, file.open, file.close or fi enum Work { Mesh(Prepared), + Cad(crate::ext::cad::Prepared), } enum JobState { @@ -28,6 +29,7 @@ enum JobState { struct Job { generation: u64, + cad: bool, path: PathBuf, args: ImportArgs, watch: Arc, @@ -68,6 +70,14 @@ impl Drop for Jobs { static NEXT: AtomicU64 = AtomicU64::new(1); +fn cad_args(a: &ImportArgs) -> Value { + let mut v = Value::Object(a.geometry.clone()); + if let Some(n) = &a.name { + v["name"] = json!(n); + } + v +} + fn weight(stage: Stage) -> (f32, f32) { match stage { Stage::Idle => (0.0, 0.0), @@ -88,6 +98,20 @@ fn overall(watch: &Watch) -> f32 { a + (b - a) * watch.fraction() } +fn overall_of(j: &Job) -> f32 { + let f = overall(&j.watch); + if !j.cad { + return f; + } + let (_, read_end) = weight(Stage::Reading); + let (_, done) = weight(Stage::Done); + if f <= read_end { + 0.9 * f / read_end + } else { + 0.9 + 0.07 * (f - read_end) / (done - read_end) + } +} + /// Starts reading, cleaning and converting `path` on a worker thread (inline on wasm32) and returns the job id. pub(crate) fn start(st: &mut State, path: PathBuf, args: ImportArgs) -> Result { if !path.is_file() { @@ -99,7 +123,11 @@ pub(crate) fn start(st: &mut State, path: PathBuf, args: ImportArgs) -> Result Result run::apply(engine, st, p, &args), + Work::Cad(p) => crate::ext::cad::apply(engine, st, p, &cad_args(&args), args.frame), }); match applied { Ok(mut reply) => { @@ -172,12 +202,12 @@ fn prune(jobs: &mut Jobs) { fn status_json(id: u64, j: &Job) -> Value { let (state, stage, fraction) = match &j.state { - JobState::Running(_) if j.watch.stage() == Stage::Done => ("running", "waiting", overall(&j.watch)), - JobState::Running(_) => ("running", j.watch.stage().as_str(), overall(&j.watch)), + JobState::Running(_) if j.watch.stage() == Stage::Done => ("running", "waiting", overall_of(j)), + JobState::Running(_) => ("running", j.watch.stage().as_str(), overall_of(j)), JobState::Done(_) => ("done", "done", 1.0), - JobState::Failed(_) => ("failed", j.watch.stage().as_str(), overall(&j.watch)), - JobState::Cancelled => ("cancelled", j.watch.stage().as_str(), overall(&j.watch)), - JobState::Stale => ("stale", j.watch.stage().as_str(), overall(&j.watch)), + JobState::Failed(_) => ("failed", j.watch.stage().as_str(), overall_of(j)), + JobState::Cancelled => ("cancelled", j.watch.stage().as_str(), overall_of(j)), + JobState::Stale => ("stale", j.watch.stage().as_str(), overall_of(j)), }; let mut v = json!({ "job": id, From 946a9151e308f2fe4ca5bb1b4f4dbe2154cbe338 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:37:08 -0500 Subject: [PATCH 124/494] feat(backend): let the cad worker route ask the engine to probe GET /api/cad/worker?probe=true passes probe to cad.status, so the window can learn the worker's OpenCascade version, protocol and method count on demand; the default stays a quick look. Verified by importing app.main in the service venv. --- backend/app/routers/cad.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/app/routers/cad.py b/backend/app/routers/cad.py index bf038c5a..64c3a496 100644 --- a/backend/app/routers/cad.py +++ b/backend/app/routers/cad.py @@ -338,23 +338,23 @@ def report(stage: str, fraction: float, message: str) -> None: _set("failed", "", 0.0, f"The worker could not be installed ({error}). Nothing was installed.") -def engine_status() -> dict: +def engine_status(probe: bool = False) -> dict: try: from app.engine import EngineError, EngineUnavailable, engine try: - return engine.dispatch("cad.status", {}) + return engine.dispatch("cad.status", {"probe": True} if probe else {}) except (EngineError, EngineUnavailable) as error: return {"available": False, "reason": f"The engine could not be asked ({error})."} except Exception as error: return {"available": False, "reason": f"The engine could not be asked ({error})."} -def status(allow_network: bool = True) -> dict: +def status(allow_network: bool = True, probe: bool = False) -> dict: with _lock: job = dict(_job) return { - "worker": engine_status(), + "worker": engine_status(probe), "published": published(allow_network), "installed": installed(), "cache": str(workers_dir()), @@ -363,8 +363,8 @@ def status(allow_network: bool = True) -> dict: @router.get("/worker") -async def worker_status() -> dict: - return await run_in_threadpool(status) +async def worker_status(probe: bool = False) -> dict: + return await run_in_threadpool(status, True, probe) @router.post("/worker/fetch") From 8fa0f147a7393a92328a91e99d2fddc984607f55 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:50:16 -0500 Subject: [PATCH 125/494] feat(cad): read iges colours and step face colours from the file The worker's xde_read gives IGES bodies no colour and one rgb per STEP body, so a new scanner reads IGES solid colours and names (entity 186, colour 314, name 406) and STEP face styles in shell order, and the reader applies them when solids match bodies one to one. Ran through the release CLI: a worker-written IGES imported with its four colours and part names, and trimesh's two_color_cube.STEP gave two meshes, red and blue. --- native/crates/fsh-cad/src/lib.rs | 1 + native/crates/fsh-cad/src/read.rs | 72 ++++- native/crates/fsh-cad/src/scan.rs | 425 ++++++++++++++++++++++++++++++ 3 files changed, 497 insertions(+), 1 deletion(-) create mode 100644 native/crates/fsh-cad/src/scan.rs diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs index 197c01f1..36892225 100644 --- a/native/crates/fsh-cad/src/lib.rs +++ b/native/crates/fsh-cad/src/lib.rs @@ -8,6 +8,7 @@ mod locate; pub mod mesh; mod quality; mod read; +pub mod scan; pub use client::{Hello, Worker, MAX_LINE, PROTOCOL}; pub use error::{CadError, Result}; diff --git a/native/crates/fsh-cad/src/read.rs b/native/crates/fsh-cad/src/read.rs index 27b26962..1362065f 100644 --- a/native/crates/fsh-cad/src/read.rs +++ b/native/crates/fsh-cad/src/read.rs @@ -131,6 +131,7 @@ struct Body { def: String, bbox: Option<[f64; 6]>, face_rgb: Vec>, + faces: usize, } fn rgb_of(v: &Value) -> Option<[f32; 3]> { @@ -182,6 +183,7 @@ fn parse_bodies(reply: &Value) -> Result> { .unwrap_or_default(), def: text(b.get("def")), bbox: b.get("summary").and_then(|s| s.get("bbox")).and_then(bbox_of), + faces: b.pointer("/summary/faces").and_then(Value::as_u64).unwrap_or(0) as usize, face_rgb: b .get("face_rgb") .and_then(Value::as_array) @@ -433,6 +435,64 @@ fn tessellate(worker: &mut Worker, id: &str, linear: f64, angular: f64, out: &Pa Err(CadError::Worker("the tessellation stayed too fine".into())) } +fn synthetic_name(name: &str, index: usize) -> bool { + name.is_empty() || name.rsplit_once(' ').is_some_and(|(_, n)| n == (index + 1).to_string()) +} + +/// The worker's XDE read gives IGES bodies no colour and numbered names. When the file's manifold solids match the +/// bodies one to one (same count, directory order), their colours and names are taken from the file; otherwise a +/// note says why not. +fn iges_colours(path: &Path, bodies: &mut [Body]) -> Option { + let bytes = std::fs::read(path).ok()?; + let h = crate::scan::iges(&bytes); + if h.solids.iter().all(|s| s.rgb.is_none() && s.name.is_empty()) { + return None; + } + if h.solids.len() != bodies.len() { + return Some(format!( + "the IGES file has {} solids for {} bodies, so its colours and names could not be matched and were left out", + h.solids.len(), + bodies.len() + )); + } + for (i, (b, s)) in bodies.iter_mut().zip(h.solids).enumerate() { + b.rgb = s.rgb; + if synthetic_name(&b.name, i) && !s.name.is_empty() { + b.name = s.name; + } + } + None +} + +const FACE_COLOUR_SCAN_BYTES: u64 = 256 << 20; + +/// The worker reports one colour per body. A STEP file that styles single faces has them read here: each body takes +/// the face colours of the one manifold solid with its face count (the worker numbers faces in shell order). Bodies +/// whose face count several differently coloured solids share keep their body colour, and a note says so. +fn step_face_colours(path: &Path, bodies: &mut [Body]) -> Option { + if std::fs::metadata(path).ok()?.len() > FACE_COLOUR_SCAN_BYTES { + return None; + } + let bytes = std::fs::read(path).ok()?; + let solids = crate::scan::step_face_colours(&bytes); + if solids.is_empty() { + return None; + } + let mut ambiguous = 0usize; + for b in bodies.iter_mut() { + let same: Vec<&crate::scan::StepSolid> = solids.iter().filter(|s| s.faces.len() == b.faces && b.faces > 0).collect(); + let Some(first) = same.first() else { continue }; + if same.iter().any(|s| s.faces != first.faces) { + ambiguous += 1; + continue; + } + if first.faces.iter().any(Option::is_some) { + b.face_rgb = first.faces.clone(); + } + } + (ambiguous > 0).then(|| format!("{ambiguous} bodies have a face count that several differently coloured solids share, so their face colours were left out")) +} + /// Opens a STEP or IGES file with the worker and tessellates every body at the asked quality. pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { watch.step(Stage::Reading, 0.0).map_err(|_| CadError::Cancelled)?; @@ -452,8 +512,18 @@ pub fn read(path: &Path, opts: &ReadOptions, watch: &Watch) -> Result { let occt = worker.hello().occt.clone(); watch.step(Stage::Reading, 0.02).map_err(|_| CadError::Cancelled)?; let reply = open(&mut worker, &source, format, opts, watch)?; - let bodies = parse_bodies(&reply)?; + let mut bodies = parse_bodies(&reply)?; let mut warnings: Vec = Vec::new(); + if format == CadFormat::Iges && bodies.iter().all(|b| b.rgb.is_none()) { + if let Some(note) = iges_colours(path, &mut bodies) { + warnings.push(note); + } + } + if format == CadFormat::Step && bodies.iter().all(|b| b.face_rgb.is_empty()) { + if let Some(note) = step_face_colours(path, &mut bodies) { + warnings.push(note); + } + } if let Some(list) = reply.get("untranslated").and_then(Value::as_array).filter(|a| !a.is_empty()) { let names: Vec = list.iter().take(8).map(|v| text(Some(v))).collect(); warnings.push(format!("{} entities had no geometry the worker could translate ({})", list.len(), names.join(", "))); diff --git a/native/crates/fsh-cad/src/scan.rs b/native/crates/fsh-cad/src/scan.rs new file mode 100644 index 00000000..8bd4a72d --- /dev/null +++ b/native/crates/fsh-cad/src/scan.rs @@ -0,0 +1,425 @@ +//! What a STEP or IGES file says about itself without the worker: header, length unit, entity counts, and for IGES +//! the colour and label of each solid (the worker's XDE read drops IGES colours). + +use std::collections::BTreeMap; + +/// Length unit a file declares, as FormShot names units (mm, cm, m, in, ft), or the file's own name for others. +pub type Unit = String; + +/// One IGES manifold solid (entity 186) in directory order. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct IgesSolid { + /// Colour in linear RGB 0..1, when the solid has one. + pub rgb: Option<[f32; 3]>, + /// Name from the solid's name property (406 form 15), else its directory label. + pub name: String, +} + +/// Header facts of a CAD file. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct Header { + /// Schema (STEP) or empty. + pub schema: String, + /// File name written in the header. + pub name: String, + /// The system that wrote the file. + pub system: String, + /// Declared length unit. + pub unit: Option, + /// Counts of the entities that tell what the file holds. + pub entities: BTreeMap, + /// IGES solids with their colours and names, in directory order. + pub solids: Vec, +} + +const STEP_COUNTED: &[&str] = &[ + "PRODUCT", + "NEXT_ASSEMBLY_USAGE_OCCURRENCE", + "MANIFOLD_SOLID_BREP", + "BREP_WITH_VOIDS", + "SHELL_BASED_SURFACE_MODEL", + "ADVANCED_FACE", + "COLOUR_RGB", + "STYLED_ITEM", + "MAPPED_ITEM", +]; + +fn srgb_to_linear(v: f32) -> f32 { + let v = v.clamp(0.0, 1.0); + if v <= 0.040_45 { + v / 12.92 + } else { + ((v + 0.055) / 1.055).powf(2.4) + } +} + +fn quoted(s: &str) -> Vec { + let mut out = Vec::new(); + let mut cur: Option = None; + let mut chars = s.chars().peekable(); + while let Some(c) = chars.next() { + match (&mut cur, c) { + (None, '\'') => cur = Some(String::new()), + (Some(t), '\'') if chars.peek() == Some(&'\'') => { + t.push('\''); + chars.next(); + } + (Some(_), '\'') => out.extend(cur.take()), + (Some(t), c) => t.push(c), + _ => {} + } + } + out +} + +fn entity_text<'a>(text: &'a str, keyword: &str) -> Option<&'a str> { + let at = text.find(keyword)?; + let end = text[at..].find(';').map(|e| at + e).unwrap_or(text.len()); + Some(&text[at..end]) +} + +fn count_keyword(text: &str, keyword: &str) -> usize { + let bytes = text.as_bytes(); + let mut n = 0; + let mut from = 0; + while let Some(i) = text[from..].find(keyword) { + let at = from + i; + let before = at.checked_sub(1).map(|b| bytes[b]); + let after = bytes.get(at + keyword.len()).copied(); + let starts = before.is_none_or(|b| !(b.is_ascii_alphanumeric() || b == b'_')); + if starts && matches!(after, Some(b'(') | Some(b' ')) { + n += 1; + } + from = at + keyword.len(); + } + n +} + +fn step_unit(text: &str) -> Option { + let mut from = 0; + while let Some(i) = text[from..].find("LENGTH_UNIT") { + let at = from + i; + from = at + 11; + let start = text[..at].rfind('=').unwrap_or(0); + let end = text[at..].find(';').map(|e| at + e).unwrap_or(text.len()); + let entity = &text[start..end]; + if entity.contains("CONVERSION_BASED_UNIT") { + let name = quoted(entity).into_iter().next().unwrap_or_default().to_ascii_uppercase(); + return Some( + match name.as_str() { + "INCH" | "IN" => "in", + "FOOT" | "FT" => "ft", + "MILLIMETRE" | "MILLIMETER" | "MM" => "mm", + "CENTIMETRE" | "CENTIMETER" | "CM" => "cm", + "METRE" | "METER" | "M" => "m", + other => return Some(other.to_ascii_lowercase()), + } + .to_string(), + ); + } + if let Some(si) = entity.find("SI_UNIT(") { + let args = &entity[si + 8..]; + let prefix = args.split(',').next().unwrap_or("").trim(); + return Some( + match prefix { + ".MILLI." => "mm", + ".CENTI." => "cm", + ".MICRO." => "micron", + ".KILO." => "km", + _ => "m", + } + .to_string(), + ); + } + } + None +} + +/// Reads a STEP file's header, unit and entity counts. +pub fn step(bytes: &[u8]) -> Header { + let text = String::from_utf8_lossy(bytes); + let mut h = Header::default(); + if let Some(e) = entity_text(&text, "FILE_SCHEMA") { + h.schema = quoted(e).join(", "); + } + if let Some(e) = entity_text(&text, "FILE_NAME") { + let q = quoted(e); + h.name = q.first().cloned().unwrap_or_default(); + h.system = q.iter().rev().skip(1).take(2).find(|s| !s.trim().is_empty()).cloned().unwrap_or_default(); + } + h.unit = step_unit(&text); + for k in STEP_COUNTED { + h.entities.insert(k.to_ascii_lowercase(), count_keyword(&text, k)); + } + h +} + +/// One STEP manifold solid in file order: its face colours in shell order (the order the worker numbers faces). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct StepSolid { + /// Colour of each face of the outer shell, in linear RGB, when the file styles it. + pub faces: Vec>, +} + +fn refs(args: &str) -> Vec { + let mut out = Vec::new(); + let b = args.as_bytes(); + let mut i = 0; + let mut quoted = false; + while i < b.len() { + match b[i] { + b'\'' => quoted = !quoted, + b'#' if !quoted => { + let s = i + 1; + let mut e = s; + while e < b.len() && b[e].is_ascii_digit() { + e += 1; + } + if let Ok(n) = args[s..e].parse() { + out.push(n); + } + i = e; + continue; + } + _ => {} + } + i += 1; + } + out +} + +fn records(text: &str) -> BTreeMap { + let mut out = BTreeMap::new(); + let data = text.find("DATA;").map(|i| &text[i + 5..]).unwrap_or(text); + let mut start = 0; + let mut quoted = false; + for (i, c) in data.char_indices() { + match c { + '\'' => quoted = !quoted, + ';' if !quoted => { + let rec = data[start..i].trim(); + start = i + 1; + let Some(rest) = rec.strip_prefix('#') else { continue }; + let Some((id, body)) = rest.split_once('=') else { continue }; + let Ok(id) = id.trim().parse::() else { continue }; + let body = body.trim(); + let name_end = body.find('(').unwrap_or(body.len()); + out.insert(id, (body[..name_end].trim(), &body[name_end..])); + } + _ => {} + } + } + out +} + +const NAMED_COLOURS: &[(&str, [f32; 3])] = &[ + ("red", [1.0, 0.0, 0.0]), + ("green", [0.0, 1.0, 0.0]), + ("blue", [0.0, 0.0, 1.0]), + ("yellow", [1.0, 1.0, 0.0]), + ("magenta", [1.0, 0.0, 1.0]), + ("cyan", [0.0, 1.0, 1.0]), + ("black", [0.0, 0.0, 0.0]), + ("white", [1.0, 1.0, 1.0]), +]; + +fn colour_from(recs: &BTreeMap, start: &[u64]) -> Option<[f32; 3]> { + let mut frontier: Vec = start.to_vec(); + for _ in 0..10 { + let mut next = Vec::new(); + for id in frontier { + let Some((name, args)) = recs.get(&id) else { continue }; + match *name { + "COLOUR_RGB" => { + let nums: Vec = args + .trim_matches(|c| c == '(' || c == ')') + .split(',') + .skip(1) + .filter_map(|s| s.trim().trim_end_matches('.').parse::().ok().or_else(|| s.trim().parse().ok())) + .collect(); + if nums.len() >= 3 { + return Some([srgb_to_linear(nums[0]), srgb_to_linear(nums[1]), srgb_to_linear(nums[2])]); + } + } + "DRAUGHTING_PRE_DEFINED_COLOUR" => { + let q = quoted(args).into_iter().next().unwrap_or_default().to_ascii_lowercase(); + if let Some((_, c)) = NAMED_COLOURS.iter().find(|(n, _)| *n == q) { + return Some(*c); + } + } + _ => next.extend(refs(args)), + } + } + if next.is_empty() { + return None; + } + frontier = next; + } + None +} + +/// The face colours of every manifold solid in a STEP file, in file order; empty when the file styles no faces. +pub fn step_face_colours(bytes: &[u8]) -> Vec { + let text = String::from_utf8_lossy(bytes); + if !text.contains("STYLED_ITEM") { + return Vec::new(); + } + let recs = records(&text); + let mut face_colour: BTreeMap = BTreeMap::new(); + for (name, args) in recs.values() { + if *name != "STYLED_ITEM" && *name != "OVER_RIDING_STYLED_ITEM" { + continue; + } + let r = refs(args); + let Some(&item) = (if *name == "STYLED_ITEM" { r.last() } else { r.get(r.len().saturating_sub(2)) }) else { continue }; + if recs.get(&item).is_some_and(|(n, _)| *n == "ADVANCED_FACE" || *n == "FACE_SURFACE") { + let styles: Vec = r.iter().copied().filter(|x| *x != item).collect(); + if let Some(c) = colour_from(&recs, &styles) { + face_colour.insert(item, c); + } + } + } + if face_colour.is_empty() { + return Vec::new(); + } + let mut out = Vec::new(); + for (name, args) in recs.values() { + if *name != "MANIFOLD_SOLID_BREP" { + continue; + } + let Some(shell) = refs(args).first().and_then(|s| recs.get(s)) else { continue }; + let faces = refs(shell.1).into_iter().map(|f| face_colour.get(&f).copied()).collect(); + out.push(StepSolid { faces }); + } + out +} + +fn columns(line: &[u8], from: usize, to: usize) -> &str { + let end = to.min(line.len()); + let start = from.min(end); + std::str::from_utf8(&line[start..end]).unwrap_or("").trim() +} + +fn field(line: &[u8], index: usize) -> i64 { + columns(line, index * 8, index * 8 + 8).parse().unwrap_or(0) +} + +/// Splits IGES parameter data into fields, honouring Hollerith strings (`5Hhello`). +fn params(data: &str, delim: char, end: char) -> Vec { + let mut out = Vec::new(); + let mut cur = String::new(); + let chars: Vec = data.chars().collect(); + let mut i = 0; + while i < chars.len() { + let c = chars[i]; + if c.is_ascii_digit() && cur.trim().chars().all(|d| d.is_ascii_digit()) { + let mut j = i; + while j < chars.len() && chars[j].is_ascii_digit() { + j += 1; + } + if j < chars.len() && chars[j] == 'H' { + let n: usize = (cur.trim().to_string() + &chars[i..j].iter().collect::()).parse().unwrap_or(0); + let text: String = chars.iter().skip(j + 1).take(n).collect(); + cur = text; + i = j + 1 + n; + continue; + } + } + if c == delim || c == end { + out.push(std::mem::take(&mut cur)); + if c == end { + break; + } + } else { + cur.push(c); + } + i += 1; + } + out +} + +const IGES_UNITS: &[(i64, &str)] = &[(1, "in"), (2, "mm"), (4, "ft"), (5, "mi"), (6, "m"), (7, "km"), (8, "mil"), (9, "micron"), (10, "cm"), (11, "microinch")]; +const IGES_STANDARD: &[[f32; 3]] = + &[[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 1.0, 1.0]]; + +struct Entry { + kind: i64, + colour: i64, + form: i64, + label: String, +} + +/// Reads an IGES file's global section, unit, entity counts and its solids' colours and names. +pub fn iges(bytes: &[u8]) -> Header { + let mut h = Header::default(); + let mut global = String::new(); + let mut dir: Vec<&[u8]> = Vec::new(); + let mut pdata: BTreeMap = BTreeMap::new(); + for raw in bytes.split(|&b| b == b'\n') { + let line = raw.strip_suffix(b"\r").unwrap_or(raw); + match line.get(72) { + Some(b'G') => global.push_str(&String::from_utf8_lossy(&line[..72])), + Some(b'D') => dir.push(line), + Some(b'P') => { + let back: i64 = columns(line, 64, 72).parse().unwrap_or(0); + pdata.entry(back).or_default().push_str(&String::from_utf8_lossy(&line[..64.min(line.len())])); + } + _ => {} + } + } + let g = global.trim_start(); + let (delim, end) = if g.starts_with("1H") && g.len() > 6 { + let mut c = g.chars(); + let d = c.nth(2).unwrap_or(','); + let e = g.get(4..).and_then(|r| r.strip_prefix("1H")).and_then(|r| r.chars().next()).unwrap_or(';'); + (d, e) + } else { + (',', ';') + }; + let gp = params(&global, delim, end); + let gv = |i: usize| gp.get(i).map(|s| s.trim().to_string()).unwrap_or_default(); + h.name = gv(3); + h.system = gv(4); + let flag: i64 = gv(13).parse().unwrap_or(0); + h.unit = IGES_UNITS.iter().find(|(f, _)| *f == flag).map(|(_, u)| u.to_string()).or_else(|| Some(gv(14).to_ascii_lowercase()).filter(|s| !s.is_empty())); + let mut entries: BTreeMap = BTreeMap::new(); + for (i, pair) in dir.chunks(2).enumerate() { + let [l1, l2] = pair else { continue }; + let kind = field(l1, 0); + *h.entities.entry(kind.to_string()).or_default() += 1; + let label = columns(l2, 56, 64).to_string(); + entries.insert((i * 2 + 1) as i64, Entry { kind, colour: field(l2, 2), form: field(l2, 4), label }); + } + let param_of = |de: i64| -> Vec { pdata.get(&de).map(|d| params(d, delim, end)).unwrap_or_default() }; + let colour_of = |c: i64| -> Option<[f32; 3]> { + if c > 0 { + return IGES_STANDARD.get((c - 1) as usize).copied(); + } + entries.get(&-c).filter(|e| e.kind == 314)?; + let p = param_of(-c); + let v = |i: usize| p.get(i).and_then(|s| s.trim().parse::().ok()).map(|x| srgb_to_linear(x / 100.0)); + Some([v(1)?, v(2)?, v(3)?]) + }; + for (de, e) in entries.iter().filter(|(_, e)| e.kind == 186) { + let p = param_of(*de); + let mut name = String::new(); + let voids: usize = p.get(3).and_then(|s| s.trim().parse().ok()).unwrap_or(0); + let mut at = 4 + 2 * voids; + let assoc: usize = p.get(at).and_then(|s| s.trim().parse().ok()).unwrap_or(0); + at += 1 + assoc; + let props: usize = p.get(at).and_then(|s| s.trim().parse().ok()).unwrap_or(0); + for k in 0..props.min(64) { + let ptr: i64 = p.get(at + 1 + k).and_then(|s| s.trim().parse().ok()).unwrap_or(0); + if entries.get(&ptr).is_some_and(|x| x.kind == 406 && x.form == 15) { + if let Some(n) = param_of(ptr).get(2).map(|s| s.trim().to_string()).filter(|s| !s.is_empty()) { + name = n; + } + } + } + if name.is_empty() { + name = e.label.clone(); + } + h.solids.push(IgesSolid { rgb: colour_of(e.colour), name }); + } + h +} From 959fc79c570312af03577b8ce91fed45a9662ee6 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:50:44 -0500 Subject: [PATCH 126/494] feat(import): re-import step and iges files file.reimport now reads a CAD source again through the worker at the quality its parts have, matches like other models, swaps changed meshes in place, keeps the new source and moves source.cad and the cad tags onto the matched parts, so retessellation follows the new file. CAD imports store source.options on their top nodes and read units, up_axis, center, merge and the options object the way file.import does. Ran through the release CLI: after the gearbox STEP changed, 10 nodes matched and 7 updated with ids and materials kept, and retessellation with the file deleted used the new kept source. --- native/crates/fsh-commands/src/ext/cad.rs | 113 ++++++++++++++---- .../fsh-commands/src/ext/import/reimport.rs | 21 +++- 2 files changed, 113 insertions(+), 21 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index c22f5604..0ab152df 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -98,6 +98,20 @@ pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, args: &Value, native::apply(engine, st, p, args, frame) } +/// A kept CAD source read again for `file.reimport`. +pub(crate) type Reread = (fsh_scene::Command, fsh_io::CleanReport, Option<(Vec, String)>); + +/// `file.reimport` of a STEP or IGES import: the file read again with the import's stored options at the quality its +/// parts have now, as the `scene.import` to match, plus the bytes to keep (with [`keep_source`]) when it applies. +pub(crate) fn reread(path: &Path, stored: &Value, doc: &fsh_scene::Document, top: fsh_core::NodeId) -> Result { + native::reread(path, stored, doc, top) +} + +/// Keeps a CAD source in the project and the crash journal; true when kept. +pub(crate) fn keep_source(st: &mut State, source: Option<(Vec, String)>) -> bool { + native::keep_source(st, source) +} + #[cfg(not(target_arch = "wasm32"))] mod native { use crate::engine::{Engine, State}; @@ -118,7 +132,7 @@ mod native { } fn opt<'a>(args: &'a Value, key: &str) -> Option<&'a Value> { - args.get(key).filter(|v| !v.is_null()).or_else(|| args.get("options").and_then(|o| o.get(key)).filter(|v| !v.is_null())) + args.get(key).filter(|v| !v.is_null()) } fn opt_str<'a>(args: &'a Value, key: &str) -> Option<&'a str> { @@ -129,6 +143,14 @@ mod native { opt(args, key).and_then(Value::as_bool) } + fn legacy(args: &Value) -> Value { + args.get("options").filter(|o| o.is_object()).cloned().unwrap_or_else(|| json!({})) + } + + fn wrap_of(args: &Value) -> bool { + opt_bool(args, "merge") == Some(true) || opt_bool(&legacy(args), "wrap_in_group").unwrap_or(true) + } + pub(super) fn quality_of(args: &Value, key: &str) -> Result { Quality::from_json(opt(args, key).unwrap_or(&Value::Null)).map_err(|m| EngineError::args(format!("{key}: {m}"))) } @@ -140,8 +162,8 @@ mod native { } fn clean_options(args: &Value) -> Result { - let mut c = CleanOptions { detect_instances: false, ..CleanOptions::default() }; - if let Some(u) = opt_str(args, "units").or_else(|| opt_str(args, "unit")).filter(|u| *u != "auto") { + let mut c = CleanOptions { detect_instances: false, ..crate::engine::clean_options(&legacy(args))? }; + if let Some(u) = opt_str(args, "units").filter(|u| *u != "auto") { c.unit = Some(u.parse::().map_err(|e| EngineError::args(e.to_string()))?); } if let Some(a) = opt_str(args, "up_axis").filter(|a| *a != "auto") { @@ -150,7 +172,7 @@ mod native { if let Some(b) = opt_bool(args, "stand_on_floor") { c.stand_on_floor = b; } - if let Some(b) = opt_bool(args, "center").or_else(|| opt_bool(args, "centre")) { + if let Some(b) = opt_bool(args, "center") { c.centre = b; } Ok(c) @@ -196,7 +218,20 @@ mod native { Ok(Prepared { path: abs, raw, tags: read.tags, report, read: info, quality, source }) } - fn tag_payload(cmd: &mut Command, p: &Prepared, wrap: bool, reference: &str) { + fn stored_options(p: &Prepared, args: &Value) -> String { + let mut kept = serde_json::Map::new(); + for k in ["options", "stand_on_floor", "center", "merge", "cad_quality"] { + if let Some(v) = args.get(k).filter(|v| !v.is_null()) { + kept.insert(k.into(), v.clone()); + } + } + kept.insert("units".into(), json!(p.report.unit.as_str())); + kept.insert("up_axis".into(), json!(p.report.up_axis.as_str())); + Value::Object(kept).to_string() + } + + fn tag_payload(cmd: &mut Command, p: &Prepared, wrap: bool, reference: &str, args: &Value) { + let options = stored_options(p, args); let Command::Import(imp) = cmd else { return }; let raw = &p.raw; let mut referenced = vec![false; raw.meshes.len()]; @@ -227,6 +262,9 @@ mod native { let meta = &mut n.node.metadata; meta.insert("source.path".into(), source_path.clone()); meta.insert("source.node".into(), inside); + if n.node.parent.is_none() { + meta.insert("source.options".into(), options.clone()); + } if let NodeKind::Part { mesh, .. } = n.node.kind { meta.insert("source.cad".into(), reference.to_string()); meta.insert("cad.quality".into(), p.quality.to_text()); @@ -250,19 +288,52 @@ mod native { Ok(()) } - /// Adds a prepared CAD import to the document as one undo step and keeps its source in the project. - pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, args: &Value, frame: Option) -> Result { - let wrap = opt_bool(args, "merge").or_else(|| opt_bool(args, "wrap_in_group")).unwrap_or(true); - let roots = p.raw.nodes.iter().filter(|n| n.parent.is_none()).count(); - let watch = Watch::new(); - let mut cmd = fsh_io::to_import_command(&p.raw, st.editor.document(), &ImportOptions { parent: None, wrap_in_group: wrap }, &watch)?; - let reference = match &p.source { + fn reference_of(p: &Prepared) -> String { + match &p.source { Some((bytes, ext)) => fsh_format::source_member(bytes, ext) .map(|m| format!("{}{m}", fsh_format::EMBED_SCHEME)) .unwrap_or_else(|| p.path.to_string_lossy().to_string()), None => p.path.to_string_lossy().to_string(), + } + } + + fn import_command(p: &Prepared, doc: &fsh_scene::Document, args: &Value) -> Result<(Command, String)> { + let wrap = wrap_of(args); + let roots = p.raw.nodes.iter().filter(|n| n.parent.is_none()).count(); + let mut cmd = fsh_io::to_import_command(&p.raw, doc, &ImportOptions { parent: None, wrap_in_group: wrap }, &Watch::new())?; + let reference = reference_of(p); + tag_payload(&mut cmd, p, wrap && roots > 1, &reference, args); + Ok((cmd, reference)) + } + + /// Keeps a CAD source in the project (and the crash journal); true when it is kept. + pub(crate) fn keep_source(st: &mut State, source: Option<(Vec, String)>) -> bool { + let kept = match source { + Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), + None => false, }; - tag_payload(&mut cmd, &p, wrap && roots > 1, &reference); + if kept { + st.note_sources(); + } + kept + } + + /// The `scene.import` a re-import compares against the document: the file read again with the import's stored + /// options, tagged like an import; also the source bytes to keep when the re-import applies. + pub(crate) fn reread(path: &Path, stored: &Value, doc: &fsh_scene::Document, top: NodeId) -> Result { + let mut args = if stored.is_object() { stored.clone() } else { json!({}) }; + let current = doc.subtree(top).into_iter().find_map(|id| doc.node(id).and_then(|n| n.metadata.get("cad.quality")).and_then(|q| Quality::from_text(q))); + if let Some(q) = current { + args["cad_quality"] = q.to_json(); + } + let p = prepare(path, &args, &Watch::new())?; + let (cmd, _) = import_command(&p, doc, &args)?; + Ok((cmd, p.report, p.source)) + } + + /// Adds a prepared CAD import to the document as one undo step and keeps its source in the project. + pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, args: &Value, frame: Option) -> Result { + let (cmd, reference) = import_command(&p, st.editor.document(), args)?; let was_empty = !st.editor.document().nodes().values().any(|n| matches!(n.kind, NodeKind::Part { .. })); let stem = p.path.file_stem().and_then(|s| s.to_str()).unwrap_or("CAD").to_string(); let label = format!("Import {}", get_str(args, "name").filter(|n| !n.is_empty()).unwrap_or(&stem)); @@ -301,13 +372,7 @@ mod native { return Err(e); } }; - let kept = match p.source { - Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), - None => false, - }; - if kept { - st.note_sources(); - } + let kept = keep_source(st, p.source); let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("file.import"); reply["report"] = json!({ @@ -583,6 +648,14 @@ mod native { Err(IoError::Unsupported(NO_WORKER.into()).into()) } + pub(super) fn reread(_path: &Path, _stored: &Value, _doc: &fsh_scene::Document, _top: fsh_core::NodeId) -> Result { + Err(IoError::Unsupported(NO_WORKER.into()).into()) + } + + pub(super) fn keep_source(_st: &mut State, _source: Option<(Vec, String)>) -> bool { + false + } + pub(super) fn retessellate(_engine: &Engine, _st: &mut State, _args: &Value) -> Result { Err(IoError::Unsupported(NO_WORKER.into()).into()) } diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index e3e66355..35863620 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -257,7 +257,14 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe let file = source::source_path(top_node).unwrap_or_default().to_string(); let stored: Value = top_node.metadata.get(source::OPTIONS).and_then(|s| serde_json::from_str(s).ok()).unwrap_or_else(|| json!({})); let a = ImportArgs::parse(&stored, Some(false))?; - let prepared = run::prepare(Path::new(&file), &a, doc, &Watch::new())?; + let mut cad_source = None; + let prepared = if crate::ext::cad::is_cad(Path::new(&file)) { + let (cmd, report, source) = crate::ext::cad::reread(Path::new(&file), &stored, doc, top)?; + cad_source = Some(source); + run::Prepared { path: Path::new(&file).to_path_buf(), cmd, report } + } else { + run::prepare(Path::new(&file), &a, doc, &Watch::new())? + }; rep.warnings.extend(prepared.report.warnings.iter().cloned()); rep.report = Some(run::report_json(&prepared.report)); let mut payload = payload_of(prepared.cmd)?; @@ -279,6 +286,7 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe let mut reuse: BTreeMap = BTreeMap::new(); let mut renames = Vec::new(); let mut paths = Vec::new(); + let mut cad_tags = Vec::new(); let mut swaps = Vec::new(); let mut returned = Vec::new(); for (nid, d) in &p.by_new { @@ -293,6 +301,11 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe if source::source_node(new) != source::source_node(old) { paths.push((*d, source::source_node(new).to_string())); } + for (k, v) in new.metadata.iter().filter(|(k, _)| k.starts_with("cad.") || k.as_str() == "source.cad") { + if old.metadata.get(k) != Some(v) { + cad_tags.push((*d, k.clone(), v.clone())); + } + } if let (Some((nm, nmat)), Some((om, omat))) = (part_of(new), part_of(old)) { if let (Some(n), Some(o)) = (nmat, omat) { reuse.entry(n).or_insert(o); @@ -354,6 +367,12 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe for (d, path) in paths { dispatch(st, "scene.set_metadata", json!({"id": d.raw(), "key": source::NODE, "value": path}), outs)?; } + if let Some(s) = cad_source { + crate::ext::cad::keep_source(st, s); + } + for (d, k, v) in cad_tags { + dispatch(st, "scene.set_metadata", json!({"id": d.raw(), "key": k, "value": v}), outs)?; + } if !returned.is_empty() { let ids: Vec = returned.iter().map(|d| d.raw()).collect(); dispatch(st, "scene.set_visible", json!({"ids": ids, "visible": true}), outs)?; From 0d7e52f575c2441f10332a4fbb5aa56f0cb5bcee Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:51:00 -0500 Subject: [PATCH 127/494] feat(cad): answer import.probe for step and iges files import.probe on a CAD file reads the header (schema, writing system, declared unit, entity counts) and, unless worker is false, opens the file with the worker without tessellating to report bodies, assembly groups, colours, faces and the size in file units and metres; with no worker it answers from the header and says why. Ran through the release CLI on the gearbox STEP and IGES, box_sides.STEP (inch, 10 bodies) and two_color_cube.STEP with worker false. --- native/crates/fsh-cad/src/lib.rs | 2 + native/crates/fsh-cad/src/probe.rs | 145 +++++++++++++++++++ native/crates/fsh-commands/src/ext/cad.rs | 17 +++ native/crates/fsh-commands/src/ext/import.rs | 4 +- 4 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 native/crates/fsh-cad/src/probe.rs diff --git a/native/crates/fsh-cad/src/lib.rs b/native/crates/fsh-cad/src/lib.rs index 36892225..3d1fee50 100644 --- a/native/crates/fsh-cad/src/lib.rs +++ b/native/crates/fsh-cad/src/lib.rs @@ -7,11 +7,13 @@ mod error; mod locate; pub mod mesh; mod quality; +mod probe; mod read; pub mod scan; pub use client::{Hello, Worker, MAX_LINE, PROTOCOL}; pub use error::{CadError, Result}; +pub use probe::probe; pub use quality::{Quality, MIN_LINEAR_MM}; pub use read::{is_cad_path, read, CadFormat, CadRead, MeshTag, ReadOptions, TIMEOUT_ENV}; pub use locate::{cache_dir, installed, locate, workers_dir, Located, Origin, CACHE_ENV, PROGRAM, WORKER_ENV}; diff --git a/native/crates/fsh-cad/src/probe.rs b/native/crates/fsh-cad/src/probe.rs new file mode 100644 index 00000000..e32edf56 --- /dev/null +++ b/native/crates/fsh-cad/src/probe.rs @@ -0,0 +1,145 @@ +use crate::client::Worker; +use crate::error::{CadError, Result}; +use crate::locate::locate; +use crate::read::{CadFormat, ReadOptions}; +use crate::scan::{self, Header}; +use fsh_io::Watch; +use serde_json::{json, Value}; +use std::collections::BTreeSet; +use std::path::Path; + +fn metres_per(unit: &str) -> Option { + Some(match unit { + "mm" => 0.001, + "cm" => 0.01, + "m" => 1.0, + "in" => 0.0254, + "ft" => 0.3048, + "micron" => 1e-6, + "km" => 1000.0, + _ => return None, + }) +} + +fn header_json(h: &Header) -> Value { + json!({"schema": h.schema, "name": h.name, "system": h.system, "unit": h.unit, "entities": h.entities}) +} + +/// Describes a STEP or IGES file for an import dialog without tessellating it: the header, declared unit and entity +/// counts from the file itself, then, when `use_worker` and the worker is installed, the worker's open (bodies, +/// assembly groups, colours, size). Without the worker the answer says why and carries only what the file says. +pub fn probe(path: &Path, opts: &ReadOptions, use_worker: bool, watch: &Watch) -> Result { + let bytes = std::fs::read(path).map_err(|e| CadError::File(format!("{} cannot be read: {e}", path.display())))?; + let head = &bytes[..bytes.len().min(512)]; + let format = CadFormat::detect(path, head).ok_or_else(|| CadError::File(format!("{} is not a STEP or IGES file", path.display())))?; + let h = match format { + CadFormat::Step => scan::step(&bytes), + CadFormat::Iges => scan::iges(&bytes), + }; + let declared = h.unit.clone().filter(|u| metres_per(u).is_some()); + let stem = path.file_stem().and_then(|s| s.to_str()).unwrap_or("CAD").to_string(); + let mut out = json!({ + "path": path.to_string_lossy(), + "bytes": bytes.len(), + "name": stem, + "format": format.extension(), + "units_declared": declared, + "units_guess": declared.clone().unwrap_or_else(|| "mm".into()), + "unit_guessed": declared.is_none(), + "up_axis": "z", + "up_axis_declared": false, + "bounds": null, + "triangles": null, + "meshes": null, + "nodes": null, + "materials": null, + "textures": 0, + "warnings": [], + "cad": header_json(&h), + }); + if !use_worker { + out["cad"]["worker"] = json!(false); + out["cad"]["reason"] = json!("the worker was not asked (worker: false)"); + return Ok(out); + } + let located = match opts.worker.clone().map(Ok).unwrap_or_else(locate) { + Ok(l) => l, + Err(e) => { + out["cad"]["worker"] = json!(false); + out["cad"]["reason"] = json!(e.to_string()); + out["cad"]["code"] = json!(e.code()); + return Ok(out); + } + }; + let opened = (|| -> Result<(Value, String)> { + let abs = path.canonicalize().map_err(|e| CadError::File(format!("{} cannot be opened: {e}", path.display())))?; + let mut worker = Worker::start(&located, opts.hello_timeout, Some(watch))?; + let occt = worker.hello().occt.clone(); + let reply = worker.call("xde_read", json!({"path": abs.to_string_lossy(), "unit": "mm", "pmi": false}), opts.timeout, Some(watch))?; + worker.shutdown(); + Ok((reply, occt)) + })(); + let (reply, occt) = match opened { + Ok(r) => r, + Err(CadError::Cancelled) => return Err(CadError::Cancelled), + Err(e) => { + out["cad"]["worker"] = json!(false); + out["cad"]["reason"] = json!(e.to_string()); + out["cad"]["code"] = json!(e.code()); + return Ok(out); + } + }; + let bodies = reply.get("bodies").and_then(Value::as_array).cloned().unwrap_or_default(); + let mut lo = [f64::INFINITY; 3]; + let mut hi = [f64::NEG_INFINITY; 3]; + let mut groups: BTreeSet> = BTreeSet::new(); + let mut colours: BTreeSet = BTreeSet::new(); + let mut defs: BTreeSet = BTreeSet::new(); + let mut faces = 0u64; + for b in &bodies { + if let Some(bb) = b.pointer("/summary/bbox").and_then(Value::as_array).filter(|a| a.len() == 6) { + let v: Vec = bb.iter().filter_map(Value::as_f64).collect(); + if v.len() == 6 { + for k in 0..3 { + lo[k] = lo[k].min(v[k]); + hi[k] = hi[k].max(v[k + 3]); + } + } + } + faces += b.pointer("/summary/faces").and_then(Value::as_u64).unwrap_or(0); + let path: Vec = b.get("path").and_then(Value::as_array).map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect()).unwrap_or_default(); + for d in 1..=path.len() { + groups.insert(path[..d].to_vec()); + } + if let Some(c) = b.get("rgb").filter(|c| c.is_array()) { + colours.insert(c.to_string()); + } + if let Some(d) = b.get("def").and_then(Value::as_str).filter(|_| format == CadFormat::Step) { + defs.insert(d.to_string()); + } + } + if format == CadFormat::Iges && colours.is_empty() { + colours.extend(h.solids.iter().filter_map(|s| s.rgb).map(|c| format!("{c:?}"))); + } + let unit = declared.clone().unwrap_or_else(|| "mm".into()); + let per = metres_per(&unit).unwrap_or(0.001); + if lo[0].is_finite() && hi[0] >= lo[0] { + let to_file = 0.001 / per; + let f = |a: [f64; 3]| json!([a[0] * to_file, a[1] * to_file, a[2] * to_file]); + let size = [hi[0] - lo[0], hi[1] - lo[1], hi[2] - lo[2]]; + out["bounds"] = json!({"min": f(lo), "max": f(hi), "size": f(size), "size_m": [size[0] * 0.001, size[1] * 0.001, size[2] * 0.001]}); + } + out["nodes"] = json!(bodies.len() + groups.len()); + out["materials"] = json!(colours.len()); + out["cad"]["worker"] = json!(true); + out["cad"]["bodies"] = json!(bodies.len()); + out["cad"]["groups"] = json!(groups.len()); + out["cad"]["faces"] = json!(faces); + out["cad"]["distinct_shapes"] = json!(if format == CadFormat::Step { Some(defs.len()) } else { None }); + out["cad"]["colours_in_file"] = reply.get("colours_in_file").cloned().unwrap_or(Value::Null); + out["cad"]["occt"] = json!(occt); + if let Some(list) = reply.get("untranslated").and_then(Value::as_array).filter(|a| !a.is_empty()) { + out["warnings"] = json!([format!("{} entities had no geometry the worker could translate", list.len())]); + } + Ok(out) +} diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 0ab152df..afc631d0 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -87,6 +87,12 @@ pub(crate) fn import(engine: &Engine, st: &mut State, path: &Path, args: &Value, pub(crate) use native::Prepared; +/// `import.probe` for a STEP or IGES file: what the file's header says, then what the worker's open says (bodies, +/// groups, colours, size) without tessellating; `worker: false` skips the worker. +pub(crate) fn probe(path: &Path, args: &Value) -> Result { + native::probe(path, get_bool(args, "worker").unwrap_or(true)) +} + /// Reads and cleans a STEP or IGES file off the session (an import job's thread); progress and cancel go through /// `watch`, and cancel stops the worker. pub(crate) fn prepare(path: &Path, args: &Value, watch: &Watch) -> Result { @@ -155,6 +161,10 @@ mod native { Quality::from_json(opt(args, key).unwrap_or(&Value::Null)).map_err(|m| EngineError::args(format!("{key}: {m}"))) } + pub(super) fn probe(path: &Path, use_worker: bool) -> Result { + fsh_cad::probe(path, &ReadOptions::default(), use_worker, &Watch::new()).map_err(cad_error) + } + pub(super) fn read_cad(path: &Path, quality: &Value, watch: &Watch) -> fsh_io::Result { let quality = Quality::from_json(quality).map_err(fsh_io::IoError::InvalidData)?; let opts = ReadOptions { quality, ..ReadOptions::default() }; @@ -640,6 +650,13 @@ mod native { pub(crate) struct Prepared; + pub(super) fn probe(path: &Path, _use_worker: bool) -> Result { + let bytes = std::fs::metadata(path).map_err(|e| crate::error::EngineError::File(format!("{}: {e}", path.display())))?.len(); + let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("").to_ascii_lowercase(); + let format = if matches!(ext.as_str(), "iges" | "igs") { "iges" } else { "step" }; + Ok(json!({"path": path.to_string_lossy(), "bytes": bytes, "format": format, "warnings": [], "cad": {"worker": false, "reason": NO_WORKER}})) + } + pub(super) fn prepare(_path: &Path, _args: &Value, _watch: &Watch) -> Result { Err(IoError::Unsupported(NO_WORKER.into()).into()) } diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index b87e8742..73eae120 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -70,6 +70,7 @@ fn reimport_schema() -> Value { fn probe_schema() -> Value { let mut p = serde_json::Map::new(); p.insert("path".into(), json!({"type": "string", "description": "Model file to read"})); + p.insert("worker".into(), json!({"type": "boolean", "default": true, "description": "STEP and IGES: also open the file with the CAD worker (bodies, groups, colours, size; a few seconds); false answers from the file's header alone"})); object(p, &["path"]) } @@ -103,7 +104,6 @@ fn object(props: serde_json::Map, required: &[&str]) -> Value { pub(crate) fn file_import_schema() -> Value { object(options::properties(), &["path"]) } - /// `file.import` (and `file.open` of a model): reads the options, imports now, one undo step. pub(crate) fn import_now(engine: &Engine, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { let a = ImportArgs::parse(args, frame)?; @@ -137,7 +137,7 @@ pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value jobs::pump(engine, st); Some(match name { "file.reimport" => crate::view::node_list(st.editor.document(), args).and_then(|nodes| reimport::reimport(engine, st, nodes)), - "import.probe" => need_path(args, name).and_then(|p| probe::probe(&p)), + "import.probe" => need_path(args, name).and_then(|p| if super::cad::is_cad(&p) { super::cad::probe(&p, args) } else { probe::probe(&p) }), "import.start" => start(st, args), "import.status" => jobs::status(st, job_of(args)), "import.cancel" => job_of(args).ok_or_else(|| EngineError::args("import.cancel needs job")).and_then(|j| jobs::cancel(st, j)), From 11969837719eb179a839b6ca7d7df6b3bbad88fd Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:51:11 -0500 Subject: [PATCH 128/494] fix(catalogue): list every option file.open and file.import accept file.open's schema now carries the import options it passes on for a model (all but frame, which open always does), the path descriptions name 3mf, fbx, step and iges, and cad_quality's chord is described as a fraction of the model's diagonal with the bounds fsh-cad enforces. Ran app.catalogue through the release CLI and read the property lists of file.open, file.import and import.probe. --- native/crates/fsh-commands/src/catalogue.rs | 6 +++--- native/crates/fsh-commands/src/ext/import.rs | 13 +++++++++++++ .../crates/fsh-commands/src/ext/import/options.rs | 6 +++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/native/crates/fsh-commands/src/catalogue.rs b/native/crates/fsh-commands/src/catalogue.rs index 4d68eac9..2533eeab 100644 --- a/native/crates/fsh-commands/src/catalogue.rs +++ b/native/crates/fsh-commands/src/catalogue.rs @@ -32,9 +32,9 @@ pub(crate) const ENGINE_COMMANDS: &[EngineCommand] = &[ cmd("history.barrier", Nothing, false, false, "End merging of continuous edits (call when a drag ends)."), cmd("camera.frame", Full, true, false, "Move the active camera so every visible part fits the view, keeping its direction."), cmd("file.new", Full, true, false, "Start a new document, empty or from a template (empty-studio, product-white, studio-light, studio-dark, spheres, turntable, daylight, sample)."), - cmd("file.open", Full, true, false, "Open a .fshot project, or a model file as a new document."), + cmd("file.open", Full, true, false, "Open a .fshot project, or a model file as a new document with the file.import options (camera framed)."), cmd("file.save", Nothing, false, false, "Save the document as .fshot to path, or to its own path."), - cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional, and every node made carries source.path and source.node metadata."), + cmd("file.import", Full, true, false, "Import a model (glb, gltf, obj, stl, ply, 3mf, fbx, step, iges) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional, and every node made carries source.path and source.node metadata."), cmd("file.close", Full, true, false, "Close the document, leaving an empty one, and stop rendering."), cmd("file.export_image", Nothing, false, false, "Write the latest progressive frame to png, hdr or exr."), cmd("file.export_model", Nothing, false, false, "Write the visible document as a binary glTF (.glb)."), @@ -107,7 +107,7 @@ pub(crate) fn engine_schema(name: &str) -> Value { ], &[], ), - "file.open" => obj(vec![("path", s("A .fshot project or a model file"))], &["path"]), + "file.open" => crate::ext::import::file_open_schema(), "file.save" => obj(vec![("path", s("Target .fshot; the document's own path when absent"))], &[]), "file.import" => crate::ext::import::file_import_schema(), "file.export_image" => obj(vec![("path", s("Target file")), ("format", picture_format()), ("denoise", b("Denoise first"))], &["path"]), diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 73eae120..4dcc4a6f 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -104,6 +104,19 @@ fn object(props: serde_json::Map, required: &[&str]) -> Value { pub(crate) fn file_import_schema() -> Value { object(options::properties(), &["path"]) } + +/// The `file.open` argument schema: a project, or a model opened as a new document with the import options (the +/// camera is always framed, so `frame` is not one of them). +pub(crate) fn file_open_schema() -> Value { + let mut p = options::properties(); + p.remove("frame"); + p.insert( + "path".into(), + json!({"type": "string", "description": "A .fshot project, or a model file (glb, gltf, obj, stl, ply, 3mf, fbx, step, stp, iges, igs) opened as a new document; the other options apply to a model only"}), + ); + object(p, &["path"]) +} + /// `file.import` (and `file.open` of a model): reads the options, imports now, one undo step. pub(crate) fn import_now(engine: &Engine, st: &mut State, path: &Path, args: &Value, frame: Option) -> Result { let a = ImportArgs::parse(args, frame)?; diff --git a/native/crates/fsh-commands/src/ext/import/options.rs b/native/crates/fsh-commands/src/ext/import/options.rs index c77981e8..ed2e25c0 100644 --- a/native/crates/fsh-commands/src/ext/import/options.rs +++ b/native/crates/fsh-commands/src/ext/import/options.rs @@ -135,7 +135,7 @@ fn enum_of(values: &[&str], desc: &str) -> Value { /// Schema properties shared by `file.import` and `import.start`. pub(crate) fn properties() -> Map { let mut p = Map::new(); - p.insert("path".into(), json!({"type": "string", "description": "Model file: glb, gltf, obj, stl, ply (3mf, fbx, step, iges where the readers support them)"})); + p.insert("path".into(), json!({"type": "string", "description": "Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker"})); p.insert("name".into(), json!({"type": "string", "description": "Name for the imported group (the original file name)"})); p.insert("units".into(), enum_of(UNITS, "Unit the file is in; auto takes what the file declares, else a guess from its size")); p.insert("up_axis".into(), enum_of(UP_AXES, "Axis that points up in the file; auto takes what the file declares, else y")); @@ -150,8 +150,8 @@ pub(crate) fn properties() -> Map { "oneOf": [ {"type": "string", "enum": CAD_QUALITIES}, {"type": "object", "properties": { - "chord": {"type": "number", "exclusiveMinimum": 0, "description": "Largest distance between the surface and its triangles, in metres"}, - "angle": {"type": "number", "exclusiveMinimum": 0, "description": "Largest angle between neighbouring triangle normals, in degrees"} + "chord": {"type": "number", "exclusiveMinimum": 0, "maximum": 0.1, "description": "Largest distance between the surface and its triangles, as a fraction of the model's bounding-box diagonal"}, + "angle": {"type": "number", "minimum": 1, "maximum": 90, "description": "Largest angle between neighbouring triangle normals, in degrees"} }, "required": ["chord", "angle"]} ] }), From 40408cc9ff1d4d49ce521d2e0c2aa92cc13798cc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:51:20 -0500 Subject: [PATCH 129/494] feat(cad): report what the worker can and cannot tell in cad.status cad.status gains capabilities: progress per body, body colours, STEP face colours and IGES colours read from the file, instance transforms derived from matching tessellations, no PMI, each with the reason taken from the worker's protocol, so the window and the owner see what FormCAD would have to add. Ran cad.status with probe through the release CLI (OCCT 8.0.1, protocol 2). --- native/crates/fsh-commands/src/ext/cad.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index afc631d0..77651b5a 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -592,6 +592,17 @@ mod native { } + fn capabilities() -> Value { + json!({ + "progress": {"supported": "per body", "reason": "the worker answers each request with one line and sends no progress while it opens a file or tessellates one body"}, + "body_colours": {"supported": true}, + "face_colours": {"supported": "STEP, from the file", "reason": "xde_read reports one rgb per body (label_color on the body's shape), never a colour per face; FormShot reads STEP face styles itself and matches each body to the one manifold solid with its face count (faces in shell order), and reads face_rgb when a worker sends it"}, + "iges_colours": {"supported": "from the file", "reason": "the worker gives IGES bodies no colour; FormShot reads the colours and names of the file's manifold solids (entity 186) when they match the bodies one to one"}, + "instance_transforms": {"supported": "derived", "reason": "xde_read returns bodies already placed and only the shared def key; FormShot recovers each instance's transform by matching its tessellation to the first one"}, + "pmi": {"supported": false, "reason": "not asked for (pmi: false)"}, + }) + } + pub(super) fn status(probe: bool) -> Value { let cache = fsh_cad::workers_dir().map(|p| p.to_string_lossy().to_string()); let installed: Vec = @@ -610,6 +621,7 @@ mod native { "cache": cache, "installed": installed, "protocol": PROTOCOL, + "capabilities": capabilities(), }); if probe { match Worker::start(&located, Duration::from_secs(90), None) { From d32633f12cce568cc800e9cafdfeddac450e3d3a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:52:46 -0500 Subject: [PATCH 130/494] fix(cad): keep the wasm32 build free of dead code and large variants keep_source now lives once outside the native module, so the browser build uses the journal hook too, and the mesh import job result is boxed so the job enum stays small when the CAD variant is empty. Verified with cargo clippy --target wasm32-unknown-unknown -p fsh-format -p fsh-scene -p fsh-commands -D warnings. --- native/crates/fsh-commands/src/ext/cad.rs | 27 +++++++------------ .../fsh-commands/src/ext/import/jobs.rs | 6 ++--- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 77651b5a..1a0f42a0 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -115,7 +115,14 @@ pub(crate) fn reread(path: &Path, stored: &Value, doc: &fsh_scene::Document, top /// Keeps a CAD source in the project and the crash journal; true when kept. pub(crate) fn keep_source(st: &mut State, source: Option<(Vec, String)>) -> bool { - native::keep_source(st, source) + let kept = match source { + Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), + None => false, + }; + if kept { + st.note_sources(); + } + kept } #[cfg(not(target_arch = "wasm32"))] @@ -316,18 +323,6 @@ mod native { Ok((cmd, reference)) } - /// Keeps a CAD source in the project (and the crash journal); true when it is kept. - pub(crate) fn keep_source(st: &mut State, source: Option<(Vec, String)>) -> bool { - let kept = match source { - Some((bytes, ext)) => st.kept.keep_source(bytes, &ext).is_ok(), - None => false, - }; - if kept { - st.note_sources(); - } - kept - } - /// The `scene.import` a re-import compares against the document: the file read again with the import's stored /// options, tagged like an import; also the source bytes to keep when the re-import applies. pub(crate) fn reread(path: &Path, stored: &Value, doc: &fsh_scene::Document, top: NodeId) -> Result { @@ -382,7 +377,7 @@ mod native { return Err(e); } }; - let kept = keep_source(st, p.source); + let kept = super::keep_source(st, p.source); let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("file.import"); reply["report"] = json!({ @@ -681,10 +676,6 @@ mod native { Err(IoError::Unsupported(NO_WORKER.into()).into()) } - pub(super) fn keep_source(_st: &mut State, _source: Option<(Vec, String)>) -> bool { - false - } - pub(super) fn retessellate(_engine: &Engine, _st: &mut State, _args: &Value) -> Result { Err(IoError::Unsupported(NO_WORKER.into()).into()) } diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index 8ec214ae..43593ff6 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -15,7 +15,7 @@ const KEEP_FINISHED: usize = 64; const STALE: &str = "the document changed (file.new, file.open, file.close or file.recover) while the job ran; nothing was applied"; enum Work { - Mesh(Prepared), + Mesh(Box), Cad(crate::ext::cad::Prepared), } @@ -126,7 +126,7 @@ pub(crate) fn start(st: &mut State, path: PathBuf, args: ImportArgs) -> Result run::apply(engine, st, p, &args), + Work::Mesh(p) => run::apply(engine, st, *p, &args), Work::Cad(p) => crate::ext::cad::apply(engine, st, p, &cad_args(&args), args.frame), }); match applied { From 3483a8f0c3d2a34eb2b7b1945e713f163ebe99ce Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:57:22 -0500 Subject: [PATCH 131/494] fix(import): box the cad job result too Boxing only the mesh result left the CAD variant large on native builds, which clippy refuses; both results are boxed now. Verified with cargo clippy -D warnings on fsh-commands for the native and wasm32 targets. --- native/crates/fsh-commands/src/ext/import/jobs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/jobs.rs b/native/crates/fsh-commands/src/ext/import/jobs.rs index 43593ff6..19d6a4a3 100644 --- a/native/crates/fsh-commands/src/ext/import/jobs.rs +++ b/native/crates/fsh-commands/src/ext/import/jobs.rs @@ -16,7 +16,7 @@ const STALE: &str = "the document changed (file.new, file.open, file.close or fi enum Work { Mesh(Box), - Cad(crate::ext::cad::Prepared), + Cad(Box), } enum JobState { @@ -124,7 +124,7 @@ pub(crate) fn start(st: &mut State, path: PathBuf, args: ImportArgs) -> Result run::apply(engine, st, *p, &args), - Work::Cad(p) => crate::ext::cad::apply(engine, st, p, &cad_args(&args), args.frame), + Work::Cad(p) => crate::ext::cad::apply(engine, st, *p, &cad_args(&args), args.frame), }); match applied { Ok(mut reply) => { From 1b6e8edd1373ebe089bace9a503a8e17dd42d732 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:57:22 -0500 Subject: [PATCH 132/494] fix(cad): honour merge for a step file with a single part merge promises one top group; a CAD file whose only top node is a part now gets a group named after the file around it, tagged as the whole-file group so re-import still matches. Ran through the release CLI: featuretype.STEP imports as one part without merge and as a group holding the part with merge. --- native/crates/fsh-commands/src/ext/cad.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 1a0f42a0..931c0acb 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -314,12 +314,33 @@ mod native { } } + /// With merge, a file whose one top node is a part still gets a group named after the file around it, as + /// file.import's merge promises; true when the group was added. + fn merge_single_part(cmd: &mut Command, name: &str) -> bool { + let Command::Import(imp) = cmd else { return false }; + let p = &mut imp.payload; + let tops: Vec = p.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); + let [top] = tops[..] else { return false }; + if matches!(p.nodes[top].node.kind, NodeKind::Group) { + return false; + } + let meshes = p.meshes.iter().map(|m| m.key.raw()); + let materials = p.materials.iter().map(|m| m.key.raw()); + let textures = p.textures.iter().map(|t| t.key.raw()); + let next = meshes.chain(materials).chain(textures).chain(p.nodes.iter().map(|n| n.id.raw())).max().unwrap_or(0) + 1; + let id = NodeId::new(next); + p.nodes[top].node.parent = Some(id); + p.nodes.insert(0, fsh_scene::ImportNode { id, node: fsh_scene::Node::new(name, NodeKind::Group) }); + true + } + fn import_command(p: &Prepared, doc: &fsh_scene::Document, args: &Value) -> Result<(Command, String)> { let wrap = wrap_of(args); let roots = p.raw.nodes.iter().filter(|n| n.parent.is_none()).count(); let mut cmd = fsh_io::to_import_command(&p.raw, doc, &ImportOptions { parent: None, wrap_in_group: wrap }, &Watch::new())?; + let merged = opt_bool(args, "merge") == Some(true) && merge_single_part(&mut cmd, &p.raw.name); let reference = reference_of(p); - tag_payload(&mut cmd, p, wrap && roots > 1, &reference, args); + tag_payload(&mut cmd, p, merged || (wrap && roots > 1), &reference, args); Ok((cmd, reference)) } From 2da231cb55143c3b71d91485d37d28f6882257f3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:59:53 -0500 Subject: [PATCH 133/494] feat(cad): answer options and source in the cad import reply A STEP or IGES import now replies with the resolved options and the absolute source path like other models, so formshot-engine info and the window show them. Ran formshot-engine info on the gearbox STEP: options units auto, up auto, floor true, center false, merge false. --- native/crates/fsh-commands/src/ext/cad.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/native/crates/fsh-commands/src/ext/cad.rs b/native/crates/fsh-commands/src/ext/cad.rs index 931c0acb..473c506a 100644 --- a/native/crates/fsh-commands/src/ext/cad.rs +++ b/native/crates/fsh-commands/src/ext/cad.rs @@ -417,6 +417,16 @@ mod native { cad["kept"] = json!(kept); cad["triangles"] = json!(p.raw.triangle_count()); reply["cad"] = cad; + let clean = clean_options(args).unwrap_or_default(); + reply["options"] = json!({ + "units": opt_str(args, "units").unwrap_or("auto"), + "up_axis": opt_str(args, "up_axis").unwrap_or("auto"), + "stand_on_floor": clean.stand_on_floor, + "center": clean.centre, + "merge": opt_bool(args, "merge").unwrap_or(false), + "cad_quality": p.quality.to_json(), + }); + reply["source"] = json!(p.path.to_string_lossy()); Ok(reply) } From eb31539391a43b10424f4a53366af5ee0e8c3dc2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:02:43 -0500 Subject: [PATCH 134/494] feat(i18n): translate the import page into four languages Translated all import strings into German, French, Italian and Spanish, keeping placeholders and format names. ./formshot i18n check passed and each placeholder set matches the English key. --- frontend/src/i18n/modules/import/de.json | 172 +++++++++++----------- frontend/src/i18n/modules/import/es.json | 174 +++++++++++------------ frontend/src/i18n/modules/import/fr.json | 168 +++++++++++----------- frontend/src/i18n/modules/import/it.json | 174 +++++++++++------------ 4 files changed, 344 insertions(+), 344 deletions(-) diff --git a/frontend/src/i18n/modules/import/de.json b/frontend/src/i18n/modules/import/de.json index ac317572..7cb276c0 100644 --- a/frontend/src/i18n/modules/import/de.json +++ b/frontend/src/i18n/modules/import/de.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "3D-Modelle", + "Automatic": "Automatisch", + "CAD quality": "CAD-Qualität", + "Centimetres (cm)": "Zentimeter (cm)", + "Centre on the origin": "Auf den Ursprung zentrieren", + "Choose model files and import them into the scene with options.": "Wähle Modelldateien aus und importiere sie mit Optionen in die Szene.", + "Cleaning up meshes": "Meshes werden bereinigt", + "Clear Recent Imports": "Zuletzt importierte Dateien löschen", + "Could not import the file: {reason}": "Die Datei konnte nicht importiert werden: {reason}", + "Could not import {name}: {reason}": "{name} konnte nicht importiert werden: {reason}", + "Could not open {name}: {reason}": "{name} konnte nicht geöffnet werden: {reason}", + "Could not read the file: {reason}": "Die Datei konnte nicht gelesen werden: {reason}", + "Could not reimport: {reason}": "Erneutes Importieren nicht möglich: {reason}", + "Could not send the file: {reason}": "Die Datei konnte nicht gesendet werden: {reason}", + "Discard unsaved changes?": "Nicht gespeicherte Änderungen verwerfen?", + "Draft": "Entwurf", + "Drop to import into the scene": "Zum Importieren in die Szene ablegen", + "Feet (ft)": "Fuß (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot öffnet jeweils ein Projekt; {n} weitere Projektdateien wurden nicht geöffnet.", + "Frame the view after import": "Ansicht nach dem Import einpassen", + "High": "Hoch", + "Import": "Importieren", + "Import All": "Alle importieren", + "Import Files": "Dateien importieren", + "Import Model": "Modell importieren", + "Import Recent File": "Zuletzt verwendete Datei importieren", + "Imported {name}.": "{name} importiert.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} importiert: {parts} Teile, {triangles} Dreiecke.", + "Imported {name}: {parts} parts.": "{name} importiert: {parts} Teile.", + "Importing": "Import läuft", + "In this file": "In dieser Datei", + "Inches (in)": "Zoll (in)", + "Making materials": "Materialien werden erstellt", + "Materials": "Materialien", + "Medium": "Mittel", + "Merge into one group": "In einer Gruppe zusammenführen", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Millimeter (mm)", + "No Recent Imports": "Keine zuletzt importierten Dateien", + "No warnings.": "Keine Warnungen.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nichts zu importieren: FormShot importiert GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- und IGES-Dateien.", + "One file beside it": "Eine Datei daneben", + "Opening {name} will close the open project and discard its unsaved changes.": "Beim Öffnen von {name} wird das geöffnete Projekt geschlossen und seine nicht gespeicherten Änderungen gehen verloren.", + "Options": "Optionen", + "Parts": "Teile", + "Placing in the scene": "Platzierung in der Szene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Liest die Quelldateien der ausgewählten Teile (oder aller importierten Teile) erneut ein und behält ihre Materialien.", + "Reading the file": "Datei wird gelesen", + "Reading the file...": "Datei wird gelesen ...", + "Recent Imports": "Zuletzt importiert", + "Reimport": "Erneut importieren", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Erneut importiert: {matched} aktualisiert, {added} neu, {hidden} ausgeblendet.", + "Send model files to FormShot and import them into the scene with options.": "Sende Modelldateien an FormShot und importiere sie mit Optionen in die Szene.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Mehrere Dateien werden nacheinander importiert. Puffer, Materialien und Texturen neben einem Modell gehören dazu.", + "Size": "Größe", + "Stand on the floor": "Auf den Boden stellen", + "Tessellating CAD surfaces": "CAD-Flächen werden trianguliert", + "The engine decides from the file.": "Die Engine entscheidet anhand der Datei.", + "The engine did not start an import job": "Die Engine hat keinen Importauftrag gestartet", + "The engine did not start in time, so the files FormShot was given were not opened.": "Die Engine wurde nicht rechtzeitig gestartet, daher wurden die an FormShot übergebenen Dateien nicht geöffnet.", + "The file says it is in {unit}.": "Die Datei gibt {unit} als Einheit an.", + "The import failed": "Der Import ist fehlgeschlagen", + "The import goes on; the files after it were not imported.": "Der Import läuft weiter; die nachfolgenden Dateien wurden nicht importiert.", + "The import of {name} was cancelled.": "Der Import von {name} wurde abgebrochen.", + "The upload failed ({status})": "Der Upload ist fehlgeschlagen ({status})", + "The upload was cancelled": "Der Upload wurde abgebrochen", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Diese Engine kann vor dem Import nicht in eine Datei hineinsehen, daher bleibt die Zusammenfassung leer.", + "This engine cannot stop an import once it has started": "Diese Engine kann einen gestarteten Import nicht mehr anhalten", + "This engine imports in one step, so there is no progress to show or stop.": "Diese Engine importiert in einem Schritt, daher gibt es keinen Fortschritt anzuzeigen oder zu stoppen.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Diese Datei nennt ihre Einheiten nicht. FormShot hat aus der Größe {unit} geschätzt; prüfe das vor dem Import.", + "Triangles": "Dreiecke", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Einheiten", + "Up axis": "Achse nach oben", + "Up axis in file": "Achse nach oben in der Datei", + "Uploading": "Upload läuft", + "Y is up": "Y zeigt nach oben", + "Z is up": "Z zeigt nach oben", + "centimetres": "Zentimeter", + "feet": "Fuß", + "inches": "Zoll", + "metres": "Meter", + "millimetres": "Millimeter", + "{i} of {n}": "{i} von {n}", + "{n} files beside it": "{n} Dateien daneben", + "{n} files were not imported.": "{n} Dateien wurden nicht importiert.", + "{n} warnings; the Scene page lists the parts.": "{n} Warnungen; die Szenenseite listet die Teile auf." } diff --git a/frontend/src/i18n/modules/import/es.json b/frontend/src/i18n/modules/import/es.json index ac317572..13d1a092 100644 --- a/frontend/src/i18n/modules/import/es.json +++ b/frontend/src/i18n/modules/import/es.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "Modelos 3D", + "Automatic": "Automático", + "CAD quality": "Calidad CAD", + "Centimetres (cm)": "Centímetros (cm)", + "Centre on the origin": "Centrar en el origen", + "Choose model files and import them into the scene with options.": "Elige archivos de modelo e impórtalos en la escena con opciones.", + "Cleaning up meshes": "Limpiando las mallas", + "Clear Recent Imports": "Borrar importaciones recientes", + "Could not import the file: {reason}": "No se pudo importar el archivo: {reason}", + "Could not import {name}: {reason}": "No se pudo importar {name}: {reason}", + "Could not open {name}: {reason}": "No se pudo abrir {name}: {reason}", + "Could not read the file: {reason}": "No se pudo leer el archivo: {reason}", + "Could not reimport: {reason}": "No se pudo reimportar: {reason}", + "Could not send the file: {reason}": "No se pudo enviar el archivo: {reason}", + "Discard unsaved changes?": "¿Descartar los cambios sin guardar?", + "Draft": "Borrador", + "Drop to import into the scene": "Suelta para importar en la escena", + "Feet (ft)": "Pies (ft)", + "Format": "Formato", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot abre un solo proyecto a la vez; {n} archivos de proyecto más se quedaron sin abrir.", + "Frame the view after import": "Encuadrar la vista tras importar", + "High": "Alta", + "Import": "Importar", + "Import All": "Importar todo", + "Import Files": "Importar archivos", + "Import Model": "Importar modelo", + "Import Recent File": "Importar archivo reciente", + "Imported {name}.": "Se importó {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Se importó {name}: {parts} piezas, {triangles} triángulos.", + "Imported {name}: {parts} parts.": "Se importó {name}: {parts} piezas.", + "Importing": "Importando", + "In this file": "En este archivo", + "Inches (in)": "Pulgadas (in)", + "Making materials": "Creando los materiales", + "Materials": "Materiales", + "Medium": "Media", + "Merge into one group": "Combinar en un solo grupo", + "Metres (m)": "Metros (m)", + "Millimetres (mm)": "Milímetros (mm)", + "No Recent Imports": "Sin importaciones recientes", + "No warnings.": "Sin advertencias.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nada que importar: FormShot importa archivos GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP e IGES.", + "One file beside it": "Un archivo al lado", + "Opening {name} will close the open project and discard its unsaved changes.": "Al abrir {name} se cerrará el proyecto abierto y se descartarán sus cambios sin guardar.", + "Options": "Opciones", + "Parts": "Piezas", + "Placing in the scene": "Colocando en la escena", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Vuelve a leer los archivos de origen de las piezas seleccionadas (o de todas las importadas) conservando sus materiales.", + "Reading the file": "Leyendo el archivo", + "Reading the file...": "Leyendo el archivo...", + "Recent Imports": "Importaciones recientes", + "Reimport": "Reimportar", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimportado: {matched} actualizadas, {added} nuevas, {hidden} ocultas.", + "Send model files to FormShot and import them into the scene with options.": "Envía archivos de modelo a FormShot e impórtalos en la escena con opciones.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Varios archivos se importan uno tras otro. Los búferes, materiales y texturas junto a un modelo se importan con él.", + "Size": "Tamaño", + "Stand on the floor": "Apoyar en el suelo", + "Tessellating CAD surfaces": "Teselando las superficies CAD", + "The engine decides from the file.": "El motor lo decide a partir del archivo.", + "The engine did not start an import job": "El motor no inició ninguna tarea de importación", + "The engine did not start in time, so the files FormShot was given were not opened.": "El motor no arrancó a tiempo, así que los archivos entregados a FormShot no se abrieron.", + "The file says it is in {unit}.": "El archivo indica que está en {unit}.", + "The import failed": "La importación falló", + "The import goes on; the files after it were not imported.": "La importación continúa; los archivos siguientes no se importaron.", + "The import of {name} was cancelled.": "Se canceló la importación de {name}.", + "The upload failed ({status})": "La subida falló ({status})", + "The upload was cancelled": "Se canceló la subida", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Este motor no puede mirar dentro de un archivo antes de importarlo, así que el resumen queda vacío.", + "This engine cannot stop an import once it has started": "Este motor no puede detener una importación una vez iniciada", + "This engine imports in one step, so there is no progress to show or stop.": "Este motor importa en un solo paso, así que no hay progreso que mostrar ni detener.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Este archivo no indica sus unidades. FormShot supuso {unit} por su tamaño; compruébalo antes de importar.", + "Triangles": "Triángulos", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Unidades", + "Up axis": "Eje vertical", + "Up axis in file": "Eje vertical en el archivo", + "Uploading": "Subiendo", + "Y is up": "Y es hacia arriba", + "Z is up": "Z es hacia arriba", + "centimetres": "centímetros", + "feet": "pies", + "inches": "pulgadas", + "metres": "metros", + "millimetres": "milímetros", + "{i} of {n}": "{i} de {n}", + "{n} files beside it": "{n} archivos al lado", + "{n} files were not imported.": "{n} archivos no se importaron.", + "{n} warnings; the Scene page lists the parts.": "{n} advertencias; la página de escena enumera las piezas." } diff --git a/frontend/src/i18n/modules/import/fr.json b/frontend/src/i18n/modules/import/fr.json index ac317572..7d66f0c9 100644 --- a/frontend/src/i18n/modules/import/fr.json +++ b/frontend/src/i18n/modules/import/fr.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "Modèles 3D", + "Automatic": "Automatique", + "CAD quality": "Qualité CAO", + "Centimetres (cm)": "Centimètres (cm)", + "Centre on the origin": "Centrer sur l'origine", + "Choose model files and import them into the scene with options.": "Choisissez des fichiers de modèle et importez-les dans la scène avec des options.", + "Cleaning up meshes": "Nettoyage des maillages", + "Clear Recent Imports": "Effacer les imports récents", + "Could not import the file: {reason}": "Impossible d'importer le fichier : {reason}", + "Could not import {name}: {reason}": "Impossible d'importer {name} : {reason}", + "Could not open {name}: {reason}": "Impossible d'ouvrir {name} : {reason}", + "Could not read the file: {reason}": "Impossible de lire le fichier : {reason}", + "Could not reimport: {reason}": "Impossible de réimporter : {reason}", + "Could not send the file: {reason}": "Impossible d'envoyer le fichier : {reason}", + "Discard unsaved changes?": "Abandonner les modifications non enregistrées ?", + "Draft": "Brouillon", + "Drop to import into the scene": "Déposer pour importer dans la scène", + "Feet (ft)": "Pieds (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot ouvre un seul projet à la fois ; {n} autres fichiers de projet n'ont pas été ouverts.", + "Frame the view after import": "Cadrer la vue après l'import", + "High": "Élevée", + "Import": "Importer", + "Import All": "Tout importer", + "Import Files": "Importer des fichiers", + "Import Model": "Importer un modèle", + "Import Recent File": "Importer un fichier récent", + "Imported {name}.": "{name} importé.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} importé : {parts} pièces, {triangles} triangles.", + "Imported {name}: {parts} parts.": "{name} importé : {parts} pièces.", + "Importing": "Import en cours", + "In this file": "Dans ce fichier", + "Inches (in)": "Pouces (in)", + "Making materials": "Création des matériaux", + "Materials": "Matériaux", + "Medium": "Moyenne", + "Merge into one group": "Fusionner en un seul groupe", + "Metres (m)": "Mètres (m)", + "Millimetres (mm)": "Millimètres (mm)", + "No Recent Imports": "Aucun import récent", + "No warnings.": "Aucun avertissement.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Rien à importer : FormShot importe les fichiers GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP et IGES.", + "One file beside it": "Un fichier à côté", + "Opening {name} will close the open project and discard its unsaved changes.": "L'ouverture de {name} fermera le projet ouvert et abandonnera ses modifications non enregistrées.", "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", + "Parts": "Pièces", + "Placing in the scene": "Placement dans la scène", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Relit les fichiers source des pièces sélectionnées (ou de toutes les pièces importées) en conservant leurs matériaux.", + "Reading the file": "Lecture du fichier", + "Reading the file...": "Lecture du fichier...", + "Recent Imports": "Imports récents", + "Reimport": "Réimporter", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Réimporté : {matched} mis à jour, {added} nouveaux, {hidden} masqués.", + "Send model files to FormShot and import them into the scene with options.": "Envoyez des fichiers de modèle à FormShot et importez-les dans la scène avec des options.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Plusieurs fichiers sont importés l'un après l'autre. Les tampons, matériaux et textures situés à côté d'un modèle l'accompagnent.", + "Size": "Taille", + "Stand on the floor": "Poser sur le sol", + "Tessellating CAD surfaces": "Tessellation des surfaces CAO", + "The engine decides from the file.": "Le moteur décide à partir du fichier.", + "The engine did not start an import job": "Le moteur n'a pas lancé de tâche d'import", + "The engine did not start in time, so the files FormShot was given were not opened.": "Le moteur n'a pas démarré à temps, les fichiers transmis à FormShot n'ont donc pas été ouverts.", + "The file says it is in {unit}.": "Le fichier indique être en {unit}.", + "The import failed": "L'import a échoué", + "The import goes on; the files after it were not imported.": "L'import se poursuit ; les fichiers suivants n'ont pas été importés.", + "The import of {name} was cancelled.": "L'import de {name} a été annulé.", + "The upload failed ({status})": "Le téléversement a échoué ({status})", + "The upload was cancelled": "Le téléversement a été annulé", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Ce moteur ne peut pas examiner un fichier avant de l'importer, le résumé reste donc vide.", + "This engine cannot stop an import once it has started": "Ce moteur ne peut pas arrêter un import une fois commencé", + "This engine imports in one step, so there is no progress to show or stop.": "Ce moteur importe en une seule étape, il n'y a donc aucune progression à afficher ni à arrêter.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Ce fichier n'indique pas ses unités. FormShot a estimé {unit} d'après sa taille ; vérifiez-le avant d'importer.", "Triangles": "Triangles", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Unités", + "Up axis": "Axe vertical", + "Up axis in file": "Axe vertical dans le fichier", + "Uploading": "Téléversement en cours", + "Y is up": "Y est vers le haut", + "Z is up": "Z est vers le haut", + "centimetres": "centimètres", + "feet": "pieds", + "inches": "pouces", + "metres": "mètres", + "millimetres": "millimètres", + "{i} of {n}": "{i} sur {n}", + "{n} files beside it": "{n} fichiers à côté", + "{n} files were not imported.": "{n} fichiers n'ont pas été importés.", + "{n} warnings; the Scene page lists the parts.": "{n} avertissements ; la page Scène liste les pièces." } diff --git a/frontend/src/i18n/modules/import/it.json b/frontend/src/i18n/modules/import/it.json index ac317572..f7f54c58 100644 --- a/frontend/src/i18n/modules/import/it.json +++ b/frontend/src/i18n/modules/import/it.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "Modelli 3D", + "Automatic": "Automatico", + "CAD quality": "Qualità CAD", + "Centimetres (cm)": "Centimetri (cm)", + "Centre on the origin": "Centra sull'origine", + "Choose model files and import them into the scene with options.": "Scegli i file dei modelli e importali nella scena con le opzioni.", + "Cleaning up meshes": "Pulizia delle mesh", + "Clear Recent Imports": "Cancella importazioni recenti", + "Could not import the file: {reason}": "Impossibile importare il file: {reason}", + "Could not import {name}: {reason}": "Impossibile importare {name}: {reason}", + "Could not open {name}: {reason}": "Impossibile aprire {name}: {reason}", + "Could not read the file: {reason}": "Impossibile leggere il file: {reason}", + "Could not reimport: {reason}": "Impossibile reimportare: {reason}", + "Could not send the file: {reason}": "Impossibile inviare il file: {reason}", + "Discard unsaved changes?": "Scartare le modifiche non salvate?", + "Draft": "Bozza", + "Drop to import into the scene": "Rilascia per importare nella scena", + "Feet (ft)": "Piedi (ft)", + "Format": "Formato", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot apre un solo progetto alla volta; {n} altri file di progetto non sono stati aperti.", + "Frame the view after import": "Inquadra la vista dopo l'importazione", + "High": "Alta", + "Import": "Importa", + "Import All": "Importa tutto", + "Import Files": "Importa file", + "Import Model": "Importa modello", + "Import Recent File": "Importa file recente", + "Imported {name}.": "{name} importato.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} importato: {parts} parti, {triangles} triangoli.", + "Imported {name}: {parts} parts.": "{name} importato: {parts} parti.", + "Importing": "Importazione in corso", + "In this file": "In questo file", + "Inches (in)": "Pollici (in)", + "Making materials": "Creazione dei materiali", + "Materials": "Materiali", + "Medium": "Media", + "Merge into one group": "Unisci in un solo gruppo", + "Metres (m)": "Metri (m)", + "Millimetres (mm)": "Millimetri (mm)", + "No Recent Imports": "Nessuna importazione recente", + "No warnings.": "Nessun avviso.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Niente da importare: FormShot importa file GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP e IGES.", + "One file beside it": "Un file accanto", + "Opening {name} will close the open project and discard its unsaved changes.": "Aprendo {name} verrà chiuso il progetto aperto e le sue modifiche non salvate andranno perse.", + "Options": "Opzioni", + "Parts": "Parti", + "Placing in the scene": "Posizionamento nella scena", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Rilegge i file sorgente delle parti selezionate (o di tutte le parti importate) mantenendone i materiali.", + "Reading the file": "Lettura del file", + "Reading the file...": "Lettura del file...", + "Recent Imports": "Importazioni recenti", + "Reimport": "Reimporta", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimportato: {matched} aggiornati, {added} nuovi, {hidden} nascosti.", + "Send model files to FormShot and import them into the scene with options.": "Invia i file dei modelli a FormShot e importali nella scena con le opzioni.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Più file vengono importati uno dopo l'altro. Buffer, materiali e texture accanto a un modello vengono importati con esso.", + "Size": "Dimensione", + "Stand on the floor": "Appoggia sul piano", + "Tessellating CAD surfaces": "Tassellazione delle superfici CAD", + "The engine decides from the file.": "Il motore decide in base al file.", + "The engine did not start an import job": "Il motore non ha avviato un processo di importazione", + "The engine did not start in time, so the files FormShot was given were not opened.": "Il motore non si è avviato in tempo, quindi i file passati a FormShot non sono stati aperti.", + "The file says it is in {unit}.": "Il file dichiara di essere in {unit}.", + "The import failed": "L'importazione non è riuscita", + "The import goes on; the files after it were not imported.": "L'importazione prosegue; i file successivi non sono stati importati.", + "The import of {name} was cancelled.": "L'importazione di {name} è stata annullata.", + "The upload failed ({status})": "Il caricamento non è riuscito ({status})", + "The upload was cancelled": "Il caricamento è stato annullato", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Questo motore non può guardare dentro un file prima di importarlo, quindi il riepilogo resta vuoto.", + "This engine cannot stop an import once it has started": "Questo motore non può interrompere un'importazione già avviata", + "This engine imports in one step, so there is no progress to show or stop.": "Questo motore importa in un unico passaggio, quindi non c'è alcun avanzamento da mostrare o interrompere.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Questo file non indica le sue unità. FormShot ha ipotizzato {unit} dalle dimensioni; controlla prima di importare.", + "Triangles": "Triangoli", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Unità", + "Up axis": "Asse verticale", + "Up axis in file": "Asse verticale nel file", + "Uploading": "Caricamento in corso", + "Y is up": "Y è verso l'alto", + "Z is up": "Z è verso l'alto", + "centimetres": "centimetri", + "feet": "piedi", + "inches": "pollici", + "metres": "metri", + "millimetres": "millimetri", + "{i} of {n}": "{i} di {n}", + "{n} files beside it": "{n} file accanto", + "{n} files were not imported.": "{n} file non sono stati importati.", + "{n} warnings; the Scene page lists the parts.": "{n} avvisi; la pagina Scena elenca le parti." } From 5dc4a9f9ca461cf16ef14d6ea18df246067c9d41 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:10 -0500 Subject: [PATCH 135/494] feat(i18n): translate the handoff page into four languages Translated all handoff strings into German, French, Italian and Spanish, keeping placeholders and format names. ./formshot i18n check passed and each placeholder set matches the English key. --- frontend/src/i18n/modules/handoff/de.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/es.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/fr.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/it.json | 120 +++++++++++----------- 4 files changed, 240 insertions(+), 240 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/de.json b/frontend/src/i18n/modules/handoff/de.json index a93ea0c0..047e68d4 100644 --- a/frontend/src/i18n/modules/handoff/de.json +++ b/frontend/src/i18n/modules/handoff/de.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 von {count}", + "A Form app is handing something over": "Eine Form-App übergibt etwas", + "A mesh with maps by role": "Ein Mesh mit Maps nach Rolle", + "A model file": "Eine Modelldatei", + "Add to this document": "Zu diesem Dokument hinzufügen", + "Added {title} from {app}": "{title} aus {app} hinzugefügt", + "Always allow": "Immer erlauben", + "Always allow {app}": "{app} immer erlauben", + "An object from the GoF folder": "Ein Objekt aus dem GoF-Ordner", + "another app": "eine andere App", + "As a new document": "Als neues Dokument", + "Base colour": "Basisfarbe", + "Block": "Blockieren", + "Choose a hand-off or give a path": "Wähle eine Übergabe oder gib einen Pfad an", + "Contents": "Inhalt", + "Could not be read": "Konnte nicht gelesen werden", + "Decline": "Ablehnen", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot überwacht den GoF-Ordner und die Exporte von FormSurface, solange dieses Fenster geöffnet ist. Wenn eine Form-App etwas übergibt, fragt FormShot hier nach, bevor es geöffnet wird.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface-Exporte", + "From": "Von", + "GoF folder": "GoF-Ordner", + "Hand-off Settings": "Einstellungen für Übergaben", + "Hand-offs": "Übergaben", + "Hand-offs from {app}": "Übergaben von {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps nach Rolle, ohne Mesh", + "Metalness": "Metallizität", + "Normal": "Normale", + "not found": "nicht gefunden", + "Not read yet": "Noch nicht gelesen", + "Nothing from the Form apps is waiting in their hand-off folders.": "In den Übergabeordnern der Form-Apps wartet nichts.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nichts wird geöffnet, bevor du es auswählst. Texturen bleiben dort, wo die App sie geschrieben hat, und werden nach Rolle referenziert.", + "Occlusion, roughness and metalness": "Okklusion, Rauheit und Metallizität", + "Opacity": "Deckkraft", + "Open a Hand-off": "Übergabe öffnen", + "Open a Hand-off...": "Übergabe öffnen ...", + "Open it": "Öffnen", + "Open once": "Einmal öffnen", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Öffnen, was FormSculpt, FormFabric, FormSurface oder FormCAD übergeben haben", + "Opened {title} from {app} as a new document": "{title} aus {app} als neues Dokument geöffnet", + "Or a path to a file or folder": "Oder ein Pfad zu einer Datei oder einem Ordner", + "Other maps": "Weitere Maps", + "Reading...": "Wird gelesen ...", + "Roughness": "Rauheit", + "Sent as": "Gesendet als", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Der FormShot-Dienst ist nicht erreichbar, daher lassen sich diese Optionen jetzt weder lesen noch ändern.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Was FormSculpt und FormFabric im GoF-Ordner abgelegt haben und was FormSurface exportiert hat. Das Öffnen von hier braucht keine Rückfrage, weil du es ausgewählt hast.", + "{app} is handing over {title}: {what}.": "{app} übergibt {title}: {what}.", + "{count} maps from FormSurface": "{count} Maps von FormSurface", + "{count} maps: {roles}": "{count} Maps: {roles}", + "{count} materials": "{count} Materialien", + "{format} file": "{format}-Datei", + "{format} file, {count} triangles": "{format}-Datei, {count} Dreiecke", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} Meshes, {triangles} Dreiecke, {materials} Materialien", + "{n} days ago": "vor {n} Tagen" } diff --git a/frontend/src/i18n/modules/handoff/es.json b/frontend/src/i18n/modules/handoff/es.json index a93ea0c0..b1f916db 100644 --- a/frontend/src/i18n/modules/handoff/es.json +++ b/frontend/src/i18n/modules/handoff/es.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 de {count}", + "A Form app is handing something over": "Una app de Form está traspasando algo", + "A mesh with maps by role": "Una malla con mapas por función", + "A model file": "Un archivo de modelo", + "Add to this document": "Añadir a este documento", + "Added {title} from {app}": "Se añadió {title} desde {app}", + "Always allow": "Permitir siempre", + "Always allow {app}": "Permitir siempre {app}", + "An object from the GoF folder": "Un objeto de la carpeta GoF", + "another app": "otra app", + "As a new document": "Como documento nuevo", + "Base colour": "Color base", + "Block": "Bloquear", + "Choose a hand-off or give a path": "Elige un traspaso o indica una ruta", + "Contents": "Contenido", + "Could not be read": "No se pudo leer", + "Decline": "Rechazar", + "Emission": "Emisión", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot vigila la carpeta GoF y las exportaciones de FormSurface mientras esta ventana está abierta. Cuando una app de Form traspasa algo, FormShot pregunta aquí antes de abrirlo.", + "FormSurface": "FormSurface", + "FormSurface exports": "Exportaciones de FormSurface", + "From": "De", + "GoF folder": "Carpeta GoF", + "Hand-off Settings": "Ajustes de traspasos", + "Hand-offs": "Traspasos", + "Hand-offs from {app}": "Traspasos desde {app}", + "Maps": "Mapas", + "Maps by role, without a mesh": "Mapas por función, sin malla", + "Metalness": "Metalicidad", + "Normal": "Normal", + "not found": "no encontrado", + "Not read yet": "Aún sin leer", + "Nothing from the Form apps is waiting in their hand-off folders.": "No hay nada de las apps de Form esperando en sus carpetas de traspaso.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "No se abre nada hasta que lo elijas. Las texturas se quedan donde la app las escribió y se referencian por función.", + "Occlusion, roughness and metalness": "Oclusión, rugosidad y metalicidad", + "Opacity": "Opacidad", + "Open a Hand-off": "Abrir un traspaso", + "Open a Hand-off...": "Abrir un traspaso...", + "Open it": "Abrir", + "Open once": "Abrir una vez", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Abrir lo que FormSculpt, FormFabric, FormSurface o FormCAD han traspasado", + "Opened {title} from {app} as a new document": "Se abrió {title} desde {app} como documento nuevo", + "Or a path to a file or folder": "O una ruta a un archivo o a una carpeta", + "Other maps": "Otros mapas", + "Reading...": "Leyendo...", + "Roughness": "Rugosidad", + "Sent as": "Enviado como", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "El servicio de FormShot no está disponible, así que ahora no se pueden leer ni cambiar estas opciones.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Lo que FormSculpt y FormFabric han puesto en la carpeta GoF y lo que FormSurface ha exportado. Abrirlo desde aquí no pide confirmación, porque lo has elegido tú.", + "{app} is handing over {title}: {what}.": "{app} está traspasando {title}: {what}.", + "{count} maps from FormSurface": "{count} mapas de FormSurface", + "{count} maps: {roles}": "{count} mapas: {roles}", + "{count} materials": "{count} materiales", + "{format} file": "Archivo {format}", + "{format} file, {count} triangles": "Archivo {format}, {count} triángulos", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} mallas, {triangles} triángulos, {materials} materiales", + "{n} days ago": "hace {n} días" } diff --git a/frontend/src/i18n/modules/handoff/fr.json b/frontend/src/i18n/modules/handoff/fr.json index a93ea0c0..e1d28754 100644 --- a/frontend/src/i18n/modules/handoff/fr.json +++ b/frontend/src/i18n/modules/handoff/fr.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 sur {count}", + "A Form app is handing something over": "Une application Form transmet quelque chose", + "A mesh with maps by role": "Un maillage avec des maps par rôle", + "A model file": "Un fichier de modèle", + "Add to this document": "Ajouter à ce document", + "Added {title} from {app}": "{title} ajouté depuis {app}", + "Always allow": "Toujours autoriser", + "Always allow {app}": "Toujours autoriser {app}", + "An object from the GoF folder": "Un objet du dossier GoF", + "another app": "une autre application", + "As a new document": "Comme nouveau document", + "Base colour": "Couleur de base", + "Block": "Bloquer", + "Choose a hand-off or give a path": "Choisissez un transfert ou indiquez un chemin", + "Contents": "Contenu", + "Could not be read": "Lecture impossible", + "Decline": "Refuser", + "Emission": "Émission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot surveille le dossier GoF et les exports de FormSurface tant que cette fenêtre est ouverte. Lorsqu'une application Form transmet quelque chose, FormShot demande ici avant de l'ouvrir.", + "FormSurface": "FormSurface", + "FormSurface exports": "Exports FormSurface", + "From": "De", + "GoF folder": "Dossier GoF", + "Hand-off Settings": "Réglages des transferts", + "Hand-offs": "Transferts", + "Hand-offs from {app}": "Transferts depuis {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps par rôle, sans maillage", + "Metalness": "Métallicité", + "Normal": "Normale", + "not found": "introuvable", + "Not read yet": "Pas encore lu", + "Nothing from the Form apps is waiting in their hand-off folders.": "Rien ne les attend dans les dossiers de transfert des applications Form.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Rien n'est ouvert tant que vous n'avez pas choisi. Les textures restent là où l'application les a écrites et sont référencées par rôle.", + "Occlusion, roughness and metalness": "Occlusion, rugosité et métallicité", + "Opacity": "Opacité", + "Open a Hand-off": "Ouvrir un transfert", + "Open a Hand-off...": "Ouvrir un transfert...", + "Open it": "Ouvrir", + "Open once": "Ouvrir une fois", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Ouvrir ce que FormSculpt, FormFabric, FormSurface ou FormCAD ont transmis", + "Opened {title} from {app} as a new document": "{title} ouvert depuis {app} comme nouveau document", + "Or a path to a file or folder": "Ou un chemin vers un fichier ou un dossier", + "Other maps": "Autres maps", + "Reading...": "Lecture...", + "Roughness": "Rugosité", + "Sent as": "Envoyé comme", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Le service FormShot est injoignable, ces choix ne peuvent donc être ni lus ni modifiés pour le moment.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Ce que FormSculpt et FormFabric ont déposé dans le dossier GoF et ce que FormSurface a exporté. L'ouverture depuis ici ne demande aucune confirmation, car c'est vous qui l'avez choisi.", + "{app} is handing over {title}: {what}.": "{app} transmet {title} : {what}.", + "{count} maps from FormSurface": "{count} maps de FormSurface", + "{count} maps: {roles}": "{count} maps : {roles}", + "{count} materials": "{count} matériaux", + "{format} file": "Fichier {format}", + "{format} file, {count} triangles": "Fichier {format}, {count} triangles", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} maillages, {triangles} triangles, {materials} matériaux", + "{n} days ago": "il y a {n} jours" } diff --git a/frontend/src/i18n/modules/handoff/it.json b/frontend/src/i18n/modules/handoff/it.json index a93ea0c0..ddd8185f 100644 --- a/frontend/src/i18n/modules/handoff/it.json +++ b/frontend/src/i18n/modules/handoff/it.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 di {count}", + "A Form app is handing something over": "Un'app Form sta trasferendo qualcosa", + "A mesh with maps by role": "Una mesh con mappe per ruolo", + "A model file": "Un file di modello", + "Add to this document": "Aggiungi a questo documento", + "Added {title} from {app}": "{title} aggiunto da {app}", + "Always allow": "Consenti sempre", + "Always allow {app}": "Consenti sempre {app}", + "An object from the GoF folder": "Un oggetto dalla cartella GoF", + "another app": "un'altra app", + "As a new document": "Come nuovo documento", + "Base colour": "Colore di base", + "Block": "Blocca", + "Choose a hand-off or give a path": "Scegli un trasferimento o indica un percorso", + "Contents": "Contenuto", + "Could not be read": "Impossibile leggere", + "Decline": "Rifiuta", + "Emission": "Emissione", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot controlla la cartella GoF e le esportazioni di FormSurface finché questa finestra è aperta. Quando un'app Form trasferisce qualcosa, FormShot chiede qui prima di aprirlo.", + "FormSurface": "FormSurface", + "FormSurface exports": "Esportazioni di FormSurface", + "From": "Da", + "GoF folder": "Cartella GoF", + "Hand-off Settings": "Impostazioni dei trasferimenti", + "Hand-offs": "Trasferimenti", + "Hand-offs from {app}": "Trasferimenti da {app}", + "Maps": "Mappe", + "Maps by role, without a mesh": "Mappe per ruolo, senza mesh", + "Metalness": "Metallicità", + "Normal": "Normale", + "not found": "non trovato", + "Not read yet": "Non ancora letto", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nessun file dalle app Form è in attesa nelle loro cartelle di trasferimento.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Non viene aperto nulla finché non scegli. Le texture restano dove l'app le ha scritte e sono referenziate per ruolo.", + "Occlusion, roughness and metalness": "Occlusione, rugosità e metallicità", + "Opacity": "Opacità", + "Open a Hand-off": "Apri un trasferimento", + "Open a Hand-off...": "Apri un trasferimento...", + "Open it": "Apri", + "Open once": "Apri una volta", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Apri ciò che FormSculpt, FormFabric, FormSurface o FormCAD hanno trasferito", + "Opened {title} from {app} as a new document": "{title} aperto da {app} come nuovo documento", + "Or a path to a file or folder": "Oppure un percorso a un file o a una cartella", + "Other maps": "Altre mappe", + "Reading...": "Lettura in corso...", + "Roughness": "Rugosità", + "Sent as": "Inviato come", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Il servizio FormShot non è raggiungibile, quindi queste scelte ora non possono essere lette né modificate.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Ciò che FormSculpt e FormFabric hanno messo nella cartella GoF e ciò che FormSurface ha esportato. Aprire da qui non richiede conferme, perché lo hai scelto tu.", + "{app} is handing over {title}: {what}.": "{app} sta trasferendo {title}: {what}.", + "{count} maps from FormSurface": "{count} mappe da FormSurface", + "{count} maps: {roles}": "{count} mappe: {roles}", + "{count} materials": "{count} materiali", + "{format} file": "File {format}", + "{format} file, {count} triangles": "File {format}, {count} triangoli", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} mesh, {triangles} triangoli, {materials} materiali", + "{n} days ago": "{n} giorni fa" } From e654021aa0519bfae59208cb9dac29d8bedb07c3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:55 -0500 Subject: [PATCH 136/494] feat(i18n): translate the cad page into four languages Translated all cad strings into German, French, Italian and Spanish, keeping placeholders and format names. ./formshot i18n check passed and each placeholder set matches the English key. --- frontend/src/i18n/modules/cad/de.json | 176 ++++++++++++------------- frontend/src/i18n/modules/cad/es.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/fr.json | 172 ++++++++++++------------- frontend/src/i18n/modules/cad/it.json | 178 +++++++++++++------------- 4 files changed, 352 insertions(+), 352 deletions(-) diff --git a/frontend/src/i18n/modules/cad/de.json b/frontend/src/i18n/modules/cad/de.json index 4debd1cd..fc82b39f 100644 --- a/frontend/src/i18n/modules/cad/de.json +++ b/frontend/src/i18n/modules/cad/de.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", + "% of the model size": "% der Modellgröße", + "About {n} triangles afterwards.": "Danach etwa {n} Dreiecke.", + "All CAD parts": "Alle CAD-Teile", + "Angle": "Winkel", + "Angle in degrees": "Winkel in Grad", + "Apply": "Anwenden", + "Beside the FormShot engine": "Neben der FormShot-Engine", + "CAD Import": "CAD-Import", + "CAD Import Settings...": "CAD-Importeinstellungen ...", + "CAD Options in the Import Sheet": "CAD-Optionen im Importdialog", + "CAD worker": "CAD-Worker", + "CAD worker: {stage}, {pct}%": "CAD-Worker: {stage}, {pct} %", + "Check the worker": "Worker prüfen", + "Checking every file": "Jede Datei wird geprüft", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Wähle STEP- oder IGES-Dateien zum Importieren aus; sie werden über den CAD-Worker geöffnet.", + "Chord": "Sehne", + "Chord as a percentage of the model size": "Sehne in Prozent der Modellgröße", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Die Sehne muss größer als 0 und höchstens {max} % der Modellgröße sein; der Winkel von {min} bis {amax} Grad.", + "Chord {chord}% of the model size, angle {angle} degrees": "Sehne {chord} % der Modellgröße, Winkel {angle} Grad", + "Could not re-tessellate: {reason}": "Neue Tesselierung nicht möglich: {reason}", + "Custom": "Benutzerdefiniert", + "Custom ({chord}%, {angle}°)": "Benutzerdefiniert ({chord} %, {angle}°)", + "Default CAD quality": "Standard-CAD-Qualität", + "Download": "Herunterladen", + "Download and check the program that opens STEP and IGES files.": "Das Programm herunterladen und prüfen, das STEP- und IGES-Dateien öffnet.", + "Download the CAD Worker": "CAD-Worker herunterladen", + "Download the CAD worker": "CAD-Worker herunterladen", + "Downloaded into the cache folder": "In den Cache-Ordner heruntergeladen", + "Downloading": "Download läuft", + "Found in": "Gefunden in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Wie fein STEP- und IGES-Flächen beim Import zu Dreiecken werden. Die Sehne ist der größte Abstand zwischen einem Dreieck und der echten Fläche, als Anteil an der Größe des ganzen Modells; der Winkel ist die größte Abknickung zwischen benachbarten Dreiecken. Feinere Einstellungen dauern länger und erzeugen größere Dateien. Der Importdialog beginnt mit dieser Auswahl; dort kannst du sie für einen einzelnen Import ändern.", + "Installed": "Installiert", + "Mixed": "Gemischt", + "Named by FORMSHOT_CAD_WORKER": "Benannt durch FORMSHOT_CAD_WORKER", + "New quality": "Neue Qualität", + "None of the selected parts came from a STEP or IGES file.": "Keines der ausgewählten Teile stammt aus einer STEP- oder IGES-Datei.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Keines der ausgewählten Teile stammt aus einer STEP- oder IGES-Datei. Hebe die Auswahl auf, um alle CAD-Teile neu aufzubauen.", + "Not available.": "Nicht verfügbar.", + "Not available: {reason}": "Nicht verfügbar: {reason}", + "Not installed": "Nicht installiert", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Noch nicht installiert. FormShot sucht es in {folder}; lade es hier herunter, um STEP- und IGES-Dateien zu öffnen.", + "Not named": "Nicht benannt", + "Not recorded": "Nicht aufgezeichnet", + "Nothing in this document came from a STEP or IGES file.": "Nichts in diesem Dokument stammt aus einer STEP- oder IGES-Datei.", + "Nothing is selected, so every CAD part is rebuilt.": "Nichts ist ausgewählt, daher werden alle CAD-Teile neu aufgebaut.", + "Published": "Veröffentlicht", + "Quality now": "Aktuelle Qualität", + "Re-tessellate CAD Parts": "CAD-Teile neu tesselieren", + "Re-tessellate CAD Parts...": "CAD-Teile neu tesselieren ...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-Teil mit {quality} neu tesseliert.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-Teil mit {quality} neu tesseliert: {before} bis {after} Dreiecke.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-Teile mit {quality} neu tesseliert.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-Teile mit {quality} neu tesseliert: {before} bis {after} Dreiecke.", + "Re-tessellating": "Neue Tesselierung läuft", + "Read the status again": "Status erneut lesen", + "Reading the published record": "Veröffentlichter Eintrag wird gelesen", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Baut die Meshes von Teilen aus STEP- oder IGES-Importen mit einer anderen Qualität neu auf, als ein einziger Rückgängig-Schritt.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- und IGES-Dateien werden vom Kernel-Worker von FormCAD geöffnet, einem separaten Programm, das FormShot einmal herunterlädt, Datei für Datei prüft und in deinem Cache-Ordner aufbewahrt. Andere Modellformate brauchen es nicht.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- und IGES-Dateien brauchen den CAD-Worker, und für diesen Computer ist keiner veröffentlicht.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- und IGES-Dateien brauchen den CAD-Worker, der noch nicht installiert ist.", + "Selected CAD parts": "Ausgewählte CAD-Teile", + "Source": "Quelle", + "The CAD worker is installed.": "Der CAD-Worker ist installiert.", + "The CAD worker is installed. You can import this file now.": "Der CAD-Worker ist installiert. Du kannst diese Datei jetzt importieren.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Der CAD-Worker, der STEP- und IGES-Dateien öffnet, und die Standard-CAD-Qualität.", + "The FormShot service is not reachable.": "Der FormShot-Dienst ist nicht erreichbar.", + "The download failed: {reason}": "Der Download ist fehlgeschlagen: {reason}", + "The download was cancelled. Nothing was installed.": "Der Download wurde abgebrochen. Es wurde nichts installiert.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Die Engine liefert keine Schätzung; feinere Qualitäten dauern länger und erzeugen mehr Dreiecke.", + "The parts could not be read: {reason}": "Die Teile konnten nicht gelesen werden: {reason}", + "The service cannot stop a download once it has started.": "Der Dienst kann einen gestarteten Download nicht mehr anhalten.", + "The service refused the request from this window.": "Der Dienst hat die Anfrage aus diesem Fenster abgelehnt.", + "The status could not be read: {reason}": "Der Status konnte nicht gelesen werden: {reason}", + "The worker did not answer: {reason}": "Der Worker hat nicht geantwortet: {reason}", + "This computer": "Dieser Computer", + "This engine cannot re-tessellate CAD parts.": "Diese Engine kann CAD-Teile nicht neu tesselieren.", + "Triangles now": "Aktuelle Dreiecke", + "Try Again": "Erneut versuchen", + "Unknown": "Unbekannt", + "Unpacking": "Wird entpackt", "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "degrees": "Grad", + "no reason was given": "es wurde kein Grund angegeben", + "{done} of {total}": "{done} von {total}", + "{n} files": "{n} Dateien", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, Protokoll {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} entpackt, Datei für Datei geprüft", + "{tag}: none for this computer": "{tag}: keiner für diesen Computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} Dateien, {size} entpackt" } diff --git a/frontend/src/i18n/modules/cad/es.json b/frontend/src/i18n/modules/cad/es.json index 4debd1cd..8f848789 100644 --- a/frontend/src/i18n/modules/cad/es.json +++ b/frontend/src/i18n/modules/cad/es.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% del tamaño del modelo", + "About {n} triangles afterwards.": "Unos {n} triángulos después.", + "All CAD parts": "Todas las piezas CAD", + "Angle": "Ángulo", + "Angle in degrees": "Ángulo en grados", + "Apply": "Aplicar", + "Beside the FormShot engine": "Junto al motor de FormShot", + "CAD Import": "Importación CAD", + "CAD Import Settings...": "Ajustes de importación CAD...", + "CAD Options in the Import Sheet": "Opciones CAD en el panel de importación", + "CAD worker": "Worker CAD", + "CAD worker: {stage}, {pct}%": "Worker CAD: {stage}, {pct}%", + "Check the worker": "Comprobar el worker", + "Checking every file": "Comprobando cada archivo", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Elige archivos STEP o IGES para importar; se abren mediante el worker CAD.", + "Chord": "Cuerda", + "Chord as a percentage of the model size": "Cuerda como porcentaje del tamaño del modelo", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "La cuerda debe ser mayor que 0 y como máximo el {max} % del tamaño del modelo; el ángulo, de {min} a {amax} grados.", + "Chord {chord}% of the model size, angle {angle} degrees": "Cuerda {chord} % del tamaño del modelo, ángulo {angle} grados", + "Could not re-tessellate: {reason}": "No se pudo volver a teselar: {reason}", + "Custom": "Personalizada", + "Custom ({chord}%, {angle}°)": "Personalizada ({chord} %, {angle}°)", + "Default CAD quality": "Calidad CAD predeterminada", + "Download": "Descargar", + "Download and check the program that opens STEP and IGES files.": "Descarga y comprueba el programa que abre los archivos STEP e IGES.", + "Download the CAD Worker": "Descargar el worker CAD", + "Download the CAD worker": "Descargar el worker CAD", + "Downloaded into the cache folder": "Descargado en la carpeta de caché", + "Downloading": "Descargando", + "Found in": "Encontrado en", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Con qué finura las superficies STEP e IGES se convierten en triángulos al importarlas. La cuerda es la mayor separación entre un triángulo y la superficie real, como proporción del tamaño de todo el modelo; el ángulo es la mayor curvatura entre triángulos vecinos. Los ajustes más finos tardan más y generan archivos más grandes. El panel de importación parte de esta elección; allí puedes cambiarla para una sola importación.", + "Installed": "Instalado", + "Mixed": "Mixto", + "Named by FORMSHOT_CAD_WORKER": "Indicado por FORMSHOT_CAD_WORKER", + "New quality": "Calidad nueva", + "None of the selected parts came from a STEP or IGES file.": "Ninguna de las piezas seleccionadas procede de un archivo STEP o IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Ninguna de las piezas seleccionadas procede de un archivo STEP o IGES. Borra la selección para reconstruir todas las piezas CAD.", + "Not available.": "No disponible.", + "Not available: {reason}": "No disponible: {reason}", + "Not installed": "No instalado", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Aún no está instalado. FormShot lo busca en {folder}; descárgalo aquí para abrir archivos STEP e IGES.", + "Not named": "Sin indicar", + "Not recorded": "Sin registrar", + "Nothing in this document came from a STEP or IGES file.": "Nada de este documento procede de un archivo STEP o IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "No hay nada seleccionado, así que se reconstruyen todas las piezas CAD.", + "Published": "Publicado", + "Quality now": "Calidad actual", + "Re-tessellate CAD Parts": "Volver a teselar piezas CAD", + "Re-tessellate CAD Parts...": "Volver a teselar piezas CAD...", + "Re-tessellated 1 CAD part at {quality}.": "Se volvió a teselar 1 pieza CAD con calidad {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Se volvió a teselar 1 pieza CAD con calidad {quality}: de {before} a {after} triángulos.", + "Re-tessellated {parts} CAD parts at {quality}.": "Se volvieron a teselar {parts} piezas CAD con calidad {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Se volvieron a teselar {parts} piezas CAD con calidad {quality}: de {before} a {after} triángulos.", + "Re-tessellating": "Volviendo a teselar", + "Read the status again": "Volver a leer el estado", + "Reading the published record": "Leyendo el registro publicado", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Reconstruye las mallas de las piezas importadas de STEP o IGES con otra calidad, como un solo paso de deshacer.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Los archivos STEP e IGES los abre el worker del kernel de FormCAD, un programa aparte que FormShot descarga una vez, comprueba archivo por archivo y guarda en tu carpeta de caché. Los demás formatos de modelo no lo necesitan.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Los archivos STEP e IGES necesitan el worker CAD, y no hay ninguno publicado para este ordenador.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Los archivos STEP e IGES necesitan el worker CAD, que aún no está instalado.", + "Selected CAD parts": "Piezas CAD seleccionadas", + "Source": "Origen", + "The CAD worker is installed.": "El worker CAD está instalado.", + "The CAD worker is installed. You can import this file now.": "El worker CAD está instalado. Ya puedes importar este archivo.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "El worker CAD que abre los archivos STEP e IGES y la calidad CAD predeterminada.", + "The FormShot service is not reachable.": "El servicio de FormShot no está disponible.", + "The download failed: {reason}": "La descarga falló: {reason}", + "The download was cancelled. Nothing was installed.": "Se canceló la descarga. No se instaló nada.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "El motor no ofrece ninguna estimación; las calidades más finas tardan más y generan más triángulos.", + "The parts could not be read: {reason}": "No se pudieron leer las piezas: {reason}", + "The service cannot stop a download once it has started.": "El servicio no puede detener una descarga una vez iniciada.", + "The service refused the request from this window.": "El servicio rechazó la solicitud de esta ventana.", + "The status could not be read: {reason}": "No se pudo leer el estado: {reason}", + "The worker did not answer: {reason}": "El worker no respondió: {reason}", + "This computer": "Este ordenador", + "This engine cannot re-tessellate CAD parts.": "Este motor no puede volver a teselar piezas CAD.", + "Triangles now": "Triángulos actuales", + "Try Again": "Reintentar", + "Unknown": "Desconocido", + "Unpacking": "Descomprimiendo", + "Version": "Versión", + "degrees": "grados", + "no reason was given": "no se indicó ningún motivo", + "{done} of {total}": "{done} de {total}", + "{n} files": "{n} archivos", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocolo {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} descomprimidos, comprobados archivo por archivo", + "{tag}: none for this computer": "{tag}: ninguno para este ordenador", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} archivos, {size} descomprimidos" } diff --git a/frontend/src/i18n/modules/cad/fr.json b/frontend/src/i18n/modules/cad/fr.json index 4debd1cd..284f13a1 100644 --- a/frontend/src/i18n/modules/cad/fr.json +++ b/frontend/src/i18n/modules/cad/fr.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", + "% of the model size": "% de la taille du modèle", + "About {n} triangles afterwards.": "Environ {n} triangles ensuite.", + "All CAD parts": "Toutes les pièces CAO", "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", + "Angle in degrees": "Angle en degrés", + "Apply": "Appliquer", + "Beside the FormShot engine": "À côté du moteur FormShot", + "CAD Import": "Import CAO", + "CAD Import Settings...": "Réglages d'import CAO...", + "CAD Options in the Import Sheet": "Options CAO dans la fenêtre d'import", + "CAD worker": "Worker CAO", + "CAD worker: {stage}, {pct}%": "Worker CAO : {stage}, {pct} %", + "Check the worker": "Vérifier le worker", + "Checking every file": "Vérification de chaque fichier", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Choisissez des fichiers STEP ou IGES à importer ; ils s'ouvrent via le worker CAO.", + "Chord": "Corde", + "Chord as a percentage of the model size": "Corde en pourcentage de la taille du modèle", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "La corde doit être supérieure à 0 et au plus égale à {max} % de la taille du modèle ; l'angle de {min} à {amax} degrés.", + "Chord {chord}% of the model size, angle {angle} degrees": "Corde {chord} % de la taille du modèle, angle {angle} degrés", + "Could not re-tessellate: {reason}": "Impossible de retesseller : {reason}", + "Custom": "Personnalisée", + "Custom ({chord}%, {angle}°)": "Personnalisée ({chord} %, {angle}°)", + "Default CAD quality": "Qualité CAO par défaut", + "Download": "Télécharger", + "Download and check the program that opens STEP and IGES files.": "Télécharger et vérifier le programme qui ouvre les fichiers STEP et IGES.", + "Download the CAD Worker": "Télécharger le worker CAO", + "Download the CAD worker": "Télécharger le worker CAO", + "Downloaded into the cache folder": "Téléchargé dans le dossier de cache", + "Downloading": "Téléchargement en cours", + "Found in": "Trouvé dans", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Précision avec laquelle les surfaces STEP et IGES deviennent des triangles à l'import. La corde est l'écart maximal entre un triangle et la surface réelle, en proportion de la taille du modèle entier ; l'angle est la plus grande déviation entre triangles voisins. Des réglages plus fins prennent plus de temps et produisent des fichiers plus volumineux. La fenêtre d'import démarre avec ce choix ; vous pouvez le modifier pour un seul import.", + "Installed": "Installé", + "Mixed": "Mixte", + "Named by FORMSHOT_CAD_WORKER": "Désigné par FORMSHOT_CAD_WORKER", + "New quality": "Nouvelle qualité", + "None of the selected parts came from a STEP or IGES file.": "Aucune des pièces sélectionnées ne provient d'un fichier STEP ou IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Aucune des pièces sélectionnées ne provient d'un fichier STEP ou IGES. Effacez la sélection pour reconstruire toutes les pièces CAO.", + "Not available.": "Indisponible.", + "Not available: {reason}": "Indisponible : {reason}", + "Not installed": "Non installé", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Pas encore installé. FormShot le cherche dans {folder} ; téléchargez-le ici pour ouvrir les fichiers STEP et IGES.", + "Not named": "Non désigné", + "Not recorded": "Non enregistré", + "Nothing in this document came from a STEP or IGES file.": "Rien dans ce document ne provient d'un fichier STEP ou IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Rien n'est sélectionné, toutes les pièces CAO sont donc reconstruites.", + "Published": "Publié", + "Quality now": "Qualité actuelle", + "Re-tessellate CAD Parts": "Retesseller les pièces CAO", + "Re-tessellate CAD Parts...": "Retesseller les pièces CAO...", + "Re-tessellated 1 CAD part at {quality}.": "1 pièce CAO retessellée en {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 pièce CAO retessellée en {quality} : de {before} à {after} triangles.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} pièces CAO retessellées en {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} pièces CAO retessellées en {quality} : de {before} à {after} triangles.", + "Re-tessellating": "Retessellation en cours", + "Read the status again": "Relire l'état", + "Reading the published record": "Lecture de l'enregistrement publié", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Reconstruit les maillages des pièces importées depuis STEP ou IGES avec une autre qualité, en une seule étape d'annulation.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Les fichiers STEP et IGES sont ouverts par le worker noyau de FormCAD, un programme distinct que FormShot télécharge une fois, vérifie fichier par fichier et conserve dans votre dossier de cache. Les autres formats de modèle n'en ont pas besoin.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Les fichiers STEP et IGES nécessitent le worker CAO, et aucun n'est publié pour cet ordinateur.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Les fichiers STEP et IGES nécessitent le worker CAO, qui n'est pas encore installé.", + "Selected CAD parts": "Pièces CAO sélectionnées", "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", + "The CAD worker is installed.": "Le worker CAO est installé.", + "The CAD worker is installed. You can import this file now.": "Le worker CAO est installé. Vous pouvez importer ce fichier maintenant.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Le worker CAO qui ouvre les fichiers STEP et IGES, et la qualité CAO par défaut.", + "The FormShot service is not reachable.": "Le service FormShot est injoignable.", + "The download failed: {reason}": "Le téléchargement a échoué : {reason}", + "The download was cancelled. Nothing was installed.": "Le téléchargement a été annulé. Rien n'a été installé.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Le moteur ne fournit aucune estimation ; les qualités plus fines prennent plus de temps et produisent plus de triangles.", + "The parts could not be read: {reason}": "Impossible de lire les pièces : {reason}", + "The service cannot stop a download once it has started.": "Le service ne peut pas arrêter un téléchargement une fois commencé.", + "The service refused the request from this window.": "Le service a refusé la requête de cette fenêtre.", + "The status could not be read: {reason}": "Impossible de lire l'état : {reason}", + "The worker did not answer: {reason}": "Le worker n'a pas répondu : {reason}", + "This computer": "Cet ordinateur", + "This engine cannot re-tessellate CAD parts.": "Ce moteur ne peut pas retesseller les pièces CAO.", + "Triangles now": "Triangles actuels", + "Try Again": "Réessayer", + "Unknown": "Inconnu", + "Unpacking": "Décompression", "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "degrees": "degrés", + "no reason was given": "aucune raison n'a été donnée", + "{done} of {total}": "{done} sur {total}", + "{n} files": "{n} fichiers", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocole {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} décompressés, vérifiés fichier par fichier", + "{tag}: none for this computer": "{tag} : aucun pour cet ordinateur", + "{tag}: {files} files, {size} unpacked": "{tag} : {files} fichiers, {size} décompressés" } diff --git a/frontend/src/i18n/modules/cad/it.json b/frontend/src/i18n/modules/cad/it.json index 4debd1cd..7c9e5654 100644 --- a/frontend/src/i18n/modules/cad/it.json +++ b/frontend/src/i18n/modules/cad/it.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% delle dimensioni del modello", + "About {n} triangles afterwards.": "Circa {n} triangoli dopo.", + "All CAD parts": "Tutte le parti CAD", + "Angle": "Angolo", + "Angle in degrees": "Angolo in gradi", + "Apply": "Applica", + "Beside the FormShot engine": "Accanto al motore di FormShot", + "CAD Import": "Importazione CAD", + "CAD Import Settings...": "Impostazioni importazione CAD...", + "CAD Options in the Import Sheet": "Opzioni CAD nel pannello di importazione", + "CAD worker": "Worker CAD", + "CAD worker: {stage}, {pct}%": "Worker CAD: {stage}, {pct}%", + "Check the worker": "Controlla il worker", + "Checking every file": "Controllo di ogni file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Scegli i file STEP o IGES da importare; si aprono tramite il worker CAD.", + "Chord": "Corda", + "Chord as a percentage of the model size": "Corda in percentuale delle dimensioni del modello", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "La corda deve essere maggiore di 0 e al massimo {max}% delle dimensioni del modello; l'angolo da {min} a {amax} gradi.", + "Chord {chord}% of the model size, angle {angle} degrees": "Corda {chord}% delle dimensioni del modello, angolo {angle} gradi", + "Could not re-tessellate: {reason}": "Impossibile ritassellare: {reason}", + "Custom": "Personalizzata", + "Custom ({chord}%, {angle}°)": "Personalizzata ({chord}%, {angle}°)", + "Default CAD quality": "Qualità CAD predefinita", + "Download": "Scarica", + "Download and check the program that opens STEP and IGES files.": "Scarica e controlla il programma che apre i file STEP e IGES.", + "Download the CAD Worker": "Scarica il worker CAD", + "Download the CAD worker": "Scarica il worker CAD", + "Downloaded into the cache folder": "Scaricato nella cartella della cache", + "Downloading": "Download in corso", + "Found in": "Trovato in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Quanto finemente le superfici STEP e IGES diventano triangoli durante l'importazione. La corda è lo scarto massimo tra un triangolo e la superficie reale, come frazione delle dimensioni dell'intero modello; l'angolo è la massima piegatura tra triangoli adiacenti. Impostazioni più fini richiedono più tempo e producono file più grandi. Il pannello di importazione parte da questa scelta; lì puoi cambiarla per una singola importazione.", + "Installed": "Installato", + "Mixed": "Misto", + "Named by FORMSHOT_CAD_WORKER": "Indicato da FORMSHOT_CAD_WORKER", + "New quality": "Nuova qualità", + "None of the selected parts came from a STEP or IGES file.": "Nessuna delle parti selezionate proviene da un file STEP o IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Nessuna delle parti selezionate proviene da un file STEP o IGES. Annulla la selezione per ricostruire tutte le parti CAD.", + "Not available.": "Non disponibile.", + "Not available: {reason}": "Non disponibile: {reason}", + "Not installed": "Non installato", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Non ancora installato. FormShot lo cerca in {folder}; scaricalo qui per aprire i file STEP e IGES.", + "Not named": "Non indicato", + "Not recorded": "Non registrato", + "Nothing in this document came from a STEP or IGES file.": "Nulla in questo documento proviene da un file STEP o IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Nessuna selezione, quindi vengono ricostruite tutte le parti CAD.", + "Published": "Pubblicato", + "Quality now": "Qualità attuale", + "Re-tessellate CAD Parts": "Ritassella parti CAD", + "Re-tessellate CAD Parts...": "Ritassella parti CAD...", + "Re-tessellated 1 CAD part at {quality}.": "1 parte CAD ritassellata con qualità {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 parte CAD ritassellata con qualità {quality}: da {before} a {after} triangoli.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} parti CAD ritassellate con qualità {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} parti CAD ritassellate con qualità {quality}: da {before} a {after} triangoli.", + "Re-tessellating": "Ritassellazione in corso", + "Read the status again": "Rileggi lo stato", + "Reading the published record": "Lettura del record pubblicato", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Ricostruisce le mesh delle parti importate da STEP o IGES con un'altra qualità, come un unico passaggio di annullamento.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "I file STEP e IGES vengono aperti dal worker del kernel di FormCAD, un programma separato che FormShot scarica una volta, controlla file per file e conserva nella tua cartella della cache. Gli altri formati di modello non ne hanno bisogno.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "I file STEP e IGES richiedono il worker CAD, e per questo computer non ne è pubblicato nessuno.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "I file STEP e IGES richiedono il worker CAD, che non è ancora installato.", + "Selected CAD parts": "Parti CAD selezionate", + "Source": "Sorgente", + "The CAD worker is installed.": "Il worker CAD è installato.", + "The CAD worker is installed. You can import this file now.": "Il worker CAD è installato. Ora puoi importare questo file.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Il worker CAD che apre i file STEP e IGES e la qualità CAD predefinita.", + "The FormShot service is not reachable.": "Il servizio FormShot non è raggiungibile.", + "The download failed: {reason}": "Il download non è riuscito: {reason}", + "The download was cancelled. Nothing was installed.": "Il download è stato annullato. Non è stato installato nulla.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Il motore non fornisce una stima; le qualità più fini richiedono più tempo e producono più triangoli.", + "The parts could not be read: {reason}": "Impossibile leggere le parti: {reason}", + "The service cannot stop a download once it has started.": "Il servizio non può interrompere un download già avviato.", + "The service refused the request from this window.": "Il servizio ha rifiutato la richiesta di questa finestra.", + "The status could not be read: {reason}": "Impossibile leggere lo stato: {reason}", + "The worker did not answer: {reason}": "Il worker non ha risposto: {reason}", + "This computer": "Questo computer", + "This engine cannot re-tessellate CAD parts.": "Questo motore non può ritassellare le parti CAD.", + "Triangles now": "Triangoli attuali", + "Try Again": "Riprova", + "Unknown": "Sconosciuto", + "Unpacking": "Decompressione", + "Version": "Versione", + "degrees": "gradi", + "no reason was given": "non è stato indicato alcun motivo", + "{done} of {total}": "{done} di {total}", + "{n} files": "{n} file", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocollo {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} decompressi, controllati file per file", + "{tag}: none for this computer": "{tag}: nessuno per questo computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} file, {size} decompressi" } From 05df6f99eabf720cf2cce9bfd7e58d211c2eb4bf Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:02:45 -0500 Subject: [PATCH 137/494] feat(i18n): translate the import page into four languages Translated the 88 import strings into Dutch, Swedish, Danish and Norwegian Bokmal. ./formshot i18n check passed at full coverage for all four. --- frontend/src/i18n/modules/import/da.json | 172 +++++++++++----------- frontend/src/i18n/modules/import/nb.json | 172 +++++++++++----------- frontend/src/i18n/modules/import/nl.json | 174 +++++++++++------------ frontend/src/i18n/modules/import/sv.json | 172 +++++++++++----------- 4 files changed, 345 insertions(+), 345 deletions(-) diff --git a/frontend/src/i18n/modules/import/da.json b/frontend/src/i18n/modules/import/da.json index ac317572..9b20f660 100644 --- a/frontend/src/i18n/modules/import/da.json +++ b/frontend/src/i18n/modules/import/da.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "3D-modeller", + "Automatic": "Automatisk", + "CAD quality": "CAD-kvalitet", + "Centimetres (cm)": "Centimeter (cm)", + "Centre on the origin": "Centrer på origo", + "Choose model files and import them into the scene with options.": "Vælg modelfiler, og importer dem til scenen med indstillinger.", + "Cleaning up meshes": "Rydder meshes op", + "Clear Recent Imports": "Ryd seneste importer", + "Could not import the file: {reason}": "Filen kunne ikke importeres: {reason}", + "Could not import {name}: {reason}": "{name} kunne ikke importeres: {reason}", + "Could not open {name}: {reason}": "{name} kunne ikke åbnes: {reason}", + "Could not read the file: {reason}": "Filen kunne ikke læses: {reason}", + "Could not reimport: {reason}": "Det lykkedes ikke at importere igen: {reason}", + "Could not send the file: {reason}": "Filen kunne ikke sendes: {reason}", + "Discard unsaved changes?": "Kassér ikke-gemte ændringer?", + "Draft": "Udkast", + "Drop to import into the scene": "Slip for at importere til scenen", + "Feet (ft)": "Fod (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot åbner ét projekt ad gangen; {n} andre projektfiler blev ikke åbnet.", + "Frame the view after import": "Indram visningen efter import", + "High": "Høj", + "Import": "Importer", + "Import All": "Importer alle", + "Import Files": "Importer filer", + "Import Model": "Importer model", + "Import Recent File": "Importer seneste fil", + "Imported {name}.": "{name} er importeret.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} er importeret: {parts} dele, {triangles} trekanter.", + "Imported {name}: {parts} parts.": "{name} er importeret: {parts} dele.", + "Importing": "Importerer", + "In this file": "I denne fil", + "Inches (in)": "Tomme (in)", + "Making materials": "Opretter materialer", + "Materials": "Materialer", + "Medium": "Mellem", + "Merge into one group": "Flet til én gruppe", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Millimeter (mm)", + "No Recent Imports": "Ingen seneste importer", + "No warnings.": "Ingen advarsler.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Intet at importere: FormShot importerer GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- og IGES-filer.", + "One file beside it": "Én fil ved siden af", + "Opening {name} will close the open project and discard its unsaved changes.": "Hvis du åbner {name}, lukkes det åbne projekt, og dets ikke-gemte ændringer kasseres.", + "Options": "Indstillinger", + "Parts": "Dele", + "Placing in the scene": "Placerer i scenen", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Læser kildefilerne for de valgte dele (eller for alle importerede dele) igen og beholder deres materialer.", + "Reading the file": "Læser filen", + "Reading the file...": "Læser filen...", + "Recent Imports": "Seneste importer", + "Reimport": "Importer igen", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Importeret igen: {matched} opdateret, {added} nye, {hidden} skjult.", + "Send model files to FormShot and import them into the scene with options.": "Send modelfiler til FormShot, og importer dem til scenen med indstillinger.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Flere filer importeres efter hinanden. Buffere, materialer og teksturer ved siden af en model følger med.", + "Size": "Størrelse", + "Stand on the floor": "Stil på gulvet", + "Tessellating CAD surfaces": "Tessellerer CAD-overflader", + "The engine decides from the file.": "Motoren afgør det ud fra filen.", + "The engine did not start an import job": "Motoren startede ikke et importjob", + "The engine did not start in time, so the files FormShot was given were not opened.": "Motoren startede ikke i tide, så de filer, FormShot fik, blev ikke åbnet.", + "The file says it is in {unit}.": "Filen angiver, at den er i {unit}.", + "The import failed": "Importen mislykkedes", + "The import goes on; the files after it were not imported.": "Importen fortsætter; filerne efter den blev ikke importeret.", + "The import of {name} was cancelled.": "Importen af {name} blev annulleret.", + "The upload failed ({status})": "Uploadingen mislykkedes ({status})", + "The upload was cancelled": "Uploadingen blev annulleret", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Denne motor kan ikke kigge ind i en fil før import, så oversigten forbliver tom.", + "This engine cannot stop an import once it has started": "Denne motor kan ikke stoppe en import, når den først er startet", + "This engine imports in one step, so there is no progress to show or stop.": "Denne motor importerer i ét trin, så der er ingen fremdrift at vise eller stoppe.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Denne fil angiver ikke sine enheder. FormShot gættede på {unit} ud fra størrelsen; kontrollér det før importen.", + "Triangles": "Trekanter", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Enheder", + "Up axis": "Opadgående akse", + "Up axis in file": "Opadgående akse i filen", + "Uploading": "Uploader", + "Y is up": "Y er op", + "Z is up": "Z er op", + "centimetres": "centimeter", + "feet": "fod", + "inches": "tommer", + "metres": "meter", + "millimetres": "millimeter", + "{i} of {n}": "{i} af {n}", + "{n} files beside it": "{n} filer ved siden af", + "{n} files were not imported.": "{n} filer blev ikke importeret.", + "{n} warnings; the Scene page lists the parts.": "{n} advarsler; Scenesiden viser delene." } diff --git a/frontend/src/i18n/modules/import/nb.json b/frontend/src/i18n/modules/import/nb.json index ac317572..b36b38ad 100644 --- a/frontend/src/i18n/modules/import/nb.json +++ b/frontend/src/i18n/modules/import/nb.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "3D-modeller", + "Automatic": "Automatisk", + "CAD quality": "CAD-kvalitet", + "Centimetres (cm)": "Centimeter (cm)", + "Centre on the origin": "Sentrer på origo", + "Choose model files and import them into the scene with options.": "Velg modellfiler og importer dem til scenen med alternativer.", + "Cleaning up meshes": "Rydder opp i meshes", + "Clear Recent Imports": "Tøm nylige importer", + "Could not import the file: {reason}": "Kunne ikke importere filen: {reason}", + "Could not import {name}: {reason}": "Kunne ikke importere {name}: {reason}", + "Could not open {name}: {reason}": "Kunne ikke åpne {name}: {reason}", + "Could not read the file: {reason}": "Kunne ikke lese filen: {reason}", + "Could not reimport: {reason}": "Kunne ikke importere på nytt: {reason}", + "Could not send the file: {reason}": "Kunne ikke sende filen: {reason}", + "Discard unsaved changes?": "Forkaste ulagrede endringer?", + "Draft": "Utkast", + "Drop to import into the scene": "Slipp for å importere til scenen", + "Feet (ft)": "Fot (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot åpner ett prosjekt om gangen; {n} andre prosjektfiler ble ikke åpnet.", + "Frame the view after import": "Ramm inn visningen etter import", + "High": "Høy", + "Import": "Importer", + "Import All": "Importer alle", + "Import Files": "Importer filer", + "Import Model": "Importer modell", + "Import Recent File": "Importer nylig fil", + "Imported {name}.": "{name} er importert.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} er importert: {parts} deler, {triangles} trekanter.", + "Imported {name}: {parts} parts.": "{name} er importert: {parts} deler.", + "Importing": "Importerer", + "In this file": "I denne filen", + "Inches (in)": "Tommer (in)", + "Making materials": "Lager materialer", + "Materials": "Materialer", + "Medium": "Middels", + "Merge into one group": "Slå sammen til én gruppe", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Millimeter (mm)", + "No Recent Imports": "Ingen nylige importer", + "No warnings.": "Ingen advarsler.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Ingenting å importere: FormShot importerer GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- og IGES-filer.", + "One file beside it": "Én fil ved siden av", + "Opening {name} will close the open project and discard its unsaved changes.": "Hvis du åpner {name}, lukkes det åpne prosjektet, og de ulagrede endringene forkastes.", + "Options": "Alternativer", + "Parts": "Deler", + "Placing in the scene": "Plasserer i scenen", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Leser kildefilene til de valgte delene (eller til alle importerte deler) på nytt og beholder materialene deres.", + "Reading the file": "Leser filen", + "Reading the file...": "Leser filen...", + "Recent Imports": "Nylige importer", + "Reimport": "Importer på nytt", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Importert på nytt: {matched} oppdatert, {added} nye, {hidden} skjult.", + "Send model files to FormShot and import them into the scene with options.": "Send modellfiler til FormShot og importer dem til scenen med alternativer.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Flere filer importeres etter hverandre. Buffere, materialer og teksturer ved siden av en modell følger med.", + "Size": "Størrelse", + "Stand on the floor": "Sett på gulvet", + "Tessellating CAD surfaces": "Tesselerer CAD-flater", + "The engine decides from the file.": "Motoren avgjør det ut fra filen.", + "The engine did not start an import job": "Motoren startet ikke noen importjobb", + "The engine did not start in time, so the files FormShot was given were not opened.": "Motoren startet ikke i tide, så filene FormShot fikk, ble ikke åpnet.", + "The file says it is in {unit}.": "Filen oppgir at den er i {unit}.", + "The import failed": "Importen mislyktes", + "The import goes on; the files after it were not imported.": "Importen fortsetter; filene etter den ble ikke importert.", + "The import of {name} was cancelled.": "Importen av {name} ble avbrutt.", + "The upload failed ({status})": "Opplastingen mislyktes ({status})", + "The upload was cancelled": "Opplastingen ble avbrutt", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Denne motoren kan ikke se inn i en fil før import, så oppsummeringen forblir tom.", + "This engine cannot stop an import once it has started": "Denne motoren kan ikke stoppe en import når den først har startet", + "This engine imports in one step, so there is no progress to show or stop.": "Denne motoren importerer i ett trinn, så det er ingen fremdrift å vise eller stoppe.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Denne filen oppgir ikke enhetene sine. FormShot gjettet {unit} ut fra størrelsen; kontroller det før importen.", + "Triangles": "Trekanter", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Enheter", + "Up axis": "Opp-akse", + "Up axis in file": "Opp-akse i filen", + "Uploading": "Laster opp", + "Y is up": "Y er opp", + "Z is up": "Z er opp", + "centimetres": "centimeter", + "feet": "fot", + "inches": "tommer", + "metres": "meter", + "millimetres": "millimeter", + "{i} of {n}": "{i} av {n}", + "{n} files beside it": "{n} filer ved siden av", + "{n} files were not imported.": "{n} filer ble ikke importert.", + "{n} warnings; the Scene page lists the parts.": "{n} advarsler; Scenesiden viser delene." } diff --git a/frontend/src/i18n/modules/import/nl.json b/frontend/src/i18n/modules/import/nl.json index ac317572..01aed371 100644 --- a/frontend/src/i18n/modules/import/nl.json +++ b/frontend/src/i18n/modules/import/nl.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "3D-modellen", + "Automatic": "Automatisch", + "CAD quality": "CAD-kwaliteit", + "Centimetres (cm)": "Centimeter (cm)", + "Centre on the origin": "Centreren op de oorsprong", + "Choose model files and import them into the scene with options.": "Kies modelbestanden en importeer ze met opties in de scène.", + "Cleaning up meshes": "Meshes opschonen", + "Clear Recent Imports": "Recente imports wissen", + "Could not import the file: {reason}": "Het bestand kon niet worden geïmporteerd: {reason}", + "Could not import {name}: {reason}": "{name} kon niet worden geïmporteerd: {reason}", + "Could not open {name}: {reason}": "{name} kon niet worden geopend: {reason}", + "Could not read the file: {reason}": "Het bestand kon niet worden gelezen: {reason}", + "Could not reimport: {reason}": "Opnieuw importeren is mislukt: {reason}", + "Could not send the file: {reason}": "Het bestand kon niet worden verzonden: {reason}", + "Discard unsaved changes?": "Niet-opgeslagen wijzigingen verwerpen?", + "Draft": "Concept", + "Drop to import into the scene": "Laat los om in de scène te importeren", + "Feet (ft)": "Voet (ft)", + "Format": "Indeling", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opent één project tegelijk; {n} andere projectbestanden zijn niet geopend.", + "Frame the view after import": "Beeld framen na het importeren", + "High": "Hoog", + "Import": "Importeren", + "Import All": "Alles importeren", + "Import Files": "Bestanden importeren", + "Import Model": "Model importeren", + "Import Recent File": "Recent bestand importeren", + "Imported {name}.": "{name} is geïmporteerd.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} is geïmporteerd: {parts} onderdelen, {triangles} driehoeken.", + "Imported {name}: {parts} parts.": "{name} is geïmporteerd: {parts} onderdelen.", + "Importing": "Importeren", + "In this file": "In dit bestand", + "Inches (in)": "Inch (in)", + "Making materials": "Materialen maken", + "Materials": "Materialen", + "Medium": "Gemiddeld", + "Merge into one group": "Samenvoegen tot één groep", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Millimeter (mm)", + "No Recent Imports": "Geen recente imports", + "No warnings.": "Geen waarschuwingen.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Niets te importeren: FormShot importeert GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- en IGES-bestanden.", + "One file beside it": "Eén bestand ernaast", + "Opening {name} will close the open project and discard its unsaved changes.": "Als je {name} opent, wordt het geopende project gesloten en gaan de niet-opgeslagen wijzigingen verloren.", + "Options": "Opties", + "Parts": "Onderdelen", + "Placing in the scene": "In de scène plaatsen", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Leest de bronbestanden van de geselecteerde onderdelen (of van alle geïmporteerde onderdelen) opnieuw in en behoudt hun materialen.", + "Reading the file": "Het bestand lezen", + "Reading the file...": "Het bestand lezen...", + "Recent Imports": "Recente imports", + "Reimport": "Opnieuw importeren", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Opnieuw geïmporteerd: {matched} bijgewerkt, {added} nieuw, {hidden} verborgen.", + "Send model files to FormShot and import them into the scene with options.": "Stuur modelbestanden naar FormShot en importeer ze met opties in de scène.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Meerdere bestanden worden na elkaar geïmporteerd. Buffers, materialen en teksturen naast een model gaan mee.", + "Size": "Grootte", + "Stand on the floor": "Op de vloer zetten", + "Tessellating CAD surfaces": "CAD-oppervlakken tesselleren", + "The engine decides from the file.": "De engine bepaalt het aan de hand van het bestand.", + "The engine did not start an import job": "De engine heeft geen importtaak gestart", + "The engine did not start in time, so the files FormShot was given were not opened.": "De engine startte niet op tijd, dus de bestanden die FormShot kreeg zijn niet geopend.", + "The file says it is in {unit}.": "Het bestand geeft aan dat het in {unit} is.", + "The import failed": "De import is mislukt", + "The import goes on; the files after it were not imported.": "De import gaat door; de bestanden daarna zijn niet geïmporteerd.", + "The import of {name} was cancelled.": "De import van {name} is geannuleerd.", + "The upload failed ({status})": "Het uploaden is mislukt ({status})", + "The upload was cancelled": "Het uploaden is geannuleerd", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Deze engine kan niet in een bestand kijken vóór het importeren, dus de samenvatting blijft leeg.", + "This engine cannot stop an import once it has started": "Deze engine kan een import niet stoppen zodra die is gestart", + "This engine imports in one step, so there is no progress to show or stop.": "Deze engine importeert in één stap, dus er is geen voortgang om te tonen of te stoppen.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Dit bestand geeft zijn eenheden niet aan. FormShot heeft {unit} geraden op basis van de grootte; controleer dit vóór het importeren.", + "Triangles": "Driehoeken", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Eenheden", + "Up axis": "Bovenste as", + "Up axis in file": "Bovenste as in bestand", + "Uploading": "Uploaden", + "Y is up": "Y is boven", + "Z is up": "Z is boven", + "centimetres": "centimeter", + "feet": "voet", + "inches": "inch", + "metres": "meter", + "millimetres": "millimeter", + "{i} of {n}": "{i} van {n}", + "{n} files beside it": "{n} bestanden ernaast", + "{n} files were not imported.": "{n} bestanden zijn niet geïmporteerd.", + "{n} warnings; the Scene page lists the parts.": "{n} waarschuwingen; de Scènepagina toont de onderdelen." } diff --git a/frontend/src/i18n/modules/import/sv.json b/frontend/src/i18n/modules/import/sv.json index ac317572..09f81787 100644 --- a/frontend/src/i18n/modules/import/sv.json +++ b/frontend/src/i18n/modules/import/sv.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "3D-modeller", + "Automatic": "Automatisk", + "CAD quality": "CAD-kvalitet", + "Centimetres (cm)": "Centimeter (cm)", + "Centre on the origin": "Centrera på origo", + "Choose model files and import them into the scene with options.": "Välj modellfiler och importera dem till scenen med alternativ.", + "Cleaning up meshes": "Rensar meshar", + "Clear Recent Imports": "Rensa senaste importer", + "Could not import the file: {reason}": "Det gick inte att importera filen: {reason}", + "Could not import {name}: {reason}": "Det gick inte att importera {name}: {reason}", + "Could not open {name}: {reason}": "Det gick inte att öppna {name}: {reason}", + "Could not read the file: {reason}": "Det gick inte att läsa filen: {reason}", + "Could not reimport: {reason}": "Det gick inte att importera om: {reason}", + "Could not send the file: {reason}": "Det gick inte att skicka filen: {reason}", + "Discard unsaved changes?": "Förkasta osparade ändringar?", + "Draft": "Utkast", + "Drop to import into the scene": "Släpp för att importera till scenen", + "Feet (ft)": "Fot (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot öppnar ett projekt i taget; {n} andra projektfiler lämnades oöppnade.", + "Frame the view after import": "Rama in vyn efter importen", + "High": "Hög", + "Import": "Importera", + "Import All": "Importera alla", + "Import Files": "Importera filer", + "Import Model": "Importera modell", + "Import Recent File": "Importera senaste fil", + "Imported {name}.": "{name} har importerats.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} har importerats: {parts} delar, {triangles} trianglar.", + "Imported {name}: {parts} parts.": "{name} har importerats: {parts} delar.", + "Importing": "Importerar", + "In this file": "I den här filen", + "Inches (in)": "Tum (in)", + "Making materials": "Skapar material", + "Materials": "Material", + "Medium": "Medel", + "Merge into one group": "Slå ihop till en grupp", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Millimeter (mm)", + "No Recent Imports": "Inga senaste importer", + "No warnings.": "Inga varningar.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Inget att importera: FormShot importerar GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- och IGES-filer.", + "One file beside it": "En fil bredvid", + "Opening {name} will close the open project and discard its unsaved changes.": "Om du öppnar {name} stängs det öppna projektet och dess osparade ändringar förkastas.", + "Options": "Alternativ", + "Parts": "Delar", + "Placing in the scene": "Placerar i scenen", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Läser källfilerna för de markerade delarna (eller för alla importerade delar) igen och behåller deras material.", + "Reading the file": "Läser filen", + "Reading the file...": "Läser filen...", + "Recent Imports": "Senaste importer", + "Reimport": "Importera om", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Omimporterat: {matched} uppdaterade, {added} nya, {hidden} dolda.", + "Send model files to FormShot and import them into the scene with options.": "Skicka modellfiler till FormShot och importera dem till scenen med alternativ.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Flera filer importeras efter varandra. Buffertar, material och texturer bredvid en modell följer med.", + "Size": "Storlek", + "Stand on the floor": "Ställ på golvet", + "Tessellating CAD surfaces": "Tesselerar CAD-ytor", + "The engine decides from the file.": "Motorn avgör utifrån filen.", + "The engine did not start an import job": "Motorn startade inget importjobb", + "The engine did not start in time, so the files FormShot was given were not opened.": "Motorn startade inte i tid, så filerna som FormShot fick öppnades inte.", + "The file says it is in {unit}.": "Filen anger att den är i {unit}.", + "The import failed": "Importen misslyckades", + "The import goes on; the files after it were not imported.": "Importen fortsätter; filerna efter den importerades inte.", + "The import of {name} was cancelled.": "Importen av {name} avbröts.", + "The upload failed ({status})": "Uppladdningen misslyckades ({status})", + "The upload was cancelled": "Uppladdningen avbröts", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Den här motorn kan inte titta i en fil före importen, så sammanfattningen förblir tom.", + "This engine cannot stop an import once it has started": "Den här motorn kan inte stoppa en import när den har startat", + "This engine imports in one step, so there is no progress to show or stop.": "Den här motorn importerar i ett enda steg, så det finns inget förlopp att visa eller stoppa.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Den här filen anger inte sina enheter. FormShot gissade {unit} utifrån storleken; kontrollera det före importen.", + "Triangles": "Trianglar", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Enheter", + "Up axis": "Uppåtaxel", + "Up axis in file": "Uppåtaxel i filen", + "Uploading": "Laddar upp", + "Y is up": "Y är uppåt", + "Z is up": "Z är uppåt", + "centimetres": "centimeter", + "feet": "fot", + "inches": "tum", + "metres": "meter", + "millimetres": "millimeter", + "{i} of {n}": "{i} av {n}", + "{n} files beside it": "{n} filer bredvid", + "{n} files were not imported.": "{n} filer importerades inte.", + "{n} warnings; the Scene page lists the parts.": "{n} varningar; Scensidan listar delarna." } From a757850a3a576313aa97db9f02f5fb76fb07c28b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:57 -0500 Subject: [PATCH 138/494] feat(i18n): translate the cad page into four languages Translated the 89 cad strings into Dutch, Swedish, Danish and Norwegian Bokmal. ./formshot i18n check passed at full coverage for all four. --- frontend/src/i18n/modules/cad/da.json | 174 ++++++++++++------------- frontend/src/i18n/modules/cad/nb.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/nl.json | 176 ++++++++++++------------- frontend/src/i18n/modules/cad/sv.json | 176 ++++++++++++------------- 4 files changed, 352 insertions(+), 352 deletions(-) diff --git a/frontend/src/i18n/modules/cad/da.json b/frontend/src/i18n/modules/cad/da.json index 4debd1cd..b88723cf 100644 --- a/frontend/src/i18n/modules/cad/da.json +++ b/frontend/src/i18n/modules/cad/da.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", + "% of the model size": "% af modellens størrelse", + "About {n} triangles afterwards.": "Cirka {n} trekanter bagefter.", + "All CAD parts": "Alle CAD-dele", + "Angle": "Vinkel", + "Angle in degrees": "Vinkel i grader", + "Apply": "Anvend", + "Beside the FormShot engine": "Ved siden af FormShot-motoren", + "CAD Import": "CAD-import", + "CAD Import Settings...": "CAD-importindstillinger...", + "CAD Options in the Import Sheet": "CAD-indstillinger i importvinduet", + "CAD worker": "CAD-worker", + "CAD worker: {stage}, {pct}%": "CAD-worker: {stage}, {pct}%", + "Check the worker": "Kontrollér workeren", + "Checking every file": "Kontrollerer hver fil", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Vælg STEP- eller IGES-filer, der skal importeres; de åbnes via CAD-workeren.", + "Chord": "Korde", + "Chord as a percentage of the model size": "Korde som procent af modellens størrelse", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Korden skal være over 0 og højst {max}% af modellens størrelse; vinklen fra {min} til {amax} grader.", + "Chord {chord}% of the model size, angle {angle} degrees": "Korde {chord}% af modellens størrelse, vinkel {angle} grader", + "Could not re-tessellate: {reason}": "Gentessellering mislykkedes: {reason}", + "Custom": "Brugerdefineret", + "Custom ({chord}%, {angle}°)": "Brugerdefineret ({chord}%, {angle}°)", + "Default CAD quality": "Standard-CAD-kvalitet", "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", + "Download and check the program that opens STEP and IGES files.": "Download og kontrollér programmet, der åbner STEP- og IGES-filer.", + "Download the CAD Worker": "Download CAD-workeren", + "Download the CAD worker": "Download CAD-workeren", + "Downloaded into the cache folder": "Downloadet til cachemappen", + "Downloading": "Downloader", + "Found in": "Fundet i", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Hvor fint STEP- og IGES-overflader bliver til trekanter ved import. Korden er den største afstand mellem en trekant og den rigtige overflade, som andel af hele modellens størrelse; vinklen er det største knæk mellem naboliggende trekanter. Finere indstillinger tager længere tid og giver større filer. Importvinduet starter med dette valg; her kan du ændre det for én enkelt import.", + "Installed": "Installeret", + "Mixed": "Blandet", + "Named by FORMSHOT_CAD_WORKER": "Angivet af FORMSHOT_CAD_WORKER", + "New quality": "Ny kvalitet", + "None of the selected parts came from a STEP or IGES file.": "Ingen af de valgte dele kom fra en STEP- eller IGES-fil.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Ingen af de valgte dele kom fra en STEP- eller IGES-fil. Ryd markeringen for at genopbygge alle CAD-dele.", + "Not available.": "Ikke tilgængeligt.", + "Not available: {reason}": "Ikke tilgængeligt: {reason}", + "Not installed": "Ikke installeret", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Endnu ikke installeret. FormShot leder efter den i {folder}; download den her for at åbne STEP- og IGES-filer.", + "Not named": "Ikke angivet", + "Not recorded": "Ikke registreret", + "Nothing in this document came from a STEP or IGES file.": "Intet i dette dokument kom fra en STEP- eller IGES-fil.", + "Nothing is selected, so every CAD part is rebuilt.": "Intet er valgt, så alle CAD-dele genopbygges.", + "Published": "Udgivet", + "Quality now": "Kvalitet nu", + "Re-tessellate CAD Parts": "Gentesseller CAD-dele", + "Re-tessellate CAD Parts...": "Gentesseller CAD-dele...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-del gentesselleret med {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-del gentesselleret med {quality}: {before} til {after} trekanter.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-dele gentesselleret med {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-dele gentesselleret med {quality}: {before} til {after} trekanter.", + "Re-tessellating": "Gentessellerer", + "Read the status again": "Læs status igen", + "Reading the published record": "Læser den udgivne post", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Genopbygger meshes for dele importeret fra STEP eller IGES med en anden kvalitet, som ét fortryd-trin.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- og IGES-filer åbnes af FormCADs kerne-worker, et separat program, som FormShot downloader én gang, kontrollerer fil for fil og beholder i din cachemappe. Andre modelformater har ikke brug for det.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- og IGES-filer kræver CAD-workeren, og der er ingen udgivet til denne computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- og IGES-filer kræver CAD-workeren, som endnu ikke er installeret.", + "Selected CAD parts": "Valgte CAD-dele", + "Source": "Kilde", + "The CAD worker is installed.": "CAD-workeren er installeret.", + "The CAD worker is installed. You can import this file now.": "CAD-workeren er installeret. Du kan importere denne fil nu.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "CAD-workeren, der åbner STEP- og IGES-filer, og standard-CAD-kvaliteten.", + "The FormShot service is not reachable.": "FormShot-tjenesten er ikke tilgængelig.", + "The download failed: {reason}": "Downloadet mislykkedes: {reason}", + "The download was cancelled. Nothing was installed.": "Downloadet blev annulleret. Intet blev installeret.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Motoren giver intet estimat; finere kvaliteter tager længere tid og giver flere trekanter.", + "The parts could not be read: {reason}": "Dele kunne ikke læses: {reason}", + "The service cannot stop a download once it has started.": "Tjenesten kan ikke stoppe et download, når det først er startet.", + "The service refused the request from this window.": "Tjenesten afviste anmodningen fra dette vindue.", + "The status could not be read: {reason}": "Status kunne ikke læses: {reason}", + "The worker did not answer: {reason}": "Workeren svarede ikke: {reason}", + "This computer": "Denne computer", + "This engine cannot re-tessellate CAD parts.": "Denne motor kan ikke gentessellere CAD-dele.", + "Triangles now": "Trekanter nu", + "Try Again": "Prøv igen", + "Unknown": "Ukendt", + "Unpacking": "Pakker ud", "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "degrees": "grader", + "no reason was given": "ingen årsag blev angivet", + "{done} of {total}": "{done} af {total}", + "{n} files": "{n} filer", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} udpakket, kontrolleret fil for fil", + "{tag}: none for this computer": "{tag}: ingen til denne computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} filer, {size} udpakket" } diff --git a/frontend/src/i18n/modules/cad/nb.json b/frontend/src/i18n/modules/cad/nb.json index 4debd1cd..b2a8bf22 100644 --- a/frontend/src/i18n/modules/cad/nb.json +++ b/frontend/src/i18n/modules/cad/nb.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% av modellstørrelsen", + "About {n} triangles afterwards.": "Omtrent {n} trekanter etterpå.", + "All CAD parts": "Alle CAD-deler", + "Angle": "Vinkel", + "Angle in degrees": "Vinkel i grader", + "Apply": "Bruk", + "Beside the FormShot engine": "Ved siden av FormShot-motoren", + "CAD Import": "CAD-import", + "CAD Import Settings...": "CAD-importinnstillinger...", + "CAD Options in the Import Sheet": "CAD-alternativer i importvinduet", + "CAD worker": "CAD-worker", + "CAD worker: {stage}, {pct}%": "CAD-worker: {stage}, {pct}%", + "Check the worker": "Kontroller workeren", + "Checking every file": "Kontrollerer hver fil", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Velg STEP- eller IGES-filer som skal importeres; de åpnes via CAD-workeren.", + "Chord": "Korde", + "Chord as a percentage of the model size": "Korde som prosent av modellstørrelsen", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Korden må være over 0 og høyst {max}% av modellstørrelsen; vinkelen fra {min} til {amax} grader.", + "Chord {chord}% of the model size, angle {angle} degrees": "Korde {chord}% av modellstørrelsen, vinkel {angle} grader", + "Could not re-tessellate: {reason}": "Kunne ikke tesselere på nytt: {reason}", + "Custom": "Egendefinert", + "Custom ({chord}%, {angle}°)": "Egendefinert ({chord}%, {angle}°)", + "Default CAD quality": "Standard CAD-kvalitet", + "Download": "Last ned", + "Download and check the program that opens STEP and IGES files.": "Last ned og kontroller programmet som åpner STEP- og IGES-filer.", + "Download the CAD Worker": "Last ned CAD-workeren", + "Download the CAD worker": "Last ned CAD-workeren", + "Downloaded into the cache folder": "Lastet ned til hurtigbuffermappen", + "Downloading": "Laster ned", + "Found in": "Funnet i", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Hvor fint STEP- og IGES-flater blir til trekanter ved import. Korden er det største avviket mellom en trekant og den virkelige flaten, som andel av hele modellens størrelse; vinkelen er det største knekket mellom nabotrekanter. Finere innstillinger tar lengre tid og gir større filer. Importvinduet starter med dette valget; der kan du endre det for én enkelt import.", + "Installed": "Installert", + "Mixed": "Blandet", + "Named by FORMSHOT_CAD_WORKER": "Angitt av FORMSHOT_CAD_WORKER", + "New quality": "Ny kvalitet", + "None of the selected parts came from a STEP or IGES file.": "Ingen av de valgte delene kom fra en STEP- eller IGES-fil.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Ingen av de valgte delene kom fra en STEP- eller IGES-fil. Fjern markeringen for å bygge om alle CAD-deler.", + "Not available.": "Ikke tilgjengelig.", + "Not available: {reason}": "Ikke tilgjengelig: {reason}", + "Not installed": "Ikke installert", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Ikke installert ennå. FormShot leter etter den i {folder}; last den ned her for å åpne STEP- og IGES-filer.", + "Not named": "Ikke angitt", + "Not recorded": "Ikke registrert", + "Nothing in this document came from a STEP or IGES file.": "Ingenting i dette dokumentet kom fra en STEP- eller IGES-fil.", + "Nothing is selected, so every CAD part is rebuilt.": "Ingenting er valgt, så alle CAD-deler bygges om.", + "Published": "Publisert", + "Quality now": "Kvalitet nå", + "Re-tessellate CAD Parts": "Tesseler CAD-deler på nytt", + "Re-tessellate CAD Parts...": "Tesseler CAD-deler på nytt...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-del tesselert på nytt med {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-del tesselert på nytt med {quality}: {before} til {after} trekanter.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-deler tesselert på nytt med {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-deler tesselert på nytt med {quality}: {before} til {after} trekanter.", + "Re-tessellating": "Tesselerer på nytt", + "Read the status again": "Les statusen på nytt", + "Reading the published record": "Leser den publiserte posten", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Bygger om meshene til deler importert fra STEP eller IGES med en annen kvalitet, som ett angretrinn.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- og IGES-filer åpnes av FormCADs kjerne-worker, et eget program som FormShot laster ned én gang, kontrollerer fil for fil og beholder i hurtigbuffermappen din. Andre modellformater trenger det ikke.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- og IGES-filer krever CAD-workeren, og ingen er publisert for denne datamaskinen.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- og IGES-filer krever CAD-workeren, som ikke er installert ennå.", + "Selected CAD parts": "Valgte CAD-deler", + "Source": "Kilde", + "The CAD worker is installed.": "CAD-workeren er installert.", + "The CAD worker is installed. You can import this file now.": "CAD-workeren er installert. Du kan importere denne filen nå.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "CAD-workeren som åpner STEP- og IGES-filer, og standard CAD-kvalitet.", + "The FormShot service is not reachable.": "FormShot-tjenesten er ikke tilgjengelig.", + "The download failed: {reason}": "Nedlastingen mislyktes: {reason}", + "The download was cancelled. Nothing was installed.": "Nedlastingen ble avbrutt. Ingenting ble installert.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Motoren gir ikke noe anslag; finere kvaliteter tar lengre tid og gir flere trekanter.", + "The parts could not be read: {reason}": "Delene kunne ikke leses: {reason}", + "The service cannot stop a download once it has started.": "Tjenesten kan ikke stoppe en nedlasting når den først har startet.", + "The service refused the request from this window.": "Tjenesten avviste forespørselen fra dette vinduet.", + "The status could not be read: {reason}": "Statusen kunne ikke leses: {reason}", + "The worker did not answer: {reason}": "Workeren svarte ikke: {reason}", + "This computer": "Denne datamaskinen", + "This engine cannot re-tessellate CAD parts.": "Denne motoren kan ikke tesselere CAD-deler på nytt.", + "Triangles now": "Trekanter nå", + "Try Again": "Prøv igjen", + "Unknown": "Ukjent", + "Unpacking": "Pakker ut", + "Version": "Versjon", + "degrees": "grader", + "no reason was given": "ingen årsak ble oppgitt", + "{done} of {total}": "{done} av {total}", + "{n} files": "{n} filer", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokoll {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} utpakket, kontrollert fil for fil", + "{tag}: none for this computer": "{tag}: ingen for denne datamaskinen", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} filer, {size} utpakket" } diff --git a/frontend/src/i18n/modules/cad/nl.json b/frontend/src/i18n/modules/cad/nl.json index 4debd1cd..2d47ad15 100644 --- a/frontend/src/i18n/modules/cad/nl.json +++ b/frontend/src/i18n/modules/cad/nl.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", + "% of the model size": "% van de modelgrootte", + "About {n} triangles afterwards.": "Daarna ongeveer {n} driehoeken.", + "All CAD parts": "Alle CAD-onderdelen", + "Angle": "Hoek", + "Angle in degrees": "Hoek in graden", + "Apply": "Toepassen", + "Beside the FormShot engine": "Naast de FormShot-engine", + "CAD Import": "CAD-import", + "CAD Import Settings...": "CAD-importinstellingen...", + "CAD Options in the Import Sheet": "CAD-opties in het importvenster", + "CAD worker": "CAD-worker", + "CAD worker: {stage}, {pct}%": "CAD-worker: {stage}, {pct}%", + "Check the worker": "Worker controleren", + "Checking every file": "Elk bestand controleren", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Kies STEP- of IGES-bestanden om te importeren; ze worden geopend via de CAD-worker.", + "Chord": "Koorde", + "Chord as a percentage of the model size": "Koorde als percentage van de modelgrootte", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "De koorde moet groter zijn dan 0 en hoogstens {max}% van de modelgrootte; de hoek ligt tussen {min} en {amax} graden.", + "Chord {chord}% of the model size, angle {angle} degrees": "Koorde {chord}% van de modelgrootte, hoek {angle} graden", + "Could not re-tessellate: {reason}": "Opnieuw tesselleren is mislukt: {reason}", + "Custom": "Aangepast", + "Custom ({chord}%, {angle}°)": "Aangepast ({chord}%, {angle}°)", + "Default CAD quality": "Standaard CAD-kwaliteit", + "Download": "Downloaden", + "Download and check the program that opens STEP and IGES files.": "Download en controleer het programma dat STEP- en IGES-bestanden opent.", + "Download the CAD Worker": "CAD-worker downloaden", + "Download the CAD worker": "CAD-worker downloaden", + "Downloaded into the cache folder": "Gedownload naar de cachemap", + "Downloading": "Downloaden", + "Found in": "Gevonden in", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Hoe fijn STEP- en IGES-oppervlakken bij het importeren in driehoeken worden omgezet. De koorde is de grootste afstand tussen een driehoek en het echte oppervlak, als deel van de grootte van het hele model; de hoek is de grootste knik tussen naburige driehoeken. Fijnere instellingen duren langer en geven grotere bestanden. Het importvenster begint met deze keuze; daar kun je haar voor één import wijzigen.", + "Installed": "Geïnstalleerd", + "Mixed": "Gemengd", + "Named by FORMSHOT_CAD_WORKER": "Opgegeven door FORMSHOT_CAD_WORKER", + "New quality": "Nieuwe kwaliteit", + "None of the selected parts came from a STEP or IGES file.": "Geen van de geselecteerde onderdelen komt uit een STEP- of IGES-bestand.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Geen van de geselecteerde onderdelen komt uit een STEP- of IGES-bestand. Hef de selectie op om alle CAD-onderdelen opnieuw op te bouwen.", + "Not available.": "Niet beschikbaar.", + "Not available: {reason}": "Niet beschikbaar: {reason}", + "Not installed": "Niet geïnstalleerd", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Nog niet geïnstalleerd. FormShot zoekt ernaar in {folder}; download het hier om STEP- en IGES-bestanden te openen.", + "Not named": "Niet opgegeven", + "Not recorded": "Niet vastgelegd", + "Nothing in this document came from a STEP or IGES file.": "Niets in dit document komt uit een STEP- of IGES-bestand.", + "Nothing is selected, so every CAD part is rebuilt.": "Er is niets geselecteerd, dus alle CAD-onderdelen worden opnieuw opgebouwd.", + "Published": "Gepubliceerd", + "Quality now": "Huidige kwaliteit", + "Re-tessellate CAD Parts": "CAD-onderdelen opnieuw tesselleren", + "Re-tessellate CAD Parts...": "CAD-onderdelen opnieuw tesselleren...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-onderdeel opnieuw getesselleerd met {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-onderdeel opnieuw getesselleerd met {quality}: van {before} naar {after} driehoeken.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-onderdelen opnieuw getesselleerd met {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-onderdelen opnieuw getesselleerd met {quality}: van {before} naar {after} driehoeken.", + "Re-tessellating": "Opnieuw tesselleren", + "Read the status again": "Status opnieuw lezen", + "Reading the published record": "Het gepubliceerde record lezen", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Bouwt de meshes van onderdelen uit STEP of IGES opnieuw op met een andere kwaliteit, als één ongedaanmakingsstap.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- en IGES-bestanden worden geopend door de kernel-worker van FormCAD, een apart programma dat FormShot eenmalig downloadt, bestand voor bestand controleert en in je cachemap bewaart. Andere modelindelingen hebben het niet nodig.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- en IGES-bestanden hebben de CAD-worker nodig, en er is er geen gepubliceerd voor deze computer.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- en IGES-bestanden hebben de CAD-worker nodig, die nog niet is geïnstalleerd.", + "Selected CAD parts": "Geselecteerde CAD-onderdelen", + "Source": "Bron", + "The CAD worker is installed.": "De CAD-worker is geïnstalleerd.", + "The CAD worker is installed. You can import this file now.": "De CAD-worker is geïnstalleerd. Je kunt dit bestand nu importeren.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "De CAD-worker die STEP- en IGES-bestanden opent, en de standaard CAD-kwaliteit.", + "The FormShot service is not reachable.": "De FormShot-service is niet bereikbaar.", + "The download failed: {reason}": "Het downloaden is mislukt: {reason}", + "The download was cancelled. Nothing was installed.": "Het downloaden is geannuleerd. Er is niets geïnstalleerd.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "De engine geeft geen schatting; fijnere kwaliteiten duren langer en geven meer driehoeken.", + "The parts could not be read: {reason}": "De onderdelen konden niet worden gelezen: {reason}", + "The service cannot stop a download once it has started.": "De service kan een download niet stoppen zodra die is gestart.", + "The service refused the request from this window.": "De service heeft het verzoek van dit venster geweigerd.", + "The status could not be read: {reason}": "De status kon niet worden gelezen: {reason}", + "The worker did not answer: {reason}": "De worker gaf geen antwoord: {reason}", + "This computer": "Deze computer", + "This engine cannot re-tessellate CAD parts.": "Deze engine kan CAD-onderdelen niet opnieuw tesselleren.", + "Triangles now": "Huidige driehoeken", + "Try Again": "Opnieuw proberen", + "Unknown": "Onbekend", + "Unpacking": "Uitpakken", + "Version": "Versie", + "degrees": "graden", + "no reason was given": "er is geen reden opgegeven", + "{done} of {total}": "{done} van {total}", + "{n} files": "{n} bestanden", "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} uitgepakt, bestand voor bestand gecontroleerd", + "{tag}: none for this computer": "{tag}: geen voor deze computer", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} bestanden, {size} uitgepakt" } diff --git a/frontend/src/i18n/modules/cad/sv.json b/frontend/src/i18n/modules/cad/sv.json index 4debd1cd..925367ea 100644 --- a/frontend/src/i18n/modules/cad/sv.json +++ b/frontend/src/i18n/modules/cad/sv.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", + "% of the model size": "% av modellens storlek", + "About {n} triangles afterwards.": "Ungefär {n} trianglar efteråt.", + "All CAD parts": "Alla CAD-delar", + "Angle": "Vinkel", + "Angle in degrees": "Vinkel i grader", + "Apply": "Använd", + "Beside the FormShot engine": "Bredvid FormShot-motorn", + "CAD Import": "CAD-import", + "CAD Import Settings...": "CAD-importinställningar...", + "CAD Options in the Import Sheet": "CAD-alternativ i importrutan", + "CAD worker": "CAD-worker", + "CAD worker: {stage}, {pct}%": "CAD-worker: {stage}, {pct}%", + "Check the worker": "Kontrollera workern", + "Checking every file": "Kontrollerar varje fil", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Välj STEP- eller IGES-filer att importera; de öppnas via CAD-workern.", + "Chord": "Korda", + "Chord as a percentage of the model size": "Korda som procent av modellens storlek", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Kordan måste vara över 0 och högst {max}% av modellens storlek; vinkeln från {min} till {amax} grader.", + "Chord {chord}% of the model size, angle {angle} degrees": "Korda {chord}% av modellens storlek, vinkel {angle} grader", + "Could not re-tessellate: {reason}": "Det gick inte att tessellera om: {reason}", + "Custom": "Anpassad", + "Custom ({chord}%, {angle}°)": "Anpassad ({chord}%, {angle}°)", + "Default CAD quality": "Standard-CAD-kvalitet", + "Download": "Ladda ned", + "Download and check the program that opens STEP and IGES files.": "Ladda ned och kontrollera programmet som öppnar STEP- och IGES-filer.", + "Download the CAD Worker": "Ladda ned CAD-workern", + "Download the CAD worker": "Ladda ned CAD-workern", + "Downloaded into the cache folder": "Nedladdad till cachemappen", + "Downloading": "Laddar ned", + "Found in": "Hittades i", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Hur fint STEP- och IGES-ytor delas upp i trianglar vid import. Kordan är det största avståndet mellan en triangel och den verkliga ytan, som andel av hela modellens storlek; vinkeln är den största knäcken mellan angränsande trianglar. Finare inställningar tar längre tid och ger större filer. Importrutan börjar med det här valet; där kan du ändra det för en enskild import.", + "Installed": "Installerad", + "Mixed": "Blandad", + "Named by FORMSHOT_CAD_WORKER": "Angiven av FORMSHOT_CAD_WORKER", + "New quality": "Ny kvalitet", + "None of the selected parts came from a STEP or IGES file.": "Ingen av de markerade delarna kom från en STEP- eller IGES-fil.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Ingen av de markerade delarna kom från en STEP- eller IGES-fil. Avmarkera allt för att bygga om alla CAD-delar.", + "Not available.": "Inte tillgängligt.", + "Not available: {reason}": "Inte tillgängligt: {reason}", + "Not installed": "Inte installerad", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Inte installerad ännu. FormShot letar efter den i {folder}; ladda ned den här för att öppna STEP- och IGES-filer.", + "Not named": "Inte angiven", + "Not recorded": "Inte registrerad", + "Nothing in this document came from a STEP or IGES file.": "Inget i det här dokumentet kom från en STEP- eller IGES-fil.", + "Nothing is selected, so every CAD part is rebuilt.": "Inget är markerat, så alla CAD-delar byggs om.", + "Published": "Publicerad", + "Quality now": "Kvalitet nu", + "Re-tessellate CAD Parts": "Tessellera om CAD-delar", + "Re-tessellate CAD Parts...": "Tessellera om CAD-delar...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-del omtesselerad med {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-del omtesselerad med {quality}: {before} till {after} trianglar.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-delar omtesselerade med {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-delar omtesselerade med {quality}: {before} till {after} trianglar.", + "Re-tessellating": "Tesselerar om", + "Read the status again": "Läs statusen igen", + "Reading the published record": "Läser den publicerade posten", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Bygger om meshar för delar importerade från STEP eller IGES med en annan kvalitet, som ett enda ångrasteg.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- och IGES-filer öppnas av FormCADs kärn-worker, ett separat program som FormShot laddar ned en gång, kontrollerar fil för fil och behåller i din cachemapp. Andra modellformat behöver det inte.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- och IGES-filer kräver CAD-workern, och ingen är publicerad för den här datorn.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- och IGES-filer kräver CAD-workern, som inte är installerad ännu.", + "Selected CAD parts": "Markerade CAD-delar", + "Source": "Källa", + "The CAD worker is installed.": "CAD-workern är installerad.", + "The CAD worker is installed. You can import this file now.": "CAD-workern är installerad. Du kan importera den här filen nu.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "CAD-workern som öppnar STEP- och IGES-filer, och standardkvaliteten för CAD.", + "The FormShot service is not reachable.": "FormShot-tjänsten går inte att nå.", + "The download failed: {reason}": "Nedladdningen misslyckades: {reason}", + "The download was cancelled. Nothing was installed.": "Nedladdningen avbröts. Inget installerades.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Motorn ger ingen uppskattning; finare kvaliteter tar längre tid och ger fler trianglar.", + "The parts could not be read: {reason}": "Delarna kunde inte läsas: {reason}", + "The service cannot stop a download once it has started.": "Tjänsten kan inte stoppa en nedladdning när den har startat.", + "The service refused the request from this window.": "Tjänsten avvisade begäran från det här fönstret.", + "The status could not be read: {reason}": "Statusen kunde inte läsas: {reason}", + "The worker did not answer: {reason}": "Workern svarade inte: {reason}", + "This computer": "Den här datorn", + "This engine cannot re-tessellate CAD parts.": "Den här motorn kan inte tessellera om CAD-delar.", + "Triangles now": "Trianglar nu", + "Try Again": "Försök igen", + "Unknown": "Okänd", + "Unpacking": "Packar upp", "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "degrees": "grader", + "no reason was given": "ingen orsak angavs", + "{done} of {total}": "{done} av {total}", + "{n} files": "{n} filer", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokoll {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} uppackad, kontrollerad fil för fil", + "{tag}: none for this computer": "{tag}: ingen för den här datorn", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} filer, {size} uppackad" } From da0efc9cd2a7fa240ecaaf1b1291e6983156f6a0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:04:04 -0500 Subject: [PATCH 139/494] feat(i18n): translate the handoff page into four languages Translated the 60 handoff strings into Dutch, Swedish, Danish and Norwegian Bokmal. ./formshot i18n check passed at full coverage for all four. --- frontend/src/i18n/modules/handoff/da.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/nb.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/nl.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/sv.json | 120 +++++++++++----------- 4 files changed, 240 insertions(+), 240 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/da.json b/frontend/src/i18n/modules/handoff/da.json index a93ea0c0..78a2b0b0 100644 --- a/frontend/src/i18n/modules/handoff/da.json +++ b/frontend/src/i18n/modules/handoff/da.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 af {count}", + "A Form app is handing something over": "En Form-app afleverer noget", + "A mesh with maps by role": "Et mesh med maps efter rolle", + "A model file": "En modelfil", + "Add to this document": "Føj til dette dokument", + "Added {title} from {app}": "Tilføjede {title} fra {app}", + "Always allow": "Tillad altid", + "Always allow {app}": "Tillad altid {app}", + "An object from the GoF folder": "Et objekt fra GoF-mappen", + "another app": "en anden app", + "As a new document": "Som et nyt dokument", + "Base colour": "Basisfarve", + "Block": "Blokér", + "Choose a hand-off or give a path": "Vælg en overdragelse, eller angiv en sti", + "Contents": "Indhold", + "Could not be read": "Kunne ikke læses", + "Decline": "Afvis", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot overvåger GoF-mappen og FormSurfaces eksporter, så længe dette vindue er åbent. Når en Form-app afleverer noget, spørger FormShot her, før det åbnes.", + "FormSurface": "FormSurface", + "FormSurface exports": "Eksporter fra FormSurface", + "From": "Fra", + "GoF folder": "GoF-mappe", + "Hand-off Settings": "Indstillinger for overdragelse", + "Hand-offs": "Overdragelser", + "Hand-offs from {app}": "Overdragelser fra {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps efter rolle, uden mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "ikke fundet", + "Not read yet": "Endnu ikke læst", + "Nothing from the Form apps is waiting in their hand-off folders.": "Der venter intet fra Form-apps i deres overdragelsesmapper.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Intet åbnes, før du vælger. Teksturer bliver, hvor appen skrev dem, og refereres efter rolle.", + "Occlusion, roughness and metalness": "Okklusion, ruhed og metalness", + "Opacity": "Opacitet", + "Open a Hand-off": "Åbn en overdragelse", + "Open a Hand-off...": "Åbn en overdragelse...", + "Open it": "Åbn den", + "Open once": "Åbn én gang", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Åbn det, som FormSculpt, FormFabric, FormSurface eller FormCAD har afleveret", + "Opened {title} from {app} as a new document": "Åbnede {title} fra {app} som et nyt dokument", + "Or a path to a file or folder": "Eller en sti til en fil eller mappe", + "Other maps": "Andre maps", + "Reading...": "Læser...", + "Roughness": "Ruhed", + "Sent as": "Sendt som", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot-tjenesten er ikke tilgængelig, så disse valg kan ikke læses eller ændres nu.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Det, som FormSculpt og FormFabric lagde i GoF-mappen, og det, som FormSurface eksporterede. Det kræver ingen forespørgsel at åbne noget her, fordi du selv har valgt det.", + "{app} is handing over {title}: {what}.": "{app} afleverer {title}: {what}.", + "{count} maps from FormSurface": "{count} maps fra FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materialer", + "{format} file": "{format}-fil", + "{format} file, {count} triangles": "{format}-fil, {count} trekanter", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} trekanter, {materials} materialer", + "{n} days ago": "for {n} dage siden" } diff --git a/frontend/src/i18n/modules/handoff/nb.json b/frontend/src/i18n/modules/handoff/nb.json index a93ea0c0..0770ed42 100644 --- a/frontend/src/i18n/modules/handoff/nb.json +++ b/frontend/src/i18n/modules/handoff/nb.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 av {count}", + "A Form app is handing something over": "En Form-app overleverer noe", + "A mesh with maps by role": "Et mesh med maps etter rolle", + "A model file": "En modellfil", + "Add to this document": "Legg til i dette dokumentet", + "Added {title} from {app}": "La til {title} fra {app}", + "Always allow": "Tillat alltid", + "Always allow {app}": "Tillat alltid {app}", + "An object from the GoF folder": "Et objekt fra GoF-mappen", + "another app": "en annen app", + "As a new document": "Som et nytt dokument", + "Base colour": "Basisfarge", + "Block": "Blokker", + "Choose a hand-off or give a path": "Velg en overlevering eller oppgi en sti", + "Contents": "Innhold", + "Could not be read": "Kunne ikke leses", + "Decline": "Avslå", + "Emission": "Emisjon", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot overvåker GoF-mappen og eksportene fra FormSurface så lenge dette vinduet er åpent. Når en Form-app overleverer noe, spør FormShot her før det åpnes.", + "FormSurface": "FormSurface", + "FormSurface exports": "Eksporter fra FormSurface", + "From": "Fra", + "GoF folder": "GoF-mappe", + "Hand-off Settings": "Innstillinger for overlevering", + "Hand-offs": "Overleveringer", + "Hand-offs from {app}": "Overleveringer fra {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps etter rolle, uten mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "ikke funnet", + "Not read yet": "Ikke lest ennå", + "Nothing from the Form apps is waiting in their hand-off folders.": "Ingenting fra Form-appene venter i overleveringsmappene deres.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Ingenting åpnes før du velger. Teksturer blir liggende der appen skrev dem og refereres etter rolle.", + "Occlusion, roughness and metalness": "Okklusjon, ruhet og metalness", + "Opacity": "Opasitet", + "Open a Hand-off": "Åpne en overlevering", + "Open a Hand-off...": "Åpne en overlevering...", + "Open it": "Åpne den", + "Open once": "Åpne én gang", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Åpne det som FormSculpt, FormFabric, FormSurface eller FormCAD har overlevert", + "Opened {title} from {app} as a new document": "Åpnet {title} fra {app} som et nytt dokument", + "Or a path to a file or folder": "Eller en sti til en fil eller mappe", + "Other maps": "Andre maps", + "Reading...": "Leser...", + "Roughness": "Ruhet", + "Sent as": "Sendt som", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot-tjenesten er ikke tilgjengelig, så disse valgene kan ikke leses eller endres nå.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Det FormSculpt og FormFabric la i GoF-mappen og det FormSurface eksporterte. Å åpne noe her krever ingen bekreftelse, fordi du har valgt det selv.", + "{app} is handing over {title}: {what}.": "{app} overleverer {title}: {what}.", + "{count} maps from FormSurface": "{count} maps fra FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materialer", + "{format} file": "{format}-fil", + "{format} file, {count} triangles": "{format}-fil, {count} trekanter", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} trekanter, {materials} materialer", + "{n} days ago": "for {n} dager siden" } diff --git a/frontend/src/i18n/modules/handoff/nl.json b/frontend/src/i18n/modules/handoff/nl.json index a93ea0c0..2641a3a5 100644 --- a/frontend/src/i18n/modules/handoff/nl.json +++ b/frontend/src/i18n/modules/handoff/nl.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 van {count}", + "A Form app is handing something over": "Een Form-app draagt iets over", + "A mesh with maps by role": "Een mesh met maps per rol", + "A model file": "Een modelbestand", + "Add to this document": "Aan dit document toevoegen", + "Added {title} from {app}": "{title} uit {app} toegevoegd", + "Always allow": "Altijd toestaan", + "Always allow {app}": "{app} altijd toestaan", + "An object from the GoF folder": "Een object uit de GoF-map", + "another app": "een andere app", + "As a new document": "Als nieuw document", + "Base colour": "Basiskleur", + "Block": "Blokkeren", + "Choose a hand-off or give a path": "Kies een overdracht of geef een pad op", + "Contents": "Inhoud", + "Could not be read": "Kon niet worden gelezen", + "Decline": "Weigeren", + "Emission": "Emissie", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot bewaakt de GoF-map en de exports van FormSurface zolang dit venster openstaat. Als een Form-app iets overdraagt, vraagt FormShot hier eerst toestemming voordat het wordt geopend.", + "FormSurface": "FormSurface", + "FormSurface exports": "Exports van FormSurface", + "From": "Van", + "GoF folder": "GoF-map", + "Hand-off Settings": "Overdrachtsinstellingen", + "Hand-offs": "Overdrachten", + "Hand-offs from {app}": "Overdrachten van {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps per rol, zonder mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "niet gevonden", + "Not read yet": "Nog niet gelezen", + "Nothing from the Form apps is waiting in their hand-off folders.": "Er wacht niets van de Form-apps in hun overdrachtsmappen.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Er wordt niets geopend voordat je kiest. Teksturen blijven waar de app ze heeft geschreven en worden per rol aangeduid.", + "Occlusion, roughness and metalness": "Occlusie, ruwheid en metalness", + "Opacity": "Dekking", + "Open a Hand-off": "Een overdracht openen", + "Open a Hand-off...": "Een overdracht openen...", + "Open it": "Openen", + "Open once": "Eenmalig openen", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open wat FormSculpt, FormFabric, FormSurface of FormCAD heeft overgedragen", + "Opened {title} from {app} as a new document": "{title} uit {app} geopend als nieuw document", + "Or a path to a file or folder": "Of een pad naar een bestand of map", + "Other maps": "Overige maps", + "Reading...": "Lezen...", + "Roughness": "Ruwheid", + "Sent as": "Verzonden als", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "De FormShot-service is niet bereikbaar, dus deze keuzes kunnen nu niet worden gelezen of gewijzigd.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Wat FormSculpt en FormFabric in de GoF-map hebben gezet en wat FormSurface heeft geëxporteerd. Hier iets openen vraagt niet om bevestiging, want je hebt het zelf gekozen.", + "{app} is handing over {title}: {what}.": "{app} draagt {title} over: {what}.", + "{count} maps from FormSurface": "{count} maps van FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} materialen", + "{format} file": "{format}-bestand", + "{format} file, {count} triangles": "{format}-bestand, {count} driehoeken", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} driehoeken, {materials} materialen", + "{n} days ago": "{n} dagen geleden" } diff --git a/frontend/src/i18n/modules/handoff/sv.json b/frontend/src/i18n/modules/handoff/sv.json index a93ea0c0..1ee1ef01 100644 --- a/frontend/src/i18n/modules/handoff/sv.json +++ b/frontend/src/i18n/modules/handoff/sv.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 av {count}", + "A Form app is handing something over": "En Form-app lämnar över något", + "A mesh with maps by role": "En mesh med maps per roll", + "A model file": "En modellfil", + "Add to this document": "Lägg till i det här dokumentet", + "Added {title} from {app}": "Lade till {title} från {app}", + "Always allow": "Tillåt alltid", + "Always allow {app}": "Tillåt alltid {app}", + "An object from the GoF folder": "Ett objekt från GoF-mappen", + "another app": "en annan app", + "As a new document": "Som ett nytt dokument", + "Base colour": "Basfärg", + "Block": "Blockera", + "Choose a hand-off or give a path": "Välj en överlämning eller ange en sökväg", + "Contents": "Innehåll", + "Could not be read": "Kunde inte läsas", + "Decline": "Avböj", + "Emission": "Emission", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot bevakar GoF-mappen och FormSurfaces exporter så länge det här fönstret är öppet. När en Form-app lämnar över något frågar FormShot här innan det öppnas.", + "FormSurface": "FormSurface", + "FormSurface exports": "Exporter från FormSurface", + "From": "Från", + "GoF folder": "GoF-mapp", + "Hand-off Settings": "Inställningar för överlämning", + "Hand-offs": "Överlämningar", + "Hand-offs from {app}": "Överlämningar från {app}", + "Maps": "Maps", + "Maps by role, without a mesh": "Maps per roll, utan mesh", + "Metalness": "Metallighet", + "Normal": "Normal", + "not found": "hittades inte", + "Not read yet": "Inte läst ännu", + "Nothing from the Form apps is waiting in their hand-off folders.": "Inget från Form-apparna väntar i deras överlämningsmappar.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Inget öppnas förrän du väljer. Texturer ligger kvar där appen skrev dem och refereras per roll.", + "Occlusion, roughness and metalness": "Ocklusion, råhet och metallighet", + "Opacity": "Opacitet", + "Open a Hand-off": "Öppna en överlämning", + "Open a Hand-off...": "Öppna en överlämning...", + "Open it": "Öppna den", + "Open once": "Öppna en gång", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Öppna det som FormSculpt, FormFabric, FormSurface eller FormCAD lämnat över", + "Opened {title} from {app} as a new document": "Öppnade {title} från {app} som ett nytt dokument", + "Or a path to a file or folder": "Eller en sökväg till en fil eller mapp", + "Other maps": "Övriga maps", + "Reading...": "Läser...", + "Roughness": "Råhet", + "Sent as": "Skickat som", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot-tjänsten går inte att nå, så de här valen kan inte läsas eller ändras nu.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Det som FormSculpt och FormFabric lade i GoF-mappen och det som FormSurface exporterade. Att öppna något här kräver ingen fråga, eftersom du har valt det.", + "{app} is handing over {title}: {what}.": "{app} lämnar över {title}: {what}.", + "{count} maps from FormSurface": "{count} maps från FormSurface", + "{count} maps: {roles}": "{count} maps: {roles}", + "{count} materials": "{count} material", + "{format} file": "{format}-fil", + "{format} file, {count} triangles": "{format}-fil, {count} trianglar", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshar, {triangles} trianglar, {materials} material", + "{n} days ago": "för {n} dagar sedan" } From 0fbc1cf459adccc9f691ff605c6064e2ee1aee12 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:48 -0500 Subject: [PATCH 140/494] feat(i18n): translate the import page into four languages Translated the 88 import strings into Finnish, Polish, Czech and Hungarian, keeping placeholders and format names. ./formshot i18n check passed. --- frontend/src/i18n/modules/import/cs.json | 174 +++++++++++------------ frontend/src/i18n/modules/import/fi.json | 174 +++++++++++------------ frontend/src/i18n/modules/import/hu.json | 174 +++++++++++------------ frontend/src/i18n/modules/import/pl.json | 172 +++++++++++----------- 4 files changed, 347 insertions(+), 347 deletions(-) diff --git a/frontend/src/i18n/modules/import/cs.json b/frontend/src/i18n/modules/import/cs.json index ac317572..d803738c 100644 --- a/frontend/src/i18n/modules/import/cs.json +++ b/frontend/src/i18n/modules/import/cs.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "3D modely", + "Automatic": "Automaticky", + "CAD quality": "Kvalita CAD", + "Centimetres (cm)": "Centimetry (cm)", + "Centre on the origin": "Vystředit na počátek", + "Choose model files and import them into the scene with options.": "Vyberte soubory modelů a importujte je do scény s využitím voleb.", + "Cleaning up meshes": "Čištění sítí", + "Clear Recent Imports": "Vymazat nedávné importy", + "Could not import the file: {reason}": "Soubor se nepodařilo importovat: {reason}", + "Could not import {name}: {reason}": "Soubor {name} se nepodařilo importovat: {reason}", + "Could not open {name}: {reason}": "Soubor {name} se nepodařilo otevřít: {reason}", + "Could not read the file: {reason}": "Soubor se nepodařilo přečíst: {reason}", + "Could not reimport: {reason}": "Opakovaný import se nezdařil: {reason}", + "Could not send the file: {reason}": "Soubor se nepodařilo odeslat: {reason}", + "Discard unsaved changes?": "Zahodit neuložené změny?", + "Draft": "Koncept", + "Drop to import into the scene": "Pusťte pro import do scény", + "Feet (ft)": "Stopy (ft)", + "Format": "Formát", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot otevírá najednou jen jeden projekt; ostatní soubory projektů ({n}) zůstaly neotevřené.", + "Frame the view after import": "Po importu zarámovat pohled", + "High": "Vysoká", + "Import": "Importovat", + "Import All": "Importovat vše", + "Import Files": "Importovat soubory", + "Import Model": "Importovat model", + "Import Recent File": "Importovat nedávný soubor", + "Imported {name}.": "Importováno: {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Importováno: {name}, {parts} částí, {triangles} trojúhelníků.", + "Imported {name}: {parts} parts.": "Importováno: {name}, {parts} částí.", + "Importing": "Importuje se", + "In this file": "V tomto souboru", + "Inches (in)": "Palce (in)", + "Making materials": "Vytváření materiálů", + "Materials": "Materiály", + "Medium": "Střední", + "Merge into one group": "Sloučit do jedné skupiny", + "Metres (m)": "Metry (m)", + "Millimetres (mm)": "Milimetry (mm)", + "No Recent Imports": "Žádné nedávné importy", + "No warnings.": "Žádná upozornění.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Není co importovat: FormShot importuje soubory GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP a IGES.", + "One file beside it": "Jeden soubor vedle něj", + "Opening {name} will close the open project and discard its unsaved changes.": "Otevřením {name} se zavře otevřený projekt a zahodí se jeho neuložené změny.", + "Options": "Možnosti", + "Parts": "Části", + "Placing in the scene": "Umísťování do scény", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Znovu načte zdrojové soubory vybraných částí (nebo všech importovaných částí) a ponechá jejich materiály.", + "Reading the file": "Čtení souboru", + "Reading the file...": "Čtení souboru...", + "Recent Imports": "Nedávné importy", + "Reimport": "Importovat znovu", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Znovu importováno: aktualizováno {matched}, nových {added}, skryto {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Odešlete soubory modelů do FormShotu a importujte je do scény s využitím voleb.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Více souborů se importuje jeden po druhém. Vyrovnávací paměti, materiály a textury vedle modelu se importují spolu s ním.", + "Size": "Velikost", + "Stand on the floor": "Postavit na podlahu", + "Tessellating CAD surfaces": "Teselace ploch CAD", + "The engine decides from the file.": "Engine rozhodne podle souboru.", + "The engine did not start an import job": "Engine nespustil úlohu importu", + "The engine did not start in time, so the files FormShot was given were not opened.": "Engine se nespustil včas, takže soubory předané FormShotu nebyly otevřeny.", + "The file says it is in {unit}.": "Soubor udává jednotku: {unit}.", + "The import failed": "Import se nezdařil", + "The import goes on; the files after it were not imported.": "Import pokračuje; následující soubory nebyly importovány.", + "The import of {name} was cancelled.": "Import souboru {name} byl zrušen.", + "The upload failed ({status})": "Nahrání se nezdařilo ({status})", + "The upload was cancelled": "Nahrávání bylo zrušeno", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Tento engine se nemůže před importem podívat dovnitř souboru, takže souhrn zůstane prázdný.", + "This engine cannot stop an import once it has started": "Tento engine nemůže zastavit import, jakmile začal", + "This engine imports in one step, so there is no progress to show or stop.": "Tento engine importuje jedním krokem, takže není co zobrazit ani zastavit.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Soubor neuvádí jednotky. FormShot podle velikosti odhadl jednotky ({unit}); před importem je zkontrolujte.", + "Triangles": "Trojúhelníky", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Jednotky", + "Up axis": "Osa nahoru", + "Up axis in file": "Osa nahoru v souboru", + "Uploading": "Nahrávání", + "Y is up": "Y je nahoru", + "Z is up": "Z je nahoru", + "centimetres": "centimetry", + "feet": "stopy", + "inches": "palce", + "metres": "metry", + "millimetres": "milimetry", + "{i} of {n}": "{i} z {n}", + "{n} files beside it": "{n} souborů vedle něj", + "{n} files were not imported.": "Nebylo importováno souborů: {n}.", + "{n} warnings; the Scene page lists the parts.": "Upozornění: {n}; části vypisuje stránka scény." } diff --git a/frontend/src/i18n/modules/import/fi.json b/frontend/src/i18n/modules/import/fi.json index ac317572..ec02e146 100644 --- a/frontend/src/i18n/modules/import/fi.json +++ b/frontend/src/i18n/modules/import/fi.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "3D-mallit", + "Automatic": "Automaattinen", + "CAD quality": "CAD-laatu", + "Centimetres (cm)": "Senttimetrit (cm)", + "Centre on the origin": "Keskitä origoon", + "Choose model files and import them into the scene with options.": "Valitse mallitiedostot ja tuo ne kohtaukseen asetusten kanssa.", + "Cleaning up meshes": "Siivotaan verkkoja", + "Clear Recent Imports": "Tyhjennä viimeisimmät tuonnit", + "Could not import the file: {reason}": "Tiedostoa ei voitu tuoda: {reason}", + "Could not import {name}: {reason}": "Tiedostoa {name} ei voitu tuoda: {reason}", + "Could not open {name}: {reason}": "Tiedostoa {name} ei voitu avata: {reason}", + "Could not read the file: {reason}": "Tiedostoa ei voitu lukea: {reason}", + "Could not reimport: {reason}": "Uudelleentuonti epäonnistui: {reason}", + "Could not send the file: {reason}": "Tiedostoa ei voitu lähettää: {reason}", + "Discard unsaved changes?": "Hylätäänkö tallentamattomat muutokset?", + "Draft": "Luonnos", + "Drop to import into the scene": "Pudota tuodaksesi kohtaukseen", + "Feet (ft)": "Jalat (ft)", + "Format": "Muoto", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot avaa yhden projektin kerrallaan; {n} muuta projektitiedostoa jätettiin avaamatta.", + "Frame the view after import": "Rajaa näkymä tuonnin jälkeen", + "High": "Korkea", + "Import": "Tuo", + "Import All": "Tuo kaikki", + "Import Files": "Tuo tiedostot", + "Import Model": "Tuo malli", + "Import Recent File": "Tuo viimeaikainen tiedosto", + "Imported {name}.": "{name} tuotu.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} tuotu: {parts} osaa, {triangles} kolmiota.", + "Imported {name}: {parts} parts.": "{name} tuotu: {parts} osaa.", + "Importing": "Tuodaan", + "In this file": "Tässä tiedostossa", + "Inches (in)": "Tuumat (in)", + "Making materials": "Luodaan materiaaleja", + "Materials": "Materiaalit", + "Medium": "Keskitaso", + "Merge into one group": "Yhdistä yhdeksi ryhmäksi", + "Metres (m)": "Metrit (m)", + "Millimetres (mm)": "Millimetrit (mm)", + "No Recent Imports": "Ei viimeisimpiä tuonteja", + "No warnings.": "Ei varoituksia.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Ei tuotavaa: FormShot tuo GLB-, glTF-, OBJ-, STL-, PLY-, 3MF-, FBX-, STEP- ja IGES-tiedostoja.", + "One file beside it": "Yksi tiedosto sen vieressä", + "Opening {name} will close the open project and discard its unsaved changes.": "Kohteen {name} avaaminen sulkee avoimen projektin ja hylkää sen tallentamattomat muutokset.", + "Options": "Valinnat", + "Parts": "Osat", + "Placing in the scene": "Sijoitetaan kohtaukseen", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Lue valittujen osien (tai kaikkien tuotujen osien) lähdetiedostot uudelleen ja säilytä niiden materiaalit.", + "Reading the file": "Luetaan tiedostoa", + "Reading the file...": "Luetaan tiedostoa...", + "Recent Imports": "Viimeisimmät tuonnit", + "Reimport": "Tuo uudelleen", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Tuotu uudelleen: päivitetty {matched}, uusia {added}, piilotettu {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Lähetä mallitiedostot FormShotiin ja tuo ne kohtaukseen asetusten kanssa.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Useat tiedostot tuodaan peräkkäin. Mallin vieressä olevat puskurit, materiaalit ja tekstuurit tulevat sen mukana.", + "Size": "Koko", + "Stand on the floor": "Aseta lattialle", + "Tessellating CAD surfaces": "Tesseloidaan CAD-pintoja", + "The engine decides from the file.": "Moottori päättää tiedoston perusteella.", + "The engine did not start an import job": "Moottori ei käynnistänyt tuontityötä", + "The engine did not start in time, so the files FormShot was given were not opened.": "Moottori ei käynnistynyt ajoissa, joten FormShotille annettuja tiedostoja ei avattu.", + "The file says it is in {unit}.": "Tiedoston ilmoittama yksikkö: {unit}.", + "The import failed": "Tuonti epäonnistui", + "The import goes on; the files after it were not imported.": "Tuonti jatkuu; sen jälkeisiä tiedostoja ei tuotu.", + "The import of {name} was cancelled.": "Kohteen {name} tuonti peruttiin.", + "The upload failed ({status})": "Lähetys epäonnistui ({status})", + "The upload was cancelled": "Lähetys peruttiin", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Tämä moottori ei voi katsoa tiedoston sisään ennen tuontia, joten yhteenveto jää tyhjäksi.", + "This engine cannot stop an import once it has started": "Tämä moottori ei voi pysäyttää tuontia sen alettua", + "This engine imports in one step, so there is no progress to show or stop.": "Tämä moottori tuo yhdessä vaiheessa, joten edistymistä ei voi näyttää eikä pysäyttää.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Tiedosto ei kerro yksikköjään. FormShotin koon perusteella arvaama yksikkö on {unit}; tarkista se ennen tuontia.", + "Triangles": "Kolmiot", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Yksiköt", + "Up axis": "Ylöspäin osoittava akseli", + "Up axis in file": "Ylöspäin osoittava akseli tiedostossa", + "Uploading": "Lähetetään", + "Y is up": "Y on ylös", + "Z is up": "Z on ylös", + "centimetres": "senttimetrit", + "feet": "jalat", + "inches": "tuumat", + "metres": "metrit", + "millimetres": "millimetrit", + "{i} of {n}": "{i} / {n}", + "{n} files beside it": "{n} tiedostoa sen vieressä", + "{n} files were not imported.": "{n} tiedostoa jäi tuomatta.", + "{n} warnings; the Scene page lists the parts.": "{n} varoitusta; Kohtaussivu luettelee osat." } diff --git a/frontend/src/i18n/modules/import/hu.json b/frontend/src/i18n/modules/import/hu.json index ac317572..ea519006 100644 --- a/frontend/src/i18n/modules/import/hu.json +++ b/frontend/src/i18n/modules/import/hu.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "3D modellek", + "Automatic": "Automatikus", + "CAD quality": "CAD-minőség", + "Centimetres (cm)": "Centiméter (cm)", + "Centre on the origin": "Középre az origóba", + "Choose model files and import them into the scene with options.": "Válassza ki a modellfájlokat, és importálja őket a jelenetbe a beállítások megadásával.", + "Cleaning up meshes": "Hálók tisztítása", + "Clear Recent Imports": "Legutóbbi importálások törlése", + "Could not import the file: {reason}": "A fájlt nem sikerült importálni: {reason}", + "Could not import {name}: {reason}": "A(z) {name} importálása nem sikerült: {reason}", + "Could not open {name}: {reason}": "A(z) {name} megnyitása nem sikerült: {reason}", + "Could not read the file: {reason}": "A fájlt nem sikerült beolvasni: {reason}", + "Could not reimport: {reason}": "Az újraimportálás nem sikerült: {reason}", + "Could not send the file: {reason}": "A fájlt nem sikerült elküldeni: {reason}", + "Discard unsaved changes?": "Elveti a nem mentett módosításokat?", + "Draft": "Vázlat", + "Drop to import into the scene": "Engedje el az importáláshoz a jelenetbe", + "Feet (ft)": "Láb (ft)", + "Format": "Formátum", + "FormShot opens one project at a time; {n} other project files were left unopened.": "A FormShot egyszerre egy projektet nyit meg; {n} további projektfájl nyitatlan maradt.", + "Frame the view after import": "Nézet kadrírozása importálás után", + "High": "Magas", + "Import": "Importálás", + "Import All": "Összes importálása", + "Import Files": "Fájlok importálása", + "Import Model": "Modell importálása", + "Import Recent File": "Legutóbbi fájl importálása", + "Imported {name}.": "Importálva: {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Importálva: {name}, {parts} alkatrész, {triangles} háromszög.", + "Imported {name}: {parts} parts.": "Importálva: {name}, {parts} alkatrész.", + "Importing": "Importálás", + "In this file": "Ebben a fájlban", + "Inches (in)": "Hüvelyk (in)", + "Making materials": "Anyagok létrehozása", + "Materials": "Anyagok", + "Medium": "Közepes", + "Merge into one group": "Egyesítés egy csoportba", + "Metres (m)": "Méter (m)", + "Millimetres (mm)": "Milliméter (mm)", + "No Recent Imports": "Nincsenek legutóbbi importálások", + "No warnings.": "Nincsenek figyelmeztetések.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nincs mit importálni: a FormShot GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP és IGES fájlokat importál.", + "One file beside it": "Egy fájl mellette", + "Opening {name} will close the open project and discard its unsaved changes.": "A(z) {name} megnyitása bezárja a megnyitott projektet, és elveti annak nem mentett módosításait.", + "Options": "Opciók", + "Parts": "Alkatrészek", + "Placing in the scene": "Elhelyezés a jelenetben", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "A kijelölt (vagy az összes importált) alkatrész forrásfájljainak újraolvasása az anyagok megtartásával.", + "Reading the file": "Fájl beolvasása", + "Reading the file...": "Fájl beolvasása...", + "Recent Imports": "Legutóbbi importálások", + "Reimport": "Újraimportálás", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Újraimportálva: frissítve {matched}, új {added}, elrejtve {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Küldje el a modellfájlokat a FormShotnak, és importálja őket a jelenetbe a beállítások megadásával.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Több fájl importálása egymás után történik. A modell melletti pufferek, anyagok és textúrák vele együtt kerülnek be.", + "Size": "Méret", + "Stand on the floor": "Padlóra állítás", + "Tessellating CAD surfaces": "CAD-felületek tesszellálása", + "The engine decides from the file.": "A motor a fájl alapján dönt.", + "The engine did not start an import job": "A motor nem indított importfeladatot", + "The engine did not start in time, so the files FormShot was given were not opened.": "A motor nem indult el időben, ezért a FormShotnak átadott fájlok nem nyíltak meg.", + "The file says it is in {unit}.": "A fájl szerint a mértékegység: {unit}.", + "The import failed": "Az importálás sikertelen", + "The import goes on; the files after it were not imported.": "Az importálás folytatódik; a következő fájlok nem lettek importálva.", + "The import of {name} was cancelled.": "A(z) {name} importálása megszakadt.", + "The upload failed ({status})": "A feltöltés sikertelen ({status})", + "The upload was cancelled": "A feltöltés megszakadt", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Ez a motor importálás előtt nem tud belenézni a fájlba, ezért az összegzés üres marad.", + "This engine cannot stop an import once it has started": "Ez a motor nem tudja leállítani az importálást, ha az már elindult", + "This engine imports in one step, so there is no progress to show or stop.": "Ez a motor egy lépésben importál, ezért nincs megjeleníthető vagy leállítható folyamat.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "A fájl nem adja meg a mértékegységét. A FormShot a méret alapján a következőt találta ki: {unit}; importálás előtt ellenőrizze.", + "Triangles": "Háromszögek", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Mértékegységek", + "Up axis": "Felfelé mutató tengely", + "Up axis in file": "Felfelé mutató tengely a fájlban", + "Uploading": "Feltöltés", + "Y is up": "Az Y felfelé mutat", + "Z is up": "A Z felfelé mutat", + "centimetres": "centiméter", + "feet": "láb", + "inches": "hüvelyk", + "metres": "méter", + "millimetres": "milliméter", + "{i} of {n}": "{i} / {n}", + "{n} files beside it": "{n} fájl mellette", + "{n} files were not imported.": "{n} fájl nem lett importálva.", + "{n} warnings; the Scene page lists the parts.": "{n} figyelmeztetés; az alkatrészeket a Jelenet oldal sorolja fel." } diff --git a/frontend/src/i18n/modules/import/pl.json b/frontend/src/i18n/modules/import/pl.json index ac317572..e94ff983 100644 --- a/frontend/src/i18n/modules/import/pl.json +++ b/frontend/src/i18n/modules/import/pl.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "Modele 3D", + "Automatic": "Automatyczne", + "CAD quality": "Jakość CAD", + "Centimetres (cm)": "Centymetry (cm)", + "Centre on the origin": "Wyśrodkuj na początku układu", + "Choose model files and import them into the scene with options.": "Wybierz pliki modeli i zaimportuj je do sceny z wybranymi opcjami.", + "Cleaning up meshes": "Czyszczenie siatek", + "Clear Recent Imports": "Wyczyść ostatnie importy", + "Could not import the file: {reason}": "Nie udało się zaimportować pliku: {reason}", + "Could not import {name}: {reason}": "Nie udało się zaimportować {name}: {reason}", + "Could not open {name}: {reason}": "Nie udało się otworzyć {name}: {reason}", + "Could not read the file: {reason}": "Nie udało się odczytać pliku: {reason}", + "Could not reimport: {reason}": "Nie udało się ponownie zaimportować: {reason}", + "Could not send the file: {reason}": "Nie udało się wysłać pliku: {reason}", + "Discard unsaved changes?": "Odrzucić niezapisane zmiany?", + "Draft": "Szkic", + "Drop to import into the scene": "Upuść, aby zaimportować do sceny", + "Feet (ft)": "Stopy (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot otwiera jeden projekt naraz; pozostałe pliki projektów ({n}) zostały pominięte.", + "Frame the view after import": "Wyśrodkuj widok po imporcie", + "High": "Wysoka", + "Import": "Importuj", + "Import All": "Importuj wszystko", + "Import Files": "Importuj pliki", + "Import Model": "Importuj model", + "Import Recent File": "Importuj ostatni plik", + "Imported {name}.": "Zaimportowano {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Zaimportowano {name}: części: {parts}, trójkąty: {triangles}.", + "Imported {name}: {parts} parts.": "Zaimportowano {name}: części: {parts}.", + "Importing": "Importowanie", + "In this file": "W tym pliku", + "Inches (in)": "Cale (in)", + "Making materials": "Tworzenie materiałów", + "Materials": "Materiały", + "Medium": "Średnia", + "Merge into one group": "Scal w jedną grupę", + "Metres (m)": "Metry (m)", + "Millimetres (mm)": "Milimetry (mm)", + "No Recent Imports": "Brak ostatnich importów", + "No warnings.": "Brak ostrzeżeń.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nie ma czego importować: FormShot importuje pliki GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP i IGES.", + "One file beside it": "Jeden plik obok niego", + "Opening {name} will close the open project and discard its unsaved changes.": "Otwarcie {name} zamknie otwarty projekt i odrzuci jego niezapisane zmiany.", + "Options": "Opcje", + "Parts": "Części", + "Placing in the scene": "Umieszczanie w scenie", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Odczytaj ponownie pliki źródłowe zaznaczonych części (lub wszystkich zaimportowanych części), zachowując ich materiały.", + "Reading the file": "Odczytywanie pliku", + "Reading the file...": "Odczytywanie pliku...", + "Recent Imports": "Ostatnie importy", + "Reimport": "Importuj ponownie", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Zaimportowano ponownie: zaktualizowano {matched}, nowe {added}, ukryte {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Wyślij pliki modeli do FormShot i zaimportuj je do sceny z opcjami.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Kilka plików jest importowanych jeden po drugim. Bufory, materiały i tekstury leżące obok modelu są importowane razem z nim.", + "Size": "Rozmiar", + "Stand on the floor": "Postaw na podłodze", + "Tessellating CAD surfaces": "Teselacja powierzchni CAD", + "The engine decides from the file.": "Silnik zdecyduje na podstawie pliku.", + "The engine did not start an import job": "Silnik nie rozpoczął zadania importu", + "The engine did not start in time, so the files FormShot was given were not opened.": "Silnik nie uruchomił się na czas, więc pliki przekazane FormShot nie zostały otwarte.", + "The file says it is in {unit}.": "Plik podaje jednostkę: {unit}.", + "The import failed": "Import nie powiódł się", + "The import goes on; the files after it were not imported.": "Import trwa dalej; kolejne pliki nie zostały zaimportowane.", + "The import of {name} was cancelled.": "Anulowano import {name}.", + "The upload failed ({status})": "Przesyłanie nie powiodło się ({status})", + "The upload was cancelled": "Przesyłanie zostało anulowane", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Ten silnik nie potrafi zajrzeć do pliku przed importem, więc podsumowanie pozostaje puste.", + "This engine cannot stop an import once it has started": "Ten silnik nie może zatrzymać importu po jego rozpoczęciu", + "This engine imports in one step, so there is no progress to show or stop.": "Ten silnik importuje w jednym kroku, więc nie ma postępu do pokazania ani do zatrzymania.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Plik nie podaje jednostek. FormShot odgadł jednostkę ({unit}) na podstawie rozmiaru; sprawdź ją przed importem.", + "Triangles": "Trójkąty", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Jednostki", + "Up axis": "Oś pionowa", + "Up axis in file": "Oś pionowa w pliku", + "Uploading": "Przesyłanie", + "Y is up": "Y jest osią pionową", + "Z is up": "Z jest osią pionową", + "centimetres": "centymetry", + "feet": "stopy", + "inches": "cale", + "metres": "metry", + "millimetres": "milimetry", + "{i} of {n}": "{i} z {n}", + "{n} files beside it": "{n} plików obok niego", + "{n} files were not imported.": "Nie zaimportowano plików: {n}.", + "{n} warnings; the Scene page lists the parts.": "Ostrzeżenia: {n}; części wymienia strona sceny." } From 300bb755c17ff9e6f8fde3598f01df0e0c952a3a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:04:20 -0500 Subject: [PATCH 141/494] feat(i18n): translate the hand-off page into four languages Translated the 57 hand-off strings into Finnish, Polish, Czech and Hungarian, keeping placeholders and app names. ./formshot i18n check passed. --- frontend/src/i18n/modules/handoff/cs.json | 112 +++++++++++----------- frontend/src/i18n/modules/handoff/fi.json | 112 +++++++++++----------- frontend/src/i18n/modules/handoff/hu.json | 112 +++++++++++----------- frontend/src/i18n/modules/handoff/pl.json | 112 +++++++++++----------- 4 files changed, 224 insertions(+), 224 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/cs.json b/frontend/src/i18n/modules/handoff/cs.json index a93ea0c0..f7d2384a 100644 --- a/frontend/src/i18n/modules/handoff/cs.json +++ b/frontend/src/i18n/modules/handoff/cs.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", + "1 of {count}": "1 z {count}", + "A Form app is handing something over": "Aplikace Form něco předává", + "A mesh with maps by role": "Síť s mapami podle role", + "A model file": "Soubor modelu", + "Add to this document": "Přidat do tohoto dokumentu", + "Added {title} from {app}": "Přidáno {title} z aplikace {app}", + "Always allow": "Vždy povolit", + "Always allow {app}": "Vždy povolit aplikaci {app}", + "An object from the GoF folder": "Objekt ze složky GoF", + "another app": "jiná aplikace", + "As a new document": "Jako nový dokument", + "Base colour": "Základní barva", + "Block": "Zablokovat", + "Choose a hand-off or give a path": "Vyberte předání nebo zadejte cestu", + "Contents": "Obsah", + "Could not be read": "Nepodařilo se přečíst", + "Decline": "Odmítnout", + "Emission": "Emise", "FormCAD": "FormCAD", "FormFabric": "FormFabric", "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot sleduje složku GoF a exporty z FormSurface, dokud je toto okno otevřené. Když aplikace Form něco předá, FormShot se zde zeptá, než to otevře.", "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "FormSurface exports": "Exporty z FormSurface", + "From": "Od", + "GoF folder": "Složka GoF", + "Hand-off Settings": "Nastavení předání", + "Hand-offs": "Předání", + "Hand-offs from {app}": "Předání z aplikace {app}", + "Maps": "Mapy", + "Maps by role, without a mesh": "Mapy podle role, bez sítě", + "Metalness": "Kovovost", + "Normal": "Normálová", + "not found": "nenalezeno", + "Not read yet": "Zatím nepřečteno", + "Nothing from the Form apps is waiting in their hand-off folders.": "V předávacích složkách aplikací Form nic nečeká.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nic se neotevře, dokud nevyberete. Textury zůstanou tam, kam je aplikace zapsala, a odkazuje se na ně podle role.", + "Occlusion, roughness and metalness": "Okluze, drsnost a kovovost", + "Opacity": "Neprůhlednost", + "Open a Hand-off": "Otevřít předání", + "Open a Hand-off...": "Otevřít předání...", + "Open it": "Otevřít", + "Open once": "Otevřít jednou", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Otevřít to, co předal FormSculpt, FormFabric, FormSurface nebo FormCAD", + "Opened {title} from {app} as a new document": "{title} z aplikace {app} bylo otevřeno jako nový dokument", + "Or a path to a file or folder": "Nebo cesta k souboru či složce", + "Other maps": "Další mapy", + "Reading...": "Čtení...", + "Roughness": "Drsnost", + "Sent as": "Odesláno jako", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Služba FormShot není dostupná, takže tyto volby nelze nyní přečíst ani změnit.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "To, co FormSculpt a FormFabric vložily do složky GoF a co exportoval FormSurface. Otevření odtud nevyžaduje potvrzení, protože jste to sami zvolili.", + "{app} is handing over {title}: {what}.": "{app} předává {title}: {what}.", + "{count} maps from FormSurface": "{count} map z FormSurface", + "{count} maps: {roles}": "{count} map: {roles}", + "{count} materials": "{count} materiálů", + "{format} file": "Soubor {format}", + "{format} file, {count} triangles": "Soubor {format}, {count} trojúhelníků", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} sítí, {triangles} trojúhelníků, {materials} materiálů", + "{n} days ago": "před {n} dny" } diff --git a/frontend/src/i18n/modules/handoff/fi.json b/frontend/src/i18n/modules/handoff/fi.json index a93ea0c0..2d5bda16 100644 --- a/frontend/src/i18n/modules/handoff/fi.json +++ b/frontend/src/i18n/modules/handoff/fi.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", + "1 of {count}": "1 / {count}", + "A Form app is handing something over": "Form-sovellus luovuttaa jotakin", + "A mesh with maps by role": "Verkko, jonka kartat on annettu roolin mukaan", + "A model file": "Mallitiedosto", + "Add to this document": "Lisää tähän dokumenttiin", + "Added {title} from {app}": "{title} lisätty sovelluksesta {app}", + "Always allow": "Salli aina", + "Always allow {app}": "Salli {app} aina", + "An object from the GoF folder": "Objekti GoF-kansiosta", + "another app": "toinen sovellus", + "As a new document": "Uutena dokumenttina", + "Base colour": "Perusväri", + "Block": "Estä", + "Choose a hand-off or give a path": "Valitse siirto tai anna polku", + "Contents": "Sisältö", + "Could not be read": "Lukeminen ei onnistunut", + "Decline": "Hylkää", + "Emission": "Emissio", "FormCAD": "FormCAD", "FormFabric": "FormFabric", "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot seuraa GoF-kansiota ja FormSurfacen vientejä, kun tämä ikkuna on auki. Kun Form-sovellus luovuttaa jotakin, FormShot kysyy täällä ennen sen avaamista.", "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "FormSurface exports": "FormSurfacen viennit", + "From": "Lähde", + "GoF folder": "GoF-kansio", + "Hand-off Settings": "Siirtojen asetukset", + "Hand-offs": "Siirrot", + "Hand-offs from {app}": "Siirrot sovelluksesta {app}", + "Maps": "Kartat", + "Maps by role, without a mesh": "Kartat rooleittain, ilman verkkoa", + "Metalness": "Metallisuus", + "Normal": "Normaali", + "not found": "ei löytynyt", + "Not read yet": "Ei vielä luettu", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form-sovellusten siirtokansioissa ei odota mitään.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Mitään ei avata ennen kuin valitset. Tekstuurit pysyvät siellä, minne sovellus ne kirjoitti, ja niihin viitataan roolin mukaan.", + "Occlusion, roughness and metalness": "Okkluusio, karheus ja metallisuus", + "Opacity": "Peittävyys", + "Open a Hand-off": "Avaa siirto", + "Open a Hand-off...": "Avaa siirto...", + "Open it": "Avaa se", + "Open once": "Avaa kerran", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Avaa se, minkä FormSculpt, FormFabric, FormSurface tai FormCAD luovutti", + "Opened {title} from {app} as a new document": "{title} avattu sovelluksesta {app} uutena dokumenttina", + "Or a path to a file or folder": "Tai polku tiedostoon tai kansioon", + "Other maps": "Muut kartat", + "Reading...": "Luetaan...", + "Roughness": "Karheus", + "Sent as": "Lähetetty muodossa", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot-palvelu ei ole tavoitettavissa, joten näitä valintoja ei voi nyt lukea eikä muuttaa.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Se, mitä FormSculpt ja FormFabric ovat laittaneet GoF-kansioon ja mitä FormSurface on viennyt. Täällä avaaminen ei vaadi kehotetta, koska olet itse valinnut sen.", + "{app} is handing over {title}: {what}.": "{app} luovuttaa kohteen {title}: {what}.", + "{count} maps from FormSurface": "{count} karttaa FormSurfacesta", + "{count} maps: {roles}": "{count} karttaa: {roles}", + "{count} materials": "{count} materiaalia", + "{format} file": "{format}-tiedosto", + "{format} file, {count} triangles": "{format}-tiedosto, {count} kolmiota", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} verkkoa, {triangles} kolmiota, {materials} materiaalia", + "{n} days ago": "{n} päivää sitten" } diff --git a/frontend/src/i18n/modules/handoff/hu.json b/frontend/src/i18n/modules/handoff/hu.json index a93ea0c0..d01cdda7 100644 --- a/frontend/src/i18n/modules/handoff/hu.json +++ b/frontend/src/i18n/modules/handoff/hu.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", + "1 of {count}": "1 / {count}", + "A Form app is handing something over": "Egy Form alkalmazás átad valamit", + "A mesh with maps by role": "Háló szerepük szerinti térképekkel", + "A model file": "Modellfájl", + "Add to this document": "Hozzáadás ehhez a dokumentumhoz", + "Added {title} from {app}": "{title} hozzáadva innen: {app}", + "Always allow": "Mindig engedélyez", + "Always allow {app}": "{app} mindig engedélyezése", + "An object from the GoF folder": "Objektum a GoF mappából", + "another app": "másik alkalmazás", + "As a new document": "Új dokumentumként", + "Base colour": "Alapszín", + "Block": "Tiltás", + "Choose a hand-off or give a path": "Válasszon átadást, vagy adjon meg útvonalat", + "Contents": "Tartalom", + "Could not be read": "Nem sikerült beolvasni", + "Decline": "Elutasítás", + "Emission": "Emisszió", "FormCAD": "FormCAD", "FormFabric": "FormFabric", "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "A FormShot figyeli a GoF mappát és a FormSurface exportjait, amíg ez az ablak nyitva van. Ha egy Form alkalmazás átad valamit, a FormShot itt kérdez rá, mielőtt megnyitná.", "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "FormSurface exports": "A FormSurface exportjai", + "From": "Forrás", + "GoF folder": "GoF mappa", + "Hand-off Settings": "Átadási beállítások", + "Hand-offs": "Átadások", + "Hand-offs from {app}": "Átadások innen: {app}", + "Maps": "Térképek", + "Maps by role, without a mesh": "Szerepük szerinti térképek háló nélkül", + "Metalness": "Fémesség", + "Normal": "Normál", + "not found": "nem található", + "Not read yet": "Még nincs beolvasva", + "Nothing from the Form apps is waiting in their hand-off folders.": "A Form alkalmazások átadási mappáiban semmi sem vár.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Semmi sem nyílik meg, amíg Ön nem választ. A textúrák ott maradnak, ahová az alkalmazás írta őket, és szerepük szerint hivatkozunk rájuk.", + "Occlusion, roughness and metalness": "Okklúzió, érdesség és fémesség", + "Opacity": "Átlátszatlanság", + "Open a Hand-off": "Átadás megnyitása", + "Open a Hand-off...": "Átadás megnyitása...", + "Open it": "Megnyitás", + "Open once": "Megnyitás egyszer", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Megnyitja, amit a FormSculpt, a FormFabric, a FormSurface vagy a FormCAD átadott", + "Opened {title} from {app} as a new document": "{title} megnyitva innen: {app}, új dokumentumként", + "Or a path to a file or folder": "Vagy egy fájl vagy mappa útvonala", + "Other maps": "További térképek", + "Reading...": "Beolvasás...", + "Roughness": "Érdesség", + "Sent as": "Küldés módja", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "A FormShot szolgáltatás nem érhető el, ezért ezeket a beállításokat most nem lehet beolvasni vagy módosítani.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Amit a FormSculpt és a FormFabric a GoF mappába tett, és amit a FormSurface exportált. A megnyitás innen nem igényel megerősítést, mert Ön választotta ki.", + "{app} is handing over {title}: {what}.": "A(z) {app} átadja a következőt: {title} ({what}).", + "{count} maps from FormSurface": "{count} térkép a FormSurface-ből", + "{count} maps: {roles}": "{count} térkép: {roles}", + "{count} materials": "{count} anyag", + "{format} file": "{format} fájl", + "{format} file, {count} triangles": "{format} fájl, {count} háromszög", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} háló, {triangles} háromszög, {materials} anyag", + "{n} days ago": "{n} napja" } diff --git a/frontend/src/i18n/modules/handoff/pl.json b/frontend/src/i18n/modules/handoff/pl.json index a93ea0c0..89ecd471 100644 --- a/frontend/src/i18n/modules/handoff/pl.json +++ b/frontend/src/i18n/modules/handoff/pl.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", + "1 of {count}": "1 z {count}", + "A Form app is handing something over": "Aplikacja Form coś przekazuje", + "A mesh with maps by role": "Siatka z mapami według roli", + "A model file": "Plik modelu", + "Add to this document": "Dodaj do tego dokumentu", + "Added {title} from {app}": "Dodano {title} z aplikacji {app}", + "Always allow": "Zawsze zezwalaj", + "Always allow {app}": "Zawsze zezwalaj aplikacji {app}", + "An object from the GoF folder": "Obiekt z folderu GoF", + "another app": "inna aplikacja", + "As a new document": "Jako nowy dokument", + "Base colour": "Kolor bazowy", + "Block": "Zablokuj", + "Choose a hand-off or give a path": "Wybierz przekazanie albo podaj ścieżkę", + "Contents": "Zawartość", + "Could not be read": "Nie udało się odczytać", + "Decline": "Odrzuć", + "Emission": "Emisja", "FormCAD": "FormCAD", "FormFabric": "FormFabric", "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot obserwuje folder GoF i eksporty FormSurface, dopóki to okno jest otwarte. Gdy aplikacja Form coś przekazuje, FormShot pyta tutaj, zanim to otworzy.", "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "FormSurface exports": "Eksporty z FormSurface", + "From": "Od", + "GoF folder": "Folder GoF", + "Hand-off Settings": "Ustawienia przekazań", + "Hand-offs": "Przekazania", + "Hand-offs from {app}": "Przekazania z aplikacji {app}", + "Maps": "Mapy", + "Maps by role, without a mesh": "Mapy według roli, bez siatki", + "Metalness": "Metaliczność", + "Normal": "Normalne", + "not found": "nie znaleziono", + "Not read yet": "Jeszcze nie odczytano", + "Nothing from the Form apps is waiting in their hand-off folders.": "W folderach przekazań aplikacji Form nic nie czeka.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nic nie zostanie otwarte, dopóki nie wybierzesz. Tekstury zostają tam, gdzie zapisała je aplikacja, i są wskazywane według roli.", + "Occlusion, roughness and metalness": "Okluzja, chropowatość i metaliczność", + "Opacity": "Nieprzezroczystość", + "Open a Hand-off": "Otwórz przekazanie", + "Open a Hand-off...": "Otwórz przekazanie...", + "Open it": "Otwórz", + "Open once": "Otwórz jednorazowo", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Otwórz to, co przekazał FormSculpt, FormFabric, FormSurface lub FormCAD", + "Opened {title} from {app} as a new document": "Otwarto {title} z aplikacji {app} jako nowy dokument", + "Or a path to a file or folder": "Albo ścieżka do pliku lub folderu", + "Other maps": "Pozostałe mapy", + "Reading...": "Odczytywanie...", + "Roughness": "Chropowatość", + "Sent as": "Przekazano jako", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Usługa FormShot jest nieosiągalna, więc tych ustawień nie można teraz odczytać ani zmienić.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "To, co FormSculpt i FormFabric umieściły w folderze GoF, oraz to, co wyeksportował FormSurface. Otwarcie stąd nie wymaga potwierdzenia, bo sam to wybierasz.", + "{app} is handing over {title}: {what}.": "{app} przekazuje {title}: {what}.", + "{count} maps from FormSurface": "Mapy z FormSurface: {count}", + "{count} maps: {roles}": "Mapy: {count} ({roles})", + "{count} materials": "Materiały: {count}", + "{format} file": "Plik {format}", + "{format} file, {count} triangles": "Plik {format}, trójkąty: {count}", + "{meshes} meshes, {triangles} triangles, {materials} materials": "Siatki: {meshes}, trójkąty: {triangles}, materiały: {materials}", + "{n} days ago": "{n} dni temu" } From 930949694ebca0d5a1da5f0fa8f57705d062bc45 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:05:25 -0500 Subject: [PATCH 142/494] feat(i18n): translate the CAD page into four languages Translated the 89 CAD strings into Finnish, Polish, Czech and Hungarian, keeping placeholders and format names. ./formshot i18n check passed. --- frontend/src/i18n/modules/cad/cs.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/fi.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/hu.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/pl.json | 178 +++++++++++++------------- 4 files changed, 356 insertions(+), 356 deletions(-) diff --git a/frontend/src/i18n/modules/cad/cs.json b/frontend/src/i18n/modules/cad/cs.json index 4debd1cd..a8bd5e50 100644 --- a/frontend/src/i18n/modules/cad/cs.json +++ b/frontend/src/i18n/modules/cad/cs.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% velikosti modelu", + "About {n} triangles afterwards.": "Poté bude přibližně {n} trojúhelníků.", + "All CAD parts": "Všechny části CAD", + "Angle": "Úhel", + "Angle in degrees": "Úhel ve stupních", + "Apply": "Použít", + "Beside the FormShot engine": "Vedle enginu FormShot", + "CAD Import": "Import CAD", + "CAD Import Settings...": "Nastavení importu CAD...", + "CAD Options in the Import Sheet": "Možnosti CAD v panelu importu", + "CAD worker": "Pracovní proces CAD", + "CAD worker: {stage}, {pct}%": "Pracovní proces CAD: {stage}, {pct} %", + "Check the worker": "Zkontrolovat pracovní proces", + "Checking every file": "Kontrola každého souboru", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Vyberte soubory STEP nebo IGES k importu; otevírají se pomocí pracovního procesu CAD.", + "Chord": "Tětiva", + "Chord as a percentage of the model size": "Tětiva v procentech velikosti modelu", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Tětiva musí být větší než 0 a nejvýše {max} % velikosti modelu; úhel od {min} do {amax} stupňů.", + "Chord {chord}% of the model size, angle {angle} degrees": "Tětiva {chord} % velikosti modelu, úhel {angle} stupňů", + "Could not re-tessellate: {reason}": "Opakovaná teselace se nezdařila: {reason}", + "Custom": "Vlastní", + "Custom ({chord}%, {angle}°)": "Vlastní ({chord} %, {angle}°)", + "Default CAD quality": "Výchozí kvalita CAD", + "Download": "Stáhnout", + "Download and check the program that opens STEP and IGES files.": "Stáhněte a zkontrolujte program, který otevírá soubory STEP a IGES.", + "Download the CAD Worker": "Stáhnout pracovní proces CAD", + "Download the CAD worker": "Stáhnout pracovní proces CAD", + "Downloaded into the cache folder": "Staženo do složky mezipaměti", + "Downloading": "Stahování", + "Found in": "Nalezeno v", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Jak jemně se plochy STEP a IGES při importu změní na trojúhelníky. Tětiva je největší odchylka mezi trojúhelníkem a skutečnou plochou jako podíl velikosti celého modelu; úhel je největší zalomení mezi sousedními trojúhelníky. Jemnější nastavení trvají déle a vytvářejí větší soubory. Panel importu začíná touto volbou; tam ji můžete změnit pro jeden import.", + "Installed": "Nainstalováno", + "Mixed": "Smíšené", + "Named by FORMSHOT_CAD_WORKER": "Určeno proměnnou FORMSHOT_CAD_WORKER", + "New quality": "Nová kvalita", + "None of the selected parts came from a STEP or IGES file.": "Žádná z vybraných částí nepochází ze souboru STEP ani IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Žádná z vybraných částí nepochází ze souboru STEP ani IGES. Zrušte výběr, aby se přestavěly všechny části CAD.", + "Not available.": "Není k dispozici.", + "Not available: {reason}": "Není k dispozici: {reason}", + "Not installed": "Nenainstalováno", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Zatím nenainstalováno. FormShot ho hledá ve složce {folder}; stáhněte jej zde, abyste mohli otevírat soubory STEP a IGES.", + "Not named": "Neurčeno", + "Not recorded": "Nezaznamenáno", + "Nothing in this document came from a STEP or IGES file.": "Nic v tomto dokumentu nepochází ze souboru STEP ani IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Není nic vybráno, takže se přestavějí všechny části CAD.", + "Published": "Publikováno", + "Quality now": "Současná kvalita", + "Re-tessellate CAD Parts": "Znovu teselovat části CAD", + "Re-tessellate CAD Parts...": "Znovu teselovat části CAD...", + "Re-tessellated 1 CAD part at {quality}.": "Znovu teselována 1 část CAD v kvalitě {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Znovu teselována 1 část CAD v kvalitě {quality}: z {before} na {after} trojúhelníků.", + "Re-tessellated {parts} CAD parts at {quality}.": "Znovu teselováno částí CAD: {parts}, kvalita {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Znovu teselováno částí CAD: {parts}, kvalita {quality}: z {before} na {after} trojúhelníků.", + "Re-tessellating": "Znovu se teseluje", + "Read the status again": "Znovu načíst stav", + "Reading the published record": "Čtení publikovaného záznamu", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Přestaví sítě částí importovaných ze STEP nebo IGES v jiné kvalitě jako jeden krok zpět.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Soubory STEP a IGES otevírá pracovní proces jádra FormCAD, samostatný program, který FormShot jednou stáhne, zkontroluje soubor po souboru a uchová ve vaší složce mezipaměti. Jiné formáty modelů ho nepotřebují.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Soubory STEP a IGES potřebují pracovní proces CAD a pro tento počítač žádný není publikován.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Soubory STEP a IGES potřebují pracovní proces CAD, který zatím není nainstalován.", + "Selected CAD parts": "Vybrané části CAD", + "Source": "Zdroj", + "The CAD worker is installed.": "Pracovní proces CAD je nainstalován.", + "The CAD worker is installed. You can import this file now.": "Pracovní proces CAD je nainstalován. Tento soubor můžete nyní importovat.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Pracovní proces CAD, který otevírá soubory STEP a IGES, a výchozí kvalita CAD.", + "The FormShot service is not reachable.": "Služba FormShot není dostupná.", + "The download failed: {reason}": "Stahování se nezdařilo: {reason}", + "The download was cancelled. Nothing was installed.": "Stahování bylo zrušeno. Nic nebylo nainstalováno.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Engine neposkytuje odhad; jemnější kvality trvají déle a vytvářejí více trojúhelníků.", + "The parts could not be read: {reason}": "Části se nepodařilo přečíst: {reason}", + "The service cannot stop a download once it has started.": "Služba nemůže zastavit stahování, jakmile začalo.", + "The service refused the request from this window.": "Služba odmítla požadavek z tohoto okna.", + "The status could not be read: {reason}": "Stav se nepodařilo přečíst: {reason}", + "The worker did not answer: {reason}": "Pracovní proces neodpověděl: {reason}", + "This computer": "Tento počítač", + "This engine cannot re-tessellate CAD parts.": "Tento engine neumí znovu teselovat části CAD.", + "Triangles now": "Nyní trojúhelníků", + "Try Again": "Zkusit znovu", + "Unknown": "Neznámé", + "Unpacking": "Rozbalování", + "Version": "Verze", + "degrees": "stupňů", + "no reason was given": "nebyl uveden důvod", + "{done} of {total}": "{done} z {total}", + "{n} files": "{n} souborů", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} rozbaleno, zkontrolováno soubor po souboru", + "{tag}: none for this computer": "{tag}: pro tento počítač žádný", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} souborů, {size} rozbaleno" } diff --git a/frontend/src/i18n/modules/cad/fi.json b/frontend/src/i18n/modules/cad/fi.json index 4debd1cd..89373a13 100644 --- a/frontend/src/i18n/modules/cad/fi.json +++ b/frontend/src/i18n/modules/cad/fi.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% mallin koosta", + "About {n} triangles afterwards.": "Jälkeenpäin noin {n} kolmiota.", + "All CAD parts": "Kaikki CAD-osat", + "Angle": "Kulma", + "Angle in degrees": "Kulma asteina", + "Apply": "Käytä", + "Beside the FormShot engine": "FormShot-moottorin vieressä", + "CAD Import": "CAD-tuonti", + "CAD Import Settings...": "CAD-tuonnin asetukset...", + "CAD Options in the Import Sheet": "CAD-valinnat tuontiarkissa", + "CAD worker": "CAD-työprosessi", + "CAD worker: {stage}, {pct}%": "CAD-työprosessi: {stage}, {pct} %", + "Check the worker": "Tarkista työprosessi", + "Checking every file": "Tarkistetaan jokainen tiedosto", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Valitse tuotavat STEP- tai IGES-tiedostot; ne avataan CAD-työprosessin kautta.", + "Chord": "Jänne", + "Chord as a percentage of the model size": "Jänne prosentteina mallin koosta", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Jänteen on oltava yli 0 ja enintään {max} % mallin koosta; kulman {min} - {amax} astetta.", + "Chord {chord}% of the model size, angle {angle} degrees": "Jänne {chord} % mallin koosta, kulma {angle} astetta", + "Could not re-tessellate: {reason}": "Uudelleentesselointi epäonnistui: {reason}", + "Custom": "Mukautettu", + "Custom ({chord}%, {angle}°)": "Mukautettu ({chord} %, {angle}°)", + "Default CAD quality": "Oletus-CAD-laatu", + "Download": "Lataa", + "Download and check the program that opens STEP and IGES files.": "Lataa ja tarkista ohjelma, joka avaa STEP- ja IGES-tiedostot.", + "Download the CAD Worker": "Lataa CAD-työprosessi", + "Download the CAD worker": "Lataa CAD-työprosessi", + "Downloaded into the cache folder": "Ladattu välimuistikansioon", + "Downloading": "Ladataan", + "Found in": "Löytyi kohteesta", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Kuinka hienoksi STEP- ja IGES-pinnat muuttuvat kolmioiksi tuonnissa. Jänne on suurin etäisyys kolmion ja todellisen pinnan välillä osuutena koko mallin koosta; kulma on suurin taite vierekkäisten kolmioiden välillä. Hienommat asetukset kestävät kauemmin ja tuottavat suurempia tiedostoja. Tuontiarkki alkaa tällä valinnalla; voit muuttaa sitä siellä yhtä tuontia varten.", + "Installed": "Asennettu", + "Mixed": "Sekalainen", + "Named by FORMSHOT_CAD_WORKER": "Nimetty muuttujalla FORMSHOT_CAD_WORKER", + "New quality": "Uusi laatu", + "None of the selected parts came from a STEP or IGES file.": "Yksikään valituista osista ei tullut STEP- tai IGES-tiedostosta.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Yksikään valituista osista ei tullut STEP- tai IGES-tiedostosta. Tyhjennä valinta, jos haluat rakentaa kaikki CAD-osat uudelleen.", + "Not available.": "Ei saatavilla.", + "Not available: {reason}": "Ei saatavilla: {reason}", + "Not installed": "Ei asennettu", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Ei vielä asennettu. FormShot etsii sitä kansiosta {folder}; lataa se tässä avataksesi STEP- ja IGES-tiedostoja.", + "Not named": "Ei nimetty", + "Not recorded": "Ei tallennettu", + "Nothing in this document came from a STEP or IGES file.": "Mikään tässä dokumentissa ei tullut STEP- tai IGES-tiedostosta.", + "Nothing is selected, so every CAD part is rebuilt.": "Mitään ei ole valittu, joten kaikki CAD-osat rakennetaan uudelleen.", + "Published": "Julkaistu", + "Quality now": "Nykyinen laatu", + "Re-tessellate CAD Parts": "Tesseloi CAD-osat uudelleen", + "Re-tessellate CAD Parts...": "Tesseloi CAD-osat uudelleen...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-osa tesseloitu uudelleen laadulla {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-osa tesseloitu uudelleen laadulla {quality}: {before} kolmiosta {after} kolmioon.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-osaa tesseloitu uudelleen laadulla {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-osaa tesseloitu uudelleen laadulla {quality}: {before} kolmiosta {after} kolmioon.", + "Re-tessellating": "Tesseloidaan uudelleen", + "Read the status again": "Lue tila uudelleen", + "Reading the published record": "Luetaan julkaistua tietuetta", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rakenna STEP- tai IGES-tiedostosta tuotujen osien verkot uudelleen toisella laadulla yhtenä kumoamisvaiheena.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP- ja IGES-tiedostot avaa FormCADin ydintyöprosessi, erillinen ohjelma, jonka FormShot lataa kerran, tarkistaa tiedosto tiedostolta ja säilyttää välimuistikansiossasi. Muut mallimuodot eivät tarvitse sitä.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP- ja IGES-tiedostot tarvitsevat CAD-työprosessin, eikä tälle tietokoneelle ole julkaistu sellaista.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP- ja IGES-tiedostot tarvitsevat CAD-työprosessin, jota ei ole vielä asennettu.", + "Selected CAD parts": "Valitut CAD-osat", + "Source": "Lähde", + "The CAD worker is installed.": "CAD-työprosessi on asennettu.", + "The CAD worker is installed. You can import this file now.": "CAD-työprosessi on asennettu. Voit nyt tuoda tämän tiedoston.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "CAD-työprosessi, joka avaa STEP- ja IGES-tiedostot, sekä oletus-CAD-laatu.", + "The FormShot service is not reachable.": "FormShot-palvelu ei ole tavoitettavissa.", + "The download failed: {reason}": "Lataus epäonnistui: {reason}", + "The download was cancelled. Nothing was installed.": "Lataus peruttiin. Mitään ei asennettu.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Moottori ei anna arviota; hienommat laadut kestävät kauemmin ja tuottavat enemmän kolmioita.", + "The parts could not be read: {reason}": "Osia ei voitu lukea: {reason}", + "The service cannot stop a download once it has started.": "Palvelu ei voi pysäyttää latausta sen alettua.", + "The service refused the request from this window.": "Palvelu hylkäsi tämän ikkunan pyynnön.", + "The status could not be read: {reason}": "Tilaa ei voitu lukea: {reason}", + "The worker did not answer: {reason}": "Työprosessi ei vastannut: {reason}", + "This computer": "Tämä tietokone", + "This engine cannot re-tessellate CAD parts.": "Tämä moottori ei voi tesseloida CAD-osia uudelleen.", + "Triangles now": "Kolmioita nyt", + "Try Again": "Yritä uudelleen", + "Unknown": "Tuntematon", + "Unpacking": "Puretaan", + "Version": "Versio", + "degrees": "astetta", + "no reason was given": "syytä ei annettu", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} tiedostoa", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokolla {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} purettuna, tarkistettu tiedosto tiedostolta", + "{tag}: none for this computer": "{tag}: ei tälle tietokoneelle", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} tiedostoa, {size} purettuna" } diff --git a/frontend/src/i18n/modules/cad/hu.json b/frontend/src/i18n/modules/cad/hu.json index 4debd1cd..ce0e8695 100644 --- a/frontend/src/i18n/modules/cad/hu.json +++ b/frontend/src/i18n/modules/cad/hu.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% a modell méretéből", + "About {n} triangles afterwards.": "Utána körülbelül {n} háromszög lesz.", + "All CAD parts": "Az összes CAD-alkatrész", + "Angle": "Szög", + "Angle in degrees": "Szög fokban", + "Apply": "Alkalmaz", + "Beside the FormShot engine": "A FormShot motor mellett", + "CAD Import": "CAD-importálás", + "CAD Import Settings...": "CAD-importálási beállítások...", + "CAD Options in the Import Sheet": "CAD-opciók az importálási panelen", + "CAD worker": "CAD-háttérfolyamat", + "CAD worker: {stage}, {pct}%": "CAD-háttérfolyamat: {stage}, {pct}%", + "Check the worker": "Háttérfolyamat ellenőrzése", + "Checking every file": "Minden fájl ellenőrzése", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Válassza ki az importálandó STEP vagy IGES fájlokat; ezek a CAD-háttérfolyamaton keresztül nyílnak meg.", + "Chord": "Húr", + "Chord as a percentage of the model size": "A húr a modell méretének százalékában", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "A húr értékének 0-nál nagyobbnak kell lennie, és legfeljebb a modell méretének {max}%-a lehet; a szög {min} és {amax} fok között lehet.", + "Chord {chord}% of the model size, angle {angle} degrees": "Húr: a modell méretének {chord}%-a, szög: {angle} fok", + "Could not re-tessellate: {reason}": "Az újratesszellálás nem sikerült: {reason}", + "Custom": "Egyéni", + "Custom ({chord}%, {angle}°)": "Egyéni ({chord}%, {angle}°)", + "Default CAD quality": "Alapértelmezett CAD-minőség", + "Download": "Letöltés", + "Download and check the program that opens STEP and IGES files.": "A STEP és IGES fájlokat megnyitó program letöltése és ellenőrzése.", + "Download the CAD Worker": "CAD-háttérfolyamat letöltése", + "Download the CAD worker": "CAD-háttérfolyamat letöltése", + "Downloaded into the cache folder": "Letöltve a gyorsítótár mappájába", + "Downloading": "Letöltés", + "Found in": "Található itt", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Mennyire finoman alakulnak háromszögekké a STEP és IGES felületek importáláskor. A húr a háromszög és a valódi felület közötti legnagyobb eltérés a teljes modell méretének arányában; a szög a szomszédos háromszögek közötti legnagyobb törés. A finomabb beállítások tovább tartanak, és nagyobb fájlokat eredményeznek. Az importálási panel ezzel az értékkel indul; ott egyetlen importáláshoz módosíthatja.", + "Installed": "Telepítve", + "Mixed": "Vegyes", + "Named by FORMSHOT_CAD_WORKER": "A FORMSHOT_CAD_WORKER adja meg", + "New quality": "Új minőség", + "None of the selected parts came from a STEP or IGES file.": "A kijelölt alkatrészek egyike sem STEP vagy IGES fájlból származik.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "A kijelölt alkatrészek egyike sem STEP vagy IGES fájlból származik. Szüntesse meg a kijelölést, hogy az összes CAD-alkatrész újra felépüljön.", + "Not available.": "Nem érhető el.", + "Not available: {reason}": "Nem érhető el: {reason}", + "Not installed": "Nincs telepítve", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Még nincs telepítve. A FormShot ebben keresi: {folder}; innen töltse le a STEP és IGES fájlok megnyitásához.", + "Not named": "Nincs megadva", + "Not recorded": "Nincs rögzítve", + "Nothing in this document came from a STEP or IGES file.": "A dokumentumban semmi sem származik STEP vagy IGES fájlból.", + "Nothing is selected, so every CAD part is rebuilt.": "Nincs kijelölés, ezért az összes CAD-alkatrész újra felépül.", + "Published": "Közzétéve", + "Quality now": "Jelenlegi minőség", + "Re-tessellate CAD Parts": "CAD-alkatrészek újratesszellálása", + "Re-tessellate CAD Parts...": "CAD-alkatrészek újratesszellálása...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD-alkatrész újratesszellálva, minőség: {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD-alkatrész újratesszellálva, minőség: {quality}: {before} háromszögről {after} háromszögre.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD-alkatrész újratesszellálva, minőség: {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD-alkatrész újratesszellálva, minőség: {quality}: {before} háromszögről {after} háromszögre.", + "Re-tessellating": "Újratesszellálás", + "Read the status again": "Állapot újraolvasása", + "Reading the published record": "A közzétett rekord beolvasása", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "A STEP vagy IGES fájlból importált alkatrészek hálóinak újraépítése más minőségben, egyetlen visszavonási lépésként.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "A STEP és IGES fájlokat a FormCAD magfolyamata nyitja meg, egy különálló program, amelyet a FormShot egyszer letölt, fájlonként ellenőriz, és a gyorsítótár mappájában tart. Más modellformátumokhoz nincs rá szükség.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "A STEP és IGES fájlokhoz CAD-háttérfolyamat kell, és ehhez a számítógéphez nincs közzétéve ilyen.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "A STEP és IGES fájlokhoz CAD-háttérfolyamat kell, amely még nincs telepítve.", + "Selected CAD parts": "Kijelölt CAD-alkatrészek", + "Source": "Forrás", + "The CAD worker is installed.": "A CAD-háttérfolyamat telepítve van.", + "The CAD worker is installed. You can import this file now.": "A CAD-háttérfolyamat telepítve van. Most már importálhatja ezt a fájlt.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "A STEP és IGES fájlokat megnyitó CAD-háttérfolyamat és az alapértelmezett CAD-minőség.", + "The FormShot service is not reachable.": "A FormShot szolgáltatás nem érhető el.", + "The download failed: {reason}": "A letöltés sikertelen: {reason}", + "The download was cancelled. Nothing was installed.": "A letöltés megszakadt. Semmi sem lett telepítve.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "A motor nem ad becslést; a finomabb minőségek tovább tartanak, és több háromszöget adnak.", + "The parts could not be read: {reason}": "Az alkatrészeket nem sikerült beolvasni: {reason}", + "The service cannot stop a download once it has started.": "A szolgáltatás nem tudja leállítani a letöltést, ha az már elindult.", + "The service refused the request from this window.": "A szolgáltatás elutasította az ebből az ablakból érkező kérést.", + "The status could not be read: {reason}": "Az állapotot nem sikerült beolvasni: {reason}", + "The worker did not answer: {reason}": "A háttérfolyamat nem válaszolt: {reason}", + "This computer": "Ez a számítógép", + "This engine cannot re-tessellate CAD parts.": "Ez a motor nem tudja újratesszellálni a CAD-alkatrészeket.", + "Triangles now": "Jelenlegi háromszögek", + "Try Again": "Próbálja újra", + "Unknown": "Ismeretlen", + "Unpacking": "Kicsomagolás", + "Version": "Verzió", + "degrees": "fok", + "no reason was given": "nem adtak meg okot", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} fájl", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokoll: {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} kicsomagolva, fájlonként ellenőrizve", + "{tag}: none for this computer": "{tag}: ehhez a számítógéphez nincs", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} fájl, {size} kicsomagolva" } diff --git a/frontend/src/i18n/modules/cad/pl.json b/frontend/src/i18n/modules/cad/pl.json index 4debd1cd..b3633a81 100644 --- a/frontend/src/i18n/modules/cad/pl.json +++ b/frontend/src/i18n/modules/cad/pl.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% rozmiaru modelu", + "About {n} triangles afterwards.": "Potem będzie około {n} trójkątów.", + "All CAD parts": "Wszystkie części CAD", + "Angle": "Kąt", + "Angle in degrees": "Kąt w stopniach", + "Apply": "Zastosuj", + "Beside the FormShot engine": "Obok silnika FormShot", + "CAD Import": "Import CAD", + "CAD Import Settings...": "Ustawienia importu CAD...", + "CAD Options in the Import Sheet": "Opcje CAD w oknie importu", + "CAD worker": "Proces roboczy CAD", + "CAD worker: {stage}, {pct}%": "Proces roboczy CAD: {stage}, {pct}%", + "Check the worker": "Sprawdź proces roboczy", + "Checking every file": "Sprawdzanie każdego pliku", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Wybierz pliki STEP lub IGES do zaimportowania; otwierane są przez proces roboczy CAD.", + "Chord": "Cięciwa", + "Chord as a percentage of the model size": "Cięciwa jako procent rozmiaru modelu", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Cięciwa musi być większa od 0 i wynosić najwyżej {max}% rozmiaru modelu; kąt od {min} do {amax} stopni.", + "Chord {chord}% of the model size, angle {angle} degrees": "Cięciwa {chord}% rozmiaru modelu, kąt {angle} stopni", + "Could not re-tessellate: {reason}": "Nie udało się ponownie wykonać teselacji: {reason}", + "Custom": "Własne", + "Custom ({chord}%, {angle}°)": "Własne ({chord}%, {angle}°)", + "Default CAD quality": "Domyślna jakość CAD", + "Download": "Pobierz", + "Download and check the program that opens STEP and IGES files.": "Pobierz i sprawdź program, który otwiera pliki STEP i IGES.", + "Download the CAD Worker": "Pobierz proces roboczy CAD", + "Download the CAD worker": "Pobierz proces roboczy CAD", + "Downloaded into the cache folder": "Pobrano do folderu pamięci podręcznej", + "Downloading": "Pobieranie", + "Found in": "Znaleziono w", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Jak drobno powierzchnie STEP i IGES zamieniają się w trójkąty podczas importu. Cięciwa to największa odległość między trójkątem a rzeczywistą powierzchnią, wyrażona jako część rozmiaru całego modelu; kąt to największe załamanie między sąsiednimi trójkątami. Dokładniejsze ustawienia trwają dłużej i dają większe pliki. Okno importu zaczyna od tego wyboru; możesz go tam zmienić dla pojedynczego importu.", + "Installed": "Zainstalowano", + "Mixed": "Mieszane", + "Named by FORMSHOT_CAD_WORKER": "Wskazany przez FORMSHOT_CAD_WORKER", + "New quality": "Nowa jakość", + "None of the selected parts came from a STEP or IGES file.": "Żadna z zaznaczonych części nie pochodzi z pliku STEP ani IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Żadna z zaznaczonych części nie pochodzi z pliku STEP ani IGES. Wyczyść zaznaczenie, aby odbudować wszystkie części CAD.", + "Not available.": "Niedostępne.", + "Not available: {reason}": "Niedostępne: {reason}", + "Not installed": "Niezainstalowano", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Jeszcze nie zainstalowano. FormShot szuka go w {folder}; pobierz go tutaj, aby otwierać pliki STEP i IGES.", + "Not named": "Nie wskazano", + "Not recorded": "Nie zapisano", + "Nothing in this document came from a STEP or IGES file.": "Nic w tym dokumencie nie pochodzi z pliku STEP ani IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Nic nie jest zaznaczone, więc zostaną odbudowane wszystkie części CAD.", + "Published": "Opublikowane", + "Quality now": "Obecna jakość", + "Re-tessellate CAD Parts": "Wykonaj ponownie teselację części CAD", + "Re-tessellate CAD Parts...": "Wykonaj ponownie teselację części CAD...", + "Re-tessellated 1 CAD part at {quality}.": "Ponownie wykonano teselację 1 części CAD w jakości {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Ponownie wykonano teselację 1 części CAD w jakości {quality}: z {before} do {after} trójkątów.", + "Re-tessellated {parts} CAD parts at {quality}.": "Ponownie wykonano teselację części CAD ({parts}) w jakości {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Ponownie wykonano teselację części CAD ({parts}) w jakości {quality}: z {before} do {after} trójkątów.", + "Re-tessellating": "Ponowna teselacja", + "Read the status again": "Odczytaj stan ponownie", + "Reading the published record": "Odczytywanie opublikowanego rekordu", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Odbuduj siatki części zaimportowanych z STEP lub IGES w innej jakości, jako jeden krok cofania.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Pliki STEP i IGES otwiera proces roboczy jądra FormCAD, osobny program, który FormShot pobiera jednorazowo, sprawdza plik po pliku i przechowuje w Twoim folderze pamięci podręcznej. Inne formaty modeli go nie potrzebują.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Pliki STEP i IGES wymagają procesu roboczego CAD, a dla tego komputera żaden nie został opublikowany.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Pliki STEP i IGES wymagają procesu roboczego CAD, który nie jest jeszcze zainstalowany.", + "Selected CAD parts": "Zaznaczone części CAD", + "Source": "Źródło", + "The CAD worker is installed.": "Proces roboczy CAD jest zainstalowany.", + "The CAD worker is installed. You can import this file now.": "Proces roboczy CAD jest zainstalowany. Możesz teraz zaimportować ten plik.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Proces roboczy CAD, który otwiera pliki STEP i IGES, oraz domyślna jakość CAD.", + "The FormShot service is not reachable.": "Usługa FormShot jest nieosiągalna.", + "The download failed: {reason}": "Pobieranie nie powiodło się: {reason}", + "The download was cancelled. Nothing was installed.": "Pobieranie zostało anulowane. Nic nie zainstalowano.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Silnik nie podaje oszacowania; dokładniejsze jakości trwają dłużej i dają więcej trójkątów.", + "The parts could not be read: {reason}": "Nie udało się odczytać części: {reason}", + "The service cannot stop a download once it has started.": "Usługa nie może zatrzymać pobierania po jego rozpoczęciu.", + "The service refused the request from this window.": "Usługa odrzuciła żądanie z tego okna.", + "The status could not be read: {reason}": "Nie udało się odczytać stanu: {reason}", + "The worker did not answer: {reason}": "Proces roboczy nie odpowiedział: {reason}", + "This computer": "Ten komputer", + "This engine cannot re-tessellate CAD parts.": "Ten silnik nie potrafi ponownie wykonać teselacji części CAD.", + "Triangles now": "Obecnie trójkątów", + "Try Again": "Spróbuj ponownie", + "Unknown": "Nieznane", + "Unpacking": "Rozpakowywanie", + "Version": "Wersja", + "degrees": "stopni", + "no reason was given": "nie podano przyczyny", + "{done} of {total}": "{done} z {total}", + "{n} files": "Pliki: {n}", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokół {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} po rozpakowaniu, sprawdzono plik po pliku", + "{tag}: none for this computer": "{tag}: brak dla tego komputera", + "{tag}: {files} files, {size} unpacked": "{tag}: pliki: {files}, {size} po rozpakowaniu" } From 441e915a6459e1dfaec76d03314be7c976d0f5a7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:02:41 -0500 Subject: [PATCH 143/494] feat(i18n): translate the import page into four languages Translated the import namespace into Russian, Ukrainian, Turkish and Brazilian Portuguese, 88 strings each. Ran ./formshot i18n check: full coverage, no placeholder mismatch. --- frontend/src/i18n/modules/import/pt-BR.json | 174 +++++++++---------- frontend/src/i18n/modules/import/ru.json | 176 ++++++++++---------- frontend/src/i18n/modules/import/tr.json | 174 +++++++++---------- frontend/src/i18n/modules/import/uk.json | 176 ++++++++++---------- 4 files changed, 350 insertions(+), 350 deletions(-) diff --git a/frontend/src/i18n/modules/import/pt-BR.json b/frontend/src/i18n/modules/import/pt-BR.json index ac317572..0759f64d 100644 --- a/frontend/src/i18n/modules/import/pt-BR.json +++ b/frontend/src/i18n/modules/import/pt-BR.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "Modelos 3D", + "Automatic": "Automático", + "CAD quality": "Qualidade CAD", + "Centimetres (cm)": "Centímetros (cm)", + "Centre on the origin": "Centralizar na origem", + "Choose model files and import them into the scene with options.": "Escolha arquivos de modelo e importe-os para a cena com opções.", + "Cleaning up meshes": "Limpando malhas", + "Clear Recent Imports": "Limpar importações recentes", + "Could not import the file: {reason}": "Não foi possível importar o arquivo: {reason}", + "Could not import {name}: {reason}": "Não foi possível importar {name}: {reason}", + "Could not open {name}: {reason}": "Não foi possível abrir {name}: {reason}", + "Could not read the file: {reason}": "Não foi possível ler o arquivo: {reason}", + "Could not reimport: {reason}": "Não foi possível reimportar: {reason}", + "Could not send the file: {reason}": "Não foi possível enviar o arquivo: {reason}", + "Discard unsaved changes?": "Descartar alterações não salvas?", + "Draft": "Rascunho", + "Drop to import into the scene": "Solte para importar para a cena", + "Feet (ft)": "Pés (ft)", + "Format": "Formato", + "FormShot opens one project at a time; {n} other project files were left unopened.": "O FormShot abre um projeto por vez; os outros {n} arquivos de projeto não foram abertos.", + "Frame the view after import": "Enquadrar a vista após importar", + "High": "Alta", + "Import": "Importar", + "Import All": "Importar tudo", + "Import Files": "Importar arquivos", + "Import Model": "Importar modelo", + "Import Recent File": "Importar arquivo recente", + "Imported {name}.": "{name} importado.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} importado: {parts} peças, {triangles} triângulos.", + "Imported {name}: {parts} parts.": "{name} importado: {parts} peças.", + "Importing": "Importando", + "In this file": "Neste arquivo", + "Inches (in)": "Polegadas (in)", + "Making materials": "Criando materiais", + "Materials": "Materiais", + "Medium": "Média", + "Merge into one group": "Mesclar em um grupo", + "Metres (m)": "Metros (m)", + "Millimetres (mm)": "Milímetros (mm)", + "No Recent Imports": "Nenhuma importação recente", + "No warnings.": "Nenhum aviso.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nada para importar: o FormShot importa arquivos GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP e IGES.", + "One file beside it": "Um arquivo ao lado", + "Opening {name} will close the open project and discard its unsaved changes.": "Abrir {name} fechará o projeto aberto e descartará as alterações não salvas dele.", + "Options": "Opções", + "Parts": "Peças", + "Placing in the scene": "Posicionando na cena", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Lê novamente os arquivos de origem das peças selecionadas (ou de todas as peças importadas), mantendo os materiais delas.", + "Reading the file": "Lendo o arquivo", + "Reading the file...": "Lendo o arquivo...", + "Recent Imports": "Importações recentes", + "Reimport": "Reimportar", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimportado: {matched} atualizadas, {added} novas, {hidden} ocultas.", + "Send model files to FormShot and import them into the scene with options.": "Envie arquivos de modelo ao FormShot e importe-os para a cena com opções.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Vários arquivos são importados um após o outro. Buffers, materiais e texturas ao lado de um modelo vão junto com ele.", + "Size": "Tamanho", + "Stand on the floor": "Apoiar no chão", + "Tessellating CAD surfaces": "Tesselando superfícies CAD", + "The engine decides from the file.": "O motor decide com base no arquivo.", + "The engine did not start an import job": "O motor não iniciou uma tarefa de importação", + "The engine did not start in time, so the files FormShot was given were not opened.": "O motor não iniciou a tempo, então os arquivos entregues ao FormShot não foram abertos.", + "The file says it is in {unit}.": "O arquivo informa que está em {unit}.", + "The import failed": "A importação falhou", + "The import goes on; the files after it were not imported.": "A importação continua; os arquivos seguintes não foram importados.", + "The import of {name} was cancelled.": "A importação de {name} foi cancelada.", + "The upload failed ({status})": "O envio falhou ({status})", + "The upload was cancelled": "O envio foi cancelado", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Este motor não consegue olhar dentro de um arquivo antes de importar, então o resumo fica vazio.", + "This engine cannot stop an import once it has started": "Este motor não pode interromper uma importação depois de iniciada", + "This engine imports in one step, so there is no progress to show or stop.": "Este motor importa em uma única etapa, então não há progresso para mostrar ou interromper.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Este arquivo não informa suas unidades. O FormShot estimou {unit} pelo tamanho; confira antes de importar.", + "Triangles": "Triângulos", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Unidades", + "Up axis": "Eixo para cima", + "Up axis in file": "Eixo para cima no arquivo", + "Uploading": "Enviando", + "Y is up": "Y é para cima", + "Z is up": "Z é para cima", + "centimetres": "centímetros", + "feet": "pés", + "inches": "polegadas", + "metres": "metros", + "millimetres": "milímetros", + "{i} of {n}": "{i} de {n}", + "{n} files beside it": "{n} arquivos ao lado", + "{n} files were not imported.": "{n} arquivos não foram importados.", + "{n} warnings; the Scene page lists the parts.": "{n} avisos; a página Cena lista as peças." } diff --git a/frontend/src/i18n/modules/import/ru.json b/frontend/src/i18n/modules/import/ru.json index ac317572..9bdbd9ea 100644 --- a/frontend/src/i18n/modules/import/ru.json +++ b/frontend/src/i18n/modules/import/ru.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D-модели", + "Automatic": "Автоматически", + "CAD quality": "Качество CAD", + "Centimetres (cm)": "Сантиметры (cm)", + "Centre on the origin": "Центрировать по началу координат", + "Choose model files and import them into the scene with options.": "Выберите файлы моделей и импортируйте их в сцену с настройками.", + "Cleaning up meshes": "Очистка мешей", + "Clear Recent Imports": "Очистить недавние импорты", + "Could not import the file: {reason}": "Не удалось импортировать файл: {reason}", + "Could not import {name}: {reason}": "Не удалось импортировать {name}: {reason}", + "Could not open {name}: {reason}": "Не удалось открыть {name}: {reason}", + "Could not read the file: {reason}": "Не удалось прочитать файл: {reason}", + "Could not reimport: {reason}": "Не удалось выполнить повторный импорт: {reason}", + "Could not send the file: {reason}": "Не удалось передать файл: {reason}", + "Discard unsaved changes?": "Отбросить несохранённые изменения?", + "Draft": "Черновик", + "Drop to import into the scene": "Отпустите, чтобы импортировать в сцену", + "Feet (ft)": "Футы (ft)", + "Format": "Формат", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot открывает один проект за раз; остальные файлы проектов ({n}) оставлены закрытыми.", + "Frame the view after import": "Показать вид после импорта", + "High": "Высокое", + "Import": "Импорт", + "Import All": "Импортировать все", + "Import Files": "Импортировать файлы", + "Import Model": "Импорт модели", + "Import Recent File": "Импортировать недавний файл", + "Imported {name}.": "Импортировано: {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Импортировано {name}: деталей {parts}, треугольников {triangles}.", + "Imported {name}: {parts} parts.": "Импортировано {name}: деталей {parts}.", + "Importing": "Импорт", + "In this file": "В этом файле", + "Inches (in)": "Дюймы (in)", + "Making materials": "Создание материалов", + "Materials": "Материалы", + "Medium": "Среднее", + "Merge into one group": "Объединить в одну группу", + "Metres (m)": "Метры (m)", + "Millimetres (mm)": "Миллиметры (mm)", + "No Recent Imports": "Нет недавних импортов", + "No warnings.": "Предупреждений нет.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Импортировать нечего: FormShot импортирует файлы GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP и IGES.", + "One file beside it": "Один файл рядом", + "Opening {name} will close the open project and discard its unsaved changes.": "Открытие {name} закроет текущий проект и отбросит его несохранённые изменения.", + "Options": "Параметры", + "Parts": "Детали", + "Placing in the scene": "Размещение в сцене", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Заново прочитать исходные файлы выбранных деталей (или всех импортированных), сохранив их материалы.", + "Reading the file": "Чтение файла", + "Reading the file...": "Чтение файла...", + "Recent Imports": "Недавние импорты", + "Reimport": "Импортировать заново", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Повторный импорт: обновлено {matched}, новых {added}, скрыто {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Отправьте файлы моделей в FormShot и импортируйте их в сцену с настройками.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Несколько файлов импортируются по очереди. Буферы, материалы и текстуры рядом с моделью импортируются вместе с ней.", + "Size": "Размер", + "Stand on the floor": "Поставить на пол", + "Tessellating CAD surfaces": "Тесселяция CAD-поверхностей", + "The engine decides from the file.": "Движок определит по файлу.", + "The engine did not start an import job": "Движок не запустил задачу импорта", + "The engine did not start in time, so the files FormShot was given were not opened.": "Движок не запустился вовремя, поэтому файлы, переданные FormShot, не были открыты.", + "The file says it is in {unit}.": "В файле указано: {unit}.", + "The import failed": "Импорт не удался", + "The import goes on; the files after it were not imported.": "Импорт продолжается; следующие за ним файлы не были импортированы.", + "The import of {name} was cancelled.": "Импорт {name} отменён.", + "The upload failed ({status})": "Не удалось загрузить ({status})", + "The upload was cancelled": "Загрузка отменена", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Этот движок не умеет заглядывать в файл перед импортом, поэтому сводка остаётся пустой.", + "This engine cannot stop an import once it has started": "Этот движок не может остановить импорт после его запуска", + "This engine imports in one step, so there is no progress to show or stop.": "Этот движок импортирует за один шаг, поэтому показывать и останавливать нечего.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "В этом файле не указаны единицы измерения. FormShot предположил {unit} по размеру; проверьте перед импортом.", + "Triangles": "Треугольники", + "Ultra": "Ультра", + "Units": "Единицы", + "Up axis": "Верхняя ось", + "Up axis in file": "Верхняя ось в файле", + "Uploading": "Загрузка", + "Y is up": "Вверх направлена ось Y", + "Z is up": "Вверх направлена ось Z", + "centimetres": "сантиметры", + "feet": "футы", + "inches": "дюймы", + "metres": "метры", + "millimetres": "миллиметры", + "{i} of {n}": "{i} из {n}", + "{n} files beside it": "Файлов рядом: {n}", + "{n} files were not imported.": "Не импортировано файлов: {n}.", + "{n} warnings; the Scene page lists the parts.": "Предупреждений: {n}; страница «Сцена» перечисляет детали." } diff --git a/frontend/src/i18n/modules/import/tr.json b/frontend/src/i18n/modules/import/tr.json index ac317572..6cfa53c3 100644 --- a/frontend/src/i18n/modules/import/tr.json +++ b/frontend/src/i18n/modules/import/tr.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "3D models": "3D modeller", + "Automatic": "Otomatik", + "CAD quality": "CAD kalitesi", + "Centimetres (cm)": "Santimetre (cm)", + "Centre on the origin": "Başlangıç noktasına ortala", + "Choose model files and import them into the scene with options.": "Model dosyalarını seçin ve seçeneklerle sahneye içe aktarın.", + "Cleaning up meshes": "Mesh'ler temizleniyor", + "Clear Recent Imports": "Son İçe Aktarmaları Temizle", + "Could not import the file: {reason}": "Dosya içe aktarılamadı: {reason}", + "Could not import {name}: {reason}": "{name} içe aktarılamadı: {reason}", + "Could not open {name}: {reason}": "{name} açılamadı: {reason}", + "Could not read the file: {reason}": "Dosya okunamadı: {reason}", + "Could not reimport: {reason}": "Yeniden içe aktarılamadı: {reason}", + "Could not send the file: {reason}": "Dosya gönderilemedi: {reason}", + "Discard unsaved changes?": "Kaydedilmemiş değişiklikler silinsin mi?", + "Draft": "Taslak", + "Drop to import into the scene": "Sahneye içe aktarmak için bırakın", + "Feet (ft)": "Fit (ft)", + "Format": "Biçim", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot aynı anda tek proje açar; diğer {n} proje dosyası açılmadı.", + "Frame the view after import": "İçe aktarmadan sonra görünümü çerçevele", + "High": "Yüksek", + "Import": "İçe aktar", + "Import All": "Tümünü İçe Aktar", + "Import Files": "Dosyaları İçe Aktar", + "Import Model": "Model İçe Aktar", + "Import Recent File": "Son Dosyayı İçe Aktar", + "Imported {name}.": "{name} içe aktarıldı.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} içe aktarıldı: {parts} parça, {triangles} üçgen.", + "Imported {name}: {parts} parts.": "{name} içe aktarıldı: {parts} parça.", + "Importing": "İçe aktarılıyor", + "In this file": "Bu dosyada", + "Inches (in)": "İnç (in)", + "Making materials": "Malzemeler oluşturuluyor", + "Materials": "Malzemeler", + "Medium": "Orta", + "Merge into one group": "Tek bir grupta birleştir", + "Metres (m)": "Metre (m)", + "Millimetres (mm)": "Milimetre (mm)", + "No Recent Imports": "Son İçe Aktarma Yok", + "No warnings.": "Uyarı yok.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "İçe aktarılacak bir şey yok: FormShot GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP ve IGES dosyalarını içe aktarır.", + "One file beside it": "Yanında bir dosya", + "Opening {name} will close the open project and discard its unsaved changes.": "{name} dosyasını açmak, açık projeyi kapatır ve kaydedilmemiş değişikliklerini siler.", + "Options": "Seçenekler", + "Parts": "Parçalar", + "Placing in the scene": "Sahneye yerleştiriliyor", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Seçili parçaların (veya içe aktarılan tüm parçaların) kaynak dosyalarını malzemelerini koruyarak yeniden okuyun.", + "Reading the file": "Dosya okunuyor", + "Reading the file...": "Dosya okunuyor...", + "Recent Imports": "Son İçe Aktarmalar", + "Reimport": "Yeniden İçe Aktar", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Yeniden içe aktarıldı: {matched} güncellendi, {added} yeni, {hidden} gizlendi.", + "Send model files to FormShot and import them into the scene with options.": "Model dosyalarını FormShot'a gönderin ve seçeneklerle sahneye içe aktarın.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Birden çok dosya sırayla içe aktarılır. Modelin yanındaki arabellekler, malzemeler ve dokular onunla birlikte gelir.", + "Size": "Boyut", + "Stand on the floor": "Zemine yerleştir", + "Tessellating CAD surfaces": "CAD yüzeyleri üçgenlere bölünüyor", + "The engine decides from the file.": "Motor dosyaya bakarak karar verir.", + "The engine did not start an import job": "Motor bir içe aktarma işi başlatmadı", + "The engine did not start in time, so the files FormShot was given were not opened.": "Motor zamanında başlamadığı için FormShot'a verilen dosyalar açılmadı.", + "The file says it is in {unit}.": "Dosyada birim {unit} olarak belirtilmiş.", + "The import failed": "İçe aktarma başarısız oldu", + "The import goes on; the files after it were not imported.": "İçe aktarma sürüyor; ondan sonraki dosyalar içe aktarılmadı.", + "The import of {name} was cancelled.": "{name} içe aktarma işlemi iptal edildi.", + "The upload failed ({status})": "Yükleme başarısız oldu ({status})", + "The upload was cancelled": "Yükleme iptal edildi", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Bu motor içe aktarmadan önce dosyanın içine bakamaz, bu yüzden özet boş kalır.", + "This engine cannot stop an import once it has started": "Bu motor başladıktan sonra bir içe aktarmayı durduramaz", + "This engine imports in one step, so there is no progress to show or stop.": "Bu motor tek adımda içe aktarır, bu yüzden gösterilecek veya durdurulacak bir ilerleme yoktur.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Bu dosya birimlerini belirtmiyor. FormShot boyutuna bakarak {unit} tahmin etti; içe aktarmadan önce kontrol edin.", + "Triangles": "Üçgenler", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Birimler", + "Up axis": "Yukarı ekseni", + "Up axis in file": "Dosyadaki yukarı ekseni", + "Uploading": "Yükleniyor", + "Y is up": "Y yukarıdır", + "Z is up": "Z yukarıdır", + "centimetres": "santimetre", + "feet": "fit", + "inches": "inç", + "metres": "metre", + "millimetres": "milimetre", + "{i} of {n}": "{i} / {n}", + "{n} files beside it": "Yanında {n} dosya", + "{n} files were not imported.": "{n} dosya içe aktarılmadı.", + "{n} warnings; the Scene page lists the parts.": "{n} uyarı; Sahne sayfası parçaları listeler." } diff --git a/frontend/src/i18n/modules/import/uk.json b/frontend/src/i18n/modules/import/uk.json index ac317572..65e6d90e 100644 --- a/frontend/src/i18n/modules/import/uk.json +++ b/frontend/src/i18n/modules/import/uk.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D-моделі", + "Automatic": "Автоматично", + "CAD quality": "Якість CAD", + "Centimetres (cm)": "Сантиметри (cm)", + "Centre on the origin": "Центрувати за початком координат", + "Choose model files and import them into the scene with options.": "Виберіть файли моделей та імпортуйте їх у сцену з параметрами.", + "Cleaning up meshes": "Очищення мешів", + "Clear Recent Imports": "Очистити нещодавні імпорти", + "Could not import the file: {reason}": "Не вдалося імпортувати файл: {reason}", + "Could not import {name}: {reason}": "Не вдалося імпортувати {name}: {reason}", + "Could not open {name}: {reason}": "Не вдалося відкрити {name}: {reason}", + "Could not read the file: {reason}": "Не вдалося прочитати файл: {reason}", + "Could not reimport: {reason}": "Не вдалося виконати повторний імпорт: {reason}", + "Could not send the file: {reason}": "Не вдалося передати файл: {reason}", + "Discard unsaved changes?": "Відкинути незбережені зміни?", + "Draft": "Чернетка", + "Drop to import into the scene": "Відпустіть, щоб імпортувати в сцену", + "Feet (ft)": "Фути (ft)", + "Format": "Формат", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot відкриває один проєкт за раз; решту файлів проєктів ({n}) залишено закритими.", + "Frame the view after import": "Показати вигляд після імпорту", + "High": "Високе", + "Import": "Імпорт", + "Import All": "Імпортувати все", + "Import Files": "Імпортувати файли", + "Import Model": "Імпорт моделі", + "Import Recent File": "Імпортувати нещодавній файл", + "Imported {name}.": "Імпортовано: {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Імпортовано {name}: деталей {parts}, трикутників {triangles}.", + "Imported {name}: {parts} parts.": "Імпортовано {name}: деталей {parts}.", + "Importing": "Імпорт", + "In this file": "У цьому файлі", + "Inches (in)": "Дюйми (in)", + "Making materials": "Створення матеріалів", + "Materials": "Матеріали", + "Medium": "Середнє", + "Merge into one group": "Об'єднати в одну групу", + "Metres (m)": "Метри (m)", + "Millimetres (mm)": "Міліметри (mm)", + "No Recent Imports": "Немає нещодавніх імпортів", + "No warnings.": "Попереджень немає.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Імпортувати нічого: FormShot імпортує файли GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP та IGES.", + "One file beside it": "Один файл поруч", + "Opening {name} will close the open project and discard its unsaved changes.": "Відкриття {name} закриє поточний проєкт і відкине його незбережені зміни.", + "Options": "Параметри", + "Parts": "Деталі", + "Placing in the scene": "Розміщення в сцені", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Заново прочитати вихідні файли вибраних деталей (або всіх імпортованих), зберігши їхні матеріали.", + "Reading the file": "Читання файлу", + "Reading the file...": "Читання файлу...", + "Recent Imports": "Нещодавні імпорти", + "Reimport": "Імпортувати заново", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Повторний імпорт: оновлено {matched}, нових {added}, приховано {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Надішліть файли моделей до FormShot та імпортуйте їх у сцену з параметрами.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Кілька файлів імпортуються по черзі. Буфери, матеріали та текстури поруч із моделлю імпортуються разом із нею.", + "Size": "Розмір", + "Stand on the floor": "Поставити на підлогу", + "Tessellating CAD surfaces": "Тесселяція CAD-поверхонь", + "The engine decides from the file.": "Рушій визначить за файлом.", + "The engine did not start an import job": "Рушій не запустив завдання імпорту", + "The engine did not start in time, so the files FormShot was given were not opened.": "Рушій не запустився вчасно, тому файли, передані FormShot, не було відкрито.", + "The file says it is in {unit}.": "У файлі вказано: {unit}.", + "The import failed": "Імпорт не вдався", + "The import goes on; the files after it were not imported.": "Імпорт триває; наступні за ним файли не було імпортовано.", + "The import of {name} was cancelled.": "Імпорт {name} скасовано.", + "The upload failed ({status})": "Не вдалося завантажити ({status})", + "The upload was cancelled": "Завантаження скасовано", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Цей рушій не вміє заглядати у файл перед імпортом, тому підсумок залишається порожнім.", + "This engine cannot stop an import once it has started": "Цей рушій не може зупинити імпорт після його запуску", + "This engine imports in one step, so there is no progress to show or stop.": "Цей рушій імпортує за один крок, тому показувати й зупиняти нічого.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "У цьому файлі не вказано одиниць вимірювання. FormShot припустив {unit} за розміром; перевірте перед імпортом.", + "Triangles": "Трикутники", + "Ultra": "Ультра", + "Units": "Одиниці", + "Up axis": "Верхня вісь", + "Up axis in file": "Верхня вісь у файлі", + "Uploading": "Завантаження", + "Y is up": "Угору спрямована вісь Y", + "Z is up": "Угору спрямована вісь Z", + "centimetres": "сантиметри", + "feet": "фути", + "inches": "дюйми", + "metres": "метри", + "millimetres": "міліметри", + "{i} of {n}": "{i} із {n}", + "{n} files beside it": "Файлів поруч: {n}", + "{n} files were not imported.": "Не імпортовано файлів: {n}.", + "{n} warnings; the Scene page lists the parts.": "Попереджень: {n}; сторінка «Сцена» перелічує деталі." } From abf72010375b75c3d8083e343bc411ebdfa077f8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:09 -0500 Subject: [PATCH 144/494] feat(i18n): translate the handoff page into four languages Translated the handoff namespace into Russian, Ukrainian, Turkish and Brazilian Portuguese, 60 strings each. Ran ./formshot i18n check: full coverage, no placeholder mismatch. --- frontend/src/i18n/modules/handoff/pt-BR.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/ru.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/tr.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/uk.json | 120 +++++++++---------- 4 files changed, 240 insertions(+), 240 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/pt-BR.json b/frontend/src/i18n/modules/handoff/pt-BR.json index a93ea0c0..6393cd5a 100644 --- a/frontend/src/i18n/modules/handoff/pt-BR.json +++ b/frontend/src/i18n/modules/handoff/pt-BR.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 de {count}", + "A Form app is handing something over": "Um app da família Form está enviando algo", + "A mesh with maps by role": "Uma malha com mapas por função", + "A model file": "Um arquivo de modelo", + "Add to this document": "Adicionar a este documento", + "Added {title} from {app}": "{title} adicionado de {app}", + "Always allow": "Sempre permitir", + "Always allow {app}": "Sempre permitir {app}", + "An object from the GoF folder": "Um objeto da pasta GoF", + "another app": "outro app", + "As a new document": "Como novo documento", + "Base colour": "Cor base", + "Block": "Bloco", + "Choose a hand-off or give a path": "Escolha uma transferência ou informe um caminho", + "Contents": "Conteúdo", + "Could not be read": "Não foi possível ler", + "Decline": "Recusar", + "Emission": "Emissão", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "O FormShot monitora a pasta GoF e as exportações do FormSurface enquanto esta janela estiver aberta. Quando um app da família Form envia algo, o FormShot pergunta aqui antes de abrir.", + "FormSurface": "FormSurface", + "FormSurface exports": "Exportações do FormSurface", + "From": "De", + "GoF folder": "Pasta GoF", + "Hand-off Settings": "Configurações de transferência", + "Hand-offs": "Transferências", + "Hand-offs from {app}": "Transferências de {app}", + "Maps": "Mapas", + "Maps by role, without a mesh": "Mapas por função, sem malha", + "Metalness": "Metalicidade", + "Normal": "Normal", + "not found": "não encontrado", + "Not read yet": "Ainda não lido", + "Nothing from the Form apps is waiting in their hand-off folders.": "Nada dos apps Form está aguardando nas pastas de transferência.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nada é aberto até você escolher. As texturas ficam onde o app as gravou e são referenciadas por função.", + "Occlusion, roughness and metalness": "Oclusão, rugosidade e metalicidade", + "Opacity": "Opacidade", + "Open a Hand-off": "Abrir transferência", + "Open a Hand-off...": "Abrir transferência...", + "Open it": "Abrir", + "Open once": "Abrir uma vez", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Abra o que o FormSculpt, o FormFabric, o FormSurface ou o FormCAD enviou", + "Opened {title} from {app} as a new document": "{title} de {app} aberto como novo documento", + "Or a path to a file or folder": "Ou um caminho para um arquivo ou pasta", + "Other maps": "Outros mapas", + "Reading...": "Lendo...", + "Roughness": "Rugosidade", + "Sent as": "Enviado como", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "O serviço do FormShot não está acessível, então estas escolhas não podem ser lidas nem alteradas agora.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "O que o FormSculpt e o FormFabric colocam na pasta GoF e o que o FormSurface exportou. Abrir um item aqui não pede confirmação, porque você o escolheu.", + "{app} is handing over {title}: {what}.": "{app} está enviando {title}: {what}.", + "{count} maps from FormSurface": "{count} mapas do FormSurface", + "{count} maps: {roles}": "{count} mapas: {roles}", + "{count} materials": "{count} materiais", + "{format} file": "Arquivo {format}", + "{format} file, {count} triangles": "Arquivo {format}, {count} triângulos", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} malhas, {triangles} triângulos, {materials} materiais", + "{n} days ago": "há {n} dias" } diff --git a/frontend/src/i18n/modules/handoff/ru.json b/frontend/src/i18n/modules/handoff/ru.json index a93ea0c0..bd5eec4d 100644 --- a/frontend/src/i18n/modules/handoff/ru.json +++ b/frontend/src/i18n/modules/handoff/ru.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 из {count}", + "A Form app is handing something over": "Приложение Form передаёт данные", + "A mesh with maps by role": "Меш с картами по ролям", + "A model file": "Файл модели", + "Add to this document": "Добавить в этот документ", + "Added {title} from {app}": "Добавлено: {title} из {app}", + "Always allow": "Всегда разрешать", + "Always allow {app}": "Всегда разрешать {app}", + "An object from the GoF folder": "Объект из папки GoF", + "another app": "другое приложение", + "As a new document": "Как новый документ", + "Base colour": "Базовый цвет", + "Block": "Блок", + "Choose a hand-off or give a path": "Выберите передачу или укажите путь", + "Contents": "Содержимое", + "Could not be read": "Не удалось прочитать", + "Decline": "Отклонить", + "Emission": "Излучение", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot следит за папкой GoF и экспортом FormSurface, пока это окно открыто. Когда приложение Form что-то передаёт, FormShot спрашивает здесь, прежде чем открыть.", + "FormSurface": "FormSurface", + "FormSurface exports": "Экспорт FormSurface", + "From": "От", + "GoF folder": "Папка GoF", + "Hand-off Settings": "Настройки передачи", + "Hand-offs": "Передачи", + "Hand-offs from {app}": "Передачи от {app}", + "Maps": "Карты", + "Maps by role, without a mesh": "Карты по ролям, без меша", + "Metalness": "Металличность", + "Normal": "Нормали", + "not found": "не найдено", + "Not read yet": "Ещё не прочитано", + "Nothing from the Form apps is waiting in their hand-off folders.": "В папках передачи приложений Form ничего не ожидает.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Ничего не открывается, пока вы не выберете. Текстуры остаются там, где их записало приложение, и подключаются по ролям.", + "Occlusion, roughness and metalness": "Окклюзия, шероховатость и металличность", + "Opacity": "Непрозрачность", + "Open a Hand-off": "Открыть передачу", + "Open a Hand-off...": "Открыть передачу...", + "Open it": "Открыть", + "Open once": "Открыть один раз", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Откройте то, что передали FormSculpt, FormFabric, FormSurface или FormCAD", + "Opened {title} from {app} as a new document": "Открыто: {title} из {app} как новый документ", + "Or a path to a file or folder": "Или путь к файлу или папке", + "Other maps": "Другие карты", + "Reading...": "Чтение...", + "Roughness": "Шероховатость", + "Sent as": "Передано как", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Служба FormShot недоступна, поэтому сейчас нельзя прочитать или изменить эти настройки.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "То, что FormSculpt и FormFabric кладут в папку GoF, и то, что экспортировал FormSurface. Открытие отсюда не требует подтверждения, потому что вы выбрали это сами.", + "{app} is handing over {title}: {what}.": "{app} передаёт {title}: {what}.", + "{count} maps from FormSurface": "Карт от FormSurface: {count}", + "{count} maps: {roles}": "Карт: {count}: {roles}", + "{count} materials": "Материалов: {count}", + "{format} file": "Файл {format}", + "{format} file, {count} triangles": "Файл {format}, треугольников: {count}", + "{meshes} meshes, {triangles} triangles, {materials} materials": "Мешей: {meshes}, треугольников: {triangles}, материалов: {materials}", + "{n} days ago": "{n} дн. назад" } diff --git a/frontend/src/i18n/modules/handoff/tr.json b/frontend/src/i18n/modules/handoff/tr.json index a93ea0c0..e57908e2 100644 --- a/frontend/src/i18n/modules/handoff/tr.json +++ b/frontend/src/i18n/modules/handoff/tr.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 / {count}", + "A Form app is handing something over": "Bir Form uygulaması bir şey devrediyor", + "A mesh with maps by role": "Role göre haritalarla bir mesh", + "A model file": "Bir model dosyası", + "Add to this document": "Bu belgeye ekle", + "Added {title} from {app}": "{app} uygulamasından {title} eklendi", + "Always allow": "Her zaman izin ver", + "Always allow {app}": "{app} için her zaman izin ver", + "An object from the GoF folder": "GoF klasöründen bir nesne", + "another app": "başka bir uygulama", + "As a new document": "Yeni belge olarak", + "Base colour": "Temel renk", + "Block": "Blok", + "Choose a hand-off or give a path": "Bir devir seçin veya yol girin", + "Contents": "İçerik", + "Could not be read": "Okunamadı", + "Decline": "Reddet", + "Emission": "Emisyon", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "Bu pencere açıkken FormShot, GoF klasörünü ve FormSurface dışa aktarımlarını izler. Bir Form uygulaması bir şey devrettiğinde FormShot, açmadan önce burada sorar.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface dışa aktarımları", + "From": "Kaynak", + "GoF folder": "GoF klasörü", + "Hand-off Settings": "Devir Ayarları", + "Hand-offs": "Devirler", + "Hand-offs from {app}": "{app} devirleri", + "Maps": "Haritalar", + "Maps by role, without a mesh": "Role göre haritalar, mesh olmadan", + "Metalness": "Metalik", + "Normal": "Normal", + "not found": "bulunamadı", + "Not read yet": "Henüz okunmadı", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form uygulamalarının devir klasörlerinde bekleyen bir şey yok.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Siz seçmeden hiçbir şey açılmaz. Dokular uygulamanın yazdığı yerde kalır ve role göre başvurulur.", + "Occlusion, roughness and metalness": "Oklüzyon, pürüzlülük ve metaliklik", + "Opacity": "Opaklık", + "Open a Hand-off": "Devri Aç", + "Open a Hand-off...": "Devri Aç...", + "Open it": "Aç", + "Open once": "Bir kez aç", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "FormSculpt, FormFabric, FormSurface veya FormCAD'in devrettiğini açın", + "Opened {title} from {app} as a new document": "{app} uygulamasından {title} yeni belge olarak açıldı", + "Or a path to a file or folder": "Veya bir dosya ya da klasör yolu", + "Other maps": "Diğer haritalar", + "Reading...": "Okunuyor...", + "Roughness": "Pürüzlülük", + "Sent as": "Gönderilme biçimi", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot hizmetine ulaşılamıyor, bu yüzden bu seçimler şu anda okunamaz veya değiştirilemez.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "FormSculpt ve FormFabric'in GoF klasörüne koyduklarıyla FormSurface'in dışa aktardıkları. Buradan açmak onay gerektirmez, çünkü onu siz seçtiniz.", + "{app} is handing over {title}: {what}.": "{app}, {title} öğesini devrediyor: {what}.", + "{count} maps from FormSurface": "FormSurface'ten {count} harita", + "{count} maps: {roles}": "{count} harita: {roles}", + "{count} materials": "{count} malzeme", + "{format} file": "{format} dosyası", + "{format} file, {count} triangles": "{format} dosyası, {count} üçgen", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} mesh, {triangles} üçgen, {materials} malzeme", + "{n} days ago": "{n} gün önce" } diff --git a/frontend/src/i18n/modules/handoff/uk.json b/frontend/src/i18n/modules/handoff/uk.json index a93ea0c0..6b193848 100644 --- a/frontend/src/i18n/modules/handoff/uk.json +++ b/frontend/src/i18n/modules/handoff/uk.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 із {count}", + "A Form app is handing something over": "Застосунок Form передає дані", + "A mesh with maps by role": "Меш із картами за ролями", + "A model file": "Файл моделі", + "Add to this document": "Додати до цього документа", + "Added {title} from {app}": "Додано: {title} з {app}", + "Always allow": "Завжди дозволяти", + "Always allow {app}": "Завжди дозволяти {app}", + "An object from the GoF folder": "Об'єкт із теки GoF", + "another app": "інший застосунок", + "As a new document": "Як новий документ", + "Base colour": "Базовий колір", + "Block": "Блок", + "Choose a hand-off or give a path": "Виберіть передачу або вкажіть шлях", + "Contents": "Вміст", + "Could not be read": "Не вдалося прочитати", + "Decline": "Відхилити", + "Emission": "Випромінювання", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot стежить за текою GoF та експортом FormSurface, поки це вікно відкрите. Коли застосунок Form щось передає, FormShot питає тут, перш ніж відкрити.", + "FormSurface": "FormSurface", + "FormSurface exports": "Експорт FormSurface", + "From": "Від", + "GoF folder": "Тека GoF", + "Hand-off Settings": "Налаштування передачі", + "Hand-offs": "Передачі", + "Hand-offs from {app}": "Передачі від {app}", + "Maps": "Карти", + "Maps by role, without a mesh": "Карти за ролями, без меша", + "Metalness": "Металевість", + "Normal": "Нормалі", + "not found": "не знайдено", + "Not read yet": "Ще не прочитано", + "Nothing from the Form apps is waiting in their hand-off folders.": "У теках передачі застосунків Form нічого не очікує.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Нічого не відкривається, поки ви не оберете. Текстури залишаються там, де їх записав застосунок, і підключаються за ролями.", + "Occlusion, roughness and metalness": "Оклюзія, шорсткість і металевість", + "Opacity": "Непрозорість", + "Open a Hand-off": "Відкрити передачу", + "Open a Hand-off...": "Відкрити передачу...", + "Open it": "Відкрити", + "Open once": "Відкрити один раз", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Відкрийте те, що передали FormSculpt, FormFabric, FormSurface або FormCAD", + "Opened {title} from {app} as a new document": "Відкрито: {title} з {app} як новий документ", + "Or a path to a file or folder": "Або шлях до файлу чи теки", + "Other maps": "Інші карти", + "Reading...": "Читання...", + "Roughness": "Шорсткість", + "Sent as": "Передано як", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Служба FormShot недоступна, тому зараз не можна прочитати чи змінити ці налаштування.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Те, що FormSculpt і FormFabric кладуть у теку GoF, і те, що експортував FormSurface. Відкриття звідси не потребує підтвердження, бо ви обрали це самі.", + "{app} is handing over {title}: {what}.": "{app} передає {title}: {what}.", + "{count} maps from FormSurface": "Карт від FormSurface: {count}", + "{count} maps: {roles}": "Карт: {count}: {roles}", + "{count} materials": "Матеріалів: {count}", + "{format} file": "Файл {format}", + "{format} file, {count} triangles": "Файл {format}, трикутників: {count}", + "{meshes} meshes, {triangles} triangles, {materials} materials": "Мешів: {meshes}, трикутників: {triangles}, матеріалів: {materials}", + "{n} days ago": "{n} дн. тому" } From f958849bde40dbca5a31e6f8cfd396a4ac810fcc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:58 -0500 Subject: [PATCH 145/494] feat(i18n): translate the cad page into four languages Translated the cad namespace into Russian, Ukrainian, Turkish and Brazilian Portuguese, 89 strings each. Ran ./formshot i18n check: full coverage, no placeholder mismatch. --- frontend/src/i18n/modules/cad/pt-BR.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/ru.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/tr.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/uk.json | 178 +++++++++++------------ 4 files changed, 356 insertions(+), 356 deletions(-) diff --git a/frontend/src/i18n/modules/cad/pt-BR.json b/frontend/src/i18n/modules/cad/pt-BR.json index 4debd1cd..616fc419 100644 --- a/frontend/src/i18n/modules/cad/pt-BR.json +++ b/frontend/src/i18n/modules/cad/pt-BR.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% do tamanho do modelo", + "About {n} triangles afterwards.": "Cerca de {n} triângulos depois.", + "All CAD parts": "Todas as peças CAD", + "Angle": "Ângulo", + "Angle in degrees": "Ângulo em graus", + "Apply": "Aplicar", + "Beside the FormShot engine": "Ao lado do motor do FormShot", + "CAD Import": "Importação CAD", + "CAD Import Settings...": "Configurações de importação CAD...", + "CAD Options in the Import Sheet": "Opções CAD na folha de importação", + "CAD worker": "Worker CAD", + "CAD worker: {stage}, {pct}%": "Worker CAD: {stage}, {pct}%", + "Check the worker": "Verificar o worker", + "Checking every file": "Verificando cada arquivo", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Escolha arquivos STEP ou IGES para importar; eles são abertos pelo worker CAD.", + "Chord": "Corda", + "Chord as a percentage of the model size": "Corda como porcentagem do tamanho do modelo", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "A corda deve ser maior que 0 e no máximo {max}% do tamanho do modelo; o ângulo, de {min} a {amax} graus.", + "Chord {chord}% of the model size, angle {angle} degrees": "Corda de {chord}% do tamanho do modelo, ângulo de {angle} graus", + "Could not re-tessellate: {reason}": "Não foi possível retesselar: {reason}", + "Custom": "Personalizado", + "Custom ({chord}%, {angle}°)": "Personalizado ({chord}%, {angle}°)", + "Default CAD quality": "Qualidade CAD padrão", + "Download": "Baixar", + "Download and check the program that opens STEP and IGES files.": "Baixe e verifique o programa que abre arquivos STEP e IGES.", + "Download the CAD Worker": "Baixar o worker CAD", + "Download the CAD worker": "Baixar o worker CAD", + "Downloaded into the cache folder": "Baixado para a pasta de cache", + "Downloading": "Baixando", + "Found in": "Encontrado em", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Define quão finamente as superfícies STEP e IGES viram triângulos ao serem importadas. Corda é a maior folga entre um triângulo e a superfície real, como fração do tamanho de todo o modelo; ângulo é a maior curvatura entre triângulos vizinhos. Configurações mais finas demoram mais e geram arquivos maiores. A folha de importação começa com esta escolha; lá você pode alterá-la para uma única importação.", + "Installed": "Instalado", + "Mixed": "Misto", + "Named by FORMSHOT_CAD_WORKER": "Definido por FORMSHOT_CAD_WORKER", + "New quality": "Nova qualidade", + "None of the selected parts came from a STEP or IGES file.": "Nenhuma das peças selecionadas veio de um arquivo STEP ou IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Nenhuma das peças selecionadas veio de um arquivo STEP ou IGES. Limpe a seleção para reconstruir todas as peças CAD.", + "Not available.": "Indisponível.", + "Not available: {reason}": "Indisponível: {reason}", + "Not installed": "Não instalado", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Ainda não instalado. O FormShot o procura em {folder}; baixe-o aqui para abrir arquivos STEP e IGES.", + "Not named": "Não informado", + "Not recorded": "Não registrado", + "Nothing in this document came from a STEP or IGES file.": "Nada neste documento veio de um arquivo STEP ou IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Nada está selecionado, então todas as peças CAD serão reconstruídas.", + "Published": "Publicado", + "Quality now": "Qualidade atual", + "Re-tessellate CAD Parts": "Retesselar peças CAD", + "Re-tessellate CAD Parts...": "Retesselar peças CAD...", + "Re-tessellated 1 CAD part at {quality}.": "1 peça CAD retesselada em {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 peça CAD retesselada em {quality}: de {before} para {after} triângulos.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} peças CAD retesseladas em {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} peças CAD retesseladas em {quality}: de {before} para {after} triângulos.", + "Re-tessellating": "Retesselando", + "Read the status again": "Ler o status novamente", + "Reading the published record": "Lendo o registro publicado", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Reconstrua as malhas das peças importadas de STEP ou IGES em outra qualidade, como uma única etapa de desfazer.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Arquivos STEP e IGES são abertos pelo worker de kernel do FormCAD, um programa separado que o FormShot baixa uma vez, verifica arquivo por arquivo e guarda na sua pasta de cache. Outros formatos de modelo não precisam dele.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Arquivos STEP e IGES precisam do worker CAD, e nenhum está publicado para este computador.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Arquivos STEP e IGES precisam do worker CAD, que ainda não está instalado.", + "Selected CAD parts": "Peças CAD selecionadas", + "Source": "Origem", + "The CAD worker is installed.": "O worker CAD está instalado.", + "The CAD worker is installed. You can import this file now.": "O worker CAD está instalado. Você já pode importar este arquivo.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "O worker CAD que abre arquivos STEP e IGES e a qualidade CAD padrão.", + "The FormShot service is not reachable.": "O serviço do FormShot não está acessível.", + "The download failed: {reason}": "O download falhou: {reason}", + "The download was cancelled. Nothing was installed.": "O download foi cancelado. Nada foi instalado.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "O motor não dá estimativa; qualidades mais finas demoram mais e geram mais triângulos.", + "The parts could not be read: {reason}": "Não foi possível ler as peças: {reason}", + "The service cannot stop a download once it has started.": "O serviço não pode interromper um download depois de iniciado.", + "The service refused the request from this window.": "O serviço recusou a solicitação desta janela.", + "The status could not be read: {reason}": "Não foi possível ler o status: {reason}", + "The worker did not answer: {reason}": "O worker não respondeu: {reason}", + "This computer": "Este computador", + "This engine cannot re-tessellate CAD parts.": "Este motor não consegue retesselar peças CAD.", + "Triangles now": "Triângulos agora", + "Try Again": "Tentar novamente", + "Unknown": "Desconhecido", + "Unpacking": "Descompactando", + "Version": "Versão", + "degrees": "graus", + "no reason was given": "nenhum motivo foi informado", + "{done} of {total}": "{done} de {total}", + "{n} files": "{n} arquivos", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocolo {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} descompactados, verificados arquivo por arquivo", + "{tag}: none for this computer": "{tag}: nenhum para este computador", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} arquivos, {size} descompactados" } diff --git a/frontend/src/i18n/modules/cad/ru.json b/frontend/src/i18n/modules/cad/ru.json index 4debd1cd..4fe19fac 100644 --- a/frontend/src/i18n/modules/cad/ru.json +++ b/frontend/src/i18n/modules/cad/ru.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% от размера модели", + "About {n} triangles afterwards.": "Примерно {n} треугольников после этого.", + "All CAD parts": "Все CAD-детали", + "Angle": "Угол", + "Angle in degrees": "Угол в градусах", + "Apply": "Применить", + "Beside the FormShot engine": "Рядом с движком FormShot", + "CAD Import": "Импорт CAD", + "CAD Import Settings...": "Настройки импорта CAD...", + "CAD Options in the Import Sheet": "Параметры CAD в окне импорта", + "CAD worker": "Рабочий процесс CAD", + "CAD worker: {stage}, {pct}%": "Рабочий процесс CAD: {stage}, {pct}%", + "Check the worker": "Проверить рабочий процесс", + "Checking every file": "Проверка каждого файла", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Выберите файлы STEP или IGES для импорта; они открываются через рабочий процесс CAD.", + "Chord": "Хорда", + "Chord as a percentage of the model size": "Хорда в процентах от размера модели", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Хорда должна быть больше 0 и не более {max}% от размера модели; угол от {min} до {amax} градусов.", + "Chord {chord}% of the model size, angle {angle} degrees": "Хорда {chord}% от размера модели, угол {angle} градусов", + "Could not re-tessellate: {reason}": "Не удалось выполнить повторную тесселяцию: {reason}", + "Custom": "Своё", + "Custom ({chord}%, {angle}°)": "Своё ({chord}%, {angle}°)", + "Default CAD quality": "Качество CAD по умолчанию", + "Download": "Скачать", + "Download and check the program that opens STEP and IGES files.": "Скачайте и проверьте программу, открывающую файлы STEP и IGES.", + "Download the CAD Worker": "Скачать рабочий процесс CAD", + "Download the CAD worker": "Скачать рабочий процесс CAD", + "Downloaded into the cache folder": "Скачано в папку кэша", + "Downloading": "Скачивание", + "Found in": "Найдено в", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Насколько мелко поверхности STEP и IGES превращаются в треугольники при импорте. Хорда: наибольший зазор между треугольником и настоящей поверхностью в долях размера всей модели; угол: наибольший изгиб между соседними треугольниками. Более мелкие настройки работают дольше и дают файлы больше. Окно импорта начинается с этого выбора; для одного импорта его можно изменить там.", + "Installed": "Установлено", + "Mixed": "Смешанное", + "Named by FORMSHOT_CAD_WORKER": "Задано через FORMSHOT_CAD_WORKER", + "New quality": "Новое качество", + "None of the selected parts came from a STEP or IGES file.": "Ни одна из выбранных деталей не получена из файла STEP или IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Ни одна из выбранных деталей не получена из файла STEP или IGES. Снимите выделение, чтобы перестроить все CAD-детали.", + "Not available.": "Недоступно.", + "Not available: {reason}": "Недоступно: {reason}", + "Not installed": "Не установлено", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Пока не установлено. FormShot ищет его в {folder}; скачайте его здесь, чтобы открывать файлы STEP и IGES.", + "Not named": "Не задано", + "Not recorded": "Не записано", + "Nothing in this document came from a STEP or IGES file.": "В этом документе нет ничего из файлов STEP или IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Ничего не выбрано, поэтому будут перестроены все CAD-детали.", + "Published": "Опубликовано", + "Quality now": "Текущее качество", + "Re-tessellate CAD Parts": "Повторная тесселяция CAD-деталей", + "Re-tessellate CAD Parts...": "Повторная тесселяция CAD-деталей...", + "Re-tessellated 1 CAD part at {quality}.": "Повторная тесселяция 1 CAD-детали с качеством {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Повторная тесселяция 1 CAD-детали с качеством {quality}: треугольников было {before}, стало {after}.", + "Re-tessellated {parts} CAD parts at {quality}.": "Повторная тесселяция CAD-деталей: {parts}, качество {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Повторная тесселяция CAD-деталей: {parts}, качество {quality}: треугольников было {before}, стало {after}.", + "Re-tessellating": "Повторная тесселяция", + "Read the status again": "Прочитать состояние заново", + "Reading the published record": "Чтение опубликованной записи", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Перестройте меши деталей, импортированных из STEP или IGES, с другим качеством, одним шагом отмены.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Файлы STEP и IGES открывает рабочий процесс ядра FormCAD, отдельная программа, которую FormShot скачивает один раз, проверяет файл за файлом и хранит в папке кэша. Другие форматы моделей в ней не нуждаются.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Для файлов STEP и IGES нужен рабочий процесс CAD, но для этого компьютера он не опубликован.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Для файлов STEP и IGES нужен рабочий процесс CAD, который ещё не установлен.", + "Selected CAD parts": "Выбранные CAD-детали", + "Source": "Источник", + "The CAD worker is installed.": "Рабочий процесс CAD установлен.", + "The CAD worker is installed. You can import this file now.": "Рабочий процесс CAD установлен. Теперь можно импортировать этот файл.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Рабочий процесс CAD, открывающий файлы STEP и IGES, и качество CAD по умолчанию.", + "The FormShot service is not reachable.": "Служба FormShot недоступна.", + "The download failed: {reason}": "Не удалось скачать: {reason}", + "The download was cancelled. Nothing was installed.": "Скачивание отменено. Ничего не установлено.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Движок не даёт оценки; более высокое качество занимает больше времени и даёт больше треугольников.", + "The parts could not be read: {reason}": "Не удалось прочитать детали: {reason}", + "The service cannot stop a download once it has started.": "Служба не может остановить скачивание после его начала.", + "The service refused the request from this window.": "Служба отклонила запрос из этого окна.", + "The status could not be read: {reason}": "Не удалось прочитать состояние: {reason}", + "The worker did not answer: {reason}": "Рабочий процесс не ответил: {reason}", + "This computer": "Этот компьютер", + "This engine cannot re-tessellate CAD parts.": "Этот движок не умеет повторно выполнять тесселяцию CAD-деталей.", + "Triangles now": "Сейчас треугольников", + "Try Again": "Повторить", + "Unknown": "Неизвестно", + "Unpacking": "Распаковка", + "Version": "Версия", + "degrees": "градусов", + "no reason was given": "причина не указана", + "{done} of {total}": "{done} из {total}", + "{n} files": "Файлов: {n}", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, протокол {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, распаковано {size}, проверено файл за файлом", + "{tag}: none for this computer": "{tag}: для этого компьютера нет", + "{tag}: {files} files, {size} unpacked": "{tag}: файлов {files}, распаковано {size}" } diff --git a/frontend/src/i18n/modules/cad/tr.json b/frontend/src/i18n/modules/cad/tr.json index 4debd1cd..642bc80c 100644 --- a/frontend/src/i18n/modules/cad/tr.json +++ b/frontend/src/i18n/modules/cad/tr.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "Model boyutunun %", + "About {n} triangles afterwards.": "Sonrasında yaklaşık {n} üçgen olur.", + "All CAD parts": "Tüm CAD parçaları", + "Angle": "Açı", + "Angle in degrees": "Derece cinsinden açı", + "Apply": "Uygula", + "Beside the FormShot engine": "FormShot motorunun yanında", + "CAD Import": "CAD İçe Aktarma", + "CAD Import Settings...": "CAD İçe Aktarma Ayarları...", + "CAD Options in the Import Sheet": "İçe Aktarma Sayfasındaki CAD Seçenekleri", + "CAD worker": "CAD çalışanı", + "CAD worker: {stage}, {pct}%": "CAD çalışanı: {stage}, %{pct}", + "Check the worker": "Çalışanı denetle", + "Checking every file": "Her dosya denetleniyor", + "Choose STEP or IGES files to import; they open through the CAD worker.": "İçe aktarmak için STEP veya IGES dosyalarını seçin; bunlar CAD çalışanı üzerinden açılır.", + "Chord": "Kiriş", + "Chord as a percentage of the model size": "Kirişin model boyutuna yüzdesi", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Kiriş 0'dan büyük ve model boyutunun en fazla %{max} kadarı olmalıdır; açı {min} ile {amax} derece arasında olmalıdır.", + "Chord {chord}% of the model size, angle {angle} degrees": "Kiriş model boyutunun %{chord} kadarı, açı {angle} derece", + "Could not re-tessellate: {reason}": "Yeniden üçgenlere bölme yapılamadı: {reason}", + "Custom": "Özel", + "Custom ({chord}%, {angle}°)": "Özel (%{chord}, {angle}°)", + "Default CAD quality": "Varsayılan CAD kalitesi", + "Download": "İndir", + "Download and check the program that opens STEP and IGES files.": "STEP ve IGES dosyalarını açan programı indirin ve denetleyin.", + "Download the CAD Worker": "CAD Çalışanını İndir", + "Download the CAD worker": "CAD çalışanını indir", + "Downloaded into the cache folder": "Önbellek klasörüne indirildi", + "Downloading": "İndiriliyor", + "Found in": "Bulunduğu yer", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "STEP ve IGES yüzeylerinin içe aktarılırken ne kadar ince üçgenlere dönüştürüleceği. Kiriş, bir üçgen ile gerçek yüzey arasındaki en büyük boşluktur ve tüm model boyutunun oranı olarak verilir; açı, komşu üçgenler arasındaki en büyük kırılmadır. İnce ayarlar daha uzun sürer ve daha büyük dosyalar üretir. İçe aktarma sayfası bu seçimle başlar; orada tek bir içe aktarma için değiştirebilirsiniz.", + "Installed": "Yüklü", + "Mixed": "Karışık", + "Named by FORMSHOT_CAD_WORKER": "FORMSHOT_CAD_WORKER ile belirtildi", + "New quality": "Yeni kalite", + "None of the selected parts came from a STEP or IGES file.": "Seçili parçaların hiçbiri bir STEP veya IGES dosyasından gelmedi.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Seçili parçaların hiçbiri bir STEP veya IGES dosyasından gelmedi. Tüm CAD parçalarını yeniden oluşturmak için seçimi kaldırın.", + "Not available.": "Kullanılamıyor.", + "Not available: {reason}": "Kullanılamıyor: {reason}", + "Not installed": "Yüklü değil", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Henüz yüklü değil. FormShot onu {folder} içinde arar; STEP ve IGES dosyalarını açmak için buradan indirin.", + "Not named": "Belirtilmedi", + "Not recorded": "Kaydedilmedi", + "Nothing in this document came from a STEP or IGES file.": "Bu belgedeki hiçbir şey bir STEP veya IGES dosyasından gelmedi.", + "Nothing is selected, so every CAD part is rebuilt.": "Hiçbir şey seçili değil, bu yüzden tüm CAD parçaları yeniden oluşturulur.", + "Published": "Yayımlandı", + "Quality now": "Şimdiki kalite", + "Re-tessellate CAD Parts": "CAD Parçalarını Yeniden Üçgenle", + "Re-tessellate CAD Parts...": "CAD Parçalarını Yeniden Üçgenle...", + "Re-tessellated 1 CAD part at {quality}.": "1 CAD parçası {quality} kalitesinde yeniden üçgenlendi.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 CAD parçası {quality} kalitesinde yeniden üçgenlendi: {before} üçgenden {after} üçgene.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} CAD parçası {quality} kalitesinde yeniden üçgenlendi.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} CAD parçası {quality} kalitesinde yeniden üçgenlendi: {before} üçgenden {after} üçgene.", + "Re-tessellating": "Yeniden üçgenleniyor", + "Read the status again": "Durumu yeniden oku", + "Reading the published record": "Yayımlanan kayıt okunuyor", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "STEP veya IGES'ten içe aktarılan parçaların meshlerini başka bir kalitede, tek bir geri alma adımı olarak yeniden oluşturun.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP ve IGES dosyalarını FormCAD'in çekirdek çalışanı açar; bu, FormShot'ın bir kez indirdiği, dosya dosya denetlediği ve önbellek klasörünüzde sakladığı ayrı bir programdır. Diğer model biçimleri ona ihtiyaç duymaz.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP ve IGES dosyaları CAD çalışanını gerektirir ve bu bilgisayar için yayımlanmış bir çalışan yok.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP ve IGES dosyaları CAD çalışanını gerektirir; o henüz yüklü değil.", + "Selected CAD parts": "Seçili CAD parçaları", + "Source": "Kaynak", + "The CAD worker is installed.": "CAD çalışanı yüklü.", + "The CAD worker is installed. You can import this file now.": "CAD çalışanı yüklü. Bu dosyayı şimdi içe aktarabilirsiniz.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "STEP ve IGES dosyalarını açan CAD çalışanı ve varsayılan CAD kalitesi.", + "The FormShot service is not reachable.": "FormShot hizmetine ulaşılamıyor.", + "The download failed: {reason}": "İndirme başarısız oldu: {reason}", + "The download was cancelled. Nothing was installed.": "İndirme iptal edildi. Hiçbir şey yüklenmedi.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Motor bir tahmin vermez; daha ince kaliteler daha uzun sürer ve daha çok üçgen üretir.", + "The parts could not be read: {reason}": "Parçalar okunamadı: {reason}", + "The service cannot stop a download once it has started.": "Hizmet, başladıktan sonra bir indirmeyi durduramaz.", + "The service refused the request from this window.": "Hizmet bu pencereden gelen isteği reddetti.", + "The status could not be read: {reason}": "Durum okunamadı: {reason}", + "The worker did not answer: {reason}": "Çalışan yanıt vermedi: {reason}", + "This computer": "Bu bilgisayar", + "This engine cannot re-tessellate CAD parts.": "Bu motor CAD parçalarını yeniden üçgenleyemez.", + "Triangles now": "Şimdiki üçgenler", + "Try Again": "Tekrar Dene", + "Unknown": "Bilinmiyor", + "Unpacking": "Açılıyor", + "Version": "Sürüm", + "degrees": "derece", + "no reason was given": "neden belirtilmedi", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} dosya", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, açılmış {size}, dosya dosya denetlendi", + "{tag}: none for this computer": "{tag}: bu bilgisayar için yok", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} dosya, açılmış {size}" } diff --git a/frontend/src/i18n/modules/cad/uk.json b/frontend/src/i18n/modules/cad/uk.json index 4debd1cd..95a0af64 100644 --- a/frontend/src/i18n/modules/cad/uk.json +++ b/frontend/src/i18n/modules/cad/uk.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% від розміру моделі", + "About {n} triangles afterwards.": "Приблизно {n} трикутників після цього.", + "All CAD parts": "Усі CAD-деталі", + "Angle": "Кут", + "Angle in degrees": "Кут у градусах", + "Apply": "Застосувати", + "Beside the FormShot engine": "Поруч із рушієм FormShot", + "CAD Import": "Імпорт CAD", + "CAD Import Settings...": "Налаштування імпорту CAD...", + "CAD Options in the Import Sheet": "Параметри CAD у вікні імпорту", + "CAD worker": "Робочий процес CAD", + "CAD worker: {stage}, {pct}%": "Робочий процес CAD: {stage}, {pct}%", + "Check the worker": "Перевірити робочий процес", + "Checking every file": "Перевірка кожного файлу", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Виберіть файли STEP або IGES для імпорту; вони відкриваються через робочий процес CAD.", + "Chord": "Хорда", + "Chord as a percentage of the model size": "Хорда у відсотках від розміру моделі", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Хорда має бути більшою за 0 і не більшою за {max}% від розміру моделі; кут від {min} до {amax} градусів.", + "Chord {chord}% of the model size, angle {angle} degrees": "Хорда {chord}% від розміру моделі, кут {angle} градусів", + "Could not re-tessellate: {reason}": "Не вдалося виконати повторну тесселяцію: {reason}", + "Custom": "Власне", + "Custom ({chord}%, {angle}°)": "Власне ({chord}%, {angle}°)", + "Default CAD quality": "Якість CAD за замовчуванням", + "Download": "Завантажити", + "Download and check the program that opens STEP and IGES files.": "Завантажте й перевірте програму, що відкриває файли STEP та IGES.", + "Download the CAD Worker": "Завантажити робочий процес CAD", + "Download the CAD worker": "Завантажити робочий процес CAD", + "Downloaded into the cache folder": "Завантажено в теку кешу", + "Downloading": "Завантаження", + "Found in": "Знайдено в", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Наскільки дрібно поверхні STEP та IGES перетворюються на трикутники під час імпорту. Хорда: найбільший проміжок між трикутником і справжньою поверхнею у частках розміру всієї моделі; кут: найбільший вигин між сусідніми трикутниками. Дрібніші налаштування працюють довше й дають більші файли. Вікно імпорту починається з цього вибору; для одного імпорту його можна змінити там.", + "Installed": "Встановлено", + "Mixed": "Змішане", + "Named by FORMSHOT_CAD_WORKER": "Задано через FORMSHOT_CAD_WORKER", + "New quality": "Нова якість", + "None of the selected parts came from a STEP or IGES file.": "Жодна з вибраних деталей не походить із файлу STEP чи IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Жодна з вибраних деталей не походить із файлу STEP чи IGES. Зніміть виділення, щоб перебудувати всі CAD-деталі.", + "Not available.": "Недоступно.", + "Not available: {reason}": "Недоступно: {reason}", + "Not installed": "Не встановлено", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Ще не встановлено. FormShot шукає його в {folder}; завантажте його тут, щоб відкривати файли STEP та IGES.", + "Not named": "Не задано", + "Not recorded": "Не записано", + "Nothing in this document came from a STEP or IGES file.": "У цьому документі немає нічого з файлів STEP чи IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Нічого не вибрано, тому буде перебудовано всі CAD-деталі.", + "Published": "Опубліковано", + "Quality now": "Поточна якість", + "Re-tessellate CAD Parts": "Повторна тесселяція CAD-деталей", + "Re-tessellate CAD Parts...": "Повторна тесселяція CAD-деталей...", + "Re-tessellated 1 CAD part at {quality}.": "Повторна тесселяція 1 CAD-деталі з якістю {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Повторна тесселяція 1 CAD-деталі з якістю {quality}: трикутників було {before}, стало {after}.", + "Re-tessellated {parts} CAD parts at {quality}.": "Повторна тесселяція CAD-деталей: {parts}, якість {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Повторна тесселяція CAD-деталей: {parts}, якість {quality}: трикутників було {before}, стало {after}.", + "Re-tessellating": "Повторна тесселяція", + "Read the status again": "Прочитати стан заново", + "Reading the published record": "Читання опублікованого запису", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Перебудуйте меші деталей, імпортованих зі STEP чи IGES, з іншою якістю, одним кроком скасування.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Файли STEP та IGES відкриває робочий процес ядра FormCAD, окрема програма, яку FormShot завантажує один раз, перевіряє файл за файлом і зберігає в теці кешу. Інші формати моделей її не потребують.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Для файлів STEP та IGES потрібен робочий процес CAD, але для цього комп'ютера його не опубліковано.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Для файлів STEP та IGES потрібен робочий процес CAD, який ще не встановлено.", + "Selected CAD parts": "Вибрані CAD-деталі", + "Source": "Джерело", + "The CAD worker is installed.": "Робочий процес CAD встановлено.", + "The CAD worker is installed. You can import this file now.": "Робочий процес CAD встановлено. Тепер можна імпортувати цей файл.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Робочий процес CAD, що відкриває файли STEP та IGES, і якість CAD за замовчуванням.", + "The FormShot service is not reachable.": "Служба FormShot недоступна.", + "The download failed: {reason}": "Не вдалося завантажити: {reason}", + "The download was cancelled. Nothing was installed.": "Завантаження скасовано. Нічого не встановлено.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Рушій не дає оцінки; вища якість займає більше часу й дає більше трикутників.", + "The parts could not be read: {reason}": "Не вдалося прочитати деталі: {reason}", + "The service cannot stop a download once it has started.": "Служба не може зупинити завантаження після його початку.", + "The service refused the request from this window.": "Служба відхилила запит із цього вікна.", + "The status could not be read: {reason}": "Не вдалося прочитати стан: {reason}", + "The worker did not answer: {reason}": "Робочий процес не відповів: {reason}", + "This computer": "Цей комп'ютер", + "This engine cannot re-tessellate CAD parts.": "Цей рушій не вміє повторно виконувати тесселяцію CAD-деталей.", + "Triangles now": "Зараз трикутників", + "Try Again": "Повторити", + "Unknown": "Невідомо", + "Unpacking": "Розпакування", + "Version": "Версія", + "degrees": "градусів", + "no reason was given": "причину не вказано", + "{done} of {total}": "{done} із {total}", + "{n} files": "Файлів: {n}", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, протокол {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, розпаковано {size}, перевірено файл за файлом", + "{tag}: none for this computer": "{tag}: для цього комп'ютера немає", + "{tag}: {files} files, {size} unpacked": "{tag}: файлів {files}, розпаковано {size}" } From 3e19aa76cbf8792ebbf210912e9b6441a7b2b1b3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:04 -0500 Subject: [PATCH 146/494] feat(i18n): translate the import page into four languages Translated the 88 import strings into Japanese, Korean, Simplified Chinese and Traditional Chinese. ./formshot i18n check passed. --- frontend/src/i18n/modules/import/ja.json | 176 ++++++++++---------- frontend/src/i18n/modules/import/ko.json | 176 ++++++++++---------- frontend/src/i18n/modules/import/zh-CN.json | 176 ++++++++++---------- frontend/src/i18n/modules/import/zh-TW.json | 176 ++++++++++---------- 4 files changed, 352 insertions(+), 352 deletions(-) diff --git a/frontend/src/i18n/modules/import/ja.json b/frontend/src/i18n/modules/import/ja.json index ac317572..666b4602 100644 --- a/frontend/src/i18n/modules/import/ja.json +++ b/frontend/src/i18n/modules/import/ja.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D モデル", + "Automatic": "自動", + "CAD quality": "CAD 品質", + "Centimetres (cm)": "センチメートル (cm)", + "Centre on the origin": "原点を中心にする", + "Choose model files and import them into the scene with options.": "モデルファイルを選び、オプションを指定してシーンに読み込みます。", + "Cleaning up meshes": "メッシュを整理中", + "Clear Recent Imports": "最近の読み込みを消去", + "Could not import the file: {reason}": "ファイルを読み込めませんでした: {reason}", + "Could not import {name}: {reason}": "{name} を読み込めませんでした: {reason}", + "Could not open {name}: {reason}": "{name} を開けませんでした: {reason}", + "Could not read the file: {reason}": "ファイルを読み取れませんでした: {reason}", + "Could not reimport: {reason}": "再読み込みできませんでした: {reason}", + "Could not send the file: {reason}": "ファイルを送信できませんでした: {reason}", + "Discard unsaved changes?": "未保存の変更を破棄しますか?", + "Draft": "ドラフト", + "Drop to import into the scene": "ドロップしてシーンに読み込む", + "Feet (ft)": "フィート (ft)", + "Format": "フォーマット", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot では一度に 1 つのプロジェクトしか開けません。ほかの {n} 個のプロジェクトファイルは開かれませんでした。", + "Frame the view after import": "読み込み後にビューを合わせる", + "High": "高", + "Import": "読み込む", + "Import All": "すべて読み込む", + "Import Files": "ファイルを読み込む", + "Import Model": "モデルを読み込む", + "Import Recent File": "最近読み込んだファイルを読み込む", + "Imported {name}.": "{name} を読み込みました。", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} を読み込みました: {parts} 個のパーツ、{triangles} 個の三角形。", + "Imported {name}: {parts} parts.": "{name} を読み込みました: {parts} 個のパーツ。", + "Importing": "読み込み中", + "In this file": "このファイル内", + "Inches (in)": "インチ (in)", + "Making materials": "マテリアルを作成中", + "Materials": "マテリアル", + "Medium": "中", + "Merge into one group": "1 つのグループにまとめる", + "Metres (m)": "メートル (m)", + "Millimetres (mm)": "ミリメートル (mm)", + "No Recent Imports": "最近の読み込みはありません", + "No warnings.": "警告はありません。", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "読み込むものがありません。FormShot は GLB、glTF、OBJ、STL、PLY、3MF、FBX、STEP、IGES ファイルを読み込めます。", + "One file beside it": "隣にある 1 個のファイル", + "Opening {name} will close the open project and discard its unsaved changes.": "{name} を開くと、現在開いているプロジェクトが閉じ、未保存の変更は破棄されます。", + "Options": "オプション", + "Parts": "パーツ", + "Placing in the scene": "シーンに配置中", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "選択したパーツ (選択がなければ読み込んだすべてのパーツ) の元ファイルを、マテリアルを保ったまま読み直します。", + "Reading the file": "ファイルを読み取り中", + "Reading the file...": "ファイルを読み取り中...", + "Recent Imports": "最近の読み込み", + "Reimport": "再読み込み", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "再読み込み完了: 更新 {matched}、新規 {added}、非表示 {hidden}。", + "Send model files to FormShot and import them into the scene with options.": "モデルファイルを FormShot に送り、オプションを指定してシーンに読み込みます。", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "複数のファイルは順番に読み込まれます。モデルの隣にあるバッファ、マテリアル、テクスチャも一緒に読み込まれます。", + "Size": "サイズ", + "Stand on the floor": "床に置く", + "Tessellating CAD surfaces": "CAD サーフェスをテッセレート中", + "The engine decides from the file.": "エンジンがファイルから判断します。", + "The engine did not start an import job": "エンジンが読み込みジョブを開始しませんでした", + "The engine did not start in time, so the files FormShot was given were not opened.": "エンジンが時間内に起動しなかったため、FormShot に渡されたファイルは開かれませんでした。", + "The file says it is in {unit}.": "ファイルの単位は {unit} と記されています。", + "The import failed": "読み込みに失敗しました", + "The import goes on; the files after it were not imported.": "読み込みは続行されます。この後のファイルは読み込まれませんでした。", + "The import of {name} was cancelled.": "{name} の読み込みはキャンセルされました。", + "The upload failed ({status})": "アップロードに失敗しました ({status})", + "The upload was cancelled": "アップロードはキャンセルされました", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "このエンジンは読み込む前にファイルの中身を調べられないため、概要は空のままです。", + "This engine cannot stop an import once it has started": "このエンジンは読み込みを開始すると中止できません", + "This engine imports in one step, so there is no progress to show or stop.": "このエンジンは読み込みを 1 回で行うため、表示や中止できる進行状況はありません。", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "このファイルには単位が記されていません。FormShot は大きさから {unit} と推測しました。読み込む前に確認してください。", + "Triangles": "三角形", + "Ultra": "ウルトラ", + "Units": "単位", + "Up axis": "上方向の軸", + "Up axis in file": "ファイル内の上方向の軸", + "Uploading": "アップロード中", + "Y is up": "Y が上", + "Z is up": "Z が上", + "centimetres": "センチメートル", + "feet": "フィート", + "inches": "インチ", + "metres": "メートル", + "millimetres": "ミリメートル", + "{i} of {n}": "{n} 個中 {i} 個", + "{n} files beside it": "隣にある {n} 個のファイル", + "{n} files were not imported.": "{n} 個のファイルは読み込まれませんでした。", + "{n} warnings; the Scene page lists the parts.": "警告 {n} 件。パーツの一覧はシーンページにあります。" } diff --git a/frontend/src/i18n/modules/import/ko.json b/frontend/src/i18n/modules/import/ko.json index ac317572..3f3988a1 100644 --- a/frontend/src/i18n/modules/import/ko.json +++ b/frontend/src/i18n/modules/import/ko.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D 모델", + "Automatic": "자동", + "CAD quality": "CAD 품질", + "Centimetres (cm)": "센티미터 (cm)", + "Centre on the origin": "원점을 중심으로", + "Choose model files and import them into the scene with options.": "모델 파일을 선택하고 옵션을 지정해 장면으로 가져옵니다.", + "Cleaning up meshes": "메시 정리 중", + "Clear Recent Imports": "최근 가져오기 지우기", + "Could not import the file: {reason}": "파일을 가져오지 못했습니다: {reason}", + "Could not import {name}: {reason}": "{name}을(를) 가져오지 못했습니다: {reason}", + "Could not open {name}: {reason}": "{name}을(를) 열지 못했습니다: {reason}", + "Could not read the file: {reason}": "파일을 읽지 못했습니다: {reason}", + "Could not reimport: {reason}": "다시 가져오지 못했습니다: {reason}", + "Could not send the file: {reason}": "파일을 보내지 못했습니다: {reason}", + "Discard unsaved changes?": "저장하지 않은 변경 사항을 버리시겠습니까?", + "Draft": "초안", + "Drop to import into the scene": "놓아서 장면으로 가져오기", + "Feet (ft)": "피트 (ft)", + "Format": "형식", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot은 한 번에 프로젝트 하나만 엽니다. 다른 프로젝트 파일 {n}개는 열지 않았습니다.", + "Frame the view after import": "가져온 후 뷰 맞추기", + "High": "높음", + "Import": "가져오기", + "Import All": "모두 가져오기", + "Import Files": "파일 가져오기", + "Import Model": "모델 가져오기", + "Import Recent File": "최근 파일 가져오기", + "Imported {name}.": "{name}을(를) 가져왔습니다.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name}을(를) 가져왔습니다: 파트 {parts}개, 삼각형 {triangles}개.", + "Imported {name}: {parts} parts.": "{name}을(를) 가져왔습니다: 파트 {parts}개.", + "Importing": "가져오는 중", + "In this file": "이 파일 안", + "Inches (in)": "인치 (in)", + "Making materials": "머티리얼 만드는 중", + "Materials": "머티리얼", + "Medium": "보통", + "Merge into one group": "하나의 그룹으로 병합", + "Metres (m)": "미터 (m)", + "Millimetres (mm)": "밀리미터 (mm)", + "No Recent Imports": "최근 가져오기 없음", + "No warnings.": "경고가 없습니다.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "가져올 항목이 없습니다. FormShot은 GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP, IGES 파일을 가져올 수 있습니다.", + "One file beside it": "옆에 있는 파일 1개", + "Opening {name} will close the open project and discard its unsaved changes.": "{name}을(를) 열면 열려 있는 프로젝트가 닫히고 저장하지 않은 변경 사항은 버려집니다.", + "Options": "옵션", + "Parts": "파트", + "Placing in the scene": "장면에 배치하는 중", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "선택한 파트(또는 가져온 모든 파트)의 원본 파일을 머티리얼을 유지한 채 다시 읽습니다.", + "Reading the file": "파일 읽는 중", + "Reading the file...": "파일 읽는 중...", + "Recent Imports": "최근 가져오기", + "Reimport": "다시 가져오기", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "다시 가져옴: 업데이트 {matched}, 새로 추가 {added}, 숨김 {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "모델 파일을 FormShot으로 보내 옵션을 지정해 장면으로 가져옵니다.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "여러 파일은 차례로 가져옵니다. 모델 옆에 있는 버퍼, 머티리얼, 텍스처도 함께 가져옵니다.", + "Size": "크기", + "Stand on the floor": "바닥에 놓기", + "Tessellating CAD surfaces": "CAD 서피스를 테셀레이션하는 중", + "The engine decides from the file.": "엔진이 파일을 보고 결정합니다.", + "The engine did not start an import job": "엔진이 가져오기 작업을 시작하지 않았습니다", + "The engine did not start in time, so the files FormShot was given were not opened.": "엔진이 제시간에 시작되지 않아 FormShot에 전달된 파일을 열지 못했습니다.", + "The file says it is in {unit}.": "파일에 단위가 {unit}(으)로 표기되어 있습니다.", + "The import failed": "가져오기에 실패했습니다", + "The import goes on; the files after it were not imported.": "가져오기는 계속됩니다. 이후의 파일은 가져오지 않았습니다.", + "The import of {name} was cancelled.": "{name} 가져오기가 취소되었습니다.", + "The upload failed ({status})": "업로드에 실패했습니다 ({status})", + "The upload was cancelled": "업로드가 취소되었습니다", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "이 엔진은 가져오기 전에 파일 내용을 확인할 수 없어 요약이 비어 있습니다.", + "This engine cannot stop an import once it has started": "이 엔진은 가져오기를 시작하면 중단할 수 없습니다", + "This engine imports in one step, so there is no progress to show or stop.": "이 엔진은 한 번에 가져오므로 표시하거나 중단할 진행 상황이 없습니다.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "이 파일에는 단위가 표기되어 있지 않습니다. FormShot이 크기를 보고 {unit}(으)로 추정했습니다. 가져오기 전에 확인하세요.", + "Triangles": "삼각형", + "Ultra": "울트라", + "Units": "단위", + "Up axis": "위쪽 축", + "Up axis in file": "파일의 위쪽 축", + "Uploading": "업로드 중", + "Y is up": "Y가 위쪽", + "Z is up": "Z가 위쪽", + "centimetres": "센티미터", + "feet": "피트", + "inches": "인치", + "metres": "미터", + "millimetres": "밀리미터", + "{i} of {n}": "{n}개 중 {i}개", + "{n} files beside it": "옆에 있는 파일 {n}개", + "{n} files were not imported.": "파일 {n}개를 가져오지 않았습니다.", + "{n} warnings; the Scene page lists the parts.": "경고 {n}개. 파트 목록은 장면 페이지에 있습니다." } diff --git a/frontend/src/i18n/modules/import/zh-CN.json b/frontend/src/i18n/modules/import/zh-CN.json index ac317572..2ad1ae86 100644 --- a/frontend/src/i18n/modules/import/zh-CN.json +++ b/frontend/src/i18n/modules/import/zh-CN.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D 模型", + "Automatic": "自动", + "CAD quality": "CAD 质量", + "Centimetres (cm)": "厘米 (cm)", + "Centre on the origin": "以原点为中心", + "Choose model files and import them into the scene with options.": "选择模型文件,并通过选项将其导入场景。", + "Cleaning up meshes": "正在清理网格", + "Clear Recent Imports": "清除最近导入", + "Could not import the file: {reason}": "无法导入文件:{reason}", + "Could not import {name}: {reason}": "无法导入 {name}:{reason}", + "Could not open {name}: {reason}": "无法打开 {name}:{reason}", + "Could not read the file: {reason}": "无法读取文件:{reason}", + "Could not reimport: {reason}": "无法重新导入:{reason}", + "Could not send the file: {reason}": "无法发送文件:{reason}", + "Discard unsaved changes?": "要放弃未保存的更改吗?", + "Draft": "草稿", + "Drop to import into the scene": "拖放以导入场景", + "Feet (ft)": "英尺 (ft)", + "Format": "格式", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot 一次只能打开一个项目,其他 {n} 个项目文件未打开。", + "Frame the view after import": "导入后调整视图", + "High": "高", + "Import": "导入", + "Import All": "全部导入", + "Import Files": "导入文件", + "Import Model": "导入模型", + "Import Recent File": "导入最近的文件", + "Imported {name}.": "已导入 {name}。", + "Imported {name}: {parts} parts, {triangles} triangles.": "已导入 {name}:{parts} 个部件,{triangles} 个三角形。", + "Imported {name}: {parts} parts.": "已导入 {name}:{parts} 个部件。", + "Importing": "正在导入", + "In this file": "此文件中", + "Inches (in)": "英寸 (in)", + "Making materials": "正在创建材质", + "Materials": "材质", + "Medium": "中", + "Merge into one group": "合并为一个组", + "Metres (m)": "米 (m)", + "Millimetres (mm)": "毫米 (mm)", + "No Recent Imports": "没有最近导入", + "No warnings.": "没有警告。", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "没有可导入的内容:FormShot 可导入 GLB、glTF、OBJ、STL、PLY、3MF、FBX、STEP 和 IGES 文件。", + "One file beside it": "旁边的 1 个文件", + "Opening {name} will close the open project and discard its unsaved changes.": "打开 {name} 将关闭当前打开的项目,并放弃其中未保存的更改。", + "Options": "选项", + "Parts": "部件", + "Placing in the scene": "正在放入场景", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "重新读取所选部件(或所有已导入部件)的源文件,并保留其材质。", + "Reading the file": "正在读取文件", + "Reading the file...": "正在读取文件...", + "Recent Imports": "最近导入", + "Reimport": "重新导入", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "已重新导入:更新 {matched} 个,新增 {added} 个,隐藏 {hidden} 个。", + "Send model files to FormShot and import them into the scene with options.": "将模型文件发送到 FormShot,并通过选项导入场景。", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "多个文件会依次导入。模型旁边的缓冲区、材质和纹理会一并导入。", + "Size": "尺寸", + "Stand on the floor": "放在地面上", + "Tessellating CAD surfaces": "正在对 CAD 曲面进行细分", + "The engine decides from the file.": "由引擎根据文件决定。", + "The engine did not start an import job": "引擎没有启动导入任务", + "The engine did not start in time, so the files FormShot was given were not opened.": "引擎未能及时启动,因此交给 FormShot 的文件没有被打开。", + "The file says it is in {unit}.": "文件中注明的单位是 {unit}。", + "The import failed": "导入失败", + "The import goes on; the files after it were not imported.": "导入仍在继续,其后的文件没有导入。", + "The import of {name} was cancelled.": "已取消导入 {name}。", + "The upload failed ({status})": "上传失败 ({status})", + "The upload was cancelled": "上传已取消", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "此引擎无法在导入前查看文件内部,因此摘要保持为空。", + "This engine cannot stop an import once it has started": "此引擎在导入开始后无法停止", + "This engine imports in one step, so there is no progress to show or stop.": "此引擎一次性完成导入,因此没有可显示或可停止的进度。", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "此文件没有注明单位。FormShot 根据其尺寸推测为 {unit},请在导入前确认。", + "Triangles": "三角形", + "Ultra": "超高", + "Units": "单位", + "Up axis": "向上轴", + "Up axis in file": "文件中的向上轴", + "Uploading": "正在上传", + "Y is up": "Y 轴向上", + "Z is up": "Z 轴向上", + "centimetres": "厘米", + "feet": "英尺", + "inches": "英寸", + "metres": "米", + "millimetres": "毫米", + "{i} of {n}": "第 {i} 个,共 {n} 个", + "{n} files beside it": "旁边的 {n} 个文件", + "{n} files were not imported.": "有 {n} 个文件未导入。", + "{n} warnings; the Scene page lists the parts.": "{n} 条警告;场景页列出了这些部件。" } diff --git a/frontend/src/i18n/modules/import/zh-TW.json b/frontend/src/i18n/modules/import/zh-TW.json index ac317572..8656d4a3 100644 --- a/frontend/src/i18n/modules/import/zh-TW.json +++ b/frontend/src/i18n/modules/import/zh-TW.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "3D 模型", + "Automatic": "自動", + "CAD quality": "CAD 品質", + "Centimetres (cm)": "公分 (cm)", + "Centre on the origin": "以原點為中心", + "Choose model files and import them into the scene with options.": "選擇模型檔案,並透過選項將其匯入場景。", + "Cleaning up meshes": "正在整理網格", + "Clear Recent Imports": "清除最近匯入", + "Could not import the file: {reason}": "無法匯入檔案:{reason}", + "Could not import {name}: {reason}": "無法匯入 {name}:{reason}", + "Could not open {name}: {reason}": "無法開啟 {name}:{reason}", + "Could not read the file: {reason}": "無法讀取檔案:{reason}", + "Could not reimport: {reason}": "無法重新匯入:{reason}", + "Could not send the file: {reason}": "無法傳送檔案:{reason}", + "Discard unsaved changes?": "要捨棄未儲存的變更嗎?", + "Draft": "草稿", + "Drop to import into the scene": "拖放以匯入場景", + "Feet (ft)": "英尺 (ft)", + "Format": "格式", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot 一次只能開啟一個專案,其他 {n} 個專案檔案未開啟。", + "Frame the view after import": "匯入後調整檢視", + "High": "高", + "Import": "匯入", + "Import All": "全部匯入", + "Import Files": "匯入檔案", + "Import Model": "匯入模型", + "Import Recent File": "匯入最近的檔案", + "Imported {name}.": "已匯入 {name}。", + "Imported {name}: {parts} parts, {triangles} triangles.": "已匯入 {name}:{parts} 個零件,{triangles} 個三角形。", + "Imported {name}: {parts} parts.": "已匯入 {name}:{parts} 個零件。", + "Importing": "正在匯入", + "In this file": "此檔案中", + "Inches (in)": "英吋 (in)", + "Making materials": "正在建立材質", + "Materials": "材質", + "Medium": "中", + "Merge into one group": "合併為一個群組", + "Metres (m)": "公尺 (m)", + "Millimetres (mm)": "公釐 (mm)", + "No Recent Imports": "沒有最近匯入", + "No warnings.": "沒有警告。", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "沒有可匯入的內容:FormShot 可匯入 GLB、glTF、OBJ、STL、PLY、3MF、FBX、STEP 和 IGES 檔案。", + "One file beside it": "旁邊的 1 個檔案", + "Opening {name} will close the open project and discard its unsaved changes.": "開啟 {name} 將關閉目前開啟的專案,並捨棄其中未儲存的變更。", + "Options": "選項", + "Parts": "零件", + "Placing in the scene": "正在放入場景", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "重新讀取所選零件(或所有已匯入零件)的來源檔案,並保留其材質。", + "Reading the file": "正在讀取檔案", + "Reading the file...": "正在讀取檔案...", + "Recent Imports": "最近匯入", + "Reimport": "重新匯入", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "已重新匯入:更新 {matched} 個,新增 {added} 個,隱藏 {hidden} 個。", + "Send model files to FormShot and import them into the scene with options.": "將模型檔案傳送到 FormShot,並透過選項匯入場景。", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "多個檔案會依序匯入。模型旁邊的緩衝區、材質和紋理會一併匯入。", + "Size": "尺寸", + "Stand on the floor": "放在地面上", + "Tessellating CAD surfaces": "正在細分 CAD 曲面", + "The engine decides from the file.": "由引擎根據檔案決定。", + "The engine did not start an import job": "引擎沒有啟動匯入工作", + "The engine did not start in time, so the files FormShot was given were not opened.": "引擎未能及時啟動,因此交給 FormShot 的檔案沒有被開啟。", + "The file says it is in {unit}.": "檔案中註明的單位是 {unit}。", + "The import failed": "匯入失敗", + "The import goes on; the files after it were not imported.": "匯入仍在繼續,其後的檔案沒有匯入。", + "The import of {name} was cancelled.": "已取消匯入 {name}。", + "The upload failed ({status})": "上傳失敗 ({status})", + "The upload was cancelled": "上傳已取消", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "此引擎無法在匯入前查看檔案內部,因此摘要保持為空。", + "This engine cannot stop an import once it has started": "此引擎在匯入開始後無法停止", + "This engine imports in one step, so there is no progress to show or stop.": "此引擎一次完成匯入,因此沒有可顯示或可停止的進度。", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "此檔案沒有註明單位。FormShot 根據其尺寸推測為 {unit},請在匯入前確認。", + "Triangles": "三角形", + "Ultra": "超高", + "Units": "單位", + "Up axis": "向上軸", + "Up axis in file": "檔案中的向上軸", + "Uploading": "正在上傳", + "Y is up": "Y 軸向上", + "Z is up": "Z 軸向上", + "centimetres": "公分", + "feet": "英尺", + "inches": "英吋", + "metres": "公尺", + "millimetres": "公釐", + "{i} of {n}": "第 {i} 個,共 {n} 個", + "{n} files beside it": "旁邊的 {n} 個檔案", + "{n} files were not imported.": "有 {n} 個檔案未匯入。", + "{n} warnings; the Scene page lists the parts.": "{n} 則警告;場景頁列出了這些零件。" } From b33fcaa087e70b702cd6196bea1d92172a9d2181 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:10 -0500 Subject: [PATCH 147/494] feat(i18n): translate the handoff page into four languages Translated the 60 handoff strings into Japanese, Korean, Simplified Chinese and Traditional Chinese. ./formshot i18n check passed. --- frontend/src/i18n/modules/handoff/ja.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/ko.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/zh-CN.json | 120 +++++++++---------- frontend/src/i18n/modules/handoff/zh-TW.json | 120 +++++++++---------- 4 files changed, 240 insertions(+), 240 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/ja.json b/frontend/src/i18n/modules/handoff/ja.json index a93ea0c0..5425b57c 100644 --- a/frontend/src/i18n/modules/handoff/ja.json +++ b/frontend/src/i18n/modules/handoff/ja.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 / {count}", + "A Form app is handing something over": "Form アプリが何かを引き渡そうとしています", + "A mesh with maps by role": "役割ごとのマップ付きメッシュ", + "A model file": "モデルファイル", + "Add to this document": "このドキュメントに追加", + "Added {title} from {app}": "{app} から {title} を追加しました", + "Always allow": "常に許可", + "Always allow {app}": "{app} を常に許可", + "An object from the GoF folder": "GoF フォルダのオブジェクト", + "another app": "別のアプリ", + "As a new document": "新規ドキュメントとして", + "Base colour": "ベースカラー", + "Block": "ブロック", + "Choose a hand-off or give a path": "ハンドオフを選ぶか、パスを指定してください", + "Contents": "内容", + "Could not be read": "読み取れませんでした", + "Decline": "拒否", + "Emission": "エミッション", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "このウィンドウを開いている間、FormShot は GoF フォルダと FormSurface の書き出し先を監視します。Form アプリが何かを引き渡すと、開く前にここで確認します。", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface の書き出し", + "From": "送信元", + "GoF folder": "GoF フォルダ", + "Hand-off Settings": "ハンドオフ設定", + "Hand-offs": "ハンドオフ", + "Hand-offs from {app}": "{app} からのハンドオフ", + "Maps": "マップ", + "Maps by role, without a mesh": "メッシュなしの役割ごとのマップ", + "Metalness": "メタルネス", + "Normal": "法線", + "not found": "見つかりません", + "Not read yet": "未読み取り", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form アプリのハンドオフフォルダに、待機中のものはありません。", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "選ぶまでは何も開かれません。テクスチャはアプリが書き出した場所に残り、役割で参照されます。", + "Occlusion, roughness and metalness": "オクルージョン、ラフネス、メタルネス", + "Opacity": "不透明度", + "Open a Hand-off": "ハンドオフを開く", + "Open a Hand-off...": "ハンドオフを開く...", + "Open it": "開く", + "Open once": "今回のみ開く", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "FormSculpt、FormFabric、FormSurface、FormCAD から引き渡されたものを開きます", + "Opened {title} from {app} as a new document": "{app} の {title} を新規ドキュメントとして開きました", + "Or a path to a file or folder": "または、ファイルかフォルダのパス", + "Other maps": "その他のマップ", + "Reading...": "読み取り中...", + "Roughness": "ラフネス", + "Sent as": "送信形式", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot サービスに接続できないため、現在これらの選択を読み取ることも変更することもできません。", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "FormSculpt と FormFabric が GoF フォルダに置いたものと、FormSurface が書き出したものです。ここで開くのはご自身で選んだ操作なので、確認は表示されません。", + "{app} is handing over {title}: {what}.": "{app} が {title} を引き渡そうとしています: {what}。", + "{count} maps from FormSurface": "FormSurface からのマップ {count} 個", + "{count} maps: {roles}": "マップ {count} 個: {roles}", + "{count} materials": "マテリアル {count} 個", + "{format} file": "{format} ファイル", + "{format} file, {count} triangles": "{format} ファイル、三角形 {count} 個", + "{meshes} meshes, {triangles} triangles, {materials} materials": "メッシュ {meshes} 個、三角形 {triangles} 個、マテリアル {materials} 個", + "{n} days ago": "{n} 日前" } diff --git a/frontend/src/i18n/modules/handoff/ko.json b/frontend/src/i18n/modules/handoff/ko.json index a93ea0c0..550710fb 100644 --- a/frontend/src/i18n/modules/handoff/ko.json +++ b/frontend/src/i18n/modules/handoff/ko.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "{count}개 중 1개", + "A Form app is handing something over": "Form 앱이 무언가를 넘겨주려 합니다", + "A mesh with maps by role": "역할별 맵이 있는 메시", + "A model file": "모델 파일", + "Add to this document": "이 문서에 추가", + "Added {title} from {app}": "{app}의 {title}을(를) 추가했습니다", + "Always allow": "항상 허용", + "Always allow {app}": "{app} 항상 허용", + "An object from the GoF folder": "GoF 폴더의 오브젝트", + "another app": "다른 앱", + "As a new document": "새 문서로", + "Base colour": "베이스 컬러", + "Block": "차단", + "Choose a hand-off or give a path": "핸드오프를 선택하거나 경로를 입력하세요", + "Contents": "내용", + "Could not be read": "읽을 수 없음", + "Decline": "거부", + "Emission": "발광", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "이 창이 열려 있는 동안 FormShot은 GoF 폴더와 FormSurface의 내보내기 폴더를 감시합니다. Form 앱이 무언가를 넘겨주면 열기 전에 여기서 확인합니다.", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface 내보내기", + "From": "보낸 곳", + "GoF folder": "GoF 폴더", + "Hand-off Settings": "핸드오프 설정", + "Hand-offs": "핸드오프", + "Hand-offs from {app}": "{app}에서 온 핸드오프", + "Maps": "맵", + "Maps by role, without a mesh": "메시 없이 역할별 맵만", + "Metalness": "메탈니스", + "Normal": "노멀", + "not found": "찾을 수 없음", + "Not read yet": "아직 읽지 않음", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form 앱의 핸드오프 폴더에 대기 중인 항목이 없습니다.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "선택하기 전에는 아무것도 열리지 않습니다. 텍스처는 앱이 기록한 위치에 그대로 있으며 역할별로 참조됩니다.", + "Occlusion, roughness and metalness": "오클루전, 러프니스, 메탈니스", + "Opacity": "불투명도", + "Open a Hand-off": "핸드오프 열기", + "Open a Hand-off...": "핸드오프 열기...", + "Open it": "열기", + "Open once": "한 번만 열기", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "FormSculpt, FormFabric, FormSurface, FormCAD가 넘겨준 항목을 엽니다", + "Opened {title} from {app} as a new document": "{app}의 {title}을(를) 새 문서로 열었습니다", + "Or a path to a file or folder": "또는 파일이나 폴더 경로", + "Other maps": "기타 맵", + "Reading...": "읽는 중...", + "Roughness": "러프니스", + "Sent as": "전송 형식", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot 서비스에 연결할 수 없어 지금은 이 선택을 읽거나 바꿀 수 없습니다.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "FormSculpt와 FormFabric이 GoF 폴더에 넣은 항목과 FormSurface가 내보낸 항목입니다. 직접 선택하는 것이므로 여기서 열 때는 확인 창이 나오지 않습니다.", + "{app} is handing over {title}: {what}.": "{app}이(가) {title}을(를) 넘겨주려 합니다: {what}.", + "{count} maps from FormSurface": "FormSurface의 맵 {count}개", + "{count} maps: {roles}": "맵 {count}개: {roles}", + "{count} materials": "머티리얼 {count}개", + "{format} file": "{format} 파일", + "{format} file, {count} triangles": "{format} 파일, 삼각형 {count}개", + "{meshes} meshes, {triangles} triangles, {materials} materials": "메시 {meshes}개, 삼각형 {triangles}개, 머티리얼 {materials}개", + "{n} days ago": "{n}일 전" } diff --git a/frontend/src/i18n/modules/handoff/zh-CN.json b/frontend/src/i18n/modules/handoff/zh-CN.json index a93ea0c0..48f68b08 100644 --- a/frontend/src/i18n/modules/handoff/zh-CN.json +++ b/frontend/src/i18n/modules/handoff/zh-CN.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "第 1 个,共 {count} 个", + "A Form app is handing something over": "有 Form 应用正在移交内容", + "A mesh with maps by role": "按用途分类贴图的网格", + "A model file": "模型文件", + "Add to this document": "添加到此文档", + "Added {title} from {app}": "已从 {app} 添加 {title}", + "Always allow": "始终允许", + "Always allow {app}": "始终允许 {app}", + "An object from the GoF folder": "GoF 文件夹中的对象", + "another app": "另一个应用", + "As a new document": "作为新文档", + "Base colour": "基础色", + "Block": "阻止", + "Choose a hand-off or give a path": "选择一个移交,或提供路径", + "Contents": "内容", + "Could not be read": "无法读取", + "Decline": "拒绝", + "Emission": "自发光", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "此窗口打开期间,FormShot 会监视 GoF 文件夹和 FormSurface 的导出。当 Form 应用移交内容时,FormShot 会先在此询问,再打开。", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface 导出", + "From": "来自", + "GoF folder": "GoF 文件夹", + "Hand-off Settings": "移交设置", + "Hand-offs": "移交", + "Hand-offs from {app}": "来自 {app} 的移交", + "Maps": "贴图", + "Maps by role, without a mesh": "按用途分类的贴图,不含网格", + "Metalness": "金属度", + "Normal": "法线", + "not found": "未找到", + "Not read yet": "尚未读取", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form 应用的移交文件夹中没有待处理的内容。", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "在你选择之前不会打开任何内容。纹理保留在应用写入的位置,并按用途引用。", + "Occlusion, roughness and metalness": "遮挡、粗糙度和金属度", + "Opacity": "不透明度", + "Open a Hand-off": "打开移交", + "Open a Hand-off...": "打开移交...", + "Open it": "打开", + "Open once": "仅打开一次", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "打开 FormSculpt、FormFabric、FormSurface 或 FormCAD 移交的内容", + "Opened {title} from {app} as a new document": "已将来自 {app} 的 {title} 作为新文档打开", + "Or a path to a file or folder": "或文件或文件夹的路径", + "Other maps": "其他贴图", + "Reading...": "正在读取...", + "Roughness": "粗糙度", + "Sent as": "发送形式", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot 服务无法访问,因此现在无法读取或更改这些选项。", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "FormSculpt 和 FormFabric 放入 GoF 文件夹的内容,以及 FormSurface 导出的内容。由你自己选择,因此在此打开无需提示。", + "{app} is handing over {title}: {what}.": "{app} 正在移交 {title}:{what}。", + "{count} maps from FormSurface": "来自 FormSurface 的 {count} 张贴图", + "{count} maps: {roles}": "{count} 张贴图:{roles}", + "{count} materials": "{count} 个材质", + "{format} file": "{format} 文件", + "{format} file, {count} triangles": "{format} 文件,{count} 个三角形", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} 个网格,{triangles} 个三角形,{materials} 个材质", + "{n} days ago": "{n} 天前" } diff --git a/frontend/src/i18n/modules/handoff/zh-TW.json b/frontend/src/i18n/modules/handoff/zh-TW.json index a93ea0c0..9c933432 100644 --- a/frontend/src/i18n/modules/handoff/zh-TW.json +++ b/frontend/src/i18n/modules/handoff/zh-TW.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "第 1 個,共 {count} 個", + "A Form app is handing something over": "有 Form 應用程式正在移交內容", + "A mesh with maps by role": "依用途分類貼圖的網格", + "A model file": "模型檔案", + "Add to this document": "加入此文件", + "Added {title} from {app}": "已從 {app} 加入 {title}", + "Always allow": "一律允許", + "Always allow {app}": "一律允許 {app}", + "An object from the GoF folder": "GoF 資料夾中的物件", + "another app": "另一個應用程式", + "As a new document": "作為新文件", + "Base colour": "基礎色", + "Block": "封鎖", + "Choose a hand-off or give a path": "選擇一個移交,或提供路徑", + "Contents": "內容", + "Could not be read": "無法讀取", + "Decline": "拒絕", + "Emission": "自發光", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "此視窗開啟期間,FormShot 會監看 GoF 資料夾和 FormSurface 的匯出。當 Form 應用程式移交內容時,FormShot 會先在此詢問,再開啟。", + "FormSurface": "FormSurface", + "FormSurface exports": "FormSurface 匯出", + "From": "來自", + "GoF folder": "GoF 資料夾", + "Hand-off Settings": "移交設定", + "Hand-offs": "移交", + "Hand-offs from {app}": "來自 {app} 的移交", + "Maps": "貼圖", + "Maps by role, without a mesh": "依用途分類的貼圖,不含網格", + "Metalness": "金屬度", + "Normal": "法線", + "not found": "找不到", + "Not read yet": "尚未讀取", + "Nothing from the Form apps is waiting in their hand-off folders.": "Form 應用程式的移交資料夾中沒有待處理的內容。", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "在你選擇之前不會開啟任何內容。紋理保留在應用程式寫入的位置,並依用途參照。", + "Occlusion, roughness and metalness": "遮蔽、粗糙度和金屬度", + "Opacity": "不透明度", + "Open a Hand-off": "開啟移交", + "Open a Hand-off...": "開啟移交...", + "Open it": "開啟", + "Open once": "僅開啟一次", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "開啟 FormSculpt、FormFabric、FormSurface 或 FormCAD 移交的內容", + "Opened {title} from {app} as a new document": "已將來自 {app} 的 {title} 作為新文件開啟", + "Or a path to a file or folder": "或檔案或資料夾的路徑", + "Other maps": "其他貼圖", + "Reading...": "正在讀取...", + "Roughness": "粗糙度", + "Sent as": "傳送形式", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "FormShot 服務無法連線,因此現在無法讀取或變更這些選項。", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "FormSculpt 和 FormFabric 放入 GoF 資料夾的內容,以及 FormSurface 匯出的內容。由你自己選擇,因此在此開啟無需提示。", + "{app} is handing over {title}: {what}.": "{app} 正在移交 {title}:{what}。", + "{count} maps from FormSurface": "來自 FormSurface 的 {count} 張貼圖", + "{count} maps: {roles}": "{count} 張貼圖:{roles}", + "{count} materials": "{count} 個材質", + "{format} file": "{format} 檔案", + "{format} file, {count} triangles": "{format} 檔案,{count} 個三角形", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} 個網格,{triangles} 個三角形,{materials} 個材質", + "{n} days ago": "{n} 天前" } From 6c85a9575721a05054e9725c0b52a6a5e6441af7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:59 -0500 Subject: [PATCH 148/494] feat(i18n): translate the cad page into four languages Translated the 89 cad strings into Japanese, Korean, Simplified Chinese and Traditional Chinese. ./formshot i18n check passed. --- frontend/src/i18n/modules/cad/ja.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/ko.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/zh-CN.json | 178 +++++++++++------------ frontend/src/i18n/modules/cad/zh-TW.json | 178 +++++++++++------------ 4 files changed, 356 insertions(+), 356 deletions(-) diff --git a/frontend/src/i18n/modules/cad/ja.json b/frontend/src/i18n/modules/cad/ja.json index 4debd1cd..98998a0c 100644 --- a/frontend/src/i18n/modules/cad/ja.json +++ b/frontend/src/i18n/modules/cad/ja.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "モデルサイズに対する %", + "About {n} triangles afterwards.": "変更後は約 {n} 個の三角形になります。", + "All CAD parts": "すべての CAD パーツ", + "Angle": "角度", + "Angle in degrees": "角度 (度)", + "Apply": "適用", + "Beside the FormShot engine": "FormShot エンジンの隣", + "CAD Import": "CAD インポート", + "CAD Import Settings...": "CAD インポート設定...", + "CAD Options in the Import Sheet": "インポートシートの CAD オプション", + "CAD worker": "CAD ワーカー", + "CAD worker: {stage}, {pct}%": "CAD ワーカー: {stage}、{pct}%", + "Check the worker": "ワーカーを確認", + "Checking every file": "すべてのファイルを確認中", + "Choose STEP or IGES files to import; they open through the CAD worker.": "STEP または IGES ファイルを選んで読み込みます。ファイルは CAD ワーカー経由で開かれます。", + "Chord": "コード長", + "Chord as a percentage of the model size": "コード長 (モデルサイズに対する割合)", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "コード長は 0 より大きく、モデルサイズの {max}% 以下にしてください。角度は {min} から {amax} 度の範囲です。", + "Chord {chord}% of the model size, angle {angle} degrees": "コード長 モデルサイズの {chord}%、角度 {angle} 度", + "Could not re-tessellate: {reason}": "再テッセレートできませんでした: {reason}", + "Custom": "カスタム", + "Custom ({chord}%, {angle}°)": "カスタム ({chord}%、{angle}°)", + "Default CAD quality": "既定の CAD 品質", + "Download": "ダウンロード", + "Download and check the program that opens STEP and IGES files.": "STEP と IGES ファイルを開くプログラムをダウンロードして確認します。", + "Download the CAD Worker": "CAD ワーカーをダウンロード", + "Download the CAD worker": "CAD ワーカーをダウンロード", + "Downloaded into the cache folder": "キャッシュフォルダにダウンロードしました", + "Downloading": "ダウンロード中", + "Found in": "検出場所", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "STEP と IGES のサーフェスを読み込むときに、どれだけ細かく三角形に分割するかを決めます。コード長は、三角形と実際のサーフェスとの最大の隔たりを、モデル全体のサイズに対する割合で表したものです。角度は、隣り合う三角形の間の最大の折れ曲がりです。細かい設定ほど時間がかかり、ファイルも大きくなります。インポートシートはこの選択で始まり、1 回の読み込みに限ってそこで変更できます。", + "Installed": "インストール済み", + "Mixed": "混在", + "Named by FORMSHOT_CAD_WORKER": "FORMSHOT_CAD_WORKER で指定", + "New quality": "新しい品質", + "None of the selected parts came from a STEP or IGES file.": "選択したパーツに、STEP または IGES ファイル由来のものはありません。", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "選択したパーツに、STEP または IGES ファイル由来のものはありません。選択を解除すると、すべての CAD パーツを再構築します。", + "Not available.": "利用できません。", + "Not available: {reason}": "利用できません: {reason}", + "Not installed": "未インストール", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "まだインストールされていません。FormShot は {folder} で探します。STEP と IGES ファイルを開くには、ここからダウンロードしてください。", + "Not named": "未指定", + "Not recorded": "記録なし", + "Nothing in this document came from a STEP or IGES file.": "このドキュメントに、STEP または IGES ファイル由来のものはありません。", + "Nothing is selected, so every CAD part is rebuilt.": "何も選択されていないため、すべての CAD パーツを再構築します。", + "Published": "公開済み", + "Quality now": "現在の品質", + "Re-tessellate CAD Parts": "CAD パーツを再テッセレート", + "Re-tessellate CAD Parts...": "CAD パーツを再テッセレート...", + "Re-tessellated 1 CAD part at {quality}.": "CAD パーツ 1 個を {quality} で再テッセレートしました。", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "CAD パーツ 1 個を {quality} で再テッセレートしました: 三角形 {before} 個から {after} 個へ。", + "Re-tessellated {parts} CAD parts at {quality}.": "CAD パーツ {parts} 個を {quality} で再テッセレートしました。", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "CAD パーツ {parts} 個を {quality} で再テッセレートしました: 三角形 {before} 個から {after} 個へ。", + "Re-tessellating": "再テッセレート中", + "Read the status again": "状態を再読み込み", + "Reading the published record": "公開レコードを読み取り中", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "STEP または IGES から読み込んだパーツのメッシュを、別の品質で再構築します。取り消しは 1 回で戻せます。", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP と IGES ファイルは、FormCAD のカーネルワーカーで開きます。これは別のプログラムで、FormShot が一度だけダウンロードし、ファイルごとに確認して、キャッシュフォルダに保管します。ほかのモデル形式では不要です。", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP と IGES ファイルには CAD ワーカーが必要ですが、このコンピュータ向けには公開されていません。", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP と IGES ファイルには CAD ワーカーが必要ですが、まだインストールされていません。", + "Selected CAD parts": "選択中の CAD パーツ", + "Source": "ソース", + "The CAD worker is installed.": "CAD ワーカーはインストールされています。", + "The CAD worker is installed. You can import this file now.": "CAD ワーカーはインストールされています。このファイルを今すぐ読み込めます。", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "STEP と IGES ファイルを開く CAD ワーカーと、既定の CAD 品質です。", + "The FormShot service is not reachable.": "FormShot サービスに接続できません。", + "The download failed: {reason}": "ダウンロードに失敗しました: {reason}", + "The download was cancelled. Nothing was installed.": "ダウンロードはキャンセルされました。何もインストールされていません。", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "エンジンは見積もりを返しません。品質を上げるほど時間がかかり、三角形も増えます。", + "The parts could not be read: {reason}": "パーツを読み取れませんでした: {reason}", + "The service cannot stop a download once it has started.": "サービスは、ダウンロードを開始すると中止できません。", + "The service refused the request from this window.": "サービスがこのウィンドウからのリクエストを拒否しました。", + "The status could not be read: {reason}": "状態を読み取れませんでした: {reason}", + "The worker did not answer: {reason}": "ワーカーから応答がありませんでした: {reason}", + "This computer": "このコンピュータ", + "This engine cannot re-tessellate CAD parts.": "このエンジンは CAD パーツを再テッセレートできません。", + "Triangles now": "現在の三角形数", + "Try Again": "再試行", + "Unknown": "不明", + "Unpacking": "展開中", + "Version": "バージョン", + "degrees": "度", + "no reason was given": "理由は示されませんでした", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} 個のファイル", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}、OpenCascade {occt}、プロトコル {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}、展開後 {size}、ファイルごとに確認済み", + "{tag}: none for this computer": "{tag}: このコンピュータ向けはありません", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} 個のファイル、展開後 {size}" } diff --git a/frontend/src/i18n/modules/cad/ko.json b/frontend/src/i18n/modules/cad/ko.json index 4debd1cd..8eb1430b 100644 --- a/frontend/src/i18n/modules/cad/ko.json +++ b/frontend/src/i18n/modules/cad/ko.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "모델 크기 대비 %", + "About {n} triangles afterwards.": "이후 삼각형은 약 {n}개가 됩니다.", + "All CAD parts": "모든 CAD 파트", + "Angle": "각도", + "Angle in degrees": "각도(도)", + "Apply": "적용", + "Beside the FormShot engine": "FormShot 엔진 옆", + "CAD Import": "CAD 가져오기", + "CAD Import Settings...": "CAD 가져오기 설정...", + "CAD Options in the Import Sheet": "가져오기 시트의 CAD 옵션", + "CAD worker": "CAD 워커", + "CAD worker: {stage}, {pct}%": "CAD 워커: {stage}, {pct}%", + "Check the worker": "워커 확인", + "Checking every file": "모든 파일 확인 중", + "Choose STEP or IGES files to import; they open through the CAD worker.": "가져올 STEP 또는 IGES 파일을 선택하세요. 파일은 CAD 워커를 통해 열립니다.", + "Chord": "현", + "Chord as a percentage of the model size": "현(모델 크기 대비 비율)", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "현은 0보다 크고 모델 크기의 {max}% 이하여야 합니다. 각도는 {min}에서 {amax}도 사이여야 합니다.", + "Chord {chord}% of the model size, angle {angle} degrees": "현: 모델 크기의 {chord}%, 각도 {angle}도", + "Could not re-tessellate: {reason}": "다시 테셀레이션하지 못했습니다: {reason}", + "Custom": "사용자 지정", + "Custom ({chord}%, {angle}°)": "사용자 지정 ({chord}%, {angle}°)", + "Default CAD quality": "기본 CAD 품질", + "Download": "다운로드", + "Download and check the program that opens STEP and IGES files.": "STEP 및 IGES 파일을 여는 프로그램을 다운로드하고 확인합니다.", + "Download the CAD Worker": "CAD 워커 다운로드", + "Download the CAD worker": "CAD 워커 다운로드", + "Downloaded into the cache folder": "캐시 폴더에 다운로드됨", + "Downloading": "다운로드 중", + "Found in": "발견된 위치", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "STEP 및 IGES 서피스를 가져올 때 삼각형으로 얼마나 촘촘히 나눌지 정합니다. 현은 삼각형과 실제 서피스 사이의 최대 간격을 모델 전체 크기의 비율로 나타낸 값이고, 각도는 이웃한 삼각형 사이의 최대 꺾임입니다. 설정이 촘촘할수록 시간이 오래 걸리고 파일이 커집니다. 가져오기 시트는 이 선택으로 시작하며, 한 번의 가져오기에 한해 시트에서 바꿀 수 있습니다.", + "Installed": "설치됨", + "Mixed": "혼합", + "Named by FORMSHOT_CAD_WORKER": "FORMSHOT_CAD_WORKER로 지정됨", + "New quality": "새 품질", + "None of the selected parts came from a STEP or IGES file.": "선택한 파트 중 STEP 또는 IGES 파일에서 온 것이 없습니다.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "선택한 파트 중 STEP 또는 IGES 파일에서 온 것이 없습니다. 선택을 해제하면 모든 CAD 파트를 다시 만듭니다.", + "Not available.": "사용할 수 없음.", + "Not available: {reason}": "사용할 수 없음: {reason}", + "Not installed": "설치되지 않음", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "아직 설치되지 않았습니다. FormShot은 {folder}에서 찾습니다. STEP 및 IGES 파일을 열려면 여기서 다운로드하세요.", + "Not named": "지정되지 않음", + "Not recorded": "기록되지 않음", + "Nothing in this document came from a STEP or IGES file.": "이 문서에는 STEP 또는 IGES 파일에서 온 항목이 없습니다.", + "Nothing is selected, so every CAD part is rebuilt.": "선택한 항목이 없으므로 모든 CAD 파트를 다시 만듭니다.", + "Published": "게시됨", + "Quality now": "현재 품질", + "Re-tessellate CAD Parts": "CAD 파트 다시 테셀레이션", + "Re-tessellate CAD Parts...": "CAD 파트 다시 테셀레이션...", + "Re-tessellated 1 CAD part at {quality}.": "CAD 파트 1개를 {quality}(으)로 다시 테셀레이션했습니다.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "CAD 파트 1개를 {quality}(으)로 다시 테셀레이션했습니다: 삼각형 {before}개에서 {after}개로.", + "Re-tessellated {parts} CAD parts at {quality}.": "CAD 파트 {parts}개를 {quality}(으)로 다시 테셀레이션했습니다.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "CAD 파트 {parts}개를 {quality}(으)로 다시 테셀레이션했습니다: 삼각형 {before}개에서 {after}개로.", + "Re-tessellating": "다시 테셀레이션하는 중", + "Read the status again": "상태 다시 읽기", + "Reading the published record": "게시된 기록을 읽는 중", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "STEP 또는 IGES에서 가져온 파트의 메시를 다른 품질로 다시 만듭니다. 실행 취소는 한 단계로 처리됩니다.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP 및 IGES 파일은 FormCAD의 커널 워커로 엽니다. 이 별도의 프로그램은 FormShot이 한 번 다운로드하고 파일별로 확인한 뒤 캐시 폴더에 보관합니다. 다른 모델 형식에는 필요하지 않습니다.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP 및 IGES 파일에는 CAD 워커가 필요하지만, 이 컴퓨터용으로 게시된 것이 없습니다.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP 및 IGES 파일에는 CAD 워커가 필요하지만 아직 설치되지 않았습니다.", + "Selected CAD parts": "선택한 CAD 파트", + "Source": "소스", + "The CAD worker is installed.": "CAD 워커가 설치되어 있습니다.", + "The CAD worker is installed. You can import this file now.": "CAD 워커가 설치되어 있습니다. 지금 이 파일을 가져올 수 있습니다.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "STEP 및 IGES 파일을 여는 CAD 워커와 기본 CAD 품질입니다.", + "The FormShot service is not reachable.": "FormShot 서비스에 연결할 수 없습니다.", + "The download failed: {reason}": "다운로드에 실패했습니다: {reason}", + "The download was cancelled. Nothing was installed.": "다운로드가 취소되었습니다. 설치된 것은 없습니다.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "엔진이 예상값을 제공하지 않습니다. 품질이 높을수록 시간이 오래 걸리고 삼각형이 늘어납니다.", + "The parts could not be read: {reason}": "파트를 읽지 못했습니다: {reason}", + "The service cannot stop a download once it has started.": "서비스는 다운로드를 시작하면 중단할 수 없습니다.", + "The service refused the request from this window.": "서비스가 이 창의 요청을 거부했습니다.", + "The status could not be read: {reason}": "상태를 읽지 못했습니다: {reason}", + "The worker did not answer: {reason}": "워커가 응답하지 않았습니다: {reason}", + "This computer": "이 컴퓨터", + "This engine cannot re-tessellate CAD parts.": "이 엔진은 CAD 파트를 다시 테셀레이션할 수 없습니다.", + "Triangles now": "현재 삼각형 수", + "Try Again": "다시 시도", + "Unknown": "알 수 없음", + "Unpacking": "압축 푸는 중", + "Version": "버전", + "degrees": "도", + "no reason was given": "이유가 제공되지 않았습니다", + "{done} of {total}": "{done} / {total}", + "{n} files": "파일 {n}개", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, 프로토콜 {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, 압축 해제 후 {size}, 파일별로 확인됨", + "{tag}: none for this computer": "{tag}: 이 컴퓨터용 없음", + "{tag}: {files} files, {size} unpacked": "{tag}: 파일 {files}개, 압축 해제 후 {size}" } diff --git a/frontend/src/i18n/modules/cad/zh-CN.json b/frontend/src/i18n/modules/cad/zh-CN.json index 4debd1cd..3a495c37 100644 --- a/frontend/src/i18n/modules/cad/zh-CN.json +++ b/frontend/src/i18n/modules/cad/zh-CN.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "占模型尺寸的百分比", + "About {n} triangles afterwards.": "之后约有 {n} 个三角形。", + "All CAD parts": "所有 CAD 部件", + "Angle": "角度", + "Angle in degrees": "角度(度)", + "Apply": "应用", + "Beside the FormShot engine": "位于 FormShot 引擎旁边", + "CAD Import": "CAD 导入", + "CAD Import Settings...": "CAD 导入设置...", + "CAD Options in the Import Sheet": "导入面板中的 CAD 选项", + "CAD worker": "CAD 工作程序", + "CAD worker: {stage}, {pct}%": "CAD 工作程序:{stage},{pct}%", + "Check the worker": "检查工作程序", + "Checking every file": "正在检查所有文件", + "Choose STEP or IGES files to import; they open through the CAD worker.": "选择要导入的 STEP 或 IGES 文件;它们将通过 CAD 工作程序打开。", + "Chord": "弦差", + "Chord as a percentage of the model size": "弦差(占模型尺寸的百分比)", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "弦差必须大于 0 且不超过模型尺寸的 {max}%;角度范围为 {min} 到 {amax} 度。", + "Chord {chord}% of the model size, angle {angle} degrees": "弦差为模型尺寸的 {chord}%,角度 {angle} 度", + "Could not re-tessellate: {reason}": "无法重新细分:{reason}", + "Custom": "自定义", + "Custom ({chord}%, {angle}°)": "自定义({chord}%,{angle}°)", + "Default CAD quality": "默认 CAD 质量", + "Download": "下载", + "Download and check the program that opens STEP and IGES files.": "下载并检查用于打开 STEP 和 IGES 文件的程序。", + "Download the CAD Worker": "下载 CAD 工作程序", + "Download the CAD worker": "下载 CAD 工作程序", + "Downloaded into the cache folder": "已下载到缓存文件夹", + "Downloading": "正在下载", + "Found in": "发现位置", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "决定导入时 STEP 和 IGES 曲面被细分为三角形的精细程度。弦差是三角形与真实曲面之间的最大间隙,以占整个模型尺寸的比例表示;角度是相邻三角形之间的最大折角。设置越精细,耗时越长,文件也越大。导入面板以此选项为起点,你可以在面板中为单次导入修改。", + "Installed": "已安装", + "Mixed": "混合", + "Named by FORMSHOT_CAD_WORKER": "由 FORMSHOT_CAD_WORKER 指定", + "New quality": "新质量", + "None of the selected parts came from a STEP or IGES file.": "所选部件均不是来自 STEP 或 IGES 文件。", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "所选部件均不是来自 STEP 或 IGES 文件。清除选择即可重建所有 CAD 部件。", + "Not available.": "不可用。", + "Not available: {reason}": "不可用:{reason}", + "Not installed": "未安装", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "尚未安装。FormShot 会在 {folder} 中查找;可在此下载以打开 STEP 和 IGES 文件。", + "Not named": "未指定", + "Not recorded": "未记录", + "Nothing in this document came from a STEP or IGES file.": "此文档中没有来自 STEP 或 IGES 文件的内容。", + "Nothing is selected, so every CAD part is rebuilt.": "未选择任何内容,因此将重建所有 CAD 部件。", + "Published": "已发布", + "Quality now": "当前质量", + "Re-tessellate CAD Parts": "重新细分 CAD 部件", + "Re-tessellate CAD Parts...": "重新细分 CAD 部件...", + "Re-tessellated 1 CAD part at {quality}.": "已按 {quality} 重新细分 1 个 CAD 部件。", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "已按 {quality} 重新细分 1 个 CAD 部件:三角形从 {before} 个变为 {after} 个。", + "Re-tessellated {parts} CAD parts at {quality}.": "已按 {quality} 重新细分 {parts} 个 CAD 部件。", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "已按 {quality} 重新细分 {parts} 个 CAD 部件:三角形从 {before} 个变为 {after} 个。", + "Re-tessellating": "正在重新细分", + "Read the status again": "重新读取状态", + "Reading the published record": "正在读取已发布的记录", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "以另一种质量重建从 STEP 或 IGES 导入的部件网格,作为一个撤销步骤。", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP 和 IGES 文件由 FormCAD 的内核工作程序打开。这是一个独立的程序,FormShot 会下载一次,逐个文件检查,并保存在你的缓存文件夹中。其他模型格式不需要它。", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP 和 IGES 文件需要 CAD 工作程序,但没有适用于此计算机的发布版本。", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP 和 IGES 文件需要 CAD 工作程序,但尚未安装。", + "Selected CAD parts": "所选 CAD 部件", + "Source": "来源", + "The CAD worker is installed.": "CAD 工作程序已安装。", + "The CAD worker is installed. You can import this file now.": "CAD 工作程序已安装。现在可以导入此文件。", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "用于打开 STEP 和 IGES 文件的 CAD 工作程序,以及默认 CAD 质量。", + "The FormShot service is not reachable.": "无法连接 FormShot 服务。", + "The download failed: {reason}": "下载失败:{reason}", + "The download was cancelled. Nothing was installed.": "下载已取消,未安装任何内容。", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "引擎不提供估算值;质量越精细,耗时越长,三角形也越多。", + "The parts could not be read: {reason}": "无法读取这些部件:{reason}", + "The service cannot stop a download once it has started.": "下载开始后,服务无法停止。", + "The service refused the request from this window.": "服务拒绝了来自此窗口的请求。", + "The status could not be read: {reason}": "无法读取状态:{reason}", + "The worker did not answer: {reason}": "工作程序没有响应:{reason}", + "This computer": "此计算机", + "This engine cannot re-tessellate CAD parts.": "此引擎无法重新细分 CAD 部件。", + "Triangles now": "当前三角形数", + "Try Again": "重试", + "Unknown": "未知", + "Unpacking": "正在解压", + "Version": "版本", + "degrees": "度", + "no reason was given": "未给出原因", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} 个文件", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag},OpenCascade {occt},协议 {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag},解压后 {size},已逐个文件检查", + "{tag}: none for this computer": "{tag}:没有适用于此计算机的版本", + "{tag}: {files} files, {size} unpacked": "{tag}:{files} 个文件,解压后 {size}" } diff --git a/frontend/src/i18n/modules/cad/zh-TW.json b/frontend/src/i18n/modules/cad/zh-TW.json index 4debd1cd..979cd68d 100644 --- a/frontend/src/i18n/modules/cad/zh-TW.json +++ b/frontend/src/i18n/modules/cad/zh-TW.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "佔模型尺寸的百分比", + "About {n} triangles afterwards.": "之後約有 {n} 個三角形。", + "All CAD parts": "所有 CAD 零件", + "Angle": "角度", + "Angle in degrees": "角度(度)", + "Apply": "套用", + "Beside the FormShot engine": "位於 FormShot 引擎旁邊", + "CAD Import": "CAD 匯入", + "CAD Import Settings...": "CAD 匯入設定...", + "CAD Options in the Import Sheet": "匯入面板中的 CAD 選項", + "CAD worker": "CAD 工作程式", + "CAD worker: {stage}, {pct}%": "CAD 工作程式:{stage},{pct}%", + "Check the worker": "檢查工作程式", + "Checking every file": "正在檢查所有檔案", + "Choose STEP or IGES files to import; they open through the CAD worker.": "選擇要匯入的 STEP 或 IGES 檔案;它們將透過 CAD 工作程式開啟。", + "Chord": "弦差", + "Chord as a percentage of the model size": "弦差(佔模型尺寸的百分比)", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "弦差必須大於 0 且不超過模型尺寸的 {max}%;角度範圍為 {min} 到 {amax} 度。", + "Chord {chord}% of the model size, angle {angle} degrees": "弦差為模型尺寸的 {chord}%,角度 {angle} 度", + "Could not re-tessellate: {reason}": "無法重新細分:{reason}", + "Custom": "自訂", + "Custom ({chord}%, {angle}°)": "自訂({chord}%,{angle}°)", + "Default CAD quality": "預設 CAD 品質", + "Download": "下載", + "Download and check the program that opens STEP and IGES files.": "下載並檢查用於開啟 STEP 和 IGES 檔案的程式。", + "Download the CAD Worker": "下載 CAD 工作程式", + "Download the CAD worker": "下載 CAD 工作程式", + "Downloaded into the cache folder": "已下載到快取資料夾", + "Downloading": "正在下載", + "Found in": "發現位置", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "決定匯入時 STEP 和 IGES 曲面被細分為三角形的精細程度。弦差是三角形與真實曲面之間的最大間隙,以佔整個模型尺寸的比例表示;角度是相鄰三角形之間的最大折角。設定越精細,耗時越長,檔案也越大。匯入面板以此選項為起點,你可以在面板中為單次匯入修改。", + "Installed": "已安裝", + "Mixed": "混合", + "Named by FORMSHOT_CAD_WORKER": "由 FORMSHOT_CAD_WORKER 指定", + "New quality": "新品質", + "None of the selected parts came from a STEP or IGES file.": "所選零件均不是來自 STEP 或 IGES 檔案。", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "所選零件均不是來自 STEP 或 IGES 檔案。清除選取即可重建所有 CAD 零件。", + "Not available.": "無法使用。", + "Not available: {reason}": "無法使用:{reason}", + "Not installed": "未安裝", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "尚未安裝。FormShot 會在 {folder} 中尋找;可在此下載以開啟 STEP 和 IGES 檔案。", + "Not named": "未指定", + "Not recorded": "未記錄", + "Nothing in this document came from a STEP or IGES file.": "此文件中沒有來自 STEP 或 IGES 檔案的內容。", + "Nothing is selected, so every CAD part is rebuilt.": "未選取任何內容,因此將重建所有 CAD 零件。", + "Published": "已發佈", + "Quality now": "目前品質", + "Re-tessellate CAD Parts": "重新細分 CAD 零件", + "Re-tessellate CAD Parts...": "重新細分 CAD 零件...", + "Re-tessellated 1 CAD part at {quality}.": "已依 {quality} 重新細分 1 個 CAD 零件。", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "已依 {quality} 重新細分 1 個 CAD 零件:三角形從 {before} 個變為 {after} 個。", + "Re-tessellated {parts} CAD parts at {quality}.": "已依 {quality} 重新細分 {parts} 個 CAD 零件。", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "已依 {quality} 重新細分 {parts} 個 CAD 零件:三角形從 {before} 個變為 {after} 個。", + "Re-tessellating": "正在重新細分", + "Read the status again": "重新讀取狀態", + "Reading the published record": "正在讀取已發佈的記錄", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "以另一種品質重建從 STEP 或 IGES 匯入的零件網格,作為一個復原步驟。", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP 和 IGES 檔案由 FormCAD 的核心工作程式開啟。這是一個獨立的程式,FormShot 會下載一次,逐個檔案檢查,並保存在你的快取資料夾中。其他模型格式不需要它。", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP 和 IGES 檔案需要 CAD 工作程式,但沒有適用於此電腦的發佈版本。", + "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP 和 IGES 檔案需要 CAD 工作程式,但尚未安裝。", + "Selected CAD parts": "所選 CAD 零件", + "Source": "來源", + "The CAD worker is installed.": "CAD 工作程式已安裝。", + "The CAD worker is installed. You can import this file now.": "CAD 工作程式已安裝。現在可以匯入此檔案。", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "用於開啟 STEP 和 IGES 檔案的 CAD 工作程式,以及預設 CAD 品質。", + "The FormShot service is not reachable.": "無法連線到 FormShot 服務。", + "The download failed: {reason}": "下載失敗:{reason}", + "The download was cancelled. Nothing was installed.": "下載已取消,未安裝任何內容。", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "引擎不提供估算值;品質越精細,耗時越長,三角形也越多。", + "The parts could not be read: {reason}": "無法讀取這些零件:{reason}", + "The service cannot stop a download once it has started.": "下載開始後,服務無法停止。", + "The service refused the request from this window.": "服務拒絕了來自此視窗的要求。", + "The status could not be read: {reason}": "無法讀取狀態:{reason}", + "The worker did not answer: {reason}": "工作程式沒有回應:{reason}", + "This computer": "此電腦", + "This engine cannot re-tessellate CAD parts.": "此引擎無法重新細分 CAD 零件。", + "Triangles now": "目前三角形數", + "Try Again": "重試", + "Unknown": "未知", + "Unpacking": "正在解壓縮", + "Version": "版本", + "degrees": "度", + "no reason was given": "未提供原因", + "{done} of {total}": "{done} / {total}", + "{n} files": "{n} 個檔案", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag},OpenCascade {occt},通訊協定 {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag},解壓縮後 {size},已逐個檔案檢查", + "{tag}: none for this computer": "{tag}:沒有適用於此電腦的版本", + "{tag}: {files} files, {size} unpacked": "{tag}:{files} 個檔案,解壓縮後 {size}" } From 79a7004ab0e822d0cc8e93b5560076ad5e3f833f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:02:55 -0500 Subject: [PATCH 149/494] feat(i18n): translate the import page into thai, vietnamese, indonesian Translated all 88 import strings into Thai, Vietnamese and Indonesian, reusing the workspace and menu terms. Ran ./formshot i18n check: no placeholder mismatch. --- frontend/src/i18n/modules/import/id.json | 172 +++++++++++----------- frontend/src/i18n/modules/import/th.json | 176 +++++++++++------------ frontend/src/i18n/modules/import/vi.json | 176 +++++++++++------------ 3 files changed, 262 insertions(+), 262 deletions(-) diff --git a/frontend/src/i18n/modules/import/id.json b/frontend/src/i18n/modules/import/id.json index ac317572..7830fe30 100644 --- a/frontend/src/i18n/modules/import/id.json +++ b/frontend/src/i18n/modules/import/id.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", + "3D models": "Model 3D", + "Automatic": "Otomatis", + "CAD quality": "Kualitas CAD", + "Centimetres (cm)": "Sentimeter (cm)", + "Centre on the origin": "Pusatkan pada titik asal", + "Choose model files and import them into the scene with options.": "Pilih file model lalu impor ke scene dengan opsi.", + "Cleaning up meshes": "Membersihkan mesh", + "Clear Recent Imports": "Hapus Impor Terbaru", + "Could not import the file: {reason}": "Tidak dapat mengimpor file: {reason}", + "Could not import {name}: {reason}": "Tidak dapat mengimpor {name}: {reason}", + "Could not open {name}: {reason}": "Tidak dapat membuka {name}: {reason}", + "Could not read the file: {reason}": "Tidak dapat membaca file: {reason}", + "Could not reimport: {reason}": "Tidak dapat mengimpor ulang: {reason}", + "Could not send the file: {reason}": "Tidak dapat mengirim file: {reason}", + "Discard unsaved changes?": "Buang perubahan yang belum disimpan?", + "Draft": "Draf", + "Drop to import into the scene": "Lepas untuk mengimpor ke scene", + "Feet (ft)": "Kaki (ft)", "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot membuka satu proyek dalam satu waktu; {n} file proyek lain tidak dibuka.", + "Frame the view after import": "Bingkai tampilan setelah impor", + "High": "Tinggi", + "Import": "Impor", + "Import All": "Impor Semua", + "Import Files": "Impor File", + "Import Model": "Impor Model", + "Import Recent File": "Impor File Terbaru", + "Imported {name}.": "{name} diimpor.", + "Imported {name}: {parts} parts, {triangles} triangles.": "{name} diimpor: {parts} bagian, {triangles} segitiga.", + "Imported {name}: {parts} parts.": "{name} diimpor: {parts} bagian.", + "Importing": "Mengimpor", + "In this file": "Dalam file ini", + "Inches (in)": "Inci (in)", + "Making materials": "Membuat material", + "Materials": "Material", + "Medium": "Sedang", + "Merge into one group": "Gabungkan menjadi satu grup", + "Metres (m)": "Meter (m)", + "Millimetres (mm)": "Milimeter (mm)", + "No Recent Imports": "Tidak Ada Impor Terbaru", + "No warnings.": "Tidak ada peringatan.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Tidak ada yang diimpor: FormShot mengimpor file GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP, dan IGES.", + "One file beside it": "Satu file di sebelahnya", + "Opening {name} will close the open project and discard its unsaved changes.": "Membuka {name} akan menutup proyek yang terbuka dan membuang perubahannya yang belum disimpan.", + "Options": "Opsi", + "Parts": "Bagian", + "Placing in the scene": "Menempatkan di scene", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Baca ulang file sumber dari bagian yang dipilih (atau dari semua bagian yang diimpor), dengan mempertahankan materialnya.", + "Reading the file": "Membaca file", + "Reading the file...": "Membaca file...", + "Recent Imports": "Impor Terbaru", + "Reimport": "Impor Ulang", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Diimpor ulang: {matched} diperbarui, {added} baru, {hidden} disembunyikan.", + "Send model files to FormShot and import them into the scene with options.": "Kirim file model ke FormShot lalu impor ke scene dengan opsi.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Beberapa file diimpor satu per satu. Buffer, material, dan tekstur di sebelah model ikut terbawa.", + "Size": "Ukuran", + "Stand on the floor": "Letakkan di lantai", + "Tessellating CAD surfaces": "Memecah permukaan CAD menjadi segitiga", + "The engine decides from the file.": "Mesin menentukan dari file.", + "The engine did not start an import job": "Mesin tidak memulai tugas impor", + "The engine did not start in time, so the files FormShot was given were not opened.": "Mesin tidak dimulai tepat waktu, sehingga file yang diberikan ke FormShot tidak dibuka.", + "The file says it is in {unit}.": "File menyatakan satuannya {unit}.", + "The import failed": "Impor gagal", + "The import goes on; the files after it were not imported.": "Impor berlanjut; file setelahnya tidak diimpor.", + "The import of {name} was cancelled.": "Impor {name} dibatalkan.", + "The upload failed ({status})": "Unggahan gagal ({status})", + "The upload was cancelled": "Unggahan dibatalkan", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Mesin ini tidak dapat melihat isi file sebelum diimpor, sehingga ringkasan tetap kosong.", + "This engine cannot stop an import once it has started": "Mesin ini tidak dapat menghentikan impor yang sudah dimulai", + "This engine imports in one step, so there is no progress to show or stop.": "Mesin ini mengimpor dalam satu langkah, sehingga tidak ada progres untuk ditampilkan atau dihentikan.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "File ini tidak menyebutkan satuannya. FormShot menebak {unit} dari ukurannya; periksa sebelum mengimpor.", + "Triangles": "Segitiga", "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "Units": "Satuan", + "Up axis": "Sumbu atas", + "Up axis in file": "Sumbu atas dalam file", + "Uploading": "Mengunggah", + "Y is up": "Y adalah atas", + "Z is up": "Z adalah atas", + "centimetres": "sentimeter", + "feet": "kaki", + "inches": "inci", + "metres": "meter", + "millimetres": "milimeter", + "{i} of {n}": "{i} dari {n}", + "{n} files beside it": "{n} file di sebelahnya", + "{n} files were not imported.": "{n} file tidak diimpor.", + "{n} warnings; the Scene page lists the parts.": "{n} peringatan; halaman Scene mencantumkan bagian-bagiannya." } diff --git a/frontend/src/i18n/modules/import/th.json b/frontend/src/i18n/modules/import/th.json index ac317572..9153beae 100644 --- a/frontend/src/i18n/modules/import/th.json +++ b/frontend/src/i18n/modules/import/th.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "โมเดล 3D", + "Automatic": "อัตโนมัติ", + "CAD quality": "คุณภาพ CAD", + "Centimetres (cm)": "เซนติเมตร (cm)", + "Centre on the origin": "จัดกึ่งกลางที่จุดกำเนิด", + "Choose model files and import them into the scene with options.": "เลือกไฟล์โมเดลแล้วนำเข้าสู่ซีนพร้อมตัวเลือก", + "Cleaning up meshes": "กำลังทำความสะอาดเมช", + "Clear Recent Imports": "ล้างรายการนำเข้าล่าสุด", + "Could not import the file: {reason}": "ไม่สามารถนำเข้าไฟล์: {reason}", + "Could not import {name}: {reason}": "ไม่สามารถนำเข้า {name}: {reason}", + "Could not open {name}: {reason}": "ไม่สามารถเปิด {name}: {reason}", + "Could not read the file: {reason}": "ไม่สามารถอ่านไฟล์: {reason}", + "Could not reimport: {reason}": "ไม่สามารถนำเข้าซ้ำ: {reason}", + "Could not send the file: {reason}": "ไม่สามารถส่งไฟล์: {reason}", + "Discard unsaved changes?": "ละทิ้งการเปลี่ยนแปลงที่ยังไม่ได้บันทึกหรือไม่?", + "Draft": "ร่าง", + "Drop to import into the scene": "วางเพื่อนำเข้าสู่ซีน", + "Feet (ft)": "ฟุต (ft)", + "Format": "รูปแบบ", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot เปิดได้ครั้งละหนึ่งโปรเจกต์ จึงไม่ได้เปิดไฟล์โปรเจกต์อื่นอีก {n} ไฟล์", + "Frame the view after import": "จัดเฟรมมุมมองหลังนำเข้า", + "High": "สูง", + "Import": "นำเข้า", + "Import All": "นำเข้าทั้งหมด", + "Import Files": "นำเข้าไฟล์", + "Import Model": "นำเข้าโมเดล", + "Import Recent File": "นำเข้าไฟล์ล่าสุด", + "Imported {name}.": "นำเข้า {name} แล้ว", + "Imported {name}: {parts} parts, {triangles} triangles.": "นำเข้า {name} แล้ว: {parts} ชิ้นส่วน, {triangles} สามเหลี่ยม", + "Imported {name}: {parts} parts.": "นำเข้า {name} แล้ว: {parts} ชิ้นส่วน", + "Importing": "กำลังนำเข้า", + "In this file": "ในไฟล์นี้", + "Inches (in)": "นิ้ว (in)", + "Making materials": "กำลังสร้างแมทีเรียล", + "Materials": "แมทีเรียล", + "Medium": "ปานกลาง", + "Merge into one group": "รวมเป็นกลุ่มเดียว", + "Metres (m)": "เมตร (m)", + "Millimetres (mm)": "มิลลิเมตร (mm)", + "No Recent Imports": "ไม่มีรายการนำเข้าล่าสุด", + "No warnings.": "ไม่มีคำเตือน", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "ไม่มีอะไรให้นำเข้า: FormShot นำเข้าไฟล์ GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP และ IGES", + "One file beside it": "หนึ่งไฟล์ข้างเคียง", + "Opening {name} will close the open project and discard its unsaved changes.": "การเปิด {name} จะปิดโปรเจกต์ที่เปิดอยู่และละทิ้งการเปลี่ยนแปลงที่ยังไม่ได้บันทึก", + "Options": "ตัวเลือก", + "Parts": "ชิ้นส่วน", + "Placing in the scene": "กำลังวางในซีน", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "อ่านไฟล์ต้นฉบับของชิ้นส่วนที่เลือก (หรือของทุกชิ้นส่วนที่นำเข้า) ใหม่ โดยคงแมทีเรียลไว้", + "Reading the file": "กำลังอ่านไฟล์", + "Reading the file...": "กำลังอ่านไฟล์...", + "Recent Imports": "นำเข้าล่าสุด", + "Reimport": "นำเข้าซ้ำ", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "นำเข้าซ้ำแล้ว: อัปเดต {matched}, ใหม่ {added}, ซ่อน {hidden}", + "Send model files to FormShot and import them into the scene with options.": "ส่งไฟล์โมเดลไปยัง FormShot แล้วนำเข้าสู่ซีนพร้อมตัวเลือก", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "หลายไฟล์จะนำเข้าทีละไฟล์ต่อกัน บัฟเฟอร์ แมทีเรียล และเท็กซ์เจอร์ที่อยู่ข้างโมเดลจะตามมาด้วย", + "Size": "ขนาด", + "Stand on the floor": "วางบนพื้น", + "Tessellating CAD surfaces": "กำลังแปลงพื้นผิว CAD เป็นสามเหลี่ยม", + "The engine decides from the file.": "เอนจินจะตัดสินจากไฟล์", + "The engine did not start an import job": "เอนจินไม่ได้เริ่มงานนำเข้า", + "The engine did not start in time, so the files FormShot was given were not opened.": "เอนจินเริ่มไม่ทันเวลา จึงไม่ได้เปิดไฟล์ที่ส่งให้ FormShot", + "The file says it is in {unit}.": "ไฟล์ระบุว่าใช้หน่วย {unit}", + "The import failed": "การนำเข้าล้มเหลว", + "The import goes on; the files after it were not imported.": "การนำเข้ายังดำเนินต่อไป แต่ไฟล์ที่ตามหลังไม่ได้ถูกนำเข้า", + "The import of {name} was cancelled.": "ยกเลิกการนำเข้า {name} แล้ว", + "The upload failed ({status})": "การอัปโหลดล้มเหลว ({status})", + "The upload was cancelled": "ยกเลิกการอัปโหลดแล้ว", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "เอนจินนี้ดูภายในไฟล์ก่อนนำเข้าไม่ได้ สรุปจึงว่างเปล่า", + "This engine cannot stop an import once it has started": "เอนจินนี้หยุดการนำเข้าที่เริ่มแล้วไม่ได้", + "This engine imports in one step, so there is no progress to show or stop.": "เอนจินนี้นำเข้าในขั้นตอนเดียว จึงไม่มีความคืบหน้าให้แสดงหรือหยุด", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "ไฟล์นี้ไม่ได้ระบุหน่วย FormShot เดาจากขนาดว่าเป็น {unit} โปรดตรวจสอบก่อนนำเข้า", + "Triangles": "สามเหลี่ยม", + "Ultra": "สูงพิเศษ", + "Units": "หน่วย", + "Up axis": "แกนขึ้น", + "Up axis in file": "แกนขึ้นในไฟล์", + "Uploading": "กำลังอัปโหลด", + "Y is up": "Y คือแกนขึ้น", + "Z is up": "Z คือแกนขึ้น", + "centimetres": "เซนติเมตร", + "feet": "ฟุต", + "inches": "นิ้ว", + "metres": "เมตร", + "millimetres": "มิลลิเมตร", + "{i} of {n}": "{i} จาก {n}", + "{n} files beside it": "{n} ไฟล์ข้างเคียง", + "{n} files were not imported.": "ไม่ได้นำเข้า {n} ไฟล์", + "{n} warnings; the Scene page lists the parts.": "{n} คำเตือน; หน้าซีนแสดงรายการชิ้นส่วน" } diff --git a/frontend/src/i18n/modules/import/vi.json b/frontend/src/i18n/modules/import/vi.json index ac317572..760a2c64 100644 --- a/frontend/src/i18n/modules/import/vi.json +++ b/frontend/src/i18n/modules/import/vi.json @@ -1,90 +1,90 @@ { - "3D models": "3D models", - "Automatic": "Automatic", - "CAD quality": "CAD quality", - "Centimetres (cm)": "Centimetres (cm)", - "Centre on the origin": "Centre on the origin", - "Choose model files and import them into the scene with options.": "Choose model files and import them into the scene with options.", - "Cleaning up meshes": "Cleaning up meshes", - "Clear Recent Imports": "Clear Recent Imports", - "Could not import the file: {reason}": "Could not import the file: {reason}", - "Could not import {name}: {reason}": "Could not import {name}: {reason}", - "Could not open {name}: {reason}": "Could not open {name}: {reason}", - "Could not read the file: {reason}": "Could not read the file: {reason}", - "Could not reimport: {reason}": "Could not reimport: {reason}", - "Could not send the file: {reason}": "Could not send the file: {reason}", - "Discard unsaved changes?": "Discard unsaved changes?", - "Draft": "Draft", - "Drop to import into the scene": "Drop to import into the scene", - "Feet (ft)": "Feet (ft)", - "Format": "Format", - "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot opens one project at a time; {n} other project files were left unopened.", - "Frame the view after import": "Frame the view after import", - "High": "High", - "Import": "Import", - "Import All": "Import All", - "Import Files": "Import Files", - "Import Model": "Import Model", - "Import Recent File": "Import Recent File", - "Imported {name}.": "Imported {name}.", - "Imported {name}: {parts} parts, {triangles} triangles.": "Imported {name}: {parts} parts, {triangles} triangles.", - "Imported {name}: {parts} parts.": "Imported {name}: {parts} parts.", - "Importing": "Importing", - "In this file": "In this file", - "Inches (in)": "Inches (in)", - "Making materials": "Making materials", - "Materials": "Materials", - "Medium": "Medium", - "Merge into one group": "Merge into one group", - "Metres (m)": "Metres (m)", - "Millimetres (mm)": "Millimetres (mm)", - "No Recent Imports": "No Recent Imports", - "No warnings.": "No warnings.", - "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.", - "One file beside it": "One file beside it", - "Opening {name} will close the open project and discard its unsaved changes.": "Opening {name} will close the open project and discard its unsaved changes.", - "Options": "Options", - "Parts": "Parts", - "Placing in the scene": "Placing in the scene", - "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Read the source files of the selected parts (or of every imported part) again, keeping their materials.", - "Reading the file": "Reading the file", - "Reading the file...": "Reading the file...", - "Recent Imports": "Recent Imports", - "Reimport": "Reimport", - "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Reimported: updated {matched}, new {added}, hidden {hidden}.", - "Send model files to FormShot and import them into the scene with options.": "Send model files to FormShot and import them into the scene with options.", - "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Several files import one after another. Buffers, materials and textures beside a model go with it.", - "Size": "Size", - "Stand on the floor": "Stand on the floor", - "Tessellating CAD surfaces": "Tessellating CAD surfaces", - "The engine decides from the file.": "The engine decides from the file.", - "The engine did not start an import job": "The engine did not start an import job", - "The engine did not start in time, so the files FormShot was given were not opened.": "The engine did not start in time, so the files FormShot was given were not opened.", - "The file says it is in {unit}.": "The file says it is in {unit}.", - "The import failed": "The import failed", - "The import goes on; the files after it were not imported.": "The import goes on; the files after it were not imported.", - "The import of {name} was cancelled.": "The import of {name} was cancelled.", - "The upload failed ({status})": "The upload failed ({status})", - "The upload was cancelled": "The upload was cancelled", - "This engine cannot look inside a file before importing it, so the summary stays empty.": "This engine cannot look inside a file before importing it, so the summary stays empty.", - "This engine cannot stop an import once it has started": "This engine cannot stop an import once it has started", - "This engine imports in one step, so there is no progress to show or stop.": "This engine imports in one step, so there is no progress to show or stop.", - "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.", - "Triangles": "Triangles", - "Ultra": "Ultra", - "Units": "Units", - "Up axis": "Up axis", - "Up axis in file": "Up axis in file", - "Uploading": "Uploading", - "Y is up": "Y is up", - "Z is up": "Z is up", - "centimetres": "centimetres", - "feet": "feet", - "inches": "inches", - "metres": "metres", - "millimetres": "millimetres", - "{i} of {n}": "{i} of {n}", - "{n} files beside it": "{n} files beside it", - "{n} files were not imported.": "{n} files were not imported.", - "{n} warnings; the Scene page lists the parts.": "{n} warnings; the Scene page lists the parts." + "3D models": "Mô hình 3D", + "Automatic": "Tự động", + "CAD quality": "Chất lượng CAD", + "Centimetres (cm)": "Xentimét (cm)", + "Centre on the origin": "Căn giữa tại gốc tọa độ", + "Choose model files and import them into the scene with options.": "Chọn tệp mô hình và nhập vào cảnh với các tùy chọn.", + "Cleaning up meshes": "Đang dọn dẹp mesh", + "Clear Recent Imports": "Xóa danh sách nhập gần đây", + "Could not import the file: {reason}": "Không thể nhập tệp: {reason}", + "Could not import {name}: {reason}": "Không thể nhập {name}: {reason}", + "Could not open {name}: {reason}": "Không thể mở {name}: {reason}", + "Could not read the file: {reason}": "Không thể đọc tệp: {reason}", + "Could not reimport: {reason}": "Không thể nhập lại: {reason}", + "Could not send the file: {reason}": "Không thể gửi tệp: {reason}", + "Discard unsaved changes?": "Bỏ các thay đổi chưa lưu?", + "Draft": "Bản nháp", + "Drop to import into the scene": "Thả vào để nhập vào cảnh", + "Feet (ft)": "Foot (ft)", + "Format": "Định dạng", + "FormShot opens one project at a time; {n} other project files were left unopened.": "FormShot mở từng dự án một nên {n} tệp dự án khác chưa được mở.", + "Frame the view after import": "Căn khung nhìn sau khi nhập", + "High": "Cao", + "Import": "Nhập", + "Import All": "Nhập tất cả", + "Import Files": "Nhập tệp", + "Import Model": "Nhập mô hình", + "Import Recent File": "Nhập tệp gần đây", + "Imported {name}.": "Đã nhập {name}.", + "Imported {name}: {parts} parts, {triangles} triangles.": "Đã nhập {name}: {parts} bộ phận, {triangles} tam giác.", + "Imported {name}: {parts} parts.": "Đã nhập {name}: {parts} bộ phận.", + "Importing": "Đang nhập", + "In this file": "Trong tệp này", + "Inches (in)": "Inch (in)", + "Making materials": "Đang tạo vật liệu", + "Materials": "Vật liệu", + "Medium": "Trung bình", + "Merge into one group": "Gộp thành một nhóm", + "Metres (m)": "Mét (m)", + "Millimetres (mm)": "Milimét (mm)", + "No Recent Imports": "Chưa có tệp nhập gần đây", + "No warnings.": "Không có cảnh báo.", + "Nothing to import: FormShot imports GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP and IGES files.": "Không có gì để nhập: FormShot nhập các tệp GLB, glTF, OBJ, STL, PLY, 3MF, FBX, STEP và IGES.", + "One file beside it": "Một tệp đi kèm", + "Opening {name} will close the open project and discard its unsaved changes.": "Mở {name} sẽ đóng dự án đang mở và bỏ các thay đổi chưa lưu của dự án đó.", + "Options": "Tùy chọn", + "Parts": "Bộ phận", + "Placing in the scene": "Đang đặt vào cảnh", + "Read the source files of the selected parts (or of every imported part) again, keeping their materials.": "Đọc lại các tệp nguồn của những bộ phận đã chọn (hoặc của mọi bộ phận đã nhập), giữ nguyên vật liệu.", + "Reading the file": "Đang đọc tệp", + "Reading the file...": "Đang đọc tệp...", + "Recent Imports": "Nhập gần đây", + "Reimport": "Nhập lại", + "Reimported: updated {matched}, new {added}, hidden {hidden}.": "Đã nhập lại: cập nhật {matched}, mới {added}, ẩn {hidden}.", + "Send model files to FormShot and import them into the scene with options.": "Gửi tệp mô hình tới FormShot và nhập vào cảnh với các tùy chọn.", + "Several files import one after another. Buffers, materials and textures beside a model go with it.": "Nhiều tệp sẽ được nhập lần lượt. Bộ đệm, vật liệu và kết cấu nằm cạnh mô hình sẽ đi kèm theo.", + "Size": "Kích thước", + "Stand on the floor": "Đặt lên sàn", + "Tessellating CAD surfaces": "Đang chia bề mặt CAD thành tam giác", + "The engine decides from the file.": "Công cụ tự quyết định dựa trên tệp.", + "The engine did not start an import job": "Công cụ không bắt đầu tác vụ nhập", + "The engine did not start in time, so the files FormShot was given were not opened.": "Công cụ không khởi động kịp thời nên các tệp gửi cho FormShot chưa được mở.", + "The file says it is in {unit}.": "Tệp cho biết đơn vị là {unit}.", + "The import failed": "Nhập không thành công", + "The import goes on; the files after it were not imported.": "Quá trình nhập vẫn tiếp tục; các tệp phía sau chưa được nhập.", + "The import of {name} was cancelled.": "Đã hủy việc nhập {name}.", + "The upload failed ({status})": "Tải lên không thành công ({status})", + "The upload was cancelled": "Đã hủy tải lên", + "This engine cannot look inside a file before importing it, so the summary stays empty.": "Công cụ này không thể xem bên trong tệp trước khi nhập nên phần tóm tắt để trống.", + "This engine cannot stop an import once it has started": "Công cụ này không thể dừng việc nhập khi đã bắt đầu", + "This engine imports in one step, so there is no progress to show or stop.": "Công cụ này nhập trong một bước nên không có tiến trình để hiển thị hay dừng.", + "This file does not say its units. FormShot guessed {unit} from its size; check it before importing.": "Tệp này không ghi đơn vị. FormShot đoán là {unit} theo kích thước; hãy kiểm tra trước khi nhập.", + "Triangles": "Tam giác", + "Ultra": "Cực cao", + "Units": "Đơn vị", + "Up axis": "Trục hướng lên", + "Up axis in file": "Trục hướng lên trong tệp", + "Uploading": "Đang tải lên", + "Y is up": "Y hướng lên", + "Z is up": "Z hướng lên", + "centimetres": "xentimét", + "feet": "foot", + "inches": "inch", + "metres": "mét", + "millimetres": "milimét", + "{i} of {n}": "{i} trên {n}", + "{n} files beside it": "{n} tệp đi kèm", + "{n} files were not imported.": "{n} tệp chưa được nhập.", + "{n} warnings; the Scene page lists the parts.": "{n} cảnh báo; trang Cảnh liệt kê các bộ phận." } From 7396a252e7118db0488fad59b5b6d69180ae683c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:03:30 -0500 Subject: [PATCH 150/494] feat(i18n): translate the handoff page into thai, vietnamese, indonesian Translated all 60 handoff strings into Thai, Vietnamese and Indonesian, reusing the workspace and menu terms. Ran ./formshot i18n check: no placeholder mismatch. --- frontend/src/i18n/modules/handoff/id.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/th.json | 120 +++++++++++----------- frontend/src/i18n/modules/handoff/vi.json | 120 +++++++++++----------- 3 files changed, 180 insertions(+), 180 deletions(-) diff --git a/frontend/src/i18n/modules/handoff/id.json b/frontend/src/i18n/modules/handoff/id.json index a93ea0c0..360870dc 100644 --- a/frontend/src/i18n/modules/handoff/id.json +++ b/frontend/src/i18n/modules/handoff/id.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 dari {count}", + "A Form app is handing something over": "Sebuah aplikasi Form sedang menyerahkan sesuatu", + "A mesh with maps by role": "Mesh dengan map menurut peran", + "A model file": "Sebuah file model", + "Add to this document": "Tambahkan ke dokumen ini", + "Added {title} from {app}": "{title} dari {app} ditambahkan", + "Always allow": "Selalu izinkan", + "Always allow {app}": "Selalu izinkan {app}", + "An object from the GoF folder": "Objek dari folder GoF", + "another app": "aplikasi lain", + "As a new document": "Sebagai dokumen baru", + "Base colour": "Warna dasar", + "Block": "Blokir", + "Choose a hand-off or give a path": "Pilih serah terima atau berikan path", + "Contents": "Isi", + "Could not be read": "Tidak dapat dibaca", + "Decline": "Tolak", + "Emission": "Emisi", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot memantau folder GoF dan ekspor FormSurface selama jendela ini terbuka. Saat aplikasi Form menyerahkan sesuatu, FormShot bertanya di sini sebelum membukanya.", + "FormSurface": "FormSurface", + "FormSurface exports": "Ekspor FormSurface", + "From": "Dari", + "GoF folder": "Folder GoF", + "Hand-off Settings": "Pengaturan Serah Terima", + "Hand-offs": "Serah Terima", + "Hand-offs from {app}": "Serah terima dari {app}", + "Maps": "Map", + "Maps by role, without a mesh": "Map menurut peran, tanpa mesh", + "Metalness": "Metalness", + "Normal": "Normal", + "not found": "tidak ditemukan", + "Not read yet": "Belum dibaca", + "Nothing from the Form apps is waiting in their hand-off folders.": "Tidak ada apa pun dari aplikasi Form yang menunggu di folder serah terima mereka.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Tidak ada yang dibuka sampai Anda memilih. Tekstur tetap berada di tempat aplikasi menulisnya dan dirujuk menurut peran.", + "Occlusion, roughness and metalness": "Oklusi, roughness, dan metalness", + "Opacity": "Opasitas", + "Open a Hand-off": "Buka Serah Terima", + "Open a Hand-off...": "Buka Serah Terima...", + "Open it": "Buka", + "Open once": "Buka sekali", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Buka apa yang diserahkan FormSculpt, FormFabric, FormSurface, atau FormCAD", + "Opened {title} from {app} as a new document": "{title} dari {app} dibuka sebagai dokumen baru", + "Or a path to a file or folder": "Atau path ke file atau folder", + "Other maps": "Map lainnya", + "Reading...": "Membaca...", + "Roughness": "Roughness", + "Sent as": "Dikirim sebagai", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Layanan FormShot tidak dapat dijangkau, sehingga pilihan ini tidak dapat dibaca atau diubah sekarang.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Apa yang ditaruh FormSculpt dan FormFabric di folder GoF dan apa yang diekspor FormSurface. Membukanya dari sini tidak perlu konfirmasi, karena Anda yang memilihnya.", + "{app} is handing over {title}: {what}.": "{app} menyerahkan {title}: {what}.", + "{count} maps from FormSurface": "{count} map dari FormSurface", + "{count} maps: {roles}": "{count} map: {roles}", + "{count} materials": "{count} material", + "{format} file": "File {format}", + "{format} file, {count} triangles": "File {format}, {count} segitiga", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} mesh, {triangles} segitiga, {materials} material", + "{n} days ago": "{n} hari lalu" } diff --git a/frontend/src/i18n/modules/handoff/th.json b/frontend/src/i18n/modules/handoff/th.json index a93ea0c0..25e208a5 100644 --- a/frontend/src/i18n/modules/handoff/th.json +++ b/frontend/src/i18n/modules/handoff/th.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 จาก {count}", + "A Form app is handing something over": "แอป Form กำลังส่งบางอย่างมาให้", + "A mesh with maps by role": "เมชพร้อมแมปตามบทบาท", + "A model file": "ไฟล์โมเดล", + "Add to this document": "เพิ่มในเอกสารนี้", + "Added {title} from {app}": "เพิ่ม {title} จาก {app} แล้ว", + "Always allow": "อนุญาตเสมอ", + "Always allow {app}": "อนุญาต {app} เสมอ", + "An object from the GoF folder": "วัตถุจากโฟลเดอร์ GoF", + "another app": "แอปอื่น", + "As a new document": "เป็นเอกสารใหม่", + "Base colour": "สีฐาน", + "Block": "บล็อก", + "Choose a hand-off or give a path": "เลือกรายการส่งต่อหรือระบุพาธ", + "Contents": "เนื้อหา", + "Could not be read": "อ่านไม่ได้", + "Decline": "ปฏิเสธ", + "Emission": "การเปล่งแสง", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot เฝ้าดูโฟลเดอร์ GoF และไฟล์ที่ FormSurface ส่งออกขณะเปิดหน้าต่างนี้ เมื่อแอป Form ส่งอะไรมา FormShot จะถามที่นี่ก่อนเปิด", + "FormSurface": "FormSurface", + "FormSurface exports": "ไฟล์ส่งออกของ FormSurface", + "From": "จาก", + "GoF folder": "โฟลเดอร์ GoF", + "Hand-off Settings": "การตั้งค่าการส่งต่อ", + "Hand-offs": "รายการส่งต่อ", + "Hand-offs from {app}": "รายการส่งต่อจาก {app}", + "Maps": "แมป", + "Maps by role, without a mesh": "แมปตามบทบาท ไม่มีเมช", + "Metalness": "ความเป็นโลหะ", + "Normal": "นอร์มอล", + "not found": "ไม่พบ", + "Not read yet": "ยังไม่ได้อ่าน", + "Nothing from the Form apps is waiting in their hand-off folders.": "ไม่มีสิ่งใดจากแอป Form รออยู่ในโฟลเดอร์ส่งต่อ", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "จะไม่เปิดอะไรจนกว่าคุณจะเลือก เท็กซ์เจอร์ยังอยู่ที่เดิมที่แอปเขียนไว้ และอ้างอิงตามบทบาท", + "Occlusion, roughness and metalness": "ออคลูชัน ความหยาบ และความเป็นโลหะ", + "Opacity": "ความทึบ", + "Open a Hand-off": "เปิดรายการส่งต่อ", + "Open a Hand-off...": "เปิดรายการส่งต่อ...", + "Open it": "เปิดเลย", + "Open once": "เปิดครั้งเดียว", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "เปิดสิ่งที่ FormSculpt, FormFabric, FormSurface หรือ FormCAD ส่งมา", + "Opened {title} from {app} as a new document": "เปิด {title} จาก {app} เป็นเอกสารใหม่แล้ว", + "Or a path to a file or folder": "หรือพาธของไฟล์หรือโฟลเดอร์", + "Other maps": "แมปอื่น ๆ", + "Reading...": "กำลังอ่าน...", + "Roughness": "ความหยาบ", + "Sent as": "ส่งมาเป็น", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "เข้าถึงบริการ FormShot ไม่ได้ จึงอ่านหรือเปลี่ยนตัวเลือกเหล่านี้ไม่ได้ในขณะนี้", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "สิ่งที่ FormSculpt และ FormFabric วางไว้ในโฟลเดอร์ GoF และสิ่งที่ FormSurface ส่งออก การเปิดรายการที่นี่ไม่ต้องถามอีก เพราะคุณเป็นผู้เลือกเอง", + "{app} is handing over {title}: {what}.": "{app} กำลังส่ง {title} มาให้: {what}", + "{count} maps from FormSurface": "{count} แมปจาก FormSurface", + "{count} maps: {roles}": "{count} แมป: {roles}", + "{count} materials": "{count} แมทีเรียล", + "{format} file": "ไฟล์ {format}", + "{format} file, {count} triangles": "ไฟล์ {format}, {count} สามเหลี่ยม", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} เมช, {triangles} สามเหลี่ยม, {materials} แมทีเรียล", + "{n} days ago": "{n} วันที่แล้ว" } diff --git a/frontend/src/i18n/modules/handoff/vi.json b/frontend/src/i18n/modules/handoff/vi.json index a93ea0c0..ff32c200 100644 --- a/frontend/src/i18n/modules/handoff/vi.json +++ b/frontend/src/i18n/modules/handoff/vi.json @@ -1,62 +1,62 @@ { - "1 of {count}": "1 of {count}", - "A Form app is handing something over": "A Form app is handing something over", - "A mesh with maps by role": "A mesh with maps by role", - "A model file": "A model file", - "Add to this document": "Add to this document", - "Added {title} from {app}": "Added {title} from {app}", - "Always allow": "Always allow", - "Always allow {app}": "Always allow {app}", - "An object from the GoF folder": "An object from the GoF folder", - "another app": "another app", - "As a new document": "As a new document", - "Base colour": "Base colour", - "Block": "Block", - "Choose a hand-off or give a path": "Choose a hand-off or give a path", - "Contents": "Contents", - "Could not be read": "Could not be read", - "Decline": "Decline", - "Emission": "Emission", - "FormCAD": "FormCAD", - "FormFabric": "FormFabric", - "FormSculpt": "FormSculpt", - "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.", - "FormSurface": "FormSurface", - "FormSurface exports": "FormSurface exports", - "From": "From", - "GoF folder": "GoF folder", - "Hand-off Settings": "Hand-off Settings", - "Hand-offs": "Hand-offs", - "Hand-offs from {app}": "Hand-offs from {app}", - "Maps": "Maps", - "Maps by role, without a mesh": "Maps by role, without a mesh", - "Metalness": "Metalness", - "Normal": "Normal", - "not found": "not found", - "Not read yet": "Not read yet", - "Nothing from the Form apps is waiting in their hand-off folders.": "Nothing from the Form apps is waiting in their hand-off folders.", - "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.", - "Occlusion, roughness and metalness": "Occlusion, roughness and metalness", - "Opacity": "Opacity", - "Open a Hand-off": "Open a Hand-off", - "Open a Hand-off...": "Open a Hand-off...", - "Open it": "Open it", - "Open once": "Open once", - "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over", - "Opened {title} from {app} as a new document": "Opened {title} from {app} as a new document", - "Or a path to a file or folder": "Or a path to a file or folder", - "Other maps": "Other maps", - "Reading...": "Reading...", - "Roughness": "Roughness", - "Sent as": "Sent as", - "The FormShot service is not reachable, so these choices cannot be read or changed now.": "The FormShot service is not reachable, so these choices cannot be read or changed now.", - "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.", - "{app} is handing over {title}: {what}.": "{app} is handing over {title}: {what}.", - "{count} maps from FormSurface": "{count} maps from FormSurface", - "{count} maps: {roles}": "{count} maps: {roles}", - "{count} materials": "{count} materials", - "{format} file": "{format} file", - "{format} file, {count} triangles": "{format} file, {count} triangles", - "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} meshes, {triangles} triangles, {materials} materials", - "{n} days ago": "{n} days ago" + "1 of {count}": "1 trên {count}", + "A Form app is handing something over": "Một ứng dụng Form đang chuyển giao nội dung", + "A mesh with maps by role": "Một mesh kèm các map theo vai trò", + "A model file": "Một tệp mô hình", + "Add to this document": "Thêm vào tài liệu này", + "Added {title} from {app}": "Đã thêm {title} từ {app}", + "Always allow": "Luôn cho phép", + "Always allow {app}": "Luôn cho phép {app}", + "An object from the GoF folder": "Một đối tượng từ thư mục GoF", + "another app": "ứng dụng khác", + "As a new document": "Làm tài liệu mới", + "Base colour": "Màu cơ bản", + "Block": "Chặn", + "Choose a hand-off or give a path": "Chọn một mục chuyển giao hoặc nhập đường dẫn", + "Contents": "Nội dung", + "Could not be read": "Không đọc được", + "Decline": "Từ chối", + "Emission": "Phát sáng", + "FormCAD": "FormCAD", + "FormFabric": "FormFabric", + "FormSculpt": "FormSculpt", + "FormShot watches the GoF folder and FormSurface's exports while this window is open. When a Form app hands something over, FormShot asks here before opening it.": "FormShot theo dõi thư mục GoF và các tệp FormSurface xuất ra khi cửa sổ này đang mở. Khi một ứng dụng Form chuyển giao nội dung, FormShot sẽ hỏi tại đây trước khi mở.", + "FormSurface": "FormSurface", + "FormSurface exports": "Tệp xuất của FormSurface", + "From": "Từ", + "GoF folder": "Thư mục GoF", + "Hand-off Settings": "Cài đặt chuyển giao", + "Hand-offs": "Chuyển giao", + "Hand-offs from {app}": "Chuyển giao từ {app}", + "Maps": "Map", + "Maps by role, without a mesh": "Các map theo vai trò, không có mesh", + "Metalness": "Độ kim loại", + "Normal": "Pháp tuyến", + "not found": "không tìm thấy", + "Not read yet": "Chưa đọc", + "Nothing from the Form apps is waiting in their hand-off folders.": "Không có gì từ các ứng dụng Form đang chờ trong thư mục chuyển giao của chúng.", + "Nothing is opened until you choose. Textures stay where the app wrote them and are referenced by role.": "Sẽ không mở gì cho đến khi bạn chọn. Kết cấu vẫn nằm ở nơi ứng dụng đã ghi và được tham chiếu theo vai trò.", + "Occlusion, roughness and metalness": "Độ che khuất, độ nhám và độ kim loại", + "Opacity": "Độ mờ đục", + "Open a Hand-off": "Mở một mục chuyển giao", + "Open a Hand-off...": "Mở một mục chuyển giao...", + "Open it": "Mở ngay", + "Open once": "Mở một lần", + "Open what FormSculpt, FormFabric, FormSurface or FormCAD handed over": "Mở nội dung mà FormSculpt, FormFabric, FormSurface hoặc FormCAD đã chuyển giao", + "Opened {title} from {app} as a new document": "Đã mở {title} từ {app} thành tài liệu mới", + "Or a path to a file or folder": "Hoặc đường dẫn tới một tệp hoặc thư mục", + "Other maps": "Các map khác", + "Reading...": "Đang đọc...", + "Roughness": "Độ nhám", + "Sent as": "Gửi dưới dạng", + "The FormShot service is not reachable, so these choices cannot be read or changed now.": "Không kết nối được dịch vụ FormShot nên hiện chưa thể đọc hay đổi các lựa chọn này.", + "What FormSculpt and FormFabric put in the GoF folder and what FormSurface exported. Opening one here needs no prompt, because you chose it.": "Những gì FormSculpt và FormFabric đặt trong thư mục GoF và những gì FormSurface đã xuất. Mở một mục tại đây không cần hỏi lại vì chính bạn đã chọn.", + "{app} is handing over {title}: {what}.": "{app} đang chuyển giao {title}: {what}.", + "{count} maps from FormSurface": "{count} map từ FormSurface", + "{count} maps: {roles}": "{count} map: {roles}", + "{count} materials": "{count} vật liệu", + "{format} file": "Tệp {format}", + "{format} file, {count} triangles": "Tệp {format}, {count} tam giác", + "{meshes} meshes, {triangles} triangles, {materials} materials": "{meshes} mesh, {triangles} tam giác, {materials} vật liệu", + "{n} days ago": "{n} ngày trước" } From 45b5a58b693524c0649869182beecca354adfa3b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:04:15 -0500 Subject: [PATCH 151/494] feat(i18n): translate the cad page into thai, vietnamese, indonesian Translated all 89 cad strings into Thai, Vietnamese and Indonesian, reusing the workspace and menu terms. Ran ./formshot i18n check: no placeholder mismatch. --- frontend/src/i18n/modules/cad/id.json | 176 ++++++++++++------------- frontend/src/i18n/modules/cad/th.json | 178 +++++++++++++------------- frontend/src/i18n/modules/cad/vi.json | 178 +++++++++++++------------- 3 files changed, 266 insertions(+), 266 deletions(-) diff --git a/frontend/src/i18n/modules/cad/id.json b/frontend/src/i18n/modules/cad/id.json index 4debd1cd..d4d2417e 100644 --- a/frontend/src/i18n/modules/cad/id.json +++ b/frontend/src/i18n/modules/cad/id.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", + "% of the model size": "% dari ukuran model", + "About {n} triangles afterwards.": "Sekitar {n} segitiga setelahnya.", + "All CAD parts": "Semua bagian CAD", + "Angle": "Sudut", + "Angle in degrees": "Sudut dalam derajat", + "Apply": "Terapkan", + "Beside the FormShot engine": "Di samping mesin FormShot", + "CAD Import": "Impor CAD", + "CAD Import Settings...": "Pengaturan Impor CAD...", + "CAD Options in the Import Sheet": "Opsi CAD di Lembar Impor", + "CAD worker": "Worker CAD", + "CAD worker: {stage}, {pct}%": "Worker CAD: {stage}, {pct}%", + "Check the worker": "Periksa worker", + "Checking every file": "Memeriksa setiap file", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Pilih file STEP atau IGES untuk diimpor; file ini dibuka lewat worker CAD.", "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "Chord as a percentage of the model size": "Chord sebagai persentase ukuran model", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord harus di atas 0 dan paling besar {max}% dari ukuran model; sudut dari {min} sampai {amax} derajat.", + "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% dari ukuran model, sudut {angle} derajat", + "Could not re-tessellate: {reason}": "Tidak dapat melakukan tesselasi ulang: {reason}", + "Custom": "Kustom", + "Custom ({chord}%, {angle}°)": "Kustom ({chord}%, {angle}°)", + "Default CAD quality": "Kualitas CAD default", + "Download": "Unduh", + "Download and check the program that opens STEP and IGES files.": "Unduh dan periksa program yang membuka file STEP dan IGES.", + "Download the CAD Worker": "Unduh Worker CAD", + "Download the CAD worker": "Unduh worker CAD", + "Downloaded into the cache folder": "Diunduh ke folder cache", + "Downloading": "Mengunduh", + "Found in": "Ditemukan di", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Seberapa halus permukaan STEP dan IGES diubah menjadi segitiga saat diimpor. Chord adalah celah terbesar antara segitiga dan permukaan sebenarnya, sebagai porsi dari ukuran seluruh model; sudut adalah tekukan terbesar antara segitiga yang bersebelahan. Pengaturan yang lebih halus memakan waktu lebih lama dan menghasilkan file lebih besar. Lembar impor dimulai dengan pilihan ini; Anda dapat mengubahnya untuk satu impor di sana.", + "Installed": "Terpasang", + "Mixed": "Campuran", + "Named by FORMSHOT_CAD_WORKER": "Dinamai oleh FORMSHOT_CAD_WORKER", + "New quality": "Kualitas baru", + "None of the selected parts came from a STEP or IGES file.": "Tidak ada bagian terpilih yang berasal dari file STEP atau IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Tidak ada bagian terpilih yang berasal dari file STEP atau IGES. Kosongkan pilihan untuk membangun ulang semua bagian CAD.", + "Not available.": "Tidak tersedia.", + "Not available: {reason}": "Tidak tersedia: {reason}", + "Not installed": "Belum terpasang", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Belum terpasang. FormShot mencarinya di {folder}; unduh di sini untuk membuka file STEP dan IGES.", + "Not named": "Tidak dinamai", + "Not recorded": "Tidak tercatat", + "Nothing in this document came from a STEP or IGES file.": "Tidak ada yang berasal dari file STEP atau IGES di dokumen ini.", + "Nothing is selected, so every CAD part is rebuilt.": "Tidak ada yang dipilih, sehingga semua bagian CAD dibangun ulang.", + "Published": "Dipublikasikan", + "Quality now": "Kualitas saat ini", + "Re-tessellate CAD Parts": "Tesselasi Ulang Bagian CAD", + "Re-tessellate CAD Parts...": "Tesselasi Ulang Bagian CAD...", + "Re-tessellated 1 CAD part at {quality}.": "1 bagian CAD ditesselasi ulang pada {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "1 bagian CAD ditesselasi ulang pada {quality}: {before} menjadi {after} segitiga.", + "Re-tessellated {parts} CAD parts at {quality}.": "{parts} bagian CAD ditesselasi ulang pada {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "{parts} bagian CAD ditesselasi ulang pada {quality}: {before} menjadi {after} segitiga.", + "Re-tessellating": "Melakukan tesselasi ulang", + "Read the status again": "Baca ulang status", + "Reading the published record": "Membaca catatan yang dipublikasikan", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Bangun ulang mesh bagian yang diimpor dari STEP atau IGES pada kualitas lain, sebagai satu langkah urungkan.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "File STEP dan IGES dibuka oleh worker kernel FormCAD, program terpisah yang diunduh FormShot sekali, diperiksa file demi file, dan disimpan di folder cache Anda. Format model lain tidak memerlukannya.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "File STEP dan IGES memerlukan worker CAD, dan belum ada yang dipublikasikan untuk komputer ini.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "File STEP dan IGES memerlukan worker CAD, yang belum terpasang.", + "Selected CAD parts": "Bagian CAD terpilih", + "Source": "Sumber", + "The CAD worker is installed.": "Worker CAD sudah terpasang.", + "The CAD worker is installed. You can import this file now.": "Worker CAD sudah terpasang. Anda dapat mengimpor file ini sekarang.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Worker CAD yang membuka file STEP dan IGES, dan kualitas CAD default.", + "The FormShot service is not reachable.": "Layanan FormShot tidak dapat dijangkau.", + "The download failed: {reason}": "Pengunduhan gagal: {reason}", + "The download was cancelled. Nothing was installed.": "Pengunduhan dibatalkan. Tidak ada yang dipasang.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Mesin tidak memberikan perkiraan; kualitas yang lebih halus memakan waktu lebih lama dan menghasilkan lebih banyak segitiga.", + "The parts could not be read: {reason}": "Bagian tidak dapat dibaca: {reason}", + "The service cannot stop a download once it has started.": "Layanan tidak dapat menghentikan unduhan yang sudah dimulai.", + "The service refused the request from this window.": "Layanan menolak permintaan dari jendela ini.", + "The status could not be read: {reason}": "Status tidak dapat dibaca: {reason}", + "The worker did not answer: {reason}": "Worker tidak menjawab: {reason}", + "This computer": "Komputer ini", + "This engine cannot re-tessellate CAD parts.": "Mesin ini tidak dapat melakukan tesselasi ulang bagian CAD.", + "Triangles now": "Segitiga saat ini", + "Try Again": "Coba Lagi", + "Unknown": "Tidak diketahui", + "Unpacking": "Mengekstrak", + "Version": "Versi", + "degrees": "derajat", + "no reason was given": "tidak ada alasan yang diberikan", + "{done} of {total}": "{done} dari {total}", + "{n} files": "{n} file", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protokol {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, {size} diekstrak, diperiksa file demi file", + "{tag}: none for this computer": "{tag}: tidak ada untuk komputer ini", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} file, {size} diekstrak" } diff --git a/frontend/src/i18n/modules/cad/th.json b/frontend/src/i18n/modules/cad/th.json index 4debd1cd..4403fe92 100644 --- a/frontend/src/i18n/modules/cad/th.json +++ b/frontend/src/i18n/modules/cad/th.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% ของขนาดโมเดล", + "About {n} triangles afterwards.": "หลังจากนี้ประมาณ {n} สามเหลี่ยม", + "All CAD parts": "ชิ้นส่วน CAD ทั้งหมด", + "Angle": "มุม", + "Angle in degrees": "มุมเป็นองศา", + "Apply": "นำไปใช้", + "Beside the FormShot engine": "อยู่ข้างเอนจิน FormShot", + "CAD Import": "นำเข้า CAD", + "CAD Import Settings...": "การตั้งค่านำเข้า CAD...", + "CAD Options in the Import Sheet": "ตัวเลือก CAD ในหน้านำเข้า", + "CAD worker": "เวิร์กเกอร์ CAD", + "CAD worker: {stage}, {pct}%": "เวิร์กเกอร์ CAD: {stage}, {pct}%", + "Check the worker": "ตรวจสอบเวิร์กเกอร์", + "Checking every file": "กำลังตรวจสอบทุกไฟล์", + "Choose STEP or IGES files to import; they open through the CAD worker.": "เลือกไฟล์ STEP หรือ IGES เพื่อนำเข้า ไฟล์เหล่านี้เปิดผ่านเวิร์กเกอร์ CAD", + "Chord": "คอร์ด", + "Chord as a percentage of the model size": "คอร์ดเป็นเปอร์เซ็นต์ของขนาดโมเดล", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "คอร์ดต้องมากกว่า 0 และไม่เกิน {max}% ของขนาดโมเดล มุมตั้งแต่ {min} ถึง {amax} องศา", + "Chord {chord}% of the model size, angle {angle} degrees": "คอร์ด {chord}% ของขนาดโมเดล มุม {angle} องศา", + "Could not re-tessellate: {reason}": "ไม่สามารถแปลงเป็นสามเหลี่ยมใหม่: {reason}", + "Custom": "กำหนดเอง", + "Custom ({chord}%, {angle}°)": "กำหนดเอง ({chord}%, {angle}°)", + "Default CAD quality": "คุณภาพ CAD เริ่มต้น", + "Download": "ดาวน์โหลด", + "Download and check the program that opens STEP and IGES files.": "ดาวน์โหลดและตรวจสอบโปรแกรมที่เปิดไฟล์ STEP และ IGES", + "Download the CAD Worker": "ดาวน์โหลดเวิร์กเกอร์ CAD", + "Download the CAD worker": "ดาวน์โหลดเวิร์กเกอร์ CAD", + "Downloaded into the cache folder": "ดาวน์โหลดลงโฟลเดอร์แคชแล้ว", + "Downloading": "กำลังดาวน์โหลด", + "Found in": "พบใน", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "พื้นผิว STEP และ IGES ถูกแบ่งเป็นสามเหลี่ยมละเอียดเพียงใดเมื่อนำเข้า คอร์ดคือช่องว่างที่ใหญ่ที่สุดระหว่างสามเหลี่ยมกับพื้นผิวจริง คิดเป็นสัดส่วนของขนาดทั้งโมเดล มุมคือการหักงอที่มากที่สุดระหว่างสามเหลี่ยมที่อยู่ติดกัน ค่าที่ละเอียดกว่าใช้เวลานานกว่าและได้ไฟล์ใหญ่กว่า หน้านำเข้าจะเริ่มด้วยตัวเลือกนี้ และคุณเปลี่ยนสำหรับการนำเข้าครั้งเดียวได้ที่นั่น", + "Installed": "ติดตั้งแล้ว", + "Mixed": "ผสม", + "Named by FORMSHOT_CAD_WORKER": "ระบุโดย FORMSHOT_CAD_WORKER", + "New quality": "คุณภาพใหม่", + "None of the selected parts came from a STEP or IGES file.": "ชิ้นส่วนที่เลือกไม่มีชิ้นใดมาจากไฟล์ STEP หรือ IGES", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "ชิ้นส่วนที่เลือกไม่มีชิ้นใดมาจากไฟล์ STEP หรือ IGES ยกเลิกการเลือกเพื่อสร้างชิ้นส่วน CAD ทั้งหมดใหม่", + "Not available.": "ไม่พร้อมใช้งาน", + "Not available: {reason}": "ไม่พร้อมใช้งาน: {reason}", + "Not installed": "ยังไม่ได้ติดตั้ง", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "ยังไม่ได้ติดตั้ง FormShot จะค้นหาใน {folder} ดาวน์โหลดที่นี่เพื่อเปิดไฟล์ STEP และ IGES", + "Not named": "ไม่ได้ระบุชื่อ", + "Not recorded": "ไม่ได้บันทึกไว้", + "Nothing in this document came from a STEP or IGES file.": "ไม่มีสิ่งใดในเอกสารนี้ที่มาจากไฟล์ STEP หรือ IGES", + "Nothing is selected, so every CAD part is rebuilt.": "ไม่ได้เลือกอะไร จึงสร้างชิ้นส่วน CAD ทั้งหมดใหม่", + "Published": "เผยแพร่แล้ว", + "Quality now": "คุณภาพปัจจุบัน", + "Re-tessellate CAD Parts": "แปลงชิ้นส่วน CAD เป็นสามเหลี่ยมใหม่", + "Re-tessellate CAD Parts...": "แปลงชิ้นส่วน CAD เป็นสามเหลี่ยมใหม่...", + "Re-tessellated 1 CAD part at {quality}.": "แปลงชิ้นส่วน CAD 1 ชิ้นเป็นสามเหลี่ยมใหม่ที่ {quality} แล้ว", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "แปลงชิ้นส่วน CAD 1 ชิ้นเป็นสามเหลี่ยมใหม่ที่ {quality} แล้ว: {before} เป็น {after} สามเหลี่ยม", + "Re-tessellated {parts} CAD parts at {quality}.": "แปลงชิ้นส่วน CAD {parts} ชิ้นเป็นสามเหลี่ยมใหม่ที่ {quality} แล้ว", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "แปลงชิ้นส่วน CAD {parts} ชิ้นเป็นสามเหลี่ยมใหม่ที่ {quality} แล้ว: {before} เป็น {after} สามเหลี่ยม", + "Re-tessellating": "กำลังแปลงเป็นสามเหลี่ยมใหม่", + "Read the status again": "อ่านสถานะอีกครั้ง", + "Reading the published record": "กำลังอ่านระเบียนที่เผยแพร่", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "สร้างเมชของชิ้นส่วนที่นำเข้าจาก STEP หรือ IGES ใหม่ที่คุณภาพอื่น เป็นการเลิกทำขั้นตอนเดียว", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "ไฟล์ STEP และ IGES เปิดโดยเวิร์กเกอร์เคอร์เนลของ FormCAD ซึ่งเป็นโปรแกรมแยกที่ FormShot ดาวน์โหลดครั้งเดียว ตรวจสอบทีละไฟล์ และเก็บไว้ในโฟลเดอร์แคชของคุณ รูปแบบโมเดลอื่นไม่ต้องใช้", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "ไฟล์ STEP และ IGES ต้องใช้เวิร์กเกอร์ CAD แต่ยังไม่มีการเผยแพร่สำหรับคอมพิวเตอร์เครื่องนี้", + "STEP and IGES files need the CAD worker, which is not installed yet.": "ไฟล์ STEP และ IGES ต้องใช้เวิร์กเกอร์ CAD ซึ่งยังไม่ได้ติดตั้ง", + "Selected CAD parts": "ชิ้นส่วน CAD ที่เลือก", + "Source": "ต้นทาง", + "The CAD worker is installed.": "ติดตั้งเวิร์กเกอร์ CAD แล้ว", + "The CAD worker is installed. You can import this file now.": "ติดตั้งเวิร์กเกอร์ CAD แล้ว คุณนำเข้าไฟล์นี้ได้เลย", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "เวิร์กเกอร์ CAD ที่เปิดไฟล์ STEP และ IGES และคุณภาพ CAD เริ่มต้น", + "The FormShot service is not reachable.": "เข้าถึงบริการ FormShot ไม่ได้", + "The download failed: {reason}": "ดาวน์โหลดล้มเหลว: {reason}", + "The download was cancelled. Nothing was installed.": "ยกเลิกการดาวน์โหลดแล้ว ไม่ได้ติดตั้งอะไร", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "เอนจินไม่มีค่าประมาณ ค่าที่ละเอียดกว่าใช้เวลานานกว่าและได้สามเหลี่ยมมากกว่า", + "The parts could not be read: {reason}": "อ่านชิ้นส่วนไม่ได้: {reason}", + "The service cannot stop a download once it has started.": "บริการหยุดการดาวน์โหลดที่เริ่มแล้วไม่ได้", + "The service refused the request from this window.": "บริการปฏิเสธคำขอจากหน้าต่างนี้", + "The status could not be read: {reason}": "อ่านสถานะไม่ได้: {reason}", + "The worker did not answer: {reason}": "เวิร์กเกอร์ไม่ตอบสนอง: {reason}", + "This computer": "คอมพิวเตอร์เครื่องนี้", + "This engine cannot re-tessellate CAD parts.": "เอนจินนี้แปลงชิ้นส่วน CAD เป็นสามเหลี่ยมใหม่ไม่ได้", + "Triangles now": "สามเหลี่ยมปัจจุบัน", + "Try Again": "ลองอีกครั้ง", + "Unknown": "ไม่ทราบ", + "Unpacking": "กำลังแตกไฟล์", + "Version": "เวอร์ชัน", + "degrees": "องศา", + "no reason was given": "ไม่ได้ระบุเหตุผล", + "{done} of {total}": "{done} จาก {total}", + "{n} files": "{n} ไฟล์", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, โพรโทคอล {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, แตกไฟล์แล้ว {size}, ตรวจสอบทีละไฟล์", + "{tag}: none for this computer": "{tag}: ไม่มีสำหรับคอมพิวเตอร์เครื่องนี้", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} ไฟล์, แตกไฟล์แล้ว {size}" } diff --git a/frontend/src/i18n/modules/cad/vi.json b/frontend/src/i18n/modules/cad/vi.json index 4debd1cd..470bf9ce 100644 --- a/frontend/src/i18n/modules/cad/vi.json +++ b/frontend/src/i18n/modules/cad/vi.json @@ -1,91 +1,91 @@ { - "% of the model size": "% of the model size", - "About {n} triangles afterwards.": "About {n} triangles afterwards.", - "All CAD parts": "All CAD parts", - "Angle": "Angle", - "Angle in degrees": "Angle in degrees", - "Apply": "Apply", - "Beside the FormShot engine": "Beside the FormShot engine", - "CAD Import": "CAD Import", - "CAD Import Settings...": "CAD Import Settings...", - "CAD Options in the Import Sheet": "CAD Options in the Import Sheet", - "CAD worker": "CAD worker", - "CAD worker: {stage}, {pct}%": "CAD worker: {stage}, {pct}%", - "Check the worker": "Check the worker", - "Checking every file": "Checking every file", - "Choose STEP or IGES files to import; they open through the CAD worker.": "Choose STEP or IGES files to import; they open through the CAD worker.", - "Chord": "Chord", - "Chord as a percentage of the model size": "Chord as a percentage of the model size", - "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.", - "Chord {chord}% of the model size, angle {angle} degrees": "Chord {chord}% of the model size, angle {angle} degrees", - "Could not re-tessellate: {reason}": "Could not re-tessellate: {reason}", - "Custom": "Custom", - "Custom ({chord}%, {angle}°)": "Custom ({chord}%, {angle}°)", - "Default CAD quality": "Default CAD quality", - "Download": "Download", - "Download and check the program that opens STEP and IGES files.": "Download and check the program that opens STEP and IGES files.", - "Download the CAD Worker": "Download the CAD Worker", - "Download the CAD worker": "Download the CAD worker", - "Downloaded into the cache folder": "Downloaded into the cache folder", - "Downloading": "Downloading", - "Found in": "Found in", - "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.", - "Installed": "Installed", - "Mixed": "Mixed", - "Named by FORMSHOT_CAD_WORKER": "Named by FORMSHOT_CAD_WORKER", - "New quality": "New quality", - "None of the selected parts came from a STEP or IGES file.": "None of the selected parts came from a STEP or IGES file.", - "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.", - "Not available.": "Not available.", - "Not available: {reason}": "Not available: {reason}", - "Not installed": "Not installed", - "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.", - "Not named": "Not named", - "Not recorded": "Not recorded", - "Nothing in this document came from a STEP or IGES file.": "Nothing in this document came from a STEP or IGES file.", - "Nothing is selected, so every CAD part is rebuilt.": "Nothing is selected, so every CAD part is rebuilt.", - "Published": "Published", - "Quality now": "Quality now", - "Re-tessellate CAD Parts": "Re-tessellate CAD Parts", - "Re-tessellate CAD Parts...": "Re-tessellate CAD Parts...", - "Re-tessellated 1 CAD part at {quality}.": "Re-tessellated 1 CAD part at {quality}.", - "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.", - "Re-tessellated {parts} CAD parts at {quality}.": "Re-tessellated {parts} CAD parts at {quality}.", - "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.", - "Re-tessellating": "Re-tessellating", - "Read the status again": "Read the status again", - "Reading the published record": "Reading the published record", - "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.", - "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.", - "STEP and IGES files need the CAD worker, and none is published for this computer.": "STEP and IGES files need the CAD worker, and none is published for this computer.", - "STEP and IGES files need the CAD worker, which is not installed yet.": "STEP and IGES files need the CAD worker, which is not installed yet.", - "Selected CAD parts": "Selected CAD parts", - "Source": "Source", - "The CAD worker is installed.": "The CAD worker is installed.", - "The CAD worker is installed. You can import this file now.": "The CAD worker is installed. You can import this file now.", - "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "The CAD worker that opens STEP and IGES files, and the default CAD quality.", - "The FormShot service is not reachable.": "The FormShot service is not reachable.", - "The download failed: {reason}": "The download failed: {reason}", - "The download was cancelled. Nothing was installed.": "The download was cancelled. Nothing was installed.", - "The engine gives no estimate; finer qualities take longer and make more triangles.": "The engine gives no estimate; finer qualities take longer and make more triangles.", - "The parts could not be read: {reason}": "The parts could not be read: {reason}", - "The service cannot stop a download once it has started.": "The service cannot stop a download once it has started.", - "The service refused the request from this window.": "The service refused the request from this window.", - "The status could not be read: {reason}": "The status could not be read: {reason}", - "The worker did not answer: {reason}": "The worker did not answer: {reason}", - "This computer": "This computer", - "This engine cannot re-tessellate CAD parts.": "This engine cannot re-tessellate CAD parts.", - "Triangles now": "Triangles now", - "Try Again": "Try Again", - "Unknown": "Unknown", - "Unpacking": "Unpacking", - "Version": "Version", - "degrees": "degrees", - "no reason was given": "no reason was given", - "{done} of {total}": "{done} of {total}", - "{n} files": "{n} files", - "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, protocol {protocol}", - "{tag}, {size} unpacked, checked file by file": "{tag}, {size} unpacked, checked file by file", - "{tag}: none for this computer": "{tag}: none for this computer", - "{tag}: {files} files, {size} unpacked": "{tag}: {files} files, {size} unpacked" + "% of the model size": "% kích thước mô hình", + "About {n} triangles afterwards.": "Sau đó khoảng {n} tam giác.", + "All CAD parts": "Tất cả bộ phận CAD", + "Angle": "Góc", + "Angle in degrees": "Góc theo độ", + "Apply": "Áp dụng", + "Beside the FormShot engine": "Cạnh công cụ FormShot", + "CAD Import": "Nhập CAD", + "CAD Import Settings...": "Cài đặt nhập CAD...", + "CAD Options in the Import Sheet": "Tùy chọn CAD trong bảng nhập", + "CAD worker": "Worker CAD", + "CAD worker: {stage}, {pct}%": "Worker CAD: {stage}, {pct}%", + "Check the worker": "Kiểm tra worker", + "Checking every file": "Đang kiểm tra từng tệp", + "Choose STEP or IGES files to import; they open through the CAD worker.": "Chọn tệp STEP hoặc IGES để nhập; các tệp này được mở bằng worker CAD.", + "Chord": "Dây cung", + "Chord as a percentage of the model size": "Dây cung theo phần trăm kích thước mô hình", + "Chord must be above 0 and at most {max}% of the model size; angle from {min} to {amax} degrees.": "Dây cung phải lớn hơn 0 và tối đa {max}% kích thước mô hình; góc từ {min} đến {amax} độ.", + "Chord {chord}% of the model size, angle {angle} degrees": "Dây cung {chord}% kích thước mô hình, góc {angle} độ", + "Could not re-tessellate: {reason}": "Không thể chia lại tam giác: {reason}", + "Custom": "Tùy chỉnh", + "Custom ({chord}%, {angle}°)": "Tùy chỉnh ({chord}%, {angle}°)", + "Default CAD quality": "Chất lượng CAD mặc định", + "Download": "Tải xuống", + "Download and check the program that opens STEP and IGES files.": "Tải xuống và kiểm tra chương trình mở tệp STEP và IGES.", + "Download the CAD Worker": "Tải xuống worker CAD", + "Download the CAD worker": "Tải xuống worker CAD", + "Downloaded into the cache folder": "Đã tải vào thư mục bộ nhớ đệm", + "Downloading": "Đang tải xuống", + "Found in": "Tìm thấy trong", + "How finely STEP and IGES surfaces become triangles when they are imported. Chord is the largest gap between a triangle and the true surface, as a share of the whole model's size; angle is the largest bend between neighbouring triangles. Finer settings take longer and make larger files. The import sheet starts with this choice; you can change it for one import there.": "Mức độ mịn khi bề mặt STEP và IGES được chia thành tam giác lúc nhập. Dây cung là khoảng hở lớn nhất giữa một tam giác và bề mặt thật, tính theo tỷ lệ kích thước cả mô hình; góc là độ gập lớn nhất giữa các tam giác kề nhau. Thiết lập mịn hơn mất nhiều thời gian hơn và tạo tệp lớn hơn. Bảng nhập bắt đầu với lựa chọn này; bạn có thể đổi cho một lần nhập ngay tại đó.", + "Installed": "Đã cài đặt", + "Mixed": "Hỗn hợp", + "Named by FORMSHOT_CAD_WORKER": "Được đặt tên bởi FORMSHOT_CAD_WORKER", + "New quality": "Chất lượng mới", + "None of the selected parts came from a STEP or IGES file.": "Không bộ phận nào trong số đã chọn đến từ tệp STEP hoặc IGES.", + "None of the selected parts came from a STEP or IGES file. Clear the selection to rebuild every CAD part.": "Không bộ phận nào trong số đã chọn đến từ tệp STEP hoặc IGES. Bỏ chọn để dựng lại mọi bộ phận CAD.", + "Not available.": "Không có sẵn.", + "Not available: {reason}": "Không có sẵn: {reason}", + "Not installed": "Chưa cài đặt", + "Not installed yet. FormShot looks for it in {folder}; download it here to open STEP and IGES files.": "Chưa cài đặt. FormShot tìm trong {folder}; hãy tải xuống tại đây để mở tệp STEP và IGES.", + "Not named": "Không được đặt tên", + "Not recorded": "Chưa ghi nhận", + "Nothing in this document came from a STEP or IGES file.": "Không có gì trong tài liệu này đến từ tệp STEP hoặc IGES.", + "Nothing is selected, so every CAD part is rebuilt.": "Chưa chọn gì nên mọi bộ phận CAD sẽ được dựng lại.", + "Published": "Đã phát hành", + "Quality now": "Chất lượng hiện tại", + "Re-tessellate CAD Parts": "Chia lại tam giác cho bộ phận CAD", + "Re-tessellate CAD Parts...": "Chia lại tam giác cho bộ phận CAD...", + "Re-tessellated 1 CAD part at {quality}.": "Đã chia lại tam giác cho 1 bộ phận CAD ở mức {quality}.", + "Re-tessellated 1 CAD part at {quality}: {before} to {after} triangles.": "Đã chia lại tam giác cho 1 bộ phận CAD ở mức {quality}: từ {before} thành {after} tam giác.", + "Re-tessellated {parts} CAD parts at {quality}.": "Đã chia lại tam giác cho {parts} bộ phận CAD ở mức {quality}.", + "Re-tessellated {parts} CAD parts at {quality}: {before} to {after} triangles.": "Đã chia lại tam giác cho {parts} bộ phận CAD ở mức {quality}: từ {before} thành {after} tam giác.", + "Re-tessellating": "Đang chia lại tam giác", + "Read the status again": "Đọc lại trạng thái", + "Reading the published record": "Đang đọc bản ghi đã phát hành", + "Rebuild the meshes of parts imported from STEP or IGES at another quality, as one undo step.": "Dựng lại mesh của các bộ phận nhập từ STEP hoặc IGES ở chất lượng khác, như một bước hoàn tác.", + "STEP and IGES files are opened by FormCAD's kernel worker, a separate program that FormShot downloads once, checks file by file and keeps in your cache folder. Other model formats do not need it.": "Tệp STEP và IGES được mở bởi worker lõi của FormCAD, một chương trình riêng mà FormShot tải xuống một lần, kiểm tra từng tệp và giữ trong thư mục bộ nhớ đệm của bạn. Các định dạng mô hình khác không cần đến nó.", + "STEP and IGES files need the CAD worker, and none is published for this computer.": "Tệp STEP và IGES cần worker CAD, nhưng chưa có bản nào được phát hành cho máy tính này.", + "STEP and IGES files need the CAD worker, which is not installed yet.": "Tệp STEP và IGES cần worker CAD, hiện chưa được cài đặt.", + "Selected CAD parts": "Bộ phận CAD đã chọn", + "Source": "Nguồn", + "The CAD worker is installed.": "Worker CAD đã được cài đặt.", + "The CAD worker is installed. You can import this file now.": "Worker CAD đã được cài đặt. Bạn có thể nhập tệp này ngay.", + "The CAD worker that opens STEP and IGES files, and the default CAD quality.": "Worker CAD mở tệp STEP và IGES, và chất lượng CAD mặc định.", + "The FormShot service is not reachable.": "Không kết nối được dịch vụ FormShot.", + "The download failed: {reason}": "Tải xuống không thành công: {reason}", + "The download was cancelled. Nothing was installed.": "Đã hủy tải xuống. Chưa cài đặt gì.", + "The engine gives no estimate; finer qualities take longer and make more triangles.": "Công cụ không đưa ra ước tính; chất lượng mịn hơn mất nhiều thời gian hơn và tạo nhiều tam giác hơn.", + "The parts could not be read: {reason}": "Không thể đọc các bộ phận: {reason}", + "The service cannot stop a download once it has started.": "Dịch vụ không thể dừng tải xuống khi đã bắt đầu.", + "The service refused the request from this window.": "Dịch vụ từ chối yêu cầu từ cửa sổ này.", + "The status could not be read: {reason}": "Không thể đọc trạng thái: {reason}", + "The worker did not answer: {reason}": "Worker không phản hồi: {reason}", + "This computer": "Máy tính này", + "This engine cannot re-tessellate CAD parts.": "Công cụ này không thể chia lại tam giác cho bộ phận CAD.", + "Triangles now": "Số tam giác hiện tại", + "Try Again": "Thử lại", + "Unknown": "Không rõ", + "Unpacking": "Đang giải nén", + "Version": "Phiên bản", + "degrees": "độ", + "no reason was given": "không có lý do nào được nêu", + "{done} of {total}": "{done} trên {total}", + "{n} files": "{n} tệp", + "{tag}, OpenCascade {occt}, protocol {protocol}": "{tag}, OpenCascade {occt}, giao thức {protocol}", + "{tag}, {size} unpacked, checked file by file": "{tag}, đã giải nén {size}, đã kiểm tra từng tệp", + "{tag}: none for this computer": "{tag}: không có bản cho máy tính này", + "{tag}: {files} files, {size} unpacked": "{tag}: {files} tệp, đã giải nén {size}" } From d56d26bce7e3224848611bc78cb49ec2ad3e9124 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 16:41:44 -0500 Subject: [PATCH 152/494] build(native): lock the 3mf, fbx, tangent and cad dependencies The readers added roxmltree, ufbx (which builds its C source with cc) and bevy_mikktspace, and the workspace gained fsh-cad; the lock now records them so builds resolve the same versions. Ran cargo clippy on the workspace with -D warnings. --- native/Cargo.lock | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/native/Cargo.lock b/native/Cargo.lock index 6f8735a3..efd79c44 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -38,6 +38,12 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "bevy_mikktspace" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff34eb29ff4b8a8688bc7299f14fb6b597461ca80fec03ed7d22939ab33e48f" + [[package]] name = "bit-set" version = "0.10.0" @@ -94,6 +100,16 @@ dependencies = [ "syn 3.0.10", ] +[[package]] +name = "cc" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95e45cf2980b2d467be49a9ed942c9179b701063a7ca3d037de7ee9bd67f8d66" +dependencies = [ + "find-msvc-tools", + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.5" @@ -188,6 +204,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" +[[package]] +name = "find-msvc-tools" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e44f110d1777dc6559a51e7d45083945ded4f1bf3305494350f693b6d20b9c8" + [[package]] name = "foldhash" version = "0.2.0" @@ -202,6 +224,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "fsh-cad" +version = "0.4.0" +dependencies = [ + "fsh-core", + "fsh-io", + "serde_json", +] + [[package]] name = "fsh-cli" version = "0.4.0" @@ -216,6 +247,7 @@ name = "fsh-commands" version = "0.4.0" dependencies = [ "fsh-accel", + "fsh-cad", "fsh-core", "fsh-format", "fsh-io", @@ -244,9 +276,12 @@ dependencies = [ name = "fsh-io" version = "0.4.0" dependencies = [ + "bevy_mikktspace", "fsh-core", "fsh-scene", + "roxmltree", "serde_json", + "ufbx", ] [[package]] @@ -932,6 +967,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +[[package]] +name = "roxmltree" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907" +dependencies = [ + "memchr", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -993,6 +1037,12 @@ dependencies = [ "zmij", ] +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "slab" version = "0.4.12" @@ -1095,6 +1145,15 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "ufbx" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "260522f1eb74139f0e78b29dd82a58e5437d728c5498024a39e5af7282694240" +dependencies = [ + "cc", +] + [[package]] name = "unicode-ident" version = "1.0.27" From 8ee6bf5dfb5768ab0aa88ba4271eceb9f18271bb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 17:05:18 -0500 Subject: [PATCH 153/494] chore(release): 0.5.0 FormShot 0.5.0 adds import and hand-offs: 3MF and FBX readers, import options, probe, background import jobs with cancel and stale detection, reimport with stable part ids, STEP and IGES through FormCAD's kernel worker with kept sources and retessellation, the worker download with pinned checks, hand-offs from FormSculpt, FormFabric, FormSurface and FormCAD behind the person's consent, the import sheet with drops and desktop opens, and their strings in every language; CHANGELOG.md gains its section, which says the Tauri desktop build, macOS and Windows were not run. Version sites moved from 0.4.0 to 0.5.0: VERSION, frontend package.json and the two package-lock.json root entries, version.ts, tauri.conf.json, src-tauri Cargo.toml and its Cargo.lock entry, backend __init__.py, the thirteen native crate manifests and their native/Cargo.lock entries, fsh-py pyproject.toml, the formshot-engine usage line, the current-version lines of README, CONTRIBUTING, NOTICE, SECURITY, ARCHITECTURE, the harness skill and the HASHOUT log headers, and the agent manifest and rendering skill tool reference regenerated by ./formshot agents sync from a 0.5.0 release engine (98 commands). Run: cargo check --locked in native/ and cargo clippy --locked in src-tauri with the sidecar placeholder (both pass), cargo build --release of fsh-cli (formshot-engine reports 0.5.0), ./formshot agents check (clean), python3 -m json.tool on package.json, package-lock.json, tauri.conf.json and agents/manifest.json. --- .../formshot-rendering/references/tools.md | 143 ++++++++++++++++-- .claude/skills/formshot-harness/SKILL.md | 6 +- .../formshot-rendering/references/tools.md | 143 ++++++++++++++++-- CHANGELOG.md | 31 ++++ CONTRIBUTING.md | 2 +- NOTICE.md | 2 +- README.md | 8 +- SECURITY.md | 2 +- VERSION | 2 +- agents/manifest.json | 22 ++- backend/HASHOUT_LOG.md | 4 +- backend/app/__init__.py | 2 +- docs/ARCHITECTURE.md | 2 +- frontend/HASHOUT_LOG.md | 4 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- frontend/src/version.ts | 2 +- native/Cargo.lock | 26 ++-- native/HASHOUT_LOG.md | 2 +- native/crates/fsh-accel/Cargo.toml | 2 +- native/crates/fsh-cad/Cargo.toml | 2 +- native/crates/fsh-cli/Cargo.toml | 2 +- native/crates/fsh-cli/src/main.rs | 2 +- native/crates/fsh-commands/Cargo.toml | 2 +- native/crates/fsh-core/Cargo.toml | 2 +- native/crates/fsh-format/Cargo.toml | 2 +- native/crates/fsh-io/Cargo.toml | 2 +- native/crates/fsh-materials/Cargo.toml | 2 +- native/crates/fsh-py/Cargo.toml | 2 +- native/crates/fsh-py/pyproject.toml | 2 +- native/crates/fsh-render-cpu/Cargo.toml | 2 +- native/crates/fsh-render-gpu/Cargo.toml | 2 +- native/crates/fsh-scene/Cargo.toml | 2 +- native/crates/fsh-wasm/Cargo.toml | 2 +- setup/HASHOUT_LOG.md | 4 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/HASHOUT_LOG.md | 4 +- src-tauri/tauri.conf.json | 2 +- 39 files changed, 369 insertions(+), 84 deletions(-) diff --git a/.agents/skills/formshot-rendering/references/tools.md b/.agents/skills/formshot-rendering/references/tools.md index 648e9f75..b2871382 100644 --- a/.agents/skills/formshot-rendering/references/tools.md +++ b/.agents/skills/formshot-rendering/references/tools.md @@ -1,10 +1,10 @@ # formshot tools -Generated from the engine's command catalogue (formshot 0.4.0) by `./formshot agents sync`; do not edit by hand. +Generated from the engine's command catalogue (formshot 0.5.0) by `./formshot agents sync`; do not edit by hand. ## Contents -- Scene: `scene.add_group`, `scene.add_part`, `scene.add_primitive`, `scene.add_light`, `scene.add_cutaway`, `scene.remove`, `scene.rename`, `scene.set_transform`, `scene.set_visible`, `scene.set_locked`, `scene.set_ray_visibility`, `scene.set_part_colour`, `scene.set_metadata`, `scene.set_pivot`, `scene.set_light`, `scene.set_cutaway`, `scene.reparent`, `scene.duplicate`, `scene.import`, `scene.summary`, `scene.meshes`, `scene.mesh_data` +- Scene: `scene.add_group`, `scene.add_part`, `scene.add_primitive`, `scene.add_light`, `scene.add_cutaway`, `scene.remove`, `scene.rename`, `scene.set_transform`, `scene.set_visible`, `scene.set_locked`, `scene.set_ray_visibility`, `scene.set_part_colour`, `scene.set_metadata`, `scene.set_pivot`, `scene.set_part_mesh`, `scene.set_light`, `scene.set_cutaway`, `scene.reparent`, `scene.duplicate`, `scene.import`, `scene.summary`, `scene.meshes`, `scene.mesh_data`, `scene.retessellate` - Mesh: `mesh.add`, `mesh.remove` - Materials: `material.create`, `material.set_params`, `material.set_type`, `material.assign`, `material.rename`, `material.remove` - Texture: `texture.add`, `texture.remove` @@ -18,8 +18,11 @@ Generated from the engine's command catalogue (formshot 0.4.0) by `./formshot ag - App: `app.version`, `app.catalogue` - Selection: `selection.set`, `selection.clear` - History: `history.undo`, `history.redo`, `history.begin_group`, `history.end_group`, `history.abandon_group`, `history.barrier` -- Files: `file.new`, `file.open`, `file.save`, `file.import`, `file.close`, `file.export_image`, `file.export_model`, `file.snapshot`, `file.recover_list`, `file.recover` +- Files: `file.new`, `file.open`, `file.save`, `file.import`, `file.close`, `file.export_image`, `file.export_model`, `file.snapshot`, `file.recover_list`, `file.recover`, `file.reimport` - Viewing: `view.bounds`, `view.pick`, `view.frame` +- Import: `import.probe`, `import.start`, `import.status`, `import.cancel` +- Cad: `cad.status` +- Handoff: `handoff.inspect`, `handoff.open` - Nodes: `node.set_visible`, `node.set_locked`, `node.rename`, `node.remove` - Undo: `undo` - Redo: `redo` @@ -144,6 +147,14 @@ Set or clear a node's gizmo pivot (local space). - `id`: integer; required; range 1 to inf; Node - `pivot`: value; Local pivot, null clears +## scene.set_part_mesh + +Make a part show another existing mesh in place, keeping its id, name, material, transform and metadata; its old mesh is removed when nothing else uses it. + +- `id`: integer; required; range 1 to inf; Part +- `mesh`: integer; required; range 1 to inf; Existing mesh the part shows from now on (add it first with mesh.add) +- `remove_unused`: boolean; default true; Remove the old mesh when no other part uses it + ## scene.set_light Change a light node's settings; give only the fields to change. @@ -402,9 +413,17 @@ Start a new document, empty or from a template (empty-studio, product-white, stu ## file.open -Open a .fshot project, or a model file as a new document. +Open a .fshot project, or a model file as a new document with the file.import options (camera framed). -- `path`: string; required; A .fshot project or a model file +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; A .fshot project, or a model file (glb, gltf, obj, stl, ply, 3mf, fbx, step, stp, iges, igs) opened as a new document; the other options apply to a model only +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## file.save @@ -414,12 +433,18 @@ Save the document as .fshot to path, or to its own path. ## file.import -Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step. +Import a model (glb, gltf, obj, stl, ply, 3mf, fbx, step, iges) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional, and every node made carries source.path and source.node metadata. -- `frame`: boolean; Frame the camera on the result (default: only when the document was empty) +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group - `name`: string; Name for the imported group (the original file name) -- `options`: object; fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group -- `path`: string; required; Model file: glb, gltf, obj, stl or ply +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## file.close @@ -598,6 +623,84 @@ Move the active camera, keeping its view direction, so the given nodes (or every - `nodes`: array of ['string', 'integer']; Node ids (decimal strings or numbers) - `width`: number; range 1 to inf; Viewport width in pixels (aspect only); the document's when absent +## import.probe + +Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units and size_m (the size in metres at units_guess), triangles, meshes, nodes, materials, warnings}. + +- `path`: string; required; Model file to read +- `worker`: boolean; default true; STEP and IGES: also open the file with the CAD worker (bodies, groups, colours, size; a few seconds); false answers from the file's header alone + +Note: read-only. + +## import.start + +Start importing a model in the background with the file.import options and return {job}; the read and clean-up run on a worker, and the document changes (one undo step) on the first engine call after the worker finishes. Follow it with import.status. + +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y + +## import.status + +An import job's progress: {job, state (running, done, failed, cancelled, or stale when the document was replaced while it ran and nothing was applied), stage (reading, validating, welding, normals, instancing, placing, converting, then waiting while a history group is open, done), fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session. + +- `job`: ['integer', 'string']; Job id from import.start + +Note: read-only. + +## import.cancel + +Cancel a running import job; the document stays exactly as it was. Answers the job's status with cancelled true when it was still running. + +- `job`: ['integer', 'string']; required; Job id from import.start + +## file.reimport + +Read the source files of the given imported nodes again (every imported node when none): parts match by source.node, then by unique name, then by identical shape; matched parts keep their materials and transforms and take the new shape, new parts are added, parts gone from the file are hidden (marked source.missing), all as one undo step. Answers {matched, added, hidden, updated, files: [{path, matched, added, hidden, updated, warnings, report (the clean-up report of the re-read), error?}]}. + +- `nodes`: array of ['string', 'integer']; Imported nodes (or groups holding them) whose files to read again; every imported node when absent + +## cad.status + +Whether the CAD worker that opens STEP and IGES files is installed, where, and which release; probe starts it once to check. + +- `probe`: boolean; Start the worker and ask its version (takes a few seconds) + +Note: read-only. + +## scene.retessellate + +Rebuild the meshes of CAD parts from their kept STEP or IGES source at a new quality; each part keeps its id, name, placement, material, visibility and selection (scene.set_part_mesh); one undo step. + +- `nodes`: array of ['string', 'integer']; Parts or groups whose CAD parts are rebuilt; every CAD part when absent +- `quality`: value; required; Tessellation of STEP and IGES surfaces: a preset, or chord (fraction of the model's diagonal) and angle (degrees) + +## handoff.inspect + +Tell what a file or folder another Form app wrote is (a GoF folder from FormSculpt or FormFabric, a FormSurface export folder of maps, a FormCAD, FormSculpt or FormFabric model) and what it holds, without changing the document. + +- `item`: ['string', 'integer']; For a GoF folder: the entry's file name, id or name; the newest entry meant for FormShot (target any or formshot) when omitted. +- `path`: string; required; Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file. +- `read`: boolean; default true; Read the model too, to count meshes, triangles, materials and textures. + +Note: read-only. + +## handoff.open + +Open what another Form app handed over, as a new document or added to the current one as one undo step; every node that arrives records source.app, source.path and source.node in its metadata, and FormSurface's maps arrive as texture references by role and colour space. + +- `as`: string (new | add); default "add"; new replaces the document with a new one holding the hand-off; add puts it into the current document as one undo step. +- `frame`: boolean; Frame the camera on the scene afterwards; by default when the document had no parts before, or for a new document. +- `item`: ['string', 'integer']; For a GoF folder: the entry's file name, id or name; the newest entry meant for FormShot (target any or formshot) when omitted. +- `path`: string; required; Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file. + ## node.set_visible Same as scene.set_visible ({id, visible} -> {ids: [id], visible}). @@ -638,16 +741,30 @@ Same as file.new ({path?, title?, template?} unchanged). Same as file.open ({path} unchanged). -- `path`: string; required; A .fshot project or a model file +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; A .fshot project, or a model file (glb, gltf, obj, stl, ply, 3mf, fbx, step, stp, iges, igs) opened as a new document; the other options apply to a model only +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## document.import Same as file.import ({path, name?, options?} unchanged). -- `frame`: boolean; Frame the camera on the result (default: only when the document was empty) +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group - `name`: string; Name for the imported group (the original file name) -- `options`: object; fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group -- `path`: string; required; Model file: glb, gltf, obj, stl or ply +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## document.save diff --git a/.claude/skills/formshot-harness/SKILL.md b/.claude/skills/formshot-harness/SKILL.md index b1f2464a..16250b7c 100644 --- a/.claude/skills/formshot-harness/SKILL.md +++ b/.claude/skills/formshot-harness/SKILL.md @@ -1,10 +1,10 @@ --- name: formshot-harness -description: "Guides work on formshot, the Form-family 3D product renderer by nodemode-ai: Rust engine workspace (fsh-*), CPU and GPU (wgpu, WGSL) path tracers, the live viewport (WebGL2 raster modes, the WebAssembly engine on WebGPU), layered materials, the .fshot project file, MCP tools, FastAPI service, Tauri desktop. Use whenever a task touches the document, commands, undo, the render snapshot, the BVH, BSDFs, sampling, tone mapping, glTF or OBJ import, the .fshot format or journal, the command registry or catalogue, the MCP endpoint or consent, the agent dock, the window shell, Home, the workspace, the service, the Tauri sidecar, doctor and notices runs, version bumps (0.x from 0.4.0), or any file under native/, frontend/src, backend/app, src-tauri or setup/. Enforces project laws (SEDO, zero DOM flicker, z-index tokens, no tests). Not for formsculpt or formsurface." +description: "Guides work on formshot, the Form-family 3D product renderer by nodemode-ai: Rust engine workspace (fsh-*), CPU and GPU (wgpu, WGSL) path tracers, the live viewport (WebGL2 raster modes, the WebAssembly engine on WebGPU), layered materials, the .fshot project file, MCP tools, FastAPI service, Tauri desktop. Use whenever a task touches the document, commands, undo, the render snapshot, the BVH, BSDFs, sampling, tone mapping, glTF or OBJ import, the .fshot format or journal, the command registry or catalogue, the MCP endpoint or consent, the agent dock, the window shell, Home, the workspace, the service, the Tauri sidecar, doctor and notices runs, version bumps (0.x from 0.5.0), or any file under native/, frontend/src, backend/app, src-tauri or setup/. Enforces project laws (SEDO, zero DOM flicker, z-index tokens, no tests). Not for formsculpt or formsurface." license: Apache-2.0 metadata: nodemode.author: nodemode-ai - nodemode.pack-version: "0.4.0" + nodemode.pack-version: "0.5.0" --- # Formshot Harness @@ -31,7 +31,7 @@ Sub-skill paths resolve as `sub-skills/[skill-name]/SUB-SKILL.md` from this fold | Area | Location | Role | | --- | --- | --- | -| Rust engine | `native/` (one Cargo workspace, edition 2021, all crates 0.4.0) | everything that knows about scenes, rays and pixels | +| Rust engine | `native/` (one Cargo workspace, edition 2021, all crates 0.5.0) | everything that knows about scenes, rays and pixels | | fsh-core | `native/crates/fsh-core` | maths, Transform, Ray, Aabb, Rgb in ACEScg, typed ids and document keys, units, the deterministic sampler, warps and MIS heuristics; std only | | fsh-scene | `native/crates/fsh-scene` | the document, the command enum and its table, undo and redo with merge and groups, change levels, selection, `flatten()` to `RenderSnapshot` | | fsh-accel | `native/crates/fsh-accel` | two-level binned-SAH BVH, watertight triangle test, `Intersector` | diff --git a/.claude/skills/formshot-rendering/references/tools.md b/.claude/skills/formshot-rendering/references/tools.md index 648e9f75..b2871382 100644 --- a/.claude/skills/formshot-rendering/references/tools.md +++ b/.claude/skills/formshot-rendering/references/tools.md @@ -1,10 +1,10 @@ # formshot tools -Generated from the engine's command catalogue (formshot 0.4.0) by `./formshot agents sync`; do not edit by hand. +Generated from the engine's command catalogue (formshot 0.5.0) by `./formshot agents sync`; do not edit by hand. ## Contents -- Scene: `scene.add_group`, `scene.add_part`, `scene.add_primitive`, `scene.add_light`, `scene.add_cutaway`, `scene.remove`, `scene.rename`, `scene.set_transform`, `scene.set_visible`, `scene.set_locked`, `scene.set_ray_visibility`, `scene.set_part_colour`, `scene.set_metadata`, `scene.set_pivot`, `scene.set_light`, `scene.set_cutaway`, `scene.reparent`, `scene.duplicate`, `scene.import`, `scene.summary`, `scene.meshes`, `scene.mesh_data` +- Scene: `scene.add_group`, `scene.add_part`, `scene.add_primitive`, `scene.add_light`, `scene.add_cutaway`, `scene.remove`, `scene.rename`, `scene.set_transform`, `scene.set_visible`, `scene.set_locked`, `scene.set_ray_visibility`, `scene.set_part_colour`, `scene.set_metadata`, `scene.set_pivot`, `scene.set_part_mesh`, `scene.set_light`, `scene.set_cutaway`, `scene.reparent`, `scene.duplicate`, `scene.import`, `scene.summary`, `scene.meshes`, `scene.mesh_data`, `scene.retessellate` - Mesh: `mesh.add`, `mesh.remove` - Materials: `material.create`, `material.set_params`, `material.set_type`, `material.assign`, `material.rename`, `material.remove` - Texture: `texture.add`, `texture.remove` @@ -18,8 +18,11 @@ Generated from the engine's command catalogue (formshot 0.4.0) by `./formshot ag - App: `app.version`, `app.catalogue` - Selection: `selection.set`, `selection.clear` - History: `history.undo`, `history.redo`, `history.begin_group`, `history.end_group`, `history.abandon_group`, `history.barrier` -- Files: `file.new`, `file.open`, `file.save`, `file.import`, `file.close`, `file.export_image`, `file.export_model`, `file.snapshot`, `file.recover_list`, `file.recover` +- Files: `file.new`, `file.open`, `file.save`, `file.import`, `file.close`, `file.export_image`, `file.export_model`, `file.snapshot`, `file.recover_list`, `file.recover`, `file.reimport` - Viewing: `view.bounds`, `view.pick`, `view.frame` +- Import: `import.probe`, `import.start`, `import.status`, `import.cancel` +- Cad: `cad.status` +- Handoff: `handoff.inspect`, `handoff.open` - Nodes: `node.set_visible`, `node.set_locked`, `node.rename`, `node.remove` - Undo: `undo` - Redo: `redo` @@ -144,6 +147,14 @@ Set or clear a node's gizmo pivot (local space). - `id`: integer; required; range 1 to inf; Node - `pivot`: value; Local pivot, null clears +## scene.set_part_mesh + +Make a part show another existing mesh in place, keeping its id, name, material, transform and metadata; its old mesh is removed when nothing else uses it. + +- `id`: integer; required; range 1 to inf; Part +- `mesh`: integer; required; range 1 to inf; Existing mesh the part shows from now on (add it first with mesh.add) +- `remove_unused`: boolean; default true; Remove the old mesh when no other part uses it + ## scene.set_light Change a light node's settings; give only the fields to change. @@ -402,9 +413,17 @@ Start a new document, empty or from a template (empty-studio, product-white, stu ## file.open -Open a .fshot project, or a model file as a new document. +Open a .fshot project, or a model file as a new document with the file.import options (camera framed). -- `path`: string; required; A .fshot project or a model file +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; A .fshot project, or a model file (glb, gltf, obj, stl, ply, 3mf, fbx, step, stp, iges, igs) opened as a new document; the other options apply to a model only +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## file.save @@ -414,12 +433,18 @@ Save the document as .fshot to path, or to its own path. ## file.import -Import a model (glb, gltf, obj, stl, ply) with clean-up as one undoable step. +Import a model (glb, gltf, obj, stl, ply, 3mf, fbx, step, iges) with clean-up as one undoable step; units, up_axis, stand_on_floor, center, merge and cad_quality are optional, and every node made carries source.path and source.node metadata. -- `frame`: boolean; Frame the camera on the result (default: only when the document was empty) +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group - `name`: string; Name for the imported group (the original file name) -- `options`: object; fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group -- `path`: string; required; Model file: glb, gltf, obj, stl or ply +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## file.close @@ -598,6 +623,84 @@ Move the active camera, keeping its view direction, so the given nodes (or every - `nodes`: array of ['string', 'integer']; Node ids (decimal strings or numbers) - `width`: number; range 1 to inf; Viewport width in pixels (aspect only); the document's when absent +## import.probe + +Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units and size_m (the size in metres at units_guess), triangles, meshes, nodes, materials, warnings}. + +- `path`: string; required; Model file to read +- `worker`: boolean; default true; STEP and IGES: also open the file with the CAD worker (bodies, groups, colours, size; a few seconds); false answers from the file's header alone + +Note: read-only. + +## import.start + +Start importing a model in the background with the file.import options and return {job}; the read and clean-up run on a worker, and the document changes (one undo step) on the first engine call after the worker finishes. Follow it with import.status. + +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y + +## import.status + +An import job's progress: {job, state (running, done, failed, cancelled, or stale when the document was replaced while it ran and nothing was applied), stage (reading, validating, welding, normals, instancing, placing, converting, then waiting while a history group is open, done), fraction (0 to 1 over the whole import), path, seconds, result (the file.import reply) when done, error {message, code} when failed}; without job, {jobs: [...]} for every job of this session. + +- `job`: ['integer', 'string']; Job id from import.start + +Note: read-only. + +## import.cancel + +Cancel a running import job; the document stays exactly as it was. Answers the job's status with cancelled true when it was still running. + +- `job`: ['integer', 'string']; required; Job id from import.start + +## file.reimport + +Read the source files of the given imported nodes again (every imported node when none): parts match by source.node, then by unique name, then by identical shape; matched parts keep their materials and transforms and take the new shape, new parts are added, parts gone from the file are hidden (marked source.missing), all as one undo step. Answers {matched, added, hidden, updated, files: [{path, matched, added, hidden, updated, warnings, report (the clean-up report of the re-read), error?}]}. + +- `nodes`: array of ['string', 'integer']; Imported nodes (or groups holding them) whose files to read again; every imported node when absent + +## cad.status + +Whether the CAD worker that opens STEP and IGES files is installed, where, and which release; probe starts it once to check. + +- `probe`: boolean; Start the worker and ask its version (takes a few seconds) + +Note: read-only. + +## scene.retessellate + +Rebuild the meshes of CAD parts from their kept STEP or IGES source at a new quality; each part keeps its id, name, placement, material, visibility and selection (scene.set_part_mesh); one undo step. + +- `nodes`: array of ['string', 'integer']; Parts or groups whose CAD parts are rebuilt; every CAD part when absent +- `quality`: value; required; Tessellation of STEP and IGES surfaces: a preset, or chord (fraction of the model's diagonal) and angle (degrees) + +## handoff.inspect + +Tell what a file or folder another Form app wrote is (a GoF folder from FormSculpt or FormFabric, a FormSurface export folder of maps, a FormCAD, FormSculpt or FormFabric model) and what it holds, without changing the document. + +- `item`: ['string', 'integer']; For a GoF folder: the entry's file name, id or name; the newest entry meant for FormShot (target any or formshot) when omitted. +- `path`: string; required; Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file. +- `read`: boolean; default true; Read the model too, to count meshes, triangles, materials and textures. + +Note: read-only. + +## handoff.open + +Open what another Form app handed over, as a new document or added to the current one as one undo step; every node that arrives records source.app, source.path and source.node in its metadata, and FormSurface's maps arrive as texture references by role and colour space. + +- `as`: string (new | add); default "add"; new replaces the document with a new one holding the hand-off; add puts it into the current document as one undo step. +- `frame`: boolean; Frame the camera on the scene afterwards; by default when the document had no parts before, or for a new document. +- `item`: ['string', 'integer']; For a GoF folder: the entry's file name, id or name; the newest entry meant for FormShot (target any or formshot) when omitted. +- `path`: string; required; Absolute path of the file or folder: a GoF folder (holding gof.json), a FormSurface export folder or one of its files, or a model file. + ## node.set_visible Same as scene.set_visible ({id, visible} -> {ids: [id], visible}). @@ -638,16 +741,30 @@ Same as file.new ({path?, title?, template?} unchanged). Same as file.open ({path} unchanged). -- `path`: string; required; A .fshot project or a model file +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `merge`: boolean; default false; Put everything the file holds under one group +- `name`: string; Name for the imported group (the original file name) +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; A .fshot project, or a model file (glb, gltf, obj, stl, ply, 3mf, fbx, step, stp, iges, igs) opened as a new document; the other options apply to a model only +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## document.import Same as file.import ({path, name?, options?} unchanged). -- `frame`: boolean; Frame the camera on the result (default: only when the document was empty) +- `cad_quality`: value; Tessellation quality for CAD files (STEP, IGES): a preset or {chord, angle} +- `center`: boolean; default false; Move the model's footprint centre to the origin +- `frame`: boolean; Frame the camera on the result (default: only when the document had no parts) +- `merge`: boolean; default false; Put everything the file holds under one group - `name`: string; Name for the imported group (the original file name) -- `options`: object; fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group -- `path`: string; required; Model file: glb, gltf, obj, stl or ply +- `options`: object; Clean-up details (the top-level units, up_axis, stand_on_floor and center win over unit, up_axis, stand_on_floor and centre here); fields centre, detect_instances, generate_normals, smoothing_angle_deg, stand_on_floor, unit, up_axis, weld, wrap_in_group +- `path`: string; required; Model file: glb, gltf, obj, stl, ply, 3mf, fbx, or step, stp, iges, igs through the CAD worker +- `stand_on_floor`: boolean; default true; Lift the model so its lowest point rests at height 0 +- `units`: string (auto | mm | cm | m | in | ft); Unit the file is in; auto takes what the file declares, else a guess from its size +- `up_axis`: string (auto | y | z); Axis that points up in the file; auto takes what the file declares, else y ## document.save diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2384a0..56693343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,37 @@ Versions follow `v*.*.*` with dots. Dates are UTC. FormShot has not been released; these versions exist in the repository only. +## 0.5.0 · 2026-12-02 + +Models come in more ways: 3MF, FBX, STEP and IGES, in the background with a sheet that shows what a file holds, and from the other Form apps. + +### Added + +- 3MF and FBX import (FBX in the desktop engine), alongside glTF, GLB, OBJ, STL and PLY. Polygons are ear-clipped, groups in OBJ files become nodes, STL facet colours become vertex colours, and tangents are made for meshes with texture coordinates. +- Repeated parts are found also when they are rotated or mirrored copies, and share one mesh. +- `file.import` takes `units`, `up_axis`, `stand_on_floor`, `center`, `frame`, `merge` and `cad_quality`; older calls keep working. A guessed unit now comes with a confidence. +- `import.probe` tells what a file holds without changing the document. +- `import.start`, `import.status` and `import.cancel` run an import in the background with its stage and progress; a cancelled import leaves the document exactly as it was, a finished one is one undo step, and a job started before another document was opened reports stale and changes nothing. +- `file.reimport` reads changed files again: parts keep their material, position and identity, new parts arrive and missing ones are hidden. +- Imported parts remember their file and where they sat in it (`source.path`, `source.node`). +- STEP and IGES through FormCAD's kernel worker: assemblies, colours (also STEP face colours and IGES solid colours read from the file) and shared parts at draft, medium, high, ultra or a custom quality. The source file is kept inside the project and the crash journal. +- `./formshot cad fetch` and Preferences > CAD Import download the CAD worker and check every file against a pinned record; `cad.status` says whether it is installed and what it can report. +- `scene.retessellate` rebuilds CAD parts at another quality, and the new `scene.set_part_mesh` swaps a part's mesh, so parts keep their ids, materials and selection. Scene > Retessellate opens a dialog for it. +- Hand-offs from the Form apps: what FormSculpt and FormFabric send through their GoF folder, FormSurface's painted maps and FormCAD's models are picked up while the window is open and offered for the person's answer first (decline, open once, always allow that app). `handoff.inspect` and `handoff.open` serve the window and agents. +- The import sheet (Mod+I, drops on the viewport and on Home): the file's size, counts and unit, the options, progress and Cancel, Import All for several files, File > Reimport and Recent Imports. Browser uploads go to `POST /api/imports` and are removed after a day without changes. +- Files given to the desktop app open: a project opens, models (now also 3MF, FBX, STEP and IGES) go to the import sheet. +- The command line takes import options on `render`, `convert` and `info`, and gains `probe` and `reimport`. +- The import sheet, the hand-off prompts and settings, and the CAD settings and dialog are translated into the 23 interface languages. + +### Checked + +- 94 files (3MF Consortium samples, Khronos glTF samples, the ufbx test files and our own) imported, and over 40,000 damaged copies gave errors, never a crash. +- Ten models with two option sets each imported, saved, reopened and saved again with identical documents. +- A 1.8 million triangle OBJ was cancelled at 23 % with the document unchanged. +- STEP and IGES ran with the real worker on Linux x86_64: a gearbox at four qualities, retessellation from draft to ultra with every part id kept, re-import of a changed file, cancel and timeout with no worker left running, and recovery after a crash with the source file deleted. The worker itself reports no progress within a file, no per-face colours and no assembly transforms. +- Hand-offs ran with real exports from FormSculpt, FormFabric and FormCAD and with FormSurface folders written by hand, through the engine and the window's prompt in headless Chrome. +- Not run: macOS and Windows, the Tauri desktop build (the open panel, native drops and launch opens ran against a stub only), and a live FormSurface export. + ## 0.4.0 · 2026-12-02 The viewport is live: you can see the scene in four modes, pick and move parts in it, and keep a path-traced picture refining while you work. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1ad19a8..702c8f8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Thank you for helping. FormShot is the Form family's 3D product renderer: open a model, dress its parts in materials, light it and render it in one window, with no account, -running on your own computer, and open to agents over MCP. It is at 0.4.0 and not +running on your own computer, and open to agents over MCP. It is at 0.5.0 and not released yet, so the most useful help now is careful use and clear reports. ## Where to start diff --git a/NOTICE.md b/NOTICE.md index 5ec2cd9a..497cea1d 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -4,7 +4,7 @@ FormShot is licensed under the Apache License 2.0 (see `LICENSE`). Copyright 202 This file is the human list: what each component is and why it is there. `THIRD-PARTY-NOTICES.txt` lists every package that ships with its version and licence; `./formshot notices` replaces it with the full licence texts (copyright lines, conditions and disclaimers) from the installed Python packages, `frontend/package-lock.json`, `native/Cargo.lock`, `src-tauri/Cargo.lock` and the cargo registry, and `./formshot notices --check` checks it covers what ships. It ships in every installer beside this file, is frozen into the service, and is shown in Preferences under About. -FormShot 0.4.0 is unreleased. Licences marked "to confirm" below were not read from package metadata on the machine that wrote this file, and are confirmed when the lock files are complete and `./formshot notices` runs. +FormShot 0.5.0 is unreleased. Licences marked "to confirm" below were not read from package metadata on the machine that wrote this file, and are confirmed when the lock files are complete and `./formshot notices` runs. ## Included in this repository diff --git a/README.md b/README.md index 49a082fd..485a2d24 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

      - version 0.4.0 + version 0.5.0 Rust TypeScript macOS, Windows, Linux @@ -65,7 +65,7 @@ ## Features -FormShot is at 0.4.0 and has not been released. This is what exists in the repository today: +FormShot is at 0.5.0 and has not been released. This is what exists in the repository today: - **The window.** Home with recent projects, four starting templates and a Trash you can restore from; the workspace with the live viewport, a material library panel, an inspector (Scene, Camera, Environment, Image and more) and a status bar; menus, a command palette, Preferences with a shortcut editor, 29 themes and the interface in English and 23 more languages. - **The live viewport.** Rendered, Material preview, Solid and Wireframe modes (the last three drawn in the window with WebGL2); click and box selection with a selection outline; a move, rotate and scale gizmo in world or local space with snapping; navigation presets for mouse, trackpad and touch; Frame Selection, Frame All, the six views and composition guides; light and camera outlines. While you move the camera the path tracer drops to fast low-resolution passes and climbs back to full resolution when you stop. A chip says what is drawing, on which device, and why the window is not drawing itself when it is not; the island menu picks the device, the viewport quality and adaptive sampling. @@ -108,7 +108,7 @@ The output names the device that drew the picture, and adds a `note:` line when
      -

      Today (0.4.0)

      +

      Today (0.5.0)

      Home and projects · Scene tree · Camera, environment and image settings · CPU path tracer · GPU path tracer · Live viewport with raster modes, selection and gizmo · Region render on the GPU · Device choice and bench · Develop and tone maps · .fshot projects · Crash recovery commands · Command line render · MCP · Agent dock
      @@ -172,7 +172,7 @@ cd formshot Render from the command line with `./formshot render model.glb out.png --samples 256` (also `--width`, `--height`, `--threads`, `--seed`, `--denoise` and `--device`). `./formshot engine wasm` builds the optional in-window engine; the window works without it. `./formshot desktop dev` opens the desktop window instead, after `./formshot install-desktop`. On Windows use `formshot_oc_install.bat` and `formshot.bat`. `FORMSHOT_DATA` moves the data folder and `FORMSHOT_PROJECTS` the projects folder (`~/Documents/FormShot` by default). > [!IMPORTANT] -> **Status:** pre-release. FormShot 0.4.0 has the shell, the document and project file, the CPU and GPU path tracers, the live viewport with region render on the GPU, and the command line render. It has not been built or tested as a desktop app on any platform yet, and GPU rendering has run only on software drivers (see [Known limits](#known-limits)). See [`CHANGELOG.md`](CHANGELOG.md). +> **Status:** pre-release. FormShot 0.5.0 has the shell, the document and project file, the CPU and GPU path tracers, the live viewport with region render on the GPU, and the command line render. It has not been built or tested as a desktop app on any platform yet, and GPU rendering has run only on software drivers (see [Known limits](#known-limits)). See [`CHANGELOG.md`](CHANGELOG.md). **Contributing:** branch from `main`, keep changes to source here, and leave packaging and releases to FormCompiler. See [`CONTRIBUTING.md`](CONTRIBUTING.md), [`.docs/BRANCHING.md`](.docs/BRANCHING.md) and [`AGENTS.md`](AGENTS.md). diff --git a/SECURITY.md b/SECURITY.md index 5512da63..d21e5a7c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ FormShot has not been released yet. Until the first release, security fixes go i | Version | Supported | | --- | --- | -| `main` (0.4.0, unreleased) | Yes | +| `main` (0.5.0, unreleased) | Yes | | Anything older | No | ## Reporting a vulnerability diff --git a/VERSION b/VERSION index 1d0ba9ea..8f0916f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.5.0 diff --git a/agents/manifest.json b/agents/manifest.json index 393c207f..5762c184 100644 --- a/agents/manifest.json +++ b/agents/manifest.json @@ -18,6 +18,7 @@ "scene.set_part_colour", "scene.set_metadata", "scene.set_pivot", + "scene.set_part_mesh", "scene.set_light", "scene.set_cutaway", "scene.reparent", @@ -81,6 +82,15 @@ "scene.meshes", "scene.mesh_data", "view.frame", + "import.probe", + "import.start", + "import.status", + "import.cancel", + "file.reimport", + "cad.status", + "scene.retessellate", + "handoff.inspect", + "handoff.open", "node.set_visible", "node.set_locked", "node.rename", @@ -105,7 +115,11 @@ "view.bounds", "view.pick", "scene.meshes", - "scene.mesh_data" + "scene.mesh_data", + "import.probe", + "import.status", + "cad.status", + "handoff.inspect" ], "approval_gated": [ "scene.add_group", @@ -122,6 +136,7 @@ "scene.set_part_colour", "scene.set_metadata", "scene.set_pivot", + "scene.set_part_mesh", "scene.set_light", "scene.set_cutaway", "scene.reparent", @@ -173,6 +188,11 @@ "render.region", "render.viewport", "view.frame", + "import.start", + "import.cancel", + "file.reimport", + "scene.retessellate", + "handoff.open", "node.set_visible", "node.set_locked", "node.rename", diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 19993a75..538792e8 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1,6 +1,6 @@ # backend HASHOUT_LOG -Living log for the service side, _v0.4.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. +Living log for the service side, _v0.5.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. ## Org-navi-map @@ -12,7 +12,7 @@ backend/ requirements.txt fastapi 0.143.0, uvicorn 0.54.0, websockets 17.2, ptyprocess 0.7.0 / pywinpty 3.0.5 requirements_macos.txt the same without the Windows terminal package requirements_desktop.txt pyinstaller 6.16.0 - app/__init__.py __version__ = "0.4.0", the single version source + app/__init__.py __version__ = "0.5.0", the single version source app/main.py the app: middleware, /api/health, /api/agent, /api/live, static frontend fallback app/startup.py engine lock, shell watch, stand-alone refusal app/local_guard.py Host and Origin guard diff --git a/backend/app/__init__.py b/backend/app/__init__.py index 6a9beea8..3d187266 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -1 +1 @@ -__version__ = "0.4.0" +__version__ = "0.5.0" diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index d064bfae..bc924e8d 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -26,7 +26,7 @@ Conventions everywhere in the engine: right-handed, Y up, metres, radians, colou ## The engine crates -All crates live in `native/crates/`, edition 2021, Apache-2.0, version 0.4.0. `fsh-py` and `fsh-wasm` are outside the workspace's default members, so a plain `cargo build` does not need Python or the wasm target; `fsh-render-gpu` is a default member, so a plain build compiles wgpu. +All crates live in `native/crates/`, edition 2021, Apache-2.0, version 0.5.0. `fsh-py` and `fsh-wasm` are outside the workspace's default members, so a plain `cargo build` does not need Python or the wasm target; `fsh-render-gpu` is a default member, so a plain build compiles wgpu. | Crate | Holds | Depends on | | --- | --- | --- | diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index e426b513..57fe423a 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,6 +1,6 @@ # frontend HASHOUT_LOG -Living log for the window side, _v0.4.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. +Living log for the window side, _v0.5.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. ## Org-navi-map @@ -9,7 +9,7 @@ frontend/ index.html the frame: every slot with a fixed id, pre-paint theme, accent, layout, dock and motion script public/splash.html the desktop splash window's page, copied into dist/ by vite build vite.config.ts host false, dev 5300 and preview 5301 strictPort, /api proxied to 127.0.0.1:8300 with ws - package.json, package-lock.json version 0.4.0, the family's pinned set, no icon libraries, no three.js + package.json, package-lock.json version 0.5.0, the family's pinned set, no icon libraries, no three.js public/formshot-logo.svg hand-drawn mark (hexagon with lens), the favicon src/main.ts boot order: window key, language, shell, modules, translator, reveal, events src/version.ts VERSION, a version site diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d388543d..6e12fe11 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "formshot", - "version": "0.4.0", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formshot", - "version": "0.4.0", + "version": "0.5.0", "license": "Apache-2.0", "dependencies": { "@fontsource/inter": "5.3.0", diff --git a/frontend/package.json b/frontend/package.json index 3bb21640..2488e610 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "formshot", - "version": "0.4.0", + "version": "0.5.0", "private": true, "description": "FormShot product renderer", "license": "Apache-2.0", diff --git a/frontend/src/version.ts b/frontend/src/version.ts index 465e390c..243bfad8 100644 --- a/frontend/src/version.ts +++ b/frontend/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.4.0'; +export const VERSION = '0.5.0'; diff --git a/native/Cargo.lock b/native/Cargo.lock index efd79c44..fb7f6844 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -218,7 +218,7 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "fsh-accel" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-core", "rayon", @@ -226,7 +226,7 @@ dependencies = [ [[package]] name = "fsh-cad" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-core", "fsh-io", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "fsh-cli" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-commands", "fsh-io", @@ -244,7 +244,7 @@ dependencies = [ [[package]] name = "fsh-commands" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-accel", "fsh-cad", @@ -260,11 +260,11 @@ dependencies = [ [[package]] name = "fsh-core" -version = "0.4.0" +version = "0.5.0" [[package]] name = "fsh-format" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-core", "fsh-scene", @@ -274,7 +274,7 @@ dependencies = [ [[package]] name = "fsh-io" -version = "0.4.0" +version = "0.5.0" dependencies = [ "bevy_mikktspace", "fsh-core", @@ -286,14 +286,14 @@ dependencies = [ [[package]] name = "fsh-materials" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-core", ] [[package]] name = "fsh-py" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-commands", "pyo3", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "fsh-render-cpu" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-accel", "fsh-core", @@ -312,7 +312,7 @@ dependencies = [ [[package]] name = "fsh-render-gpu" -version = "0.4.0" +version = "0.5.0" dependencies = [ "bytemuck", "fsh-accel", @@ -327,7 +327,7 @@ dependencies = [ [[package]] name = "fsh-scene" -version = "0.4.0" +version = "0.5.0" dependencies = [ "fsh-core", "serde", @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "fsh-wasm" -version = "0.4.0" +version = "0.5.0" dependencies = [ "bytemuck", "fsh-commands", diff --git a/native/HASHOUT_LOG.md b/native/HASHOUT_LOG.md index b667e054..3a0a93bd 100644 --- a/native/HASHOUT_LOG.md +++ b/native/HASHOUT_LOG.md @@ -1,6 +1,6 @@ # native HASHOUT_LOG -Living log for the Rust engine side, _v0.4.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. Entries are appended to their crate's section as each part lands; the GPU engine's entries (fsh-render-gpu, last) carry the buffer layout contract, the WGSL module map and the recipe for running it on software Vulkan, GL and WebGPU, and docs/GPU-ENGINE.md restates them as tables. +Living log for the Rust engine side, _v0.5.0. Read the map and the TOC first; entries are anchored by file and symbol, and removed code is quoted in full. Entries are appended to their crate's section as each part lands; the GPU engine's entries (fsh-render-gpu, last) carry the buffer layout contract, the WGSL module map and the recipe for running it on software Vulkan, GL and WebGPU, and docs/GPU-ENGINE.md restates them as tables. ## Org-navi-map diff --git a/native/crates/fsh-accel/Cargo.toml b/native/crates/fsh-accel/Cargo.toml index 92a0cc72..0e88ad74 100644 --- a/native/crates/fsh-accel/Cargo.toml +++ b/native/crates/fsh-accel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-accel" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-cad/Cargo.toml b/native/crates/fsh-cad/Cargo.toml index 4c1ac88d..6f1b7de5 100644 --- a/native/crates/fsh-cad/Cargo.toml +++ b/native/crates/fsh-cad/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-cad" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-cli/Cargo.toml b/native/crates/fsh-cli/Cargo.toml index 1b7d435f..1b63d00c 100644 --- a/native/crates/fsh-cli/Cargo.toml +++ b/native/crates/fsh-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-cli" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-cli/src/main.rs b/native/crates/fsh-cli/src/main.rs index 4983ad93..1b91e8bf 100644 --- a/native/crates/fsh-cli/src/main.rs +++ b/native/crates/fsh-cli/src/main.rs @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; use std::process::ExitCode; use std::time::Instant; -const USAGE: &str = "formshot-engine 0.4.0, the FormShot engine +const USAGE: &str = "formshot-engine 0.5.0, the FormShot engine Usage: formshot-engine render [options] diff --git a/native/crates/fsh-commands/Cargo.toml b/native/crates/fsh-commands/Cargo.toml index c08563d3..96d9048d 100644 --- a/native/crates/fsh-commands/Cargo.toml +++ b/native/crates/fsh-commands/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-commands" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-core/Cargo.toml b/native/crates/fsh-core/Cargo.toml index 70558b69..d9ea05b6 100644 --- a/native/crates/fsh-core/Cargo.toml +++ b/native/crates/fsh-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-core" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-format/Cargo.toml b/native/crates/fsh-format/Cargo.toml index 6c263e87..77b9b7fb 100644 --- a/native/crates/fsh-format/Cargo.toml +++ b/native/crates/fsh-format/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-format" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-io/Cargo.toml b/native/crates/fsh-io/Cargo.toml index 05d029dd..2e618d45 100644 --- a/native/crates/fsh-io/Cargo.toml +++ b/native/crates/fsh-io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-io" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-materials/Cargo.toml b/native/crates/fsh-materials/Cargo.toml index ff2f94b2..99621225 100644 --- a/native/crates/fsh-materials/Cargo.toml +++ b/native/crates/fsh-materials/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-materials" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-py/Cargo.toml b/native/crates/fsh-py/Cargo.toml index f2600a3e..43cc818e 100644 --- a/native/crates/fsh-py/Cargo.toml +++ b/native/crates/fsh-py/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-py" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-py/pyproject.toml b/native/crates/fsh-py/pyproject.toml index 0555f980..3f306362 100644 --- a/native/crates/fsh-py/pyproject.toml +++ b/native/crates/fsh-py/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "fsh-py" -version = "0.4.0" +version = "0.5.0" description = "FormShot engine binding: the command catalogue and an engine session" license = { text = "Apache-2.0" } requires-python = ">=3.9" diff --git a/native/crates/fsh-render-cpu/Cargo.toml b/native/crates/fsh-render-cpu/Cargo.toml index 049a3ca0..052b2f1b 100644 --- a/native/crates/fsh-render-cpu/Cargo.toml +++ b/native/crates/fsh-render-cpu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-render-cpu" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-render-gpu/Cargo.toml b/native/crates/fsh-render-gpu/Cargo.toml index ac8e1670..918a6c26 100644 --- a/native/crates/fsh-render-gpu/Cargo.toml +++ b/native/crates/fsh-render-gpu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-render-gpu" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-scene/Cargo.toml b/native/crates/fsh-scene/Cargo.toml index ce6cd4b1..12a89a9a 100644 --- a/native/crates/fsh-scene/Cargo.toml +++ b/native/crates/fsh-scene/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-scene" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/native/crates/fsh-wasm/Cargo.toml b/native/crates/fsh-wasm/Cargo.toml index 8567cbd8..fd2d74f5 100644 --- a/native/crates/fsh-wasm/Cargo.toml +++ b/native/crates/fsh-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fsh-wasm" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "Apache-2.0" publish = false diff --git a/setup/HASHOUT_LOG.md b/setup/HASHOUT_LOG.md index 4023b21b..ef9d795a 100644 --- a/setup/HASHOUT_LOG.md +++ b/setup/HASHOUT_LOG.md @@ -1,6 +1,6 @@ # setup HASHOUT_LOG -Living log for the launcher, the setup suite and the root configuration, _v0.4.0. Entries are anchored by file and symbol, and removed code is quoted in full. +Living log for the launcher, the setup suite and the root configuration, _v0.5.0. Entries are anchored by file and symbol, and removed code is quoted in full. ## Org-navi-map @@ -112,7 +112,7 @@ Extract writes `frontend/src/i18n/strings.json`; check reads `locales/.jso - refers-to: VERSION; rust-toolchain.toml; .editorconfig; .gitattributes; .gitignore; .mcp.json - kind: rationale - logged: v0.2.0 · 2026-12-02 -`VERSION` 0.4.0. rust-toolchain.toml pins 1.99.1 with clippy, rustfmt, wasm32-unknown-unknown, profile minimal. The family's .editorconfig (plus 4-space .rs), .gitattributes and .gitignore (plus frontend/src/engine/pkg/). `.mcp.json` names the project server `formshot` as `${CLAUDE_PROJECT_DIR:-.}/formshot mcp`. +`VERSION` 0.5.0. rust-toolchain.toml pins 1.99.1 with clippy, rustfmt, wasm32-unknown-unknown, profile minimal. The family's .editorconfig (plus 4-space .rs), .gitattributes and .gitignore (plus frontend/src/engine/pkg/). `.mcp.json` names the project server `formshot` as `${CLAUDE_PROJECT_DIR:-.}/formshot mcp`. ### .github/workflows/ci.yml · checks without tests - refers-to: .github/workflows/ci.yml :: frontend, engine, backend, desktop-shell, scripts diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 3cb541c8..032fdeaf 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1053,7 +1053,7 @@ dependencies = [ [[package]] name = "formshot" -version = "0.4.0" +version = "0.5.0" dependencies = [ "objc2", "objc2-app-kit", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 26d86663..ec01b320 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formshot" -version = "0.4.0" +version = "0.5.0" description = "FormShot desktop shell" authors = ["NodeAgentc, Inc."] license = "Apache-2.0" diff --git a/src-tauri/HASHOUT_LOG.md b/src-tauri/HASHOUT_LOG.md index ea25273e..77dd4f71 100644 --- a/src-tauri/HASHOUT_LOG.md +++ b/src-tauri/HASHOUT_LOG.md @@ -1,12 +1,12 @@ # src-tauri HASHOUT_LOG -Living log for the desktop shell and its service start, _v0.4.0. Entries are anchored by file and symbol, and removed code is quoted in full. +Living log for the desktop shell and its service start, _v0.5.0. Entries are anchored by file and symbol, and removed code is quoted in full. ## Org-navi-map ```text src-tauri/ - Cargo.toml crate formshot 0.4.0: tauri 2 (macos-private-api), shell, dialog, updater, + Cargo.toml crate formshot 0.5.0: tauri 2 (macos-private-api), shell, dialog, updater, single-instance plugins, regex, serde, serde_json; windows-sys; objc2 build.rs the eight app commands for tauri-build's allow- permissions tauri.conf.json FormShot, ai.nodemode.formshot, devUrl 5300, splash window, sidecar, .fshot, updater diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d9c0ce7d..aa3bbf32 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "FormShot", - "version": "0.4.0", + "version": "0.5.0", "identifier": "ai.nodemode.formshot", "build": { "devUrl": "http://localhost:5300", From 142d84df768a099ad7d4f79cfc28e98c644dffcb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:57:17 -0500 Subject: [PATCH 154/494] docs(library): describe the material preset format and its sources Adds the library folder's README: layout, preset fields, colour space and units, the data sources with their licences, and how measured numbers were turned into parameters. Not run. --- assets/library/README.md | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 assets/library/README.md diff --git a/assets/library/README.md b/assets/library/README.md new file mode 100644 index 00000000..d5291817 --- /dev/null +++ b/assets/library/README.md @@ -0,0 +1,45 @@ +# FormShot material library + +Material presets for the Library window. Every preset here is our own work, written from public physical data, and is licensed with the rest of FormShot under Apache-2.0 (each file says so in its `licence` field). No preset, name or description comes from another renderer's library. + +## Layout + +- `materials//.json`: one preset per file. Categories, in the window's order: Metal, Plastic, Glass, Paint, Rubber, Fabric, Wood, Stone, Ceramic, Liquid, Gem, Emissive. The folder is the category in lower case. +- `materials/index.json`: every preset with its id, name, category, type, tags, file and the SHA-256 of the file. + +## Preset format (version 1) + +``` +{format: "formshot-material-preset", version: 1, id, name, category, type, params, tags, source, licence} +``` + +- `id` is `/`, stable for good: favourites, thumbnails and documents refer to it. +- `type` is a material type id (`metal`, `metal_brushed`, `plastic`, `plastic_clear`, `paint`, `paint_metallic`, `glass`, `glass_thin`, `liquid`, `gem`, `rubber`, `fabric`, `ceramic`, `diffuse`, `emissive`, `wood`, `stone`, `generic`). +- `params` uses the field names of the engine's surface model (`SurfaceParams` in fsh-scene, which follows the OpenPBR Surface parameter names). Applying a preset starts from the type's defaults and sets every key in `params`. Version 1 presets store the full value of every field that defines their look. +- Colours are scene-linear ACEScg, the engine's working space. Lengths are metres, except `thin_film_thickness` in micrometres. `emission_luminance` is in nits (cd/m2) and `emission_color` is normalised to luminance 1, so the number is the surface's luminance. +- `source` says where each number came from: `kind` is `measured`, `published` or `authored`; `reference` and `urls` cite the data; `notes` explains derivations and the reasoning behind authored values; `authored` lists the parameters we chose ourselves (roughness of a finish, the colour of a dyed plastic) when the rest of the preset is measured or published. + +## Sources and licences + +| Source | Used for | Licence | +| --- | --- | --- | +| refractiveindex.info database, M. N. Polyanskiy, Sci. Data 11, 94 (2024), https://github.com/polyanskiy/refractiveindex.info-database (commit e6d15e364f70de1cad8a96a20f75689f2fba8b21) | Complex refractive index n and k of metals and alloys; refractive index and dispersion of glasses, polymers, liquids and crystals; absorption of water and window glasses | CC0 1.0 | +| CIE 1931 2 degree colour matching functions and CIE illuminant D65, as tabulated in the colour-science Python package (BSD-3-Clause), https://github.com/colour-science/colour | Turning spectra into colours (used only by the conversion, not stored) | CIE standard data; package BSD-3-Clause | +| USDA AMS, Sucrose Conversion Table, Technical Procedures Manual Appendix XV, https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf | Refractive index of sugar solutions (juices, syrups, soft drinks) | US federal government work | +| Museum of Fine Arts Boston, CAMEO, Gemstone properties table, https://cameo.mfa.org/wiki/Gemstone | Refractive index and dispersion of gems without n data in the database | Facts cited, nothing copied | +| GIA Gem Encyclopedia, emerald facts, https://www.gia.edu/emerald/gem-overview | Emerald refractive index | Facts cited, nothing copied | +| Orders of magnitude (luminance), https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance | Luminance of displays and lamps | Facts cited, nothing copied | + +Only numbers are taken from these sources; the presets, names and notes are ours. + +## How the numbers were made + +- Metals: the base colour is the normal-incidence Fresnel reflectance of the measured n and k, and the edge tint (`specular_color`) is the F82 tint of the OpenPBR metal model: the ratio of the true reflectance at 82 degrees (cosine 1/7) to the Schlick curve through the base colour. Each reflectance spectrum (380 to 780 nm, 5 nm steps) is integrated against the CIE 1931 colour matching functions under D65, normalised so a perfect reflector is white, converted to linear sRGB and then to ACEScg with the engine's matrix. The fitted F0 and tint reproduce the true reflectance at every angle to within 0.04 (most metals within 0.02). +- Dielectrics: `specular_ior` is n at 587.6 nm; the Abbe number is (nd - 1) / (nF - nC) at 587.6, 486.1 and 656.3 nm. For gems quoted with a B-G dispersion (nG - nB), the Abbe number uses nF - nC = 0.5845 (nG - nB), which follows from Cauchy's two-term formula. +- Absorbing transparent materials (water, window glasses): `transmission_color` is the Beer-Lambert transmittance exp(-4 pi k d / lambda) at `transmission_depth` d, integrated to a colour like the metals. +- Emitters: `emission_color` is the colour of a blackbody at the lamp's colour temperature, or of the emission line, normalised to luminance 1. +- Authored values (finish roughness, dye and pigment colours, coat settings) are recorded in each preset's `source.authored` and explained in `source.notes`; authored colours give the 8-bit sRGB value they were picked as. + +## Adding a preset + +Write the file by hand in the format above, add its entry to `materials/index.json` (keep the order: category, then name) with the file's SHA-256, and keep the whole library under 2 MB. Cite every measured or published number; list every chosen one in `authored`. From 87536e2ea134606135905153f5791f69f29ce549 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:58:42 -0500 Subject: [PATCH 155/494] feat(library): add polished pure metal presets from measured n and k Twenty-three pure metals whose base colour and F82 edge tint were computed from refractiveindex.info n and k spectra under D65. Ran the library validator: every file parses and every value is in range. --- .../materials/metal/aluminium-polished.json | 23 +++++++++++++++++++ .../materials/metal/beryllium-polished.json | 23 +++++++++++++++++++ .../materials/metal/bismuth-polished.json | 23 +++++++++++++++++++ .../materials/metal/chromium-polished.json | 23 +++++++++++++++++++ .../materials/metal/cobalt-polished.json | 23 +++++++++++++++++++ .../materials/metal/copper-polished.json | 23 +++++++++++++++++++ .../materials/metal/gold-polished.json | 23 +++++++++++++++++++ .../materials/metal/iridium-polished.json | 23 +++++++++++++++++++ .../materials/metal/iron-polished.json | 23 +++++++++++++++++++ .../materials/metal/lead-polished.json | 23 +++++++++++++++++++ .../materials/metal/magnesium-polished.json | 23 +++++++++++++++++++ .../materials/metal/mercury-polished.json | 23 +++++++++++++++++++ .../materials/metal/molybdenum-polished.json | 23 +++++++++++++++++++ .../materials/metal/nickel-polished.json | 23 +++++++++++++++++++ .../materials/metal/niobium-polished.json | 23 +++++++++++++++++++ .../materials/metal/palladium-polished.json | 23 +++++++++++++++++++ .../materials/metal/platinum-polished.json | 23 +++++++++++++++++++ .../materials/metal/rhodium-polished.json | 23 +++++++++++++++++++ .../materials/metal/silver-polished.json | 23 +++++++++++++++++++ .../materials/metal/titanium-polished.json | 23 +++++++++++++++++++ .../materials/metal/tungsten-polished.json | 23 +++++++++++++++++++ .../materials/metal/vanadium-polished.json | 23 +++++++++++++++++++ .../materials/metal/zinc-polished.json | 23 +++++++++++++++++++ 23 files changed, 529 insertions(+) create mode 100644 assets/library/materials/metal/aluminium-polished.json create mode 100644 assets/library/materials/metal/beryllium-polished.json create mode 100644 assets/library/materials/metal/bismuth-polished.json create mode 100644 assets/library/materials/metal/chromium-polished.json create mode 100644 assets/library/materials/metal/cobalt-polished.json create mode 100644 assets/library/materials/metal/copper-polished.json create mode 100644 assets/library/materials/metal/gold-polished.json create mode 100644 assets/library/materials/metal/iridium-polished.json create mode 100644 assets/library/materials/metal/iron-polished.json create mode 100644 assets/library/materials/metal/lead-polished.json create mode 100644 assets/library/materials/metal/magnesium-polished.json create mode 100644 assets/library/materials/metal/mercury-polished.json create mode 100644 assets/library/materials/metal/molybdenum-polished.json create mode 100644 assets/library/materials/metal/nickel-polished.json create mode 100644 assets/library/materials/metal/niobium-polished.json create mode 100644 assets/library/materials/metal/palladium-polished.json create mode 100644 assets/library/materials/metal/platinum-polished.json create mode 100644 assets/library/materials/metal/rhodium-polished.json create mode 100644 assets/library/materials/metal/silver-polished.json create mode 100644 assets/library/materials/metal/titanium-polished.json create mode 100644 assets/library/materials/metal/tungsten-polished.json create mode 100644 assets/library/materials/metal/vanadium-polished.json create mode 100644 assets/library/materials/metal/zinc-polished.json diff --git a/assets/library/materials/metal/aluminium-polished.json b/assets/library/materials/metal/aluminium-polished.json new file mode 100644 index 00000000..46eb6f95 --- /dev/null +++ b/assets/library/materials/metal/aluminium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-polished", + "name": "Aluminium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0067 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/beryllium-polished.json b/assets/library/materials/metal/beryllium-polished.json new file mode 100644 index 00000000..f1b65b82 --- /dev/null +++ b/assets/library/materials/metal/beryllium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/beryllium-polished", + "name": "Beryllium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5373, 0.5357, 0.5355], + "base_metalness": 1.0, + "specular_color": [0.7323, 0.7356, 0.752], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "A. D. Rakić, A. B. Djurišic, J. M. Elazar, M. L. Majewski. Optical properties of metallic films for vertical-cavity optoelectronic devices. Appl. Opt. 37, 5271-5283 (1998) [Calculation script (Python)]; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Be/nk/Rakic-LD.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0273 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/bismuth-polished.json b/assets/library/materials/metal/bismuth-polished.json new file mode 100644 index 00000000..7183c223 --- /dev/null +++ b/assets/library/materials/metal/bismuth-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/bismuth-polished", + "name": "Bismuth, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5471, 0.5319, 0.4915], + "base_metalness": 1.0, + "specular_color": [0.8263, 0.8447, 0.8943], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "H.-J. Hagemann, W. Gudat, C. Kunz. Optical constants from the far infrared to the x-ray region: Mg, Al, Cu, Ag, Au, Bi, C, and Al2O3. J. Opt. Soc. Am. 65, 742-744 (1975); H.-J. Hagemann, W. Gudat, and C. Kunz. DESY report SR-74/7 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Bi/nk/Hagemann.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0077 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/chromium-polished.json b/assets/library/materials/metal/chromium-polished.json new file mode 100644 index 00000000..735abec6 --- /dev/null +++ b/assets/library/materials/metal/chromium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/chromium-polished", + "name": "Chromium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6457, 0.6498, 0.6538], + "base_metalness": 1.0, + "specular_color": [0.7404, 0.7584, 0.8073], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "automotive", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "A. D. Rakić, A. B. Djurišic, J. M. Elazar, M. L. Majewski. Optical properties of metallic films for vertical-cavity optoelectronic devices. Appl. Opt. 37, 5271-5283 (1998) [Calculation script (Python)]; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cr/nk/Rakic-LD.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0273 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/cobalt-polished.json b/assets/library/materials/metal/cobalt-polished.json new file mode 100644 index 00000000..78de9fab --- /dev/null +++ b/assets/library/materials/metal/cobalt-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/cobalt-polished", + "name": "Cobalt, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6704, 0.6566, 0.6217], + "base_metalness": 1.0, + "specular_color": [0.8087, 0.8187, 0.8531], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Co/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0125 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/copper-polished.json b/assets/library/materials/metal/copper-polished.json new file mode 100644 index 00000000..216426cb --- /dev/null +++ b/assets/library/materials/metal/copper-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/copper-polished", + "name": "Copper, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9015, 0.7108, 0.5855], + "base_metalness": 1.0, + "specular_color": [0.9872, 0.9665, 0.9613], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "orange", "kitchen", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cu/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0074 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gold-polished.json b/assets/library/materials/metal/gold-polished.json new file mode 100644 index 00000000..80ec64fb --- /dev/null +++ b/assets/library/materials/metal/gold-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gold-polished", + "name": "Gold, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9277, 0.7966, 0.4057], + "base_metalness": 1.0, + "specular_color": [0.982, 1.0, 0.9713], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "gold", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Au/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0171 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/iridium-polished.json b/assets/library/materials/metal/iridium-polished.json new file mode 100644 index 00000000..629e14d9 --- /dev/null +++ b/assets/library/materials/metal/iridium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/iridium-polished", + "name": "Iridium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.7384, 0.7323, 0.7049], + "base_metalness": 1.0, + "specular_color": [0.7653, 0.7763, 0.8018], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. Schmitt, N. Felde, T. Doehring, M. Stollenwerk, I. Uschmann, K. Hanemann, M. Siegler, G. Klemm, N. Gratzke, A. Tuennermann, S. Schwinde, S. Schroeder, A. Szeghalmi. Optical, structural, and functional properties of highly reflective and stable iridium mirror coatings for infrared applications. Opt. Mater. Express 12, 545-559 (2022) (See supplementary materials. High-resolution data kindly provided by Paul Schmitt.); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ir/nk/Schmitt-MS.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0268 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/iron-polished.json b/assets/library/materials/metal/iron-polished.json new file mode 100644 index 00000000..45058005 --- /dev/null +++ b/assets/library/materials/metal/iron-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/iron-polished", + "name": "Iron, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5224, 0.5141, 0.4971], + "base_metalness": 1.0, + "specular_color": [0.7674, 0.7676, 0.797], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Fe/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0175 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/lead-polished.json b/assets/library/materials/metal/lead-polished.json new file mode 100644 index 00000000..9d1852d4 --- /dev/null +++ b/assets/library/materials/metal/lead-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/lead-polished", + "name": "Lead, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6599, 0.661, 0.6886], + "base_metalness": 1.0, + "specular_color": [0.7787, 0.7795, 0.809], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "A. G. Mathewson and H. P. Myers. Absolute values of the optical constants of some pure metals. Phys. Scr. 4, 291-292 (1971); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Pb/nk/Mathewson-298K.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0139 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/magnesium-polished.json b/assets/library/materials/metal/magnesium-polished.json new file mode 100644 index 00000000..7afcc34d --- /dev/null +++ b/assets/library/materials/metal/magnesium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/magnesium-polished", + "name": "Magnesium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.8889, 0.8825, 0.8927], + "base_metalness": 1.0, + "specular_color": [0.9049, 0.9129, 0.9437], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "K. J. Palm, J. B. Murray, T. C. Narayan, J. N. Munday. Dynamic optical properties of metal hydrides. ACS Photonics 5, 4677-4686 (2018) (Numerical data kindly provided by Kevin Palm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Mg/nk/Palm.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0096 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/mercury-polished.json b/assets/library/materials/metal/mercury-polished.json new file mode 100644 index 00000000..580f0cbf --- /dev/null +++ b/assets/library/materials/metal/mercury-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/mercury-polished", + "name": "Mercury (liquid), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.7806, 0.7796, 0.7786], + "base_metalness": 1.0, + "specular_color": [0.8304, 0.8497, 0.8948], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "T. Inagaki, E. T. Arakawa, and M. W. Williams. Optical properties of liquid mercury. Phys. Rev. B 23, 5246-5262 (1981); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Hg/nk/Inagaki.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0137 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/molybdenum-polished.json b/assets/library/materials/metal/molybdenum-polished.json new file mode 100644 index 00000000..6aacadb4 --- /dev/null +++ b/assets/library/materials/metal/molybdenum-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/molybdenum-polished", + "name": "Molybdenum, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5765, 0.5838, 0.5829], + "base_metalness": 1.0, + "specular_color": [0.7302, 0.7322, 0.7632], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "M. M. Kirillova, L. V. Nomerovannaya, M. M. Noskov. Optical properties of molybdenum single crystals , Sov. Phys. JETP 33, 1210-1214 (1971); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Mo/nk/Kirillova.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0282 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/nickel-polished.json b/assets/library/materials/metal/nickel-polished.json new file mode 100644 index 00000000..4c2086a4 --- /dev/null +++ b/assets/library/materials/metal/nickel-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/nickel-polished", + "name": "Nickel, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6715, 0.6434, 0.5745], + "base_metalness": 1.0, + "specular_color": [0.8239, 0.8332, 0.8653], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ni/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0126 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/niobium-polished.json b/assets/library/materials/metal/niobium-polished.json new file mode 100644 index 00000000..4b365782 --- /dev/null +++ b/assets/library/materials/metal/niobium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/niobium-polished", + "name": "Niobium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5027, 0.5066, 0.5017], + "base_metalness": 1.0, + "specular_color": [0.7706, 0.7692, 0.7904], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "J. H. Weaver, D. W. Lynch, C. G. Olson. Optical properties of niobium from 0.1 to 36.4 eV. Phys. Rev. B 7, 4311-4318 (1973) (Data points extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Nb/nk/Weaver.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0173 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/palladium-polished.json b/assets/library/materials/metal/palladium-polished.json new file mode 100644 index 00000000..879d1757 --- /dev/null +++ b/assets/library/materials/metal/palladium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/palladium-polished", + "name": "Palladium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.7167, 0.6988, 0.6589], + "base_metalness": 1.0, + "specular_color": [0.8409, 0.8509, 0.8818], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Pd/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0134 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/platinum-polished.json b/assets/library/materials/metal/platinum-polished.json new file mode 100644 index 00000000..4839a35e --- /dev/null +++ b/assets/library/materials/metal/platinum-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/platinum-polished", + "name": "Platinum, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6598, 0.6398, 0.5915], + "base_metalness": 1.0, + "specular_color": [0.804, 0.8172, 0.8482], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "A. D. Rakić, A. B. Djurišic, J. M. Elazar, M. L. Majewski. Optical properties of metallic films for vertical-cavity optoelectronic devices. Appl. Opt. 37, 5271-5283 (1998) [Calculation script (Python)]; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Pt/nk/Rakic-LD.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0123 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/rhodium-polished.json b/assets/library/materials/metal/rhodium-polished.json new file mode 100644 index 00000000..3f26924e --- /dev/null +++ b/assets/library/materials/metal/rhodium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/rhodium-polished", + "name": "Rhodium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.7834, 0.7665, 0.746], + "base_metalness": 1.0, + "specular_color": [0.8127, 0.8177, 0.834], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "J. H. Weaver, C. G. Olson, D. W. Lynch. Optical investigation of the electronic structure of bulk Rh and Ir. Phys. Rev. B 15, 4115 (1977); Handbook of Optical Constants of Solids, Edward D. Palik, ed. Academic Press, Boston, 1985 * Ref. 2 provides numerical values for the graphical data reported in Ref. 1; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Rh/nk/Weaver.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0129 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/silver-polished.json b/assets/library/materials/metal/silver-polished.json new file mode 100644 index 00000000..ee90e691 --- /dev/null +++ b/assets/library/materials/metal/silver-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/silver-polished", + "name": "Silver, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9886, 0.9876, 0.9803], + "base_metalness": 1.0, + "specular_color": [0.9946, 0.9955, 0.9984], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ag/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0016 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-polished.json b/assets/library/materials/metal/titanium-polished.json new file mode 100644 index 00000000..42c95ee4 --- /dev/null +++ b/assets/library/materials/metal/titanium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-polished", + "name": "Titanium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0134 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/tungsten-polished.json b/assets/library/materials/metal/tungsten-polished.json new file mode 100644 index 00000000..2a58092e --- /dev/null +++ b/assets/library/materials/metal/tungsten-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/tungsten-polished", + "name": "Tungsten, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5069, 0.4973, 0.4716], + "base_metalness": 1.0, + "specular_color": [0.7237, 0.7287, 0.742], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "J. H. Weaver, C. G. Olson, D. W. Lynch. Optical properties of crystalline tungsten. Phys. Rev. B 12, 1293-1297 (1975) (Data points extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/W/nk/Weaver.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0305 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/vanadium-polished.json b/assets/library/materials/metal/vanadium-polished.json new file mode 100644 index 00000000..f93f2642 --- /dev/null +++ b/assets/library/materials/metal/vanadium-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/vanadium-polished", + "name": "Vanadium, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.527, 0.5343, 0.5623], + "base_metalness": 1.0, + "specular_color": [0.7183, 0.7028, 0.7167], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/V/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0384 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/zinc-polished.json b/assets/library/materials/metal/zinc-polished.json new file mode 100644 index 00000000..068613a7 --- /dev/null +++ b/assets/library/materials/metal/zinc-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/zinc-polished", + "name": "Zinc, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.8229, 0.8419, 0.8612], + "base_metalness": 1.0, + "specular_color": [0.7934, 0.8294, 0.8869], + "specular_roughness": 0.04 + }, + "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "W. S. M. Werner, K. Glantschnig, C. Ambrosch-Draxl. Optical constants and inelastic electron-scattering data for 17 elemental metals. J. Phys Chem Ref. Data 38, 1013-1092 (2009); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Zn/nk/Werner-DFT.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0352 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} From 7ab172d840ef98802f54c5a74c8107e08afe010d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:58:42 -0500 Subject: [PATCH 156/494] feat(library): add polished alloy and coating metal presets Brasses, austenitic and ferritic stainless steel, gold-silver alloys and titanium nitride, coloured from measured alloy n and k data. Ran the library validator on the new files. --- .../materials/metal/brass-polished.json | 23 +++++++++++++++++++ .../materials/metal/electrum-polished.json | 23 +++++++++++++++++++ .../metal/gilding-metal-polished.json | 23 +++++++++++++++++++ .../metal/gold-silver-au60-polished.json | 23 +++++++++++++++++++ .../metal/gold-silver-au80-polished.json | 23 +++++++++++++++++++ .../materials/metal/red-brass-polished.json | 23 +++++++++++++++++++ .../stainless-steel-austenitic-polished.json | 23 +++++++++++++++++++ .../stainless-steel-ferritic-polished.json | 23 +++++++++++++++++++ .../metal/titanium-nitride-polished.json | 23 +++++++++++++++++++ 9 files changed, 207 insertions(+) create mode 100644 assets/library/materials/metal/brass-polished.json create mode 100644 assets/library/materials/metal/electrum-polished.json create mode 100644 assets/library/materials/metal/gilding-metal-polished.json create mode 100644 assets/library/materials/metal/gold-silver-au60-polished.json create mode 100644 assets/library/materials/metal/gold-silver-au80-polished.json create mode 100644 assets/library/materials/metal/red-brass-polished.json create mode 100644 assets/library/materials/metal/stainless-steel-austenitic-polished.json create mode 100644 assets/library/materials/metal/stainless-steel-ferritic-polished.json create mode 100644 assets/library/materials/metal/titanium-nitride-polished.json diff --git a/assets/library/materials/metal/brass-polished.json b/assets/library/materials/metal/brass-polished.json new file mode 100644 index 00000000..3aff3f66 --- /dev/null +++ b/assets/library/materials/metal/brass-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/brass-polished", + "name": "Brass (Cu70 Zn30), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.842, 0.7827, 0.4718], + "base_metalness": 1.0, + "specular_color": [0.9631, 0.9771, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "gold", "architectural", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "M. R. Querry. Optical constants, Contractor Report CRDC-CR-85034 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Cu-Zn/nk/Querry-Cu70Zn30.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0214 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/electrum-polished.json b/assets/library/materials/metal/electrum-polished.json new file mode 100644 index 00000000..55998758 --- /dev/null +++ b/assets/library/materials/metal/electrum-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/electrum-polished", + "name": "Electrum (Au50 Ag50), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9047, 0.896, 0.6597], + "base_metalness": 1.0, + "specular_color": [0.9732, 0.9765, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "D. Rioux, S. Vallières, S. Besner, P. Muñoz, E. Mazur, M. Meunier. An analytic model for the dielectric function of Au, Ag, and their alloys. Adv. Opt. Mater. 2, 176-182 (2014) (See Supporting information for MATLAB model); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Au-Ag/nk/Rioux-Au50Ag50.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0203 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gilding-metal-polished.json b/assets/library/materials/metal/gilding-metal-polished.json new file mode 100644 index 00000000..69e6bd11 --- /dev/null +++ b/assets/library/materials/metal/gilding-metal-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gilding-metal-polished", + "name": "Gilding metal (Cu90 Zn10), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.8544, 0.7275, 0.5016], + "base_metalness": 1.0, + "specular_color": [0.9795, 0.9921, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "orange", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "M. R. Querry. Optical constants, Contractor Report CRDC-CR-85034 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Cu-Zn/nk/Querry-Cu90Zn10.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0195 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gold-silver-au60-polished.json b/assets/library/materials/metal/gold-silver-au60-polished.json new file mode 100644 index 00000000..c3b50e53 --- /dev/null +++ b/assets/library/materials/metal/gold-silver-au60-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gold-silver-au60-polished", + "name": "Gold-silver alloy (Au60 Ag40), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.8975, 0.883, 0.5932], + "base_metalness": 1.0, + "specular_color": [0.9722, 0.9769, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "D. Rioux, S. Vallières, S. Besner, P. Muñoz, E. Mazur, M. Meunier. An analytic model for the dielectric function of Au, Ag, and their alloys. Adv. Opt. Mater. 2, 176-182 (2014) (See Supporting information for MATLAB model); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Au-Ag/nk/Rioux-Au60Ag40.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0226 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gold-silver-au80-polished.json b/assets/library/materials/metal/gold-silver-au80-polished.json new file mode 100644 index 00000000..c379890f --- /dev/null +++ b/assets/library/materials/metal/gold-silver-au80-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gold-silver-au80-polished", + "name": "Gold-silver alloy (Au80 Ag20), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9, 0.8511, 0.4819], + "base_metalness": 1.0, + "specular_color": [0.9749, 0.985, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "D. Rioux, S. Vallières, S. Besner, P. Muñoz, E. Mazur, M. Meunier. An analytic model for the dielectric function of Au, Ag, and their alloys. Adv. Opt. Mater. 2, 176-182 (2014) (See Supporting information for MATLAB model); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Au-Ag/nk/Rioux-Au80Ag20.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.022 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/red-brass-polished.json b/assets/library/materials/metal/red-brass-polished.json new file mode 100644 index 00000000..92ce9418 --- /dev/null +++ b/assets/library/materials/metal/red-brass-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/red-brass-polished", + "name": "Red brass (Cu85 Zn15), polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.8218, 0.7241, 0.4623], + "base_metalness": 1.0, + "specular_color": [0.9809, 1.0, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "orange", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "M. R. Querry. Optical constants, Contractor Report CRDC-CR-85034 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Cu-Zn/nk/Querry-Cu85Zn15.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0421 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-austenitic-polished.json b/assets/library/materials/metal/stainless-steel-austenitic-polished.json new file mode 100644 index 00000000..7b2897fd --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-austenitic-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-austenitic-polished", + "name": "Stainless steel, austenitic, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6557, 0.6405, 0.6043], + "base_metalness": 1.0, + "specular_color": [0.8039, 0.8214, 0.8632], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-austenitic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0122 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-ferritic-polished.json b/assets/library/materials/metal/stainless-steel-ferritic-polished.json new file mode 100644 index 00000000..0ca74868 --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-ferritic-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-ferritic-polished", + "name": "Stainless steel, ferritic, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5967, 0.5877, 0.5707], + "base_metalness": 1.0, + "specular_color": [0.829, 0.8451, 0.8945], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-ferritic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0103 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-nitride-polished.json b/assets/library/materials/metal/titanium-nitride-polished.json new file mode 100644 index 00000000..d2222ff8 --- /dev/null +++ b/assets/library/materials/metal/titanium-nitride-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-nitride-polished", + "name": "Titanium nitride coating, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.544, 0.4691, 0.2656], + "base_metalness": 1.0, + "specular_color": [0.9306, 0.9788, 1.0], + "specular_roughness": 0.04 + }, + "tags": ["coating", "gold", "industrial", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "J. Pflüger, J. Fink. Determination of optical constants by high-energy, electron-energy-loss spectroscopy (EELS), in Handbook of optical constants of solids II, Edward D. Palik, ed. Academic Press, 1991. pp. 293-310; J. Pflüger, J. Fink, W. Weber, K. P. Bohnen, G. Crecelius. Dielectric properties of TiCx, TiNx, VCx, and VNx from 1.5 to 40 eV determined by electron-energy-loss spectroscopy. Phys. Rev. B 30, 1155-1163 (1984); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiN/nk/Pfluger.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0405 of the exact Fresnel reflectance at every angle. Roughness authored, polished: a near-mirror reflection with a slight blur, GGX alpha 0.0016.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} From 1d40315ce56bbc13757def1f0d29483eaf23bde0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:58:52 -0500 Subject: [PATCH 157/494] feat(library): add satin, brushed and blasted metal finishes Common product metals at mirror, satin, brushed, bead blasted and as-cast finishes; measured colours, authored roughness, anisotropy 0.8 on brushed presets. Ran the library validator on all metal files. --- .../materials/metal/aluminium-as-cast.json | 23 ++++++++++++++++++ .../metal/aluminium-bead-blasted.json | 23 ++++++++++++++++++ .../materials/metal/aluminium-brushed.json | 24 +++++++++++++++++++ .../materials/metal/aluminium-satin.json | 23 ++++++++++++++++++ .../materials/metal/brass-brushed.json | 24 +++++++++++++++++++ .../library/materials/metal/brass-satin.json | 23 ++++++++++++++++++ .../materials/metal/chromium-satin.json | 23 ++++++++++++++++++ .../materials/metal/copper-bead-blasted.json | 23 ++++++++++++++++++ .../materials/metal/copper-brushed.json | 24 +++++++++++++++++++ .../library/materials/metal/copper-satin.json | 23 ++++++++++++++++++ .../library/materials/metal/gold-brushed.json | 24 +++++++++++++++++++ .../library/materials/metal/gold-satin.json | 23 ++++++++++++++++++ .../library/materials/metal/iron-as-cast.json | 23 ++++++++++++++++++ .../materials/metal/iron-bead-blasted.json | 23 ++++++++++++++++++ .../library/materials/metal/iron-satin.json | 23 ++++++++++++++++++ .../materials/metal/nickel-brushed.json | 24 +++++++++++++++++++ .../library/materials/metal/nickel-satin.json | 23 ++++++++++++++++++ .../materials/metal/silver-brushed.json | 24 +++++++++++++++++++ .../library/materials/metal/silver-satin.json | 23 ++++++++++++++++++ .../metal/stainless-steel-bead-blasted.json | 23 ++++++++++++++++++ .../metal/stainless-steel-brushed.json | 24 +++++++++++++++++++ .../metal/stainless-steel-mirror.json | 23 ++++++++++++++++++ .../metal/stainless-steel-satin.json | 23 ++++++++++++++++++ .../metal/titanium-bead-blasted.json | 23 ++++++++++++++++++ .../materials/metal/titanium-brushed.json | 24 +++++++++++++++++++ .../materials/metal/titanium-satin.json | 23 ++++++++++++++++++ 26 files changed, 606 insertions(+) create mode 100644 assets/library/materials/metal/aluminium-as-cast.json create mode 100644 assets/library/materials/metal/aluminium-bead-blasted.json create mode 100644 assets/library/materials/metal/aluminium-brushed.json create mode 100644 assets/library/materials/metal/aluminium-satin.json create mode 100644 assets/library/materials/metal/brass-brushed.json create mode 100644 assets/library/materials/metal/brass-satin.json create mode 100644 assets/library/materials/metal/chromium-satin.json create mode 100644 assets/library/materials/metal/copper-bead-blasted.json create mode 100644 assets/library/materials/metal/copper-brushed.json create mode 100644 assets/library/materials/metal/copper-satin.json create mode 100644 assets/library/materials/metal/gold-brushed.json create mode 100644 assets/library/materials/metal/gold-satin.json create mode 100644 assets/library/materials/metal/iron-as-cast.json create mode 100644 assets/library/materials/metal/iron-bead-blasted.json create mode 100644 assets/library/materials/metal/iron-satin.json create mode 100644 assets/library/materials/metal/nickel-brushed.json create mode 100644 assets/library/materials/metal/nickel-satin.json create mode 100644 assets/library/materials/metal/silver-brushed.json create mode 100644 assets/library/materials/metal/silver-satin.json create mode 100644 assets/library/materials/metal/stainless-steel-bead-blasted.json create mode 100644 assets/library/materials/metal/stainless-steel-brushed.json create mode 100644 assets/library/materials/metal/stainless-steel-mirror.json create mode 100644 assets/library/materials/metal/stainless-steel-satin.json create mode 100644 assets/library/materials/metal/titanium-bead-blasted.json create mode 100644 assets/library/materials/metal/titanium-brushed.json create mode 100644 assets/library/materials/metal/titanium-satin.json diff --git a/assets/library/materials/metal/aluminium-as-cast.json b/assets/library/materials/metal/aluminium-as-cast.json new file mode 100644 index 00000000..6904479f --- /dev/null +++ b/assets/library/materials/metal/aluminium-as-cast.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-as-cast", + "name": "Aluminium, as cast", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.55 + }, + "tags": ["pure-metal", "silver", "electronics", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0067 of the exact Fresnel reflectance at every angle. Roughness authored, as cast or hot rolled: coarse surface, broad highlight.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-bead-blasted.json b/assets/library/materials/metal/aluminium-bead-blasted.json new file mode 100644 index 00000000..1f6b0533 --- /dev/null +++ b/assets/library/materials/metal/aluminium-bead-blasted.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-bead-blasted", + "name": "Aluminium, bead blasted", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.45 + }, + "tags": ["pure-metal", "silver", "electronics", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0067 of the exact Fresnel reflectance at every angle. Roughness authored, bead blasted: uniform micro-roughness, reflections blurred to a sheen.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-brushed.json b/assets/library/materials/metal/aluminium-brushed.json new file mode 100644 index 00000000..1904f282 --- /dev/null +++ b/assets/library/materials/metal/aluminium-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-brushed", + "name": "Aluminium, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "silver", "electronics", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0067 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-satin.json b/assets/library/materials/metal/aluminium-satin.json new file mode 100644 index 00000000..c3ba4a33 --- /dev/null +++ b/assets/library/materials/metal/aluminium-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-satin", + "name": "Aluminium, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "silver", "electronics", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0067 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/brass-brushed.json b/assets/library/materials/metal/brass-brushed.json new file mode 100644 index 00000000..5ad39daf --- /dev/null +++ b/assets/library/materials/metal/brass-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/brass-brushed", + "name": "Brass, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.842, 0.7827, 0.4718], + "base_metalness": 1.0, + "specular_color": [0.9631, 0.9771, 1.0], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["alloy", "gold", "architectural", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "M. R. Querry. Optical constants, Contractor Report CRDC-CR-85034 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Cu-Zn/nk/Querry-Cu70Zn30.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0214 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/brass-satin.json b/assets/library/materials/metal/brass-satin.json new file mode 100644 index 00000000..7baf426f --- /dev/null +++ b/assets/library/materials/metal/brass-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/brass-satin", + "name": "Brass, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.842, 0.7827, 0.4718], + "base_metalness": 1.0, + "specular_color": [0.9631, 0.9771, 1.0], + "specular_roughness": 0.25 + }, + "tags": ["alloy", "gold", "architectural", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "M. R. Querry. Optical constants, Contractor Report CRDC-CR-85034 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/Cu-Zn/nk/Querry-Cu70Zn30.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0214 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/chromium-satin.json b/assets/library/materials/metal/chromium-satin.json new file mode 100644 index 00000000..e8384182 --- /dev/null +++ b/assets/library/materials/metal/chromium-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/chromium-satin", + "name": "Chromium, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6457, 0.6498, 0.6538], + "base_metalness": 1.0, + "specular_color": [0.7404, 0.7584, 0.8073], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "silver", "automotive", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "A. D. Rakić, A. B. Djurišic, J. M. Elazar, M. L. Majewski. Optical properties of metallic films for vertical-cavity optoelectronic devices. Appl. Opt. 37, 5271-5283 (1998) [Calculation script (Python)]; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cr/nk/Rakic-LD.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0273 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/copper-bead-blasted.json b/assets/library/materials/metal/copper-bead-blasted.json new file mode 100644 index 00000000..2a1a16cf --- /dev/null +++ b/assets/library/materials/metal/copper-bead-blasted.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/copper-bead-blasted", + "name": "Copper, bead blasted", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9015, 0.7108, 0.5855], + "base_metalness": 1.0, + "specular_color": [0.9872, 0.9665, 0.9613], + "specular_roughness": 0.45 + }, + "tags": ["pure-metal", "orange", "kitchen", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cu/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0074 of the exact Fresnel reflectance at every angle. Roughness authored, bead blasted: uniform micro-roughness, reflections blurred to a sheen.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/copper-brushed.json b/assets/library/materials/metal/copper-brushed.json new file mode 100644 index 00000000..cc25619f --- /dev/null +++ b/assets/library/materials/metal/copper-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/copper-brushed", + "name": "Copper, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.9015, 0.7108, 0.5855], + "base_metalness": 1.0, + "specular_color": [0.9872, 0.9665, 0.9613], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "orange", "kitchen", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cu/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0074 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/copper-satin.json b/assets/library/materials/metal/copper-satin.json new file mode 100644 index 00000000..785f1352 --- /dev/null +++ b/assets/library/materials/metal/copper-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/copper-satin", + "name": "Copper, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9015, 0.7108, 0.5855], + "base_metalness": 1.0, + "specular_color": [0.9872, 0.9665, 0.9613], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "orange", "kitchen", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cu/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0074 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gold-brushed.json b/assets/library/materials/metal/gold-brushed.json new file mode 100644 index 00000000..0760eb20 --- /dev/null +++ b/assets/library/materials/metal/gold-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gold-brushed", + "name": "Gold, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.9277, 0.7966, 0.4057], + "base_metalness": 1.0, + "specular_color": [0.982, 1.0, 0.9713], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "gold", "jewellery", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Au/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0171 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/gold-satin.json b/assets/library/materials/metal/gold-satin.json new file mode 100644 index 00000000..1cae277c --- /dev/null +++ b/assets/library/materials/metal/gold-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/gold-satin", + "name": "Gold, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9277, 0.7966, 0.4057], + "base_metalness": 1.0, + "specular_color": [0.982, 1.0, 0.9713], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "gold", "jewellery", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Au/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0171 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/iron-as-cast.json b/assets/library/materials/metal/iron-as-cast.json new file mode 100644 index 00000000..14f51884 --- /dev/null +++ b/assets/library/materials/metal/iron-as-cast.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/iron-as-cast", + "name": "Iron, as cast", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5224, 0.5141, 0.4971], + "base_metalness": 1.0, + "specular_color": [0.7674, 0.7676, 0.797], + "specular_roughness": 0.55 + }, + "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Fe/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0175 of the exact Fresnel reflectance at every angle. Roughness authored, as cast or hot rolled: coarse surface, broad highlight.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/iron-bead-blasted.json b/assets/library/materials/metal/iron-bead-blasted.json new file mode 100644 index 00000000..935b9018 --- /dev/null +++ b/assets/library/materials/metal/iron-bead-blasted.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/iron-bead-blasted", + "name": "Iron, bead blasted", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5224, 0.5141, 0.4971], + "base_metalness": 1.0, + "specular_color": [0.7674, 0.7676, 0.797], + "specular_roughness": 0.45 + }, + "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Fe/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0175 of the exact Fresnel reflectance at every angle. Roughness authored, bead blasted: uniform micro-roughness, reflections blurred to a sheen.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/iron-satin.json b/assets/library/materials/metal/iron-satin.json new file mode 100644 index 00000000..ea3be260 --- /dev/null +++ b/assets/library/materials/metal/iron-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/iron-satin", + "name": "Iron, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.5224, 0.5141, 0.4971], + "base_metalness": 1.0, + "specular_color": [0.7674, 0.7676, 0.797], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "grey", "industrial", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Fe/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0175 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/nickel-brushed.json b/assets/library/materials/metal/nickel-brushed.json new file mode 100644 index 00000000..07e87378 --- /dev/null +++ b/assets/library/materials/metal/nickel-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/nickel-brushed", + "name": "Nickel, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.6715, 0.6434, 0.5745], + "base_metalness": 1.0, + "specular_color": [0.8239, 0.8332, 0.8653], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "silver", "industrial", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ni/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0126 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/nickel-satin.json b/assets/library/materials/metal/nickel-satin.json new file mode 100644 index 00000000..ad63f742 --- /dev/null +++ b/assets/library/materials/metal/nickel-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/nickel-satin", + "name": "Nickel, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6715, 0.6434, 0.5745], + "base_metalness": 1.0, + "specular_color": [0.8239, 0.8332, 0.8653], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "silver", "industrial", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ni/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0126 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/silver-brushed.json b/assets/library/materials/metal/silver-brushed.json new file mode 100644 index 00000000..ea99840d --- /dev/null +++ b/assets/library/materials/metal/silver-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/silver-brushed", + "name": "Silver, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.9886, 0.9876, 0.9803], + "base_metalness": 1.0, + "specular_color": [0.9946, 0.9955, 0.9984], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "silver", "jewellery", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ag/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0016 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/silver-satin.json b/assets/library/materials/metal/silver-satin.json new file mode 100644 index 00000000..dfb51f87 --- /dev/null +++ b/assets/library/materials/metal/silver-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/silver-satin", + "name": "Silver, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9886, 0.9876, 0.9803], + "base_metalness": 1.0, + "specular_color": [0.9946, 0.9955, 0.9984], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "silver", "jewellery", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ag/nk/McPeak.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0016 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-bead-blasted.json b/assets/library/materials/metal/stainless-steel-bead-blasted.json new file mode 100644 index 00000000..b58dc4ff --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-bead-blasted.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-bead-blasted", + "name": "Stainless steel, bead blasted", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6557, 0.6405, 0.6043], + "base_metalness": 1.0, + "specular_color": [0.8039, 0.8214, 0.8632], + "specular_roughness": 0.45 + }, + "tags": ["alloy", "silver", "kitchen", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-austenitic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0122 of the exact Fresnel reflectance at every angle. Roughness authored, bead blasted: uniform micro-roughness, reflections blurred to a sheen.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-brushed.json b/assets/library/materials/metal/stainless-steel-brushed.json new file mode 100644 index 00000000..89a2ec39 --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-brushed", + "name": "Stainless steel, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.6557, 0.6405, 0.6043], + "base_metalness": 1.0, + "specular_color": [0.8039, 0.8214, 0.8632], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["alloy", "silver", "kitchen", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-austenitic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0122 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-mirror.json b/assets/library/materials/metal/stainless-steel-mirror.json new file mode 100644 index 00000000..a7afbe6a --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-mirror.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-mirror", + "name": "Stainless steel, mirror", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6557, 0.6405, 0.6043], + "base_metalness": 1.0, + "specular_color": [0.8039, 0.8214, 0.8632], + "specular_roughness": 0.02 + }, + "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-austenitic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0122 of the exact Fresnel reflectance at every angle. Roughness authored, mirror finish: the sharpest highlight a real buffed part keeps.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/stainless-steel-satin.json b/assets/library/materials/metal/stainless-steel-satin.json new file mode 100644 index 00000000..b59352c0 --- /dev/null +++ b/assets/library/materials/metal/stainless-steel-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/stainless-steel-satin", + "name": "Stainless steel, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6557, 0.6405, 0.6043], + "base_metalness": 1.0, + "specular_color": [0.8039, 0.8214, 0.8632], + "specular_roughness": 0.25 + }, + "tags": ["alloy", "silver", "kitchen", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "Björn Karlsson, Carl G. Ribbing. Optical constants and spectral selectivity of stainless steel and its oxides. J. Appl. Phys. 53, 6340-6346 (1982) (Data extracted from a figure); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/alloys/stainless%20steel/nk/Karlsson-austenitic.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0122 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-bead-blasted.json b/assets/library/materials/metal/titanium-bead-blasted.json new file mode 100644 index 00000000..d55ceae0 --- /dev/null +++ b/assets/library/materials/metal/titanium-bead-blasted.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-bead-blasted", + "name": "Titanium, bead blasted", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.45 + }, + "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0134 of the exact Fresnel reflectance at every angle. Roughness authored, bead blasted: uniform micro-roughness, reflections blurred to a sheen.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-brushed.json b/assets/library/materials/metal/titanium-brushed.json new file mode 100644 index 00000000..b1c90d0e --- /dev/null +++ b/assets/library/materials/metal/titanium-brushed.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-brushed", + "name": "Titanium, brushed", + "category": "Metal", + "type": "metal_brushed", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.3, + "specular_roughness_anisotropy": 0.8 + }, + "tags": ["pure-metal", "grey", "industrial", "brushed", "opaque", "anisotropic"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0134 of the exact Fresnel reflectance at every angle. Roughness authored, brushed: directional grain; anisotropy 0.8 stretches the highlight across the grain.", + "authored": ["specular_roughness", "specular_roughness_anisotropy"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-satin.json b/assets/library/materials/metal/titanium-satin.json new file mode 100644 index 00000000..60592955 --- /dev/null +++ b/assets/library/materials/metal/titanium-satin.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-satin", + "name": "Titanium, satin", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.25 + }, + "tags": ["pure-metal", "grey", "industrial", "satin", "opaque"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml"], + "notes": "base_color is the normal-incidence reflectance and specular_color the F82 edge tint, both computed from the measured n and k (380-780 nm, CIE 1931 2 degree observer, D65, ACEScg); the F82 fit stays within 0.0134 of the exact Fresnel reflectance at every angle. Roughness authored, satin: fine abrasive finish, soft highlight, reflections still recognisable.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} From b24ea1ce9981be6f82f239926a732d99d450076c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 12:59:09 -0500 Subject: [PATCH 158/494] feat(library): add anodised aluminium, anodised titanium and rose gold Dyed anodised aluminium as measured aluminium under a tinted oxide coat; anodised titanium as an interference film whose thickness was picked from an Airy-formula sweep of TiO2 on titanium; rose gold as an authored gold-copper blend. Ran the library validator. --- .../metal/aluminium-anodised-black.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-blue.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-bronze.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-gold.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-green.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-purple.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-red.json | 27 +++++++++++++++++++ .../metal/aluminium-anodised-rose.json | 27 +++++++++++++++++++ .../materials/metal/rose-gold-polished.json | 23 ++++++++++++++++ .../metal/titanium-anodised-blue.json | 26 ++++++++++++++++++ .../metal/titanium-anodised-bronze.json | 26 ++++++++++++++++++ .../metal/titanium-anodised-gold.json | 26 ++++++++++++++++++ .../metal/titanium-anodised-light-blue.json | 26 ++++++++++++++++++ .../metal/titanium-anodised-magenta.json | 26 ++++++++++++++++++ .../metal/titanium-anodised-purple.json | 26 ++++++++++++++++++ 15 files changed, 395 insertions(+) create mode 100644 assets/library/materials/metal/aluminium-anodised-black.json create mode 100644 assets/library/materials/metal/aluminium-anodised-blue.json create mode 100644 assets/library/materials/metal/aluminium-anodised-bronze.json create mode 100644 assets/library/materials/metal/aluminium-anodised-gold.json create mode 100644 assets/library/materials/metal/aluminium-anodised-green.json create mode 100644 assets/library/materials/metal/aluminium-anodised-purple.json create mode 100644 assets/library/materials/metal/aluminium-anodised-red.json create mode 100644 assets/library/materials/metal/aluminium-anodised-rose.json create mode 100644 assets/library/materials/metal/rose-gold-polished.json create mode 100644 assets/library/materials/metal/titanium-anodised-blue.json create mode 100644 assets/library/materials/metal/titanium-anodised-bronze.json create mode 100644 assets/library/materials/metal/titanium-anodised-gold.json create mode 100644 assets/library/materials/metal/titanium-anodised-light-blue.json create mode 100644 assets/library/materials/metal/titanium-anodised-magenta.json create mode 100644 assets/library/materials/metal/titanium-anodised-purple.json diff --git a/assets/library/materials/metal/aluminium-anodised-black.json b/assets/library/materials/metal/aluminium-anodised-black.json new file mode 100644 index 00000000..d5ae2bf8 --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-black.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-black", + "name": "Aluminium, anodised black", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.007, 0.007, 0.007], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "black", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #141414, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-blue.json b/assets/library/materials/metal/aluminium-anodised-blue.json new file mode 100644 index 00000000..1c4f423c --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-blue.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-blue", + "name": "Aluminium, anodised blue", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.0555, 0.0784, 0.3865], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "blue", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #1f4fb0, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-bronze.json b/assets/library/materials/metal/aluminium-anodised-bronze.json new file mode 100644 index 00000000..7c96c13f --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-bronze.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-bronze", + "name": "Aluminium, anodised bronze", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.156, 0.1079, 0.052], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "brown", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #7a5a3a, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-gold.json b/assets/library/materials/metal/aluminium-anodised-gold.json new file mode 100644 index 00000000..02909d4a --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-gold.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-gold", + "name": "Aluminium, anodised gold", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.5543, 0.3938, 0.0765], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "gold", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #d9a52b, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-green.json b/assets/library/materials/metal/aluminium-anodised-green.json new file mode 100644 index 00000000..d2d0efd0 --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-green.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-green", + "name": "Aluminium, anodised green", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.1127, 0.2543, 0.0675], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "green", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #2f8f3a, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-purple.json b/assets/library/materials/metal/aluminium-anodised-purple.json new file mode 100644 index 00000000..81015158 --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-purple.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-purple", + "name": "Aluminium, anodised purple", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.1127, 0.0377, 0.2949], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "purple", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #6a2c9c, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-red.json b/assets/library/materials/metal/aluminium-anodised-red.json new file mode 100644 index 00000000..2e63add8 --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-red.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-red", + "name": "Aluminium, anodised red", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.3292, 0.0505, 0.0326], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "red", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #c0202a, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/aluminium-anodised-rose.json b/assets/library/materials/metal/aluminium-anodised-rose.json new file mode 100644 index 00000000..0996a20f --- /dev/null +++ b/assets/library/materials/metal/aluminium-anodised-rose.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/aluminium-anodised-rose", + "name": "Aluminium, anodised rose", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9104, 0.9156, 0.9215], + "base_metalness": 1.0, + "specular_color": [0.9009, 0.9166, 0.9429], + "specular_roughness": 0.3, + "coat_weight": 1.0, + "coat_color": [0.4725, 0.2268, 0.242], + "coat_roughness": 0.15, + "coat_ior": 1.65 + }, + "tags": ["anodised", "pink", "satin", "coat", "electronics"], + "source": { + "kind": "measured", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al/nk/McPeak.yml"], + "notes": "Aluminium under a dyed anodic oxide layer. The metal is measured (see the polished aluminium preset). The oxide is modelled as a coat: coat_color authored as sRGB #d27a86, the dye's look over bright aluminium; coat_ior 1.65 authored, in the range of amorphous anodic alumina, below crystalline sapphire's ordinary index of 1.7682; roughness 0.3 for the etched metal and 0.15 for the sealed oxide, a typical bead-blasted and anodised product finish.", + "authored": ["specular_roughness", "coat_color", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/rose-gold-polished.json b/assets/library/materials/metal/rose-gold-polished.json new file mode 100644 index 00000000..e06c9299 --- /dev/null +++ b/assets/library/materials/metal/rose-gold-polished.json @@ -0,0 +1,23 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/rose-gold-polished", + "name": "Rose gold, polished", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.9159, 0.758, 0.4866], + "base_metalness": 1.0, + "specular_color": [0.9843, 0.9849, 0.9668], + "specular_roughness": 0.04 + }, + "tags": ["alloy", "pink", "polished", "jewellery", "opaque"], + "source": { + "kind": "authored", + "reference": "K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); K. M. McPeak, S. V. Jayanti, S. J. P. Kress, S. Meyer, S. Iotti, A. Rossinelli, D. J. Norris. Plasmonic films can easily be better: Rules and recipes. ACS Photonics 2, 326-333 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Au/nk/McPeak.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Cu/nk/McPeak.yml"], + "notes": "Authored approximation: no measured n and k for gold-copper alloys in the database. Colour and edge tint are a 55 to 45 blend of the measured gold and copper values, close to an 18 carat rose alloy's look. Roughness authored, polished finish.", + "authored": ["base_color", "specular_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-blue.json b/assets/library/materials/metal/titanium-anodised-blue.json new file mode 100644 index 00000000..6594d727 --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-blue.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-blue", + "name": "Titanium, anodised blue", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.05, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "blue", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.05 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as blue. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-bronze.json b/assets/library/materials/metal/titanium-anodised-bronze.json new file mode 100644 index 00000000..9bc3a815 --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-bronze.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-bronze", + "name": "Titanium, anodised bronze", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.025, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "brown", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.025 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as bronze. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-gold.json b/assets/library/materials/metal/titanium-anodised-gold.json new file mode 100644 index 00000000..2e776d2f --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-gold.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-gold", + "name": "Titanium, anodised gold", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.115, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "gold", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.115 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as gold. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-light-blue.json b/assets/library/materials/metal/titanium-anodised-light-blue.json new file mode 100644 index 00000000..cc2d43e4 --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-light-blue.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-light-blue", + "name": "Titanium, anodised light blue", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.065, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "blue", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.065 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as light blue. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-magenta.json b/assets/library/materials/metal/titanium-anodised-magenta.json new file mode 100644 index 00000000..453e3af8 --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-magenta.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-magenta", + "name": "Titanium, anodised magenta", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.14, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "pink", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.14 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as magenta. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/metal/titanium-anodised-purple.json b/assets/library/materials/metal/titanium-anodised-purple.json new file mode 100644 index 00000000..69fb3af8 --- /dev/null +++ b/assets/library/materials/metal/titanium-anodised-purple.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "metal/titanium-anodised-purple", + "name": "Titanium, anodised purple", + "category": "Metal", + "type": "metal", + "params": { + "base_color": [0.6017, 0.5816, 0.5481], + "base_metalness": 1.0, + "specular_color": [0.7783, 0.7893, 0.8161], + "specular_roughness": 0.12, + "thin_film_weight": 1.0, + "thin_film_thickness": 0.04, + "thin_film_ior": 2.449 + }, + "tags": ["anodised", "purple", "thin-film", "polished", "jewellery"], + "source": { + "kind": "measured", + "reference": "P. B. Johnson and R. W. Christy. Optical constants of transition metals: Ti, V, Cr, Mn, Fe, Co, Ni, and Pd. Phys. Rev. B 9, 5056-5070 (1974); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); A. Jolivet et al. Structural, optical, and electrical properties of TiO2 thin films deposited by ALD. Appl. Surf. Sci. 608, 155214 (2023)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Ti/nk/Johnson.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/TiO2/nk/Jolivet-amorphous.yml"], + "notes": "Titanium coloured by an anodic oxide film: interference colour, no dye. The film thickness 0.04 um was chosen by computing the reflectance of an amorphous TiO2 film (n 2.449 at 550 nm) on measured titanium with the Airy formula for thicknesses 0 to 0.155 um and picking the one whose colour reads as purple. Needs the thin-film lobe; without it the preset renders as plain titanium. Roughness authored.", + "authored": ["specular_roughness", "thin_film_thickness"] + }, + "licence": "Apache-2.0" +} From 7b6f552067be36d4efe977ededfa07a786d5ef69 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:19 -0500 Subject: [PATCH 159/494] feat(library): add opaque plastic presets at gloss, satin and matte ABS, polypropylene, nylon, acetal, PVC, HDPE and PLA in common colours; measured indices where the database has them, authored typical indices otherwise, authored colours and finish roughness. Ran the library validator. --- .../materials/plastic/abs-black-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/abs-black-matte.json | 25 +++++++++++++++++++ .../materials/plastic/abs-black-satin.json | 25 +++++++++++++++++++ .../materials/plastic/abs-blue-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/abs-grey-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/abs-grey-matte.json | 25 +++++++++++++++++++ .../materials/plastic/abs-red-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/abs-white-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/abs-yellow-gloss.json | 25 +++++++++++++++++++ .../materials/plastic/acetal-black-satin.json | 25 +++++++++++++++++++ .../materials/plastic/acetal-white-satin.json | 25 +++++++++++++++++++ .../materials/plastic/hdpe-white-matte.json | 25 +++++++++++++++++++ .../materials/plastic/nylon-black-matte.json | 25 +++++++++++++++++++ .../plastic/nylon-natural-matte.json | 25 +++++++++++++++++++ .../materials/plastic/pla-orange-satin.json | 25 +++++++++++++++++++ .../materials/plastic/pla-white-satin.json | 25 +++++++++++++++++++ .../plastic/polypropylene-black-satin.json | 25 +++++++++++++++++++ .../plastic/polypropylene-white-satin.json | 25 +++++++++++++++++++ .../materials/plastic/pvc-grey-satin.json | 25 +++++++++++++++++++ .../materials/plastic/pvc-white-gloss.json | 25 +++++++++++++++++++ 20 files changed, 500 insertions(+) create mode 100644 assets/library/materials/plastic/abs-black-gloss.json create mode 100644 assets/library/materials/plastic/abs-black-matte.json create mode 100644 assets/library/materials/plastic/abs-black-satin.json create mode 100644 assets/library/materials/plastic/abs-blue-gloss.json create mode 100644 assets/library/materials/plastic/abs-grey-gloss.json create mode 100644 assets/library/materials/plastic/abs-grey-matte.json create mode 100644 assets/library/materials/plastic/abs-red-gloss.json create mode 100644 assets/library/materials/plastic/abs-white-gloss.json create mode 100644 assets/library/materials/plastic/abs-yellow-gloss.json create mode 100644 assets/library/materials/plastic/acetal-black-satin.json create mode 100644 assets/library/materials/plastic/acetal-white-satin.json create mode 100644 assets/library/materials/plastic/hdpe-white-matte.json create mode 100644 assets/library/materials/plastic/nylon-black-matte.json create mode 100644 assets/library/materials/plastic/nylon-natural-matte.json create mode 100644 assets/library/materials/plastic/pla-orange-satin.json create mode 100644 assets/library/materials/plastic/pla-white-satin.json create mode 100644 assets/library/materials/plastic/polypropylene-black-satin.json create mode 100644 assets/library/materials/plastic/polypropylene-white-satin.json create mode 100644 assets/library/materials/plastic/pvc-grey-satin.json create mode 100644 assets/library/materials/plastic/pvc-white-gloss.json diff --git a/assets/library/materials/plastic/abs-black-gloss.json b/assets/library/materials/plastic/abs-black-gloss.json new file mode 100644 index 00000000..93d99588 --- /dev/null +++ b/assets/library/materials/plastic/abs-black-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-black-gloss", + "name": "ABS, black gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.0052, 0.0052, 0.0052], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "black", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #101010. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-black-matte.json b/assets/library/materials/plastic/abs-black-matte.json new file mode 100644 index 00000000..31ae3ad9 --- /dev/null +++ b/assets/library/materials/plastic/abs-black-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-black-matte", + "name": "ABS, black matte", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.008, 0.008, 0.008], + "base_metalness": 0.0, + "specular_roughness": 0.55, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "matte", "black", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #161616. Roughness 0.55 authored: fine spark-eroded mould texture, broad highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-black-satin.json b/assets/library/materials/plastic/abs-black-satin.json new file mode 100644 index 00000000..5cb6b138 --- /dev/null +++ b/assets/library/materials/plastic/abs-black-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-black-satin", + "name": "ABS, black satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.007, 0.007, 0.007], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "black", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #141414. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-blue-gloss.json b/assets/library/materials/plastic/abs-blue-gloss.json new file mode 100644 index 00000000..459e5277 --- /dev/null +++ b/assets/library/materials/plastic/abs-blue-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-blue-gloss", + "name": "ABS, blue gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.0498, 0.077, 0.298], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "blue", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #1d4f9c. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-grey-gloss.json b/assets/library/materials/plastic/abs-grey-gloss.json new file mode 100644 index 00000000..f60d5613 --- /dev/null +++ b/assets/library/materials/plastic/abs-grey-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-grey-gloss", + "name": "ABS, grey gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.2577, 0.2618, 0.2693], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "grey", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #8a8c8e. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-grey-matte.json b/assets/library/materials/plastic/abs-grey-matte.json new file mode 100644 index 00000000..8db26140 --- /dev/null +++ b/assets/library/materials/plastic/abs-grey-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-grey-matte", + "name": "ABS, grey matte", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.1587, 0.1617, 0.1701], + "base_metalness": 0.0, + "specular_roughness": 0.55, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "matte", "grey", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #6e7073. Roughness 0.55 authored: fine spark-eroded mould texture, broad highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-red-gloss.json b/assets/library/materials/plastic/abs-red-gloss.json new file mode 100644 index 00000000..f91d8dc4 --- /dev/null +++ b/assets/library/materials/plastic/abs-red-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-red-gloss", + "name": "ABS, red gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.3417, 0.0463, 0.0224], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "red", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #c4161c. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-white-gloss.json b/assets/library/materials/plastic/abs-white-gloss.json new file mode 100644 index 00000000..8e5399fd --- /dev/null +++ b/assets/library/materials/plastic/abs-white-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-white-gloss", + "name": "ABS, white gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8535, 0.8546, 0.827], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "white", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #eeeeea. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/abs-yellow-gloss.json b/assets/library/materials/plastic/abs-yellow-gloss.json new file mode 100644 index 00000000..749752d6 --- /dev/null +++ b/assets/library/materials/plastic/abs-yellow-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/abs-yellow-gloss", + "name": "ABS, yellow gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.7275, 0.5567, 0.0774], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "yellow", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f2c200. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.53: authored typical value: ABS sits between its acrylonitrile-butadiene phases (about 1.51 to 1.52) and polystyrene (1.59 measured); grades are quoted around 1.53 to 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acetal-black-satin.json b/assets/library/materials/plastic/acetal-black-satin.json new file mode 100644 index 00000000..965e5321 --- /dev/null +++ b/assets/library/materials/plastic/acetal-black-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acetal-black-satin", + "name": "Acetal, black satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.0075, 0.0075, 0.0075], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.48, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "black", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #151515. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.48: authored typical value for polyoxymethylene (quoted 1.48).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acetal-white-satin.json b/assets/library/materials/plastic/acetal-white-satin.json new file mode 100644 index 00000000..163dd691 --- /dev/null +++ b/assets/library/materials/plastic/acetal-white-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acetal-white-satin", + "name": "Acetal, white satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8749, 0.8715, 0.8432], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.48, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "white", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f1f0ec. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.48: authored typical value for polyoxymethylene (quoted 1.48).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/hdpe-white-matte.json b/assets/library/materials/plastic/hdpe-white-matte.json new file mode 100644 index 00000000..dd86e65b --- /dev/null +++ b/assets/library/materials/plastic/hdpe-white-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/hdpe-white-matte", + "name": "HDPE, white matte", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8915, 0.8881, 0.8595], + "base_metalness": 0.0, + "specular_roughness": 0.55, + "specular_ior": 1.54, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "matte", "white", "opaque", "packaging"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f3f2ee. Roughness 0.55 authored: fine spark-eroded mould texture, broad highlight. specular_ior 1.54: authored typical value for high-density polyethylene, whose crystalline fraction raises n from the amorphous 1.49 to about 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/nylon-black-matte.json b/assets/library/materials/plastic/nylon-black-matte.json new file mode 100644 index 00000000..2bc6fcbf --- /dev/null +++ b/assets/library/materials/plastic/nylon-black-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/nylon-black-matte", + "name": "Nylon, black matte", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.0103, 0.0103, 0.0103], + "base_metalness": 0.0, + "specular_roughness": 0.55, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "matte", "black", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #1a1a1a. Roughness 0.55 authored: fine spark-eroded mould texture, broad highlight. specular_ior 1.53: authored typical value for polyamide 6 (quoted 1.52 to 1.54).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/nylon-natural-matte.json b/assets/library/materials/plastic/nylon-natural-matte.json new file mode 100644 index 00000000..d155d734 --- /dev/null +++ b/assets/library/materials/plastic/nylon-natural-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/nylon-natural-matte", + "name": "Nylon, natural matte", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.7678, 0.747, 0.6407], + "base_metalness": 0.0, + "specular_roughness": 0.55, + "specular_ior": 1.53, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "matte", "white", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #e6e0cf. Roughness 0.55 authored: fine spark-eroded mould texture, broad highlight. specular_ior 1.53: authored typical value for polyamide 6 (quoted 1.52 to 1.54).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pla-orange-satin.json b/assets/library/materials/plastic/pla-orange-satin.json new file mode 100644 index 00000000..003b1147 --- /dev/null +++ b/assets/library/materials/plastic/pla-orange-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pla-orange-satin", + "name": "PLA, orange satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.6008, 0.2396, 0.0483], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.4589, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "orange", "opaque", "industrial"], + "source": { + "kind": "published", + "reference": "I. Bodurov, I. Vlaeva, A. Viraneva, T. Yovcheva, S. Sainov. Modified design of a laser refractometer. Nanosci. Nanotechnol. 16, 31-33 (2016); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C3H4O2)n%20-%20polylactic%20acid/nk/Bodurov.yml"], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f07a1a. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.4589 is the measured n at 587.6 nm.", + "authored": ["base_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pla-white-satin.json b/assets/library/materials/plastic/pla-white-satin.json new file mode 100644 index 00000000..106f4a9b --- /dev/null +++ b/assets/library/materials/plastic/pla-white-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pla-white-satin", + "name": "PLA, white satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8995, 0.8963, 0.8605], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.4589, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "white", "opaque", "industrial"], + "source": { + "kind": "published", + "reference": "I. Bodurov, I. Vlaeva, A. Viraneva, T. Yovcheva, S. Sainov. Modified design of a laser refractometer. Nanosci. Nanotechnol. 16, 31-33 (2016); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C3H4O2)n%20-%20polylactic%20acid/nk/Bodurov.yml"], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f4f3ee. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.4589 is the measured n at 587.6 nm.", + "authored": ["base_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polypropylene-black-satin.json b/assets/library/materials/plastic/polypropylene-black-satin.json new file mode 100644 index 00000000..745421e8 --- /dev/null +++ b/assets/library/materials/plastic/polypropylene-black-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polypropylene-black-satin", + "name": "Polypropylene, black satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.0086, 0.0086, 0.0086], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.49, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "black", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #171717. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.49: authored typical value for isotactic polypropylene (quoted 1.47 to 1.50).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polypropylene-white-satin.json b/assets/library/materials/plastic/polypropylene-white-satin.json new file mode 100644 index 00000000..3b5a314c --- /dev/null +++ b/assets/library/materials/plastic/polypropylene-white-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polypropylene-white-satin", + "name": "Polypropylene, white satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8659, 0.8631, 0.8213], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.49, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "white", "opaque", "packaging"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f0efe9. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.49: authored typical value for isotactic polypropylene (quoted 1.47 to 1.50).", + "authored": ["base_color", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pvc-grey-satin.json b/assets/library/materials/plastic/pvc-grey-satin.json new file mode 100644 index 00000000..69bf85f5 --- /dev/null +++ b/assets/library/materials/plastic/pvc-grey-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pvc-grey-satin", + "name": "PVC, grey satin", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.27, 0.2742, 0.2819], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.5425, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "satin", "grey", "opaque", "architectural"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C2H3Cl)n%20-%20polyvinyl%20chloride/nk/Zhang.yml"], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #8d8f91. Roughness 0.3 authored: lightly textured mould, soft highlight. specular_ior 1.5425 is the measured n at 587.6 nm.", + "authored": ["base_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pvc-white-gloss.json b/assets/library/materials/plastic/pvc-white-gloss.json new file mode 100644 index 00000000..9f30c21c --- /dev/null +++ b/assets/library/materials/plastic/pvc-white-gloss.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pvc-white-gloss", + "name": "PVC, white gloss", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8867, 0.8876, 0.8664], + "base_metalness": 0.0, + "specular_roughness": 0.08, + "specular_ior": 1.5425, + "transmission_weight": 0.0, + "coat_weight": 0.0 + }, + "tags": ["polymer", "gloss", "white", "opaque", "architectural"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C2H3Cl)n%20-%20polyvinyl%20chloride/nk/Zhang.yml"], + "notes": "Opaque pigmented plastic. base_color authored as sRGB #f2f2ef. Roughness 0.08 authored: polished mould, sharp highlight. specular_ior 1.5425 is the measured n at 587.6 nm.", + "authored": ["base_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} From 9198a832a76a59216e945465308276add9c670bc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:19 -0500 Subject: [PATCH 160/494] feat(library): add clear, tinted and translucent plastic presets Acrylic, polycarbonate, polystyrene, PET, cellulose acetate, silicone and CR-39 with measured index and Abbe number, tinted sheets with an authored colour at sheet depth, and milky polyolefins through subsurface. Ran the library validator. --- .../materials/plastic/acrylic-amber.json | 28 +++++++++++++++++++ .../materials/plastic/acrylic-blue.json | 28 +++++++++++++++++++ .../materials/plastic/acrylic-clear.json | 28 +++++++++++++++++++ .../materials/plastic/acrylic-frosted.json | 28 +++++++++++++++++++ .../materials/plastic/acrylic-red.json | 28 +++++++++++++++++++ .../materials/plastic/acrylic-smoke.json | 28 +++++++++++++++++++ .../plastic/cellulose-acetate-clear.json | 28 +++++++++++++++++++ .../library/materials/plastic/cr39-clear.json | 28 +++++++++++++++++++ .../materials/plastic/hdpe-natural.json | 27 ++++++++++++++++++ .../library/materials/plastic/pdms-clear.json | 28 +++++++++++++++++++ .../library/materials/plastic/pet-amber.json | 28 +++++++++++++++++++ .../library/materials/plastic/pet-clear.json | 28 +++++++++++++++++++ .../library/materials/plastic/pet-green.json | 28 +++++++++++++++++++ .../plastic/polycarbonate-clear.json | 28 +++++++++++++++++++ .../plastic/polycarbonate-frosted.json | 28 +++++++++++++++++++ .../plastic/polypropylene-natural.json | 27 ++++++++++++++++++ .../materials/plastic/polystyrene-clear.json | 28 +++++++++++++++++++ 17 files changed, 474 insertions(+) create mode 100644 assets/library/materials/plastic/acrylic-amber.json create mode 100644 assets/library/materials/plastic/acrylic-blue.json create mode 100644 assets/library/materials/plastic/acrylic-clear.json create mode 100644 assets/library/materials/plastic/acrylic-frosted.json create mode 100644 assets/library/materials/plastic/acrylic-red.json create mode 100644 assets/library/materials/plastic/acrylic-smoke.json create mode 100644 assets/library/materials/plastic/cellulose-acetate-clear.json create mode 100644 assets/library/materials/plastic/cr39-clear.json create mode 100644 assets/library/materials/plastic/hdpe-natural.json create mode 100644 assets/library/materials/plastic/pdms-clear.json create mode 100644 assets/library/materials/plastic/pet-amber.json create mode 100644 assets/library/materials/plastic/pet-clear.json create mode 100644 assets/library/materials/plastic/pet-green.json create mode 100644 assets/library/materials/plastic/polycarbonate-clear.json create mode 100644 assets/library/materials/plastic/polycarbonate-frosted.json create mode 100644 assets/library/materials/plastic/polypropylene-natural.json create mode 100644 assets/library/materials/plastic/polystyrene-clear.json diff --git a/assets/library/materials/plastic/acrylic-amber.json b/assets/library/materials/plastic/acrylic-amber.json new file mode 100644 index 00000000..0483a86e --- /dev/null +++ b/assets/library/materials/plastic/acrylic-amber.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-amber", + "name": "Acrylic, amber tint", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [0.5435, 0.2853, 0.0477], + "transmission_depth": 0.005 + }, + "tags": ["polymer", "transparent", "orange", "tinted", "gloss"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #e08a10, the colour reached through 0.005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acrylic-blue.json b/assets/library/materials/plastic/acrylic-blue.json new file mode 100644 index 00000000..9a93ec3b --- /dev/null +++ b/assets/library/materials/plastic/acrylic-blue.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-blue", + "name": "Acrylic, blue tint", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [0.0609, 0.082, 0.5114], + "transmission_depth": 0.005 + }, + "tags": ["polymer", "transparent", "blue", "tinted", "gloss"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #1a50c8, the colour reached through 0.005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acrylic-clear.json b/assets/library/materials/plastic/acrylic-clear.json new file mode 100644 index 00000000..fb431d36 --- /dev/null +++ b/assets/library/materials/plastic/acrylic-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-clear", + "name": "Acrylic, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "architectural"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acrylic-frosted.json b/assets/library/materials/plastic/acrylic-frosted.json new file mode 100644 index 00000000..9c1cf0f5 --- /dev/null +++ b/assets/library/materials/plastic/acrylic-frosted.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-frosted", + "name": "Acrylic, frosted", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.35, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "frosted", "translucent"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.35 authored: optically polished sheet or moulding. Frosted: roughness 0.35 authored for a sand-blasted or acid-etched sheet.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acrylic-red.json b/assets/library/materials/plastic/acrylic-red.json new file mode 100644 index 00000000..27c346d9 --- /dev/null +++ b/assets/library/materials/plastic/acrylic-red.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-red", + "name": "Acrylic, red tint", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [0.3892, 0.0492, 0.0261], + "transmission_depth": 0.005 + }, + "tags": ["polymer", "transparent", "red", "tinted", "gloss"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #d01020, the colour reached through 0.005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/acrylic-smoke.json b/assets/library/materials/plastic/acrylic-smoke.json new file mode 100644 index 00000000..d9418cf1 --- /dev/null +++ b/assets/library/materials/plastic/acrylic-smoke.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/acrylic-smoke", + "name": "Acrylic, smoke grey", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 53.2, + "transmission_color": [0.1022, 0.1022, 0.1022], + "transmission_depth": 0.005 + }, + "tags": ["polymer", "transparent", "grey", "tinted", "gloss"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C5H8O2)n%20-%20poly(methyl%20methacrylate)/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4906 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #5a5a5a, the colour reached through 0.005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/cellulose-acetate-clear.json b/assets/library/materials/plastic/cellulose-acetate-clear.json new file mode 100644 index 00000000..53d9e441 --- /dev/null +++ b/assets/library/materials/plastic/cellulose-acetate-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/cellulose-acetate-clear", + "name": "Cellulose acetate, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.4701, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 54.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.4701 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. Index from measured cellulose, the backbone of cellulose acetate film and spectacle frames.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/cr39-clear.json b/assets/library/materials/plastic/cr39-clear.json new file mode 100644 index 00000000..ff30aa69 --- /dev/null +++ b/assets/library/materials/plastic/cr39-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/cr39-clear", + "name": "CR-39 lens resin, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.498, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 58.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "optics"], + "source": { + "kind": "published", + "reference": "CR-39 Product Bulletin - PPG Industries (2006); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/commercial%20polymers/CR-39/nk/poly.yml"], + "notes": "Transparent plastic. specular_ior 1.498 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. CR-39 data gives only n at 589.3 nm; the Abbe number 58 is authored from lens makers' commonly quoted value for CR-39.", + "authored": ["specular_roughness", "transmission_dispersion_abbe_number"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/hdpe-natural.json b/assets/library/materials/plastic/hdpe-natural.json new file mode 100644 index 00000000..ec3e7807 --- /dev/null +++ b/assets/library/materials/plastic/hdpe-natural.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/hdpe-natural", + "name": "HDPE, natural translucent", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.9119, 0.905, 0.8477], + "base_metalness": 0.0, + "specular_roughness": 0.35, + "specular_ior": 1.54, + "subsurface_weight": 1.0, + "subsurface_color": [0.9119, 0.905, 0.8477], + "subsurface_radius": 0.003, + "subsurface_radius_scale": [1.0, 1.0, 0.9] + }, + "tags": ["polymer", "satin", "white", "translucent", "subsurface", "packaging"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Unpigmented semicrystalline polyolefin: light scatters in the crystallites, so it glows milky. Modelled with subsurface: colour sRGB #f6f4ec, mean free path 3 mm (authored so a 2 mm wall looks translucent but not clear), slightly shorter in blue. Roughness 0.35 authored. specular_ior 1.54: authored typical value for high-density polyethylene, whose crystalline fraction raises n from the amorphous 1.49 to about 1.54.", + "authored": ["base_color", "specular_roughness", "specular_ior", "subsurface_color", "subsurface_radius", "subsurface_radius_scale"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pdms-clear.json b/assets/library/materials/plastic/pdms-clear.json new file mode 100644 index 00000000..156b0afd --- /dev/null +++ b/assets/library/materials/plastic/pdms-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pdms-clear", + "name": "Silicone (PDMS), clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.02, + "specular_ior": 1.4316, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 44.6, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "elastomer"], + "source": { + "kind": "published", + "reference": "F. Schneider, J. Draheim, R. Kamberger, U. Wallrabe. Process and material properties of polydimethylsiloxane (PDMS) for Optical MEMS. Sens. Actuators A Phys. 151, 95-99 (2009); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C2H6OSi)n%20-%20polydimethylsiloxane/nk/Schneider-Sylgard184.yml"], + "notes": "Transparent plastic. specular_ior 1.4316 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.02 authored: optically polished sheet or moulding. Measured Sylgard 184 polydimethylsiloxane, the common clear casting silicone.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pet-amber.json b/assets/library/materials/plastic/pet-amber.json new file mode 100644 index 00000000..7fe10f81 --- /dev/null +++ b/assets/library/materials/plastic/pet-amber.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pet-amber", + "name": "PET, amber bottle tint", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.5693, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 27.9, + "transmission_color": [0.3118, 0.1524, 0.0336], + "transmission_depth": 0.0005 + }, + "tags": ["polymer", "transparent", "brown", "tinted", "packaging"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Transparent plastic. specular_ior 1.5693 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #b0661c, the colour reached through 0.0005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pet-clear.json b/assets/library/materials/plastic/pet-clear.json new file mode 100644 index 00000000..b3b6796c --- /dev/null +++ b/assets/library/materials/plastic/pet-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pet-clear", + "name": "PET, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.5693, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 27.9, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "packaging"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Transparent plastic. specular_ior 1.5693 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/pet-green.json b/assets/library/materials/plastic/pet-green.json new file mode 100644 index 00000000..d071c173 --- /dev/null +++ b/assets/library/materials/plastic/pet-green.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/pet-green", + "name": "PET, green bottle tint", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.5693, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 27.9, + "transmission_color": [0.2207, 0.3978, 0.1741], + "transmission_depth": 0.0005 + }, + "tags": ["polymer", "transparent", "green", "tinted", "packaging"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Transparent plastic. specular_ior 1.5693 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding. transmission_color authored as sRGB #5fae6a, the colour reached through 0.0005 m, a typical sheet thickness.", + "authored": ["specular_roughness", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polycarbonate-clear.json b/assets/library/materials/plastic/polycarbonate-clear.json new file mode 100644 index 00000000..d9d9f647 --- /dev/null +++ b/assets/library/materials/plastic/polycarbonate-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polycarbonate-clear", + "name": "Polycarbonate, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.5848, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 27.9, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "electronics"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C16H14O3)n%20-%20polycarbonate/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.5848 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polycarbonate-frosted.json b/assets/library/materials/plastic/polycarbonate-frosted.json new file mode 100644 index 00000000..80981498 --- /dev/null +++ b/assets/library/materials/plastic/polycarbonate-frosted.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polycarbonate-frosted", + "name": "Polycarbonate, frosted", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "specular_ior": 1.5848, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 27.9, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "frosted", "translucent", "lighting"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C16H14O3)n%20-%20polycarbonate/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.5848 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.3 authored: optically polished sheet or moulding. Frosted: roughness 0.3 authored for a textured diffuser moulding.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polypropylene-natural.json b/assets/library/materials/plastic/polypropylene-natural.json new file mode 100644 index 00000000..ce148386 --- /dev/null +++ b/assets/library/materials/plastic/polypropylene-natural.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polypropylene-natural", + "name": "Polypropylene, natural translucent", + "category": "Plastic", + "type": "plastic", + "params": { + "base_color": [0.8908, 0.8802, 0.8033], + "base_metalness": 0.0, + "specular_roughness": 0.35, + "specular_ior": 1.49, + "subsurface_weight": 1.0, + "subsurface_color": [0.8908, 0.8802, 0.8033], + "subsurface_radius": 0.003, + "subsurface_radius_scale": [1.0, 1.0, 0.9] + }, + "tags": ["polymer", "satin", "white", "translucent", "subsurface", "packaging"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Unpigmented semicrystalline polyolefin: light scatters in the crystallites, so it glows milky. Modelled with subsurface: colour sRGB #f4f1e6, mean free path 3 mm (authored so a 2 mm wall looks translucent but not clear), slightly shorter in blue. Roughness 0.35 authored. specular_ior 1.49: authored typical value for isotactic polypropylene (quoted 1.47 to 1.50).", + "authored": ["base_color", "specular_roughness", "specular_ior", "subsurface_color", "subsurface_radius", "subsurface_radius_scale"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/plastic/polystyrene-clear.json b/assets/library/materials/plastic/polystyrene-clear.json new file mode 100644 index 00000000..de1d81c4 --- /dev/null +++ b/assets/library/materials/plastic/polystyrene-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "plastic/polystyrene-clear", + "name": "Polystyrene, clear", + "category": "Plastic", + "type": "plastic_clear", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.01, + "specular_ior": 1.5916, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 29.5, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["polymer", "transparent", "clear", "gloss", "packaging"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C8H8)n%20-%20polystyrene/nk/Sultanova.yml"], + "notes": "Transparent plastic. specular_ior 1.5916 is the measured n at 587.6 nm; the Abbe number is (nd - 1)/(nF - nC) from the same data, stored with dispersion off (scale 0) since plastics show little fire; turn the scale to 1 for optics. Roughness 0.01 authored: optically polished sheet or moulding.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} From c2ca1755718b269b6cdf5ea9a88d157290053636 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:55 -0500 Subject: [PATCH 161/494] feat(library): add window and optical glass presets Soda-lime window glasses whose transmission colours come from measured absorption spectra, plus crown, flint and fused silica with measured index and Abbe number. Ran the library validator. --- .../materials/glass/dense-flint-n-sf11.json | 28 +++++++++++++++++++ .../library/materials/glass/fused-silica.json | 28 +++++++++++++++++++ .../materials/glass/optical-crown-n-bk7.json | 28 +++++++++++++++++++ .../materials/glass/optical-flint-n-f2.json | 28 +++++++++++++++++++ .../materials/glass/window-glass-bronze.json | 28 +++++++++++++++++++ .../materials/glass/window-glass-clear.json | 28 +++++++++++++++++++ .../materials/glass/window-glass-frosted.json | 28 +++++++++++++++++++ .../materials/glass/window-glass-green.json | 28 +++++++++++++++++++ .../materials/glass/window-glass-grey.json | 28 +++++++++++++++++++ .../glass/window-glass-low-iron.json | 28 +++++++++++++++++++ 10 files changed, 280 insertions(+) create mode 100644 assets/library/materials/glass/dense-flint-n-sf11.json create mode 100644 assets/library/materials/glass/fused-silica.json create mode 100644 assets/library/materials/glass/optical-crown-n-bk7.json create mode 100644 assets/library/materials/glass/optical-flint-n-f2.json create mode 100644 assets/library/materials/glass/window-glass-bronze.json create mode 100644 assets/library/materials/glass/window-glass-clear.json create mode 100644 assets/library/materials/glass/window-glass-frosted.json create mode 100644 assets/library/materials/glass/window-glass-green.json create mode 100644 assets/library/materials/glass/window-glass-grey.json create mode 100644 assets/library/materials/glass/window-glass-low-iron.json diff --git a/assets/library/materials/glass/dense-flint-n-sf11.json b/assets/library/materials/glass/dense-flint-n-sf11.json new file mode 100644 index 00000000..b4d6b4ed --- /dev/null +++ b/assets/library/materials/glass/dense-flint-n-sf11.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/dense-flint-n-sf11", + "name": "Dense flint glass (N-SF11)", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7847, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 25.7 + }, + "tags": ["glass", "transparent", "clear", "optics", "dispersion"], + "source": { + "kind": "published", + "reference": "SCHOTT Zemax catalog 2017-01-20b (obtained from http://www.schott.com)See also SCHOTT glass data sheets; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/specs/schott/optical/N-SF11.yml"], + "notes": "specular_ior 1.7847 is the measured n at 587.6 nm and Abbe number 25.7 is (nd - 1)/(nF - nC) from the same data. Dispersion on (scale 1): visible fire is part of this glass's look.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/fused-silica.json b/assets/library/materials/glass/fused-silica.json new file mode 100644 index 00000000..20507223 --- /dev/null +++ b/assets/library/materials/glass/fused-silica.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/fused-silica", + "name": "Fused silica", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4585, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 67.8 + }, + "tags": ["glass", "transparent", "clear", "optics"], + "source": { + "kind": "published", + "reference": "I. H. Malitson. Interspecimen comparison of the refractive index of fused silica. J. Opt. Soc. Am. 55, 1205-1208 (1965); C. Z. Tan. Determination of refractive index of silica glass for infrared wavelengths by IR spectroscopy. J. Non-Cryst. Solids 223, 158-163 (1998) * Sellmeier formula is reported in Ref. 1 for the 0.21-3.71 μm wavelength range. Ref. 2 verifies the validity of the formula up to 6.7 μm.; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Malitson.yml"], + "notes": "specular_ior 1.4585 is the measured n at 587.6 nm and Abbe number 67.8 is (nd - 1)/(nF - nC) from the same data. Dispersion on (scale 1): visible fire is part of this glass's look.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/optical-crown-n-bk7.json b/assets/library/materials/glass/optical-crown-n-bk7.json new file mode 100644 index 00000000..5de0f3bb --- /dev/null +++ b/assets/library/materials/glass/optical-crown-n-bk7.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/optical-crown-n-bk7", + "name": "Optical crown glass (N-BK7)", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5168, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 64.2 + }, + "tags": ["glass", "transparent", "clear", "optics"], + "source": { + "kind": "published", + "reference": "SCHOTT Zemax catalog 2017-01-20b (obtained from http://www.schott.com) See also SCHOTT glass data sheets; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/specs/schott/optical/N-BK7.yml"], + "notes": "specular_ior 1.5168 is the measured n at 587.6 nm and Abbe number 64.2 is (nd - 1)/(nF - nC) from the same data. Dispersion on (scale 1): visible fire is part of this glass's look.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/optical-flint-n-f2.json b/assets/library/materials/glass/optical-flint-n-f2.json new file mode 100644 index 00000000..80f7e278 --- /dev/null +++ b/assets/library/materials/glass/optical-flint-n-f2.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/optical-flint-n-f2", + "name": "Optical flint glass (N-F2)", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.6201, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 36.4 + }, + "tags": ["glass", "transparent", "clear", "optics", "dispersion"], + "source": { + "kind": "published", + "reference": "SCHOTT Zemax catalog 2017-01-20b (obtained from http://www.schott.com)See also SCHOTT glass data sheets; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/specs/schott/optical/N-F2.yml"], + "notes": "specular_ior 1.6201 is the measured n at 587.6 nm and Abbe number 36.4 is (nd - 1)/(nF - nC) from the same data. Dispersion on (scale 1): visible fire is part of this glass's look.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-bronze.json b/assets/library/materials/glass/window-glass-bronze.json new file mode 100644 index 00000000..ac7cf925 --- /dev/null +++ b/assets/library/materials/glass/window-glass-bronze.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-bronze", + "name": "Window glass, bronze tint", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.6105, 0.5673, 0.4963], + "transmission_depth": 0.006, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "brown", "tinted", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-bronze.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.006 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-clear.json b/assets/library/materials/glass/window-glass-clear.json new file mode 100644 index 00000000..52dd73cc --- /dev/null +++ b/assets/library/materials/glass/window-glass-clear.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-clear", + "name": "Window glass, clear", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.6033, 0.773, 0.7639], + "transmission_depth": 0.05, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "clear", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.05 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-frosted.json b/assets/library/materials/glass/window-glass-frosted.json new file mode 100644 index 00000000..8d2aaa02 --- /dev/null +++ b/assets/library/materials/glass/window-glass-frosted.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-frosted", + "name": "Window glass, frosted", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.35, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.6033, 0.773, 0.7639], + "transmission_depth": 0.05, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "clear", "frosted", "translucent", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.05 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire. Roughness 0.35 authored for an acid-etched surface.", + "authored": ["specular_roughness", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-green.json b/assets/library/materials/glass/window-glass-green.json new file mode 100644 index 00000000..7b104e6c --- /dev/null +++ b/assets/library/materials/glass/window-glass-green.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-green", + "name": "Window glass, green tint", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.3827, 0.573, 0.5777], + "transmission_depth": 0.02, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "green", "tinted", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-green.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.02 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-grey.json b/assets/library/materials/glass/window-glass-grey.json new file mode 100644 index 00000000..6928130e --- /dev/null +++ b/assets/library/materials/glass/window-glass-grey.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-grey", + "name": "Window glass, grey tint", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.4563, 0.4663, 0.4886], + "transmission_depth": 0.006, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "grey", "tinted", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-grey.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.006 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-glass-low-iron.json b/assets/library/materials/glass/window-glass-low-iron.json new file mode 100644 index 00000000..d2b870b7 --- /dev/null +++ b/assets/library/materials/glass/window-glass-low-iron.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-glass-low-iron", + "name": "Window glass, low iron", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.6326, 0.7898, 0.7875], + "transmission_depth": 0.2, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "clear", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-lowiron.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through transmission_depth 0.2 m; the depth was chosen so the colour is strong enough to keep its hue in RGB. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} From e7b386812bb7969094b33a8cb1e67ff52aec5eec Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:55 -0500 Subject: [PATCH 162/494] feat(library): add thin pane, coloured and opal glass presets Thin-walled panes carrying the measured colour of one 6 mm pane, authored bottle and cobalt tints over the measured soda-lime index, and opal glass as subsurface scattering. Ran the library validator. --- .../materials/glass/bottle-glass-amber.json | 28 ++++++++++++++++++ .../materials/glass/bottle-glass-green.json | 28 ++++++++++++++++++ .../materials/glass/cobalt-blue-glass.json | 28 ++++++++++++++++++ .../library/materials/glass/opal-glass.json | 28 ++++++++++++++++++ .../glass/window-pane-thin-bronze.json | 29 +++++++++++++++++++ .../glass/window-pane-thin-frosted.json | 29 +++++++++++++++++++ .../materials/glass/window-pane-thin.json | 29 +++++++++++++++++++ 7 files changed, 199 insertions(+) create mode 100644 assets/library/materials/glass/bottle-glass-amber.json create mode 100644 assets/library/materials/glass/bottle-glass-green.json create mode 100644 assets/library/materials/glass/cobalt-blue-glass.json create mode 100644 assets/library/materials/glass/opal-glass.json create mode 100644 assets/library/materials/glass/window-pane-thin-bronze.json create mode 100644 assets/library/materials/glass/window-pane-thin-frosted.json create mode 100644 assets/library/materials/glass/window-pane-thin.json diff --git a/assets/library/materials/glass/bottle-glass-amber.json b/assets/library/materials/glass/bottle-glass-amber.json new file mode 100644 index 00000000..202d0558 --- /dev/null +++ b/assets/library/materials/glass/bottle-glass-amber.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/bottle-glass-amber", + "name": "Bottle glass, amber", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.2734, 0.117, 0.0229], + "transmission_depth": 0.003, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "brown", "tinted", "packaging"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire. transmission_color authored as sRGB #a8580f, the amber of iron-sulphur coloured container glass through a 3 mm wall; the measured clear soda-lime index is kept.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/bottle-glass-green.json b/assets/library/materials/glass/bottle-glass-green.json new file mode 100644 index 00000000..f4f989b8 --- /dev/null +++ b/assets/library/materials/glass/bottle-glass-green.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/bottle-glass-green", + "name": "Bottle glass, green", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.1599, 0.3022, 0.0789], + "transmission_depth": 0.003, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "green", "tinted", "packaging"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire. transmission_color authored as sRGB #4f9a3e, the green of iron and chromium coloured container glass seen through a 3 mm wall; the measured clear soda-lime index is kept.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/cobalt-blue-glass.json b/assets/library/materials/glass/cobalt-blue-glass.json new file mode 100644 index 00000000..b81ff58f --- /dev/null +++ b/assets/library/materials/glass/cobalt-blue-glass.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/cobalt-blue-glass", + "name": "Cobalt blue glass", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.0453, 0.0522, 0.3739], + "transmission_depth": 0.003, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0 + }, + "tags": ["glass", "transparent", "blue", "tinted", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire. transmission_color authored as sRGB #1f3fae, the deep blue of cobalt oxide glass through a 3 mm wall; the measured clear soda-lime index is kept.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/opal-glass.json b/assets/library/materials/glass/opal-glass.json new file mode 100644 index 00000000..6fccd000 --- /dev/null +++ b/assets/library/materials/glass/opal-glass.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/opal-glass", + "name": "Opal glass", + "category": "Glass", + "type": "glass", + "params": { + "base_color": [0.8864, 0.8875, 0.8593], + "base_metalness": 0.0, + "specular_roughness": 0.05, + "specular_ior": 1.5234, + "transmission_weight": 0.0, + "subsurface_weight": 1.0, + "subsurface_color": [0.8864, 0.8875, 0.8593], + "subsurface_radius": 0.002, + "subsurface_radius_scale": [1.0, 0.9, 0.8] + }, + "tags": ["glass", "translucent", "subsurface", "white", "lighting"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Opal (milk) glass: a clear soda-lime base (measured n 1.5234) with light-scattering inclusions, modelled as subsurface with transmission off. Colour sRGB #f2f2ee, mean free path 2 mm and the warm radius scale are authored so a 3 mm lamp shade diffuses fully.", + "authored": ["base_color", "specular_roughness", "subsurface_color", "subsurface_radius", "subsurface_radius_scale"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-pane-thin-bronze.json b/assets/library/materials/glass/window-pane-thin-bronze.json new file mode 100644 index 00000000..2e4df5c3 --- /dev/null +++ b/assets/library/materials/glass/window-pane-thin-bronze.json @@ -0,0 +1,29 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-pane-thin-bronze", + "name": "Window pane, thin bronze", + "category": "Glass", + "type": "glass_thin", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.6105, 0.5673, 0.4963], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0, + "geometry_thin_walled": true + }, + "tags": ["glass", "transparent", "brown", "tinted", "architectural", "thin-walled"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-bronze.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through one 6 mm pane, applied at the surface of the thin shell. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-pane-thin-frosted.json b/assets/library/materials/glass/window-pane-thin-frosted.json new file mode 100644 index 00000000..4f0d3f34 --- /dev/null +++ b/assets/library/materials/glass/window-pane-thin-frosted.json @@ -0,0 +1,29 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-pane-thin-frosted", + "name": "Window pane, thin frosted", + "category": "Glass", + "type": "glass_thin", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.35, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.94, 0.9693, 0.968], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0, + "geometry_thin_walled": true + }, + "tags": ["glass", "transparent", "clear", "frosted", "architectural", "thin-walled"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through one 6 mm pane, applied at the surface of the thin shell. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire. Roughness 0.35 authored for an acid-etched pane.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/glass/window-pane-thin.json b/assets/library/materials/glass/window-pane-thin.json new file mode 100644 index 00000000..ffc4f283 --- /dev/null +++ b/assets/library/materials/glass/window-pane-thin.json @@ -0,0 +1,29 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "glass/window-pane-thin", + "name": "Window pane, thin shell", + "category": "Glass", + "type": "glass_thin", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5234, + "transmission_weight": 1.0, + "transmission_color": [0.94, 0.9693, 0.968], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.0, + "geometry_thin_walled": true + }, + "tags": ["glass", "transparent", "clear", "architectural", "thin-walled"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "specular_ior 1.5234 is the measured n at 587.6 nm and Abbe number 64.0 is (nd - 1)/(nF - nC) from the same data. transmission_color is the measured absorption (Beer-Lambert from k, CIE 1931 under D65) through one 6 mm pane, applied at the surface of the thin shell. Dispersion stored but off (scale 0); set the scale to 1 for spectral fire.", + "authored": [] + }, + "licence": "Apache-2.0" +} From fd5e724f20a99e220b5c2a738340e2e1aaecafcf Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:01:28 -0500 Subject: [PATCH 163/494] feat(library): add gloss, satin and matte paint presets Solid paints with authored colours: gloss and satin as pigment under a clear binder coat, matte with the coat off and a rough diffuse lobe. Ran the library validator. --- .../library/materials/paint/gloss-black.json | 27 +++++++++++++++++++ .../library/materials/paint/gloss-blue.json | 27 +++++++++++++++++++ .../library/materials/paint/gloss-green.json | 27 +++++++++++++++++++ .../library/materials/paint/gloss-orange.json | 27 +++++++++++++++++++ assets/library/materials/paint/gloss-red.json | 27 +++++++++++++++++++ .../library/materials/paint/gloss-white.json | 27 +++++++++++++++++++ .../library/materials/paint/gloss-yellow.json | 27 +++++++++++++++++++ .../library/materials/paint/matte-black.json | 25 +++++++++++++++++ .../library/materials/paint/matte-sage.json | 25 +++++++++++++++++ .../materials/paint/matte-terracotta.json | 25 +++++++++++++++++ .../library/materials/paint/matte-white.json | 25 +++++++++++++++++ .../library/materials/paint/satin-blue.json | 27 +++++++++++++++++++ .../library/materials/paint/satin-grey.json | 27 +++++++++++++++++++ .../library/materials/paint/satin-white.json | 27 +++++++++++++++++++ 14 files changed, 370 insertions(+) create mode 100644 assets/library/materials/paint/gloss-black.json create mode 100644 assets/library/materials/paint/gloss-blue.json create mode 100644 assets/library/materials/paint/gloss-green.json create mode 100644 assets/library/materials/paint/gloss-orange.json create mode 100644 assets/library/materials/paint/gloss-red.json create mode 100644 assets/library/materials/paint/gloss-white.json create mode 100644 assets/library/materials/paint/gloss-yellow.json create mode 100644 assets/library/materials/paint/matte-black.json create mode 100644 assets/library/materials/paint/matte-sage.json create mode 100644 assets/library/materials/paint/matte-terracotta.json create mode 100644 assets/library/materials/paint/matte-white.json create mode 100644 assets/library/materials/paint/satin-blue.json create mode 100644 assets/library/materials/paint/satin-grey.json create mode 100644 assets/library/materials/paint/satin-white.json diff --git a/assets/library/materials/paint/gloss-black.json b/assets/library/materials/paint/gloss-black.json new file mode 100644 index 00000000..0f005adf --- /dev/null +++ b/assets/library/materials/paint/gloss-black.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-black", + "name": "Gloss enamel, black", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.004, 0.004, 0.004], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "black", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #0d0d0d. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-blue.json b/assets/library/materials/paint/gloss-blue.json new file mode 100644 index 00000000..aab90e03 --- /dev/null +++ b/assets/library/materials/paint/gloss-blue.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-blue", + "name": "Gloss enamel, blue", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.038, 0.0503, 0.2633], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "blue", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #1c3f94. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-green.json b/assets/library/materials/paint/gloss-green.json new file mode 100644 index 00000000..2652bfbe --- /dev/null +++ b/assets/library/materials/paint/gloss-green.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-green", + "name": "Gloss enamel, green", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.0603, 0.1363, 0.0532], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "green", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #1f6b3a. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-orange.json b/assets/library/materials/paint/gloss-orange.json new file mode 100644 index 00000000..5bdc7724 --- /dev/null +++ b/assets/library/materials/paint/gloss-orange.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-orange", + "name": "Gloss enamel, orange", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.5288, 0.1482, 0.0308], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "orange", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #e8590c. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-red.json b/assets/library/materials/paint/gloss-red.json new file mode 100644 index 00000000..fc44240d --- /dev/null +++ b/assets/library/materials/paint/gloss-red.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-red", + "name": "Gloss enamel, red", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.2859, 0.0381, 0.0197], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "red", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #b5121b. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-white.json b/assets/library/materials/paint/gloss-white.json new file mode 100644 index 00000000..2a1b0a34 --- /dev/null +++ b/assets/library/materials/paint/gloss-white.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-white", + "name": "Gloss enamel, white", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.8535, 0.8546, 0.827], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "white", "opaque", "furniture"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #eeeeea. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/gloss-yellow.json b/assets/library/materials/paint/gloss-yellow.json new file mode 100644 index 00000000..0fbeb5c2 --- /dev/null +++ b/assets/library/materials/paint/gloss-yellow.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/gloss-yellow", + "name": "Gloss enamel, yellow", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.7472, 0.5699, 0.0793], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "gloss", "coat", "yellow", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #f5c400. Gloss enamel: pigment layer under a smooth binder film, coat roughness 0.03; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/matte-black.json b/assets/library/materials/paint/matte-black.json new file mode 100644 index 00000000..0ffaca0d --- /dev/null +++ b/assets/library/materials/paint/matte-black.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/matte-black", + "name": "Matte paint, black", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.006, 0.006, 0.006], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["paint", "matte", "black", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #121212. Flat (matte) paint: pigment-rich surface with no binder film on top, specular roughness 0.7 and a rough diffuse lobe; coat off. specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/matte-sage.json b/assets/library/materials/paint/matte-sage.json new file mode 100644 index 00000000..02e5208f --- /dev/null +++ b/assets/library/materials/paint/matte-sage.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/matte-sage", + "name": "Matte paint, sage green", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.3429, 0.3849, 0.2672], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["paint", "matte", "green", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #9aa889. Flat (matte) paint: pigment-rich surface with no binder film on top, specular roughness 0.7 and a rough diffuse lobe; coat off. specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/matte-terracotta.json b/assets/library/materials/paint/matte-terracotta.json new file mode 100644 index 00000000..bc91d682 --- /dev/null +++ b/assets/library/materials/paint/matte-terracotta.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/matte-terracotta", + "name": "Matte paint, terracotta", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.3254, 0.1403, 0.0656], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["paint", "matte", "orange", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #b5603f. Flat (matte) paint: pigment-rich surface with no binder film on top, specular roughness 0.7 and a rough diffuse lobe; coat off. specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/matte-white.json b/assets/library/materials/paint/matte-white.json new file mode 100644 index 00000000..1c6d1a07 --- /dev/null +++ b/assets/library/materials/paint/matte-white.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/matte-white", + "name": "Matte paint, white", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.8585, 0.8551, 0.8271], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["paint", "matte", "white", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #efeeea. Flat (matte) paint: pigment-rich surface with no binder film on top, specular roughness 0.7 and a rough diffuse lobe; coat off. specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/satin-blue.json b/assets/library/materials/paint/satin-blue.json new file mode 100644 index 00000000..3216aca5 --- /dev/null +++ b/assets/library/materials/paint/satin-blue.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/satin-blue", + "name": "Satin paint, blue", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.0768, 0.1113, 0.2345], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.25, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "satin", "coat", "blue", "opaque", "furniture"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #3a5f8a. Satin (eggshell) paint: the binder film is micro-rough, coat roughness 0.25; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/satin-grey.json b/assets/library/materials/paint/satin-grey.json new file mode 100644 index 00000000..7de85824 --- /dev/null +++ b/assets/library/materials/paint/satin-grey.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/satin-grey", + "name": "Satin paint, grey", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.21, 0.2153, 0.2286], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.25, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "satin", "coat", "grey", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #7d8084. Satin (eggshell) paint: the binder film is micro-rough, coat roughness 0.25; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/satin-white.json b/assets/library/materials/paint/satin-white.json new file mode 100644 index 00000000..1aa9bff6 --- /dev/null +++ b/assets/library/materials/paint/satin-white.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/satin-white", + "name": "Satin paint, white", + "category": "Paint", + "type": "paint", + "params": { + "base_color": [0.8338, 0.8308, 0.7966], + "base_metalness": 0.0, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.25, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "satin", "coat", "white", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "base_color authored as sRGB #ecebe6. Satin (eggshell) paint: the binder film is micro-rough, coat roughness 0.25; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). specular_ior 1.5 of the pigment layer authored (binder-dominated).", + "authored": ["base_color", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} From b3452b81eb4659ef41081845718b606a10f66b62 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:01:28 -0500 Subject: [PATCH 164/494] feat(library): add metallic and pearl paint presets Metallic paints as partly metallic tinted basecoats under a clear coat, and pearl paints with a titanium dioxide interference film; all marked as needing the flakes graph for sparkle. Ran the library validator. --- .../materials/paint/metallic-black.json | 27 +++++++++++++++++ .../materials/paint/metallic-blue.json | 27 +++++++++++++++++ .../materials/paint/metallic-champagne.json | 27 +++++++++++++++++ .../materials/paint/metallic-gunmetal.json | 27 +++++++++++++++++ .../library/materials/paint/metallic-red.json | 27 +++++++++++++++++ .../materials/paint/metallic-silver.json | 27 +++++++++++++++++ .../library/materials/paint/pearl-blue.json | 30 +++++++++++++++++++ .../library/materials/paint/pearl-white.json | 30 +++++++++++++++++++ 8 files changed, 222 insertions(+) create mode 100644 assets/library/materials/paint/metallic-black.json create mode 100644 assets/library/materials/paint/metallic-blue.json create mode 100644 assets/library/materials/paint/metallic-champagne.json create mode 100644 assets/library/materials/paint/metallic-gunmetal.json create mode 100644 assets/library/materials/paint/metallic-red.json create mode 100644 assets/library/materials/paint/metallic-silver.json create mode 100644 assets/library/materials/paint/pearl-blue.json create mode 100644 assets/library/materials/paint/pearl-white.json diff --git a/assets/library/materials/paint/metallic-black.json b/assets/library/materials/paint/metallic-black.json new file mode 100644 index 00000000..30fb766c --- /dev/null +++ b/assets/library/materials/paint/metallic-black.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-black", + "name": "Metallic paint, black", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.0106, 0.0109, 0.0121], + "base_metalness": 0.6, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "black", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #1a1b1d; base_metalness 0.6 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/metallic-blue.json b/assets/library/materials/paint/metallic-blue.json new file mode 100644 index 00000000..a7d4df66 --- /dev/null +++ b/assets/library/materials/paint/metallic-blue.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-blue", + "name": "Metallic paint, blue", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.0325, 0.0449, 0.1745], + "base_metalness": 0.7, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "blue", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #1e3c7a; base_metalness 0.7 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/metallic-champagne.json b/assets/library/materials/paint/metallic-champagne.json new file mode 100644 index 00000000..0bd42d10 --- /dev/null +++ b/assets/library/materials/paint/metallic-champagne.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-champagne", + "name": "Metallic paint, champagne", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.5255, 0.4628, 0.2902], + "base_metalness": 0.7, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "gold", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #c9b48c; base_metalness 0.7 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/metallic-gunmetal.json b/assets/library/materials/paint/metallic-gunmetal.json new file mode 100644 index 00000000..91f8b51e --- /dev/null +++ b/assets/library/materials/paint/metallic-gunmetal.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-gunmetal", + "name": "Metallic paint, gunmetal", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.0721, 0.0758, 0.0869], + "base_metalness": 0.7, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "grey", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #4a4e54; base_metalness 0.7 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/metallic-red.json b/assets/library/materials/paint/metallic-red.json new file mode 100644 index 00000000..a449be45 --- /dev/null +++ b/assets/library/materials/paint/metallic-red.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-red", + "name": "Metallic paint, red", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.2139, 0.0337, 0.0221], + "base_metalness": 0.7, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "red", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #9e1a22; base_metalness 0.7 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/metallic-silver.json b/assets/library/materials/paint/metallic-silver.json new file mode 100644 index 00000000..e7da259a --- /dev/null +++ b/assets/library/materials/paint/metallic-silver.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/metallic-silver", + "name": "Metallic paint, silver", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.4896, 0.5016, 0.5235], + "base_metalness": 0.8, + "specular_roughness": 0.35, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "silver", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Metallic automotive paint: aluminium flakes in a tinted basecoat under a clear coat. base_color authored as sRGB #b8bcc0; base_metalness 0.8 authored to mix flake reflection with pigment; flake spread as specular roughness 0.35; clear coat roughness 0.02; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49). The sparkle needs the type's flakes graph.", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/pearl-blue.json b/assets/library/materials/paint/pearl-blue.json new file mode 100644 index 00000000..1b997dab --- /dev/null +++ b/assets/library/materials/paint/pearl-blue.json @@ -0,0 +1,30 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/pearl-blue", + "name": "Pearl paint, blue", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.0524, 0.0715, 0.2365], + "base_metalness": 0.3, + "specular_roughness": 0.3, + "specular_ior": 1.5, + "thin_film_weight": 0.8, + "thin_film_thickness": 0.065, + "thin_film_ior": 2.4, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "thin-film", "blue", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Pearlescent paint: titanium-dioxide coated mica platelets whose interference shifts the colour with angle. base_color authored as sRGB #2c4c8c; thin film ior 2.4 authored (TiO2), thickness 0.065 um authored for the blue interference hue, weight 0.8 so some pigment shows through; base_metalness 0.3 authored for the platelets' mirror-like sheen; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49).", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "thin_film_weight", "thin_film_thickness", "thin_film_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/paint/pearl-white.json b/assets/library/materials/paint/pearl-white.json new file mode 100644 index 00000000..28325380 --- /dev/null +++ b/assets/library/materials/paint/pearl-white.json @@ -0,0 +1,30 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "paint/pearl-white", + "name": "Pearl paint, white", + "category": "Paint", + "type": "paint_metallic", + "params": { + "base_color": [0.8706, 0.8636, 0.8146], + "base_metalness": 0.3, + "specular_roughness": 0.3, + "specular_ior": 1.5, + "thin_film_weight": 0.8, + "thin_film_thickness": 0.08, + "thin_film_ior": 2.4, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["paint", "coat", "thin-film", "white", "gloss", "automotive", "needs-graph"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Pearlescent paint: titanium-dioxide coated mica platelets whose interference shifts the colour with angle. base_color authored as sRGB #f1efe8; thin film ior 2.4 authored (TiO2), thickness 0.08 um authored for the white interference hue, weight 0.8 so some pigment shows through; base_metalness 0.3 authored for the platelets' mirror-like sheen; coat_ior 1.5 authored, typical of acrylic and polyurethane clear binders (cured acrylic is about 1.49).", + "authored": ["base_color", "base_metalness", "specular_roughness", "specular_ior", "thin_film_weight", "thin_film_thickness", "thin_film_ior", "coat_roughness", "coat_ior", "coat_color"] + }, + "licence": "Apache-2.0" +} From b64b53827dac2fcfb0f19c0cf2d38f353e0e7166 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 165/494] feat(library): add rubber and silicone presets Black, grey, natural and dyed rubbers with authored colours and roughness, and silicone with the measured PDMS index and slight subsurface. Ran the library validator. --- .../materials/rubber/black-rubber-matte.json | 25 +++++++++++++++++ .../materials/rubber/black-rubber-satin.json | 25 +++++++++++++++++ .../library/materials/rubber/epdm-grey.json | 25 +++++++++++++++++ .../materials/rubber/gum-rubber-natural.json | 25 +++++++++++++++++ .../materials/rubber/nitrile-blue.json | 25 +++++++++++++++++ .../materials/rubber/silicone-rubber-red.json | 28 +++++++++++++++++++ .../rubber/silicone-rubber-white.json | 28 +++++++++++++++++++ .../materials/rubber/soft-touch-black.json | 25 +++++++++++++++++ .../library/materials/rubber/tyre-rubber.json | 25 +++++++++++++++++ 9 files changed, 231 insertions(+) create mode 100644 assets/library/materials/rubber/black-rubber-matte.json create mode 100644 assets/library/materials/rubber/black-rubber-satin.json create mode 100644 assets/library/materials/rubber/epdm-grey.json create mode 100644 assets/library/materials/rubber/gum-rubber-natural.json create mode 100644 assets/library/materials/rubber/nitrile-blue.json create mode 100644 assets/library/materials/rubber/silicone-rubber-red.json create mode 100644 assets/library/materials/rubber/silicone-rubber-white.json create mode 100644 assets/library/materials/rubber/soft-touch-black.json create mode 100644 assets/library/materials/rubber/tyre-rubber.json diff --git a/assets/library/materials/rubber/black-rubber-matte.json b/assets/library/materials/rubber/black-rubber-matte.json new file mode 100644 index 00000000..ec1b03cc --- /dev/null +++ b/assets/library/materials/rubber/black-rubber-matte.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/black-rubber-matte", + "name": "Black rubber, matte", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.006, 0.006, 0.006], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "black", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Moulded black rubber with a dull bloom. base_color authored as sRGB #121212; specular roughness 0.7 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/black-rubber-satin.json b/assets/library/materials/rubber/black-rubber-satin.json new file mode 100644 index 00000000..3fdd35a6 --- /dev/null +++ b/assets/library/materials/rubber/black-rubber-satin.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/black-rubber-satin", + "name": "Black rubber, satin", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.006, 0.006, 0.006], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.4, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "satin", "black", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Freshly moulded or dressed black rubber. base_color authored as sRGB #121212; specular roughness 0.4 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/epdm-grey.json b/assets/library/materials/rubber/epdm-grey.json new file mode 100644 index 00000000..38aab0cf --- /dev/null +++ b/assets/library/materials/rubber/epdm-grey.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/epdm-grey", + "name": "EPDM rubber, grey", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.1127, 0.1165, 0.1236], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.6, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "grey", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Light-grey EPDM seal or gasket. base_color authored as sRGB #5d6063; specular roughness 0.6 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/gum-rubber-natural.json b/assets/library/materials/rubber/gum-rubber-natural.json new file mode 100644 index 00000000..d1eff10e --- /dev/null +++ b/assets/library/materials/rubber/gum-rubber-natural.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/gum-rubber-natural", + "name": "Gum rubber, natural", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.3872, 0.2679, 0.1007], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.5, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "brown", "opaque", "apparel"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Unfilled natural crepe or gum rubber, as on shoe soles. base_color authored as sRGB #b98a4c; specular roughness 0.5 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/nitrile-blue.json b/assets/library/materials/rubber/nitrile-blue.json new file mode 100644 index 00000000..23c8b1f1 --- /dev/null +++ b/assets/library/materials/rubber/nitrile-blue.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/nitrile-blue", + "name": "Nitrile rubber, blue", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.1098, 0.1571, 0.5669], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.5, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "blue", "opaque", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Blue-dyed nitrile, as in gloves and O-rings. base_color authored as sRGB #3a6fd0; specular roughness 0.5 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/silicone-rubber-red.json b/assets/library/materials/rubber/silicone-rubber-red.json new file mode 100644 index 00000000..8efda2f3 --- /dev/null +++ b/assets/library/materials/rubber/silicone-rubber-red.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/silicone-rubber-red", + "name": "Silicone rubber, red", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.3343, 0.0644, 0.0342], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.4316, + "coat_weight": 0.0, + "subsurface_weight": 0.3, + "subsurface_color": [0.3343, 0.0644, 0.0342], + "subsurface_radius": 0.002 + }, + "tags": ["elastomer", "satin", "red", "subsurface", "kitchen"], + "source": { + "kind": "published", + "reference": "F. Schneider, J. Draheim, R. Kamberger, U. Wallrabe. Process and material properties of polydimethylsiloxane (PDMS) for Optical MEMS. Sens. Actuators A Phys. 151, 95-99 (2009); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C2H6OSi)n%20-%20polydimethylsiloxane/nk/Schneider-Sylgard184.yml"], + "notes": "Pigmented silicone (PDMS): specular_ior 1.4316 is the measured n of Sylgard 184 at 587.6 nm. base_color and subsurface colour authored as sRGB #c0302a; subsurface weight 0.3 and 2 mm mean free path authored for the slight translucency of moulded silicone; roughness authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "subsurface_weight", "subsurface_color", "subsurface_radius"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/silicone-rubber-white.json b/assets/library/materials/rubber/silicone-rubber-white.json new file mode 100644 index 00000000..d1affd5c --- /dev/null +++ b/assets/library/materials/rubber/silicone-rubber-white.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/silicone-rubber-white", + "name": "Silicone rubber, white", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.8465, 0.8393, 0.7978], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.4316, + "coat_weight": 0.0, + "subsurface_weight": 0.3, + "subsurface_color": [0.8465, 0.8393, 0.7978], + "subsurface_radius": 0.002 + }, + "tags": ["elastomer", "satin", "white", "subsurface", "kitchen"], + "source": { + "kind": "published", + "reference": "F. Schneider, J. Draheim, R. Kamberger, U. Wallrabe. Process and material properties of polydimethylsiloxane (PDMS) for Optical MEMS. Sens. Actuators A Phys. 151, 95-99 (2009); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C2H6OSi)n%20-%20polydimethylsiloxane/nk/Schneider-Sylgard184.yml"], + "notes": "Pigmented silicone (PDMS): specular_ior 1.4316 is the measured n of Sylgard 184 at 587.6 nm. base_color and subsurface colour authored as sRGB #eeece6; subsurface weight 0.3 and 2 mm mean free path authored for the slight translucency of moulded silicone; roughness authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "subsurface_weight", "subsurface_color", "subsurface_radius"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/soft-touch-black.json b/assets/library/materials/rubber/soft-touch-black.json new file mode 100644 index 00000000..fb4f1fde --- /dev/null +++ b/assets/library/materials/rubber/soft-touch-black.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/soft-touch-black", + "name": "Soft-touch coating, black", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.0103, 0.0103, 0.0103], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.55, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "black", "opaque", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Elastomeric soft-touch paint on plastic housings. base_color authored as sRGB #1a1a1a; specular roughness 0.55 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/rubber/tyre-rubber.json b/assets/library/materials/rubber/tyre-rubber.json new file mode 100644 index 00000000..048ab75b --- /dev/null +++ b/assets/library/materials/rubber/tyre-rubber.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "rubber/tyre-rubber", + "name": "Tyre rubber", + "category": "Rubber", + "type": "rubber", + "params": { + "base_color": [0.0052, 0.0052, 0.0052], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.65, + "specular_ior": 1.52, + "coat_weight": 0.0 + }, + "tags": ["elastomer", "matte", "black", "opaque", "automotive"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Carbon-black filled tread compound: albedo about 0.01 linear, worn surface. base_color authored as sRGB #101010; specular roughness 0.65 and diffuse roughness 0.5 authored. specular_ior 1.52 authored: the commonly quoted index of natural rubber (cis-polyisoprene) and of carbon-black filled compounds' binder.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} From 56fa2e700d949981e9e6267df1a7cc1049792a12 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 166/494] feat(library): add fabric presets through the fuzz layer Cotton, denim, linen, polyester, wool, felt, velvet and silk as a rough diffuse base with a fuzz layer; fibre indices measured where the database has them. Ran the library validator. --- .../library/materials/fabric/cotton-navy.json | 28 ++++++++++++++++++ .../library/materials/fabric/cotton-red.json | 28 ++++++++++++++++++ .../materials/fabric/cotton-white.json | 28 ++++++++++++++++++ .../library/materials/fabric/denim-blue.json | 28 ++++++++++++++++++ .../materials/fabric/felt-charcoal.json | 28 ++++++++++++++++++ .../materials/fabric/linen-natural.json | 28 ++++++++++++++++++ .../materials/fabric/polyester-black.json | 28 ++++++++++++++++++ .../materials/fabric/polyester-grey.json | 28 ++++++++++++++++++ .../library/materials/fabric/silk-ivory.json | 29 +++++++++++++++++++ .../materials/fabric/velvet-black.json | 28 ++++++++++++++++++ .../materials/fabric/velvet-burgundy.json | 28 ++++++++++++++++++ .../library/materials/fabric/wool-camel.json | 28 ++++++++++++++++++ .../library/materials/fabric/wool-grey.json | 28 ++++++++++++++++++ 13 files changed, 365 insertions(+) create mode 100644 assets/library/materials/fabric/cotton-navy.json create mode 100644 assets/library/materials/fabric/cotton-red.json create mode 100644 assets/library/materials/fabric/cotton-white.json create mode 100644 assets/library/materials/fabric/denim-blue.json create mode 100644 assets/library/materials/fabric/felt-charcoal.json create mode 100644 assets/library/materials/fabric/linen-natural.json create mode 100644 assets/library/materials/fabric/polyester-black.json create mode 100644 assets/library/materials/fabric/polyester-grey.json create mode 100644 assets/library/materials/fabric/silk-ivory.json create mode 100644 assets/library/materials/fabric/velvet-black.json create mode 100644 assets/library/materials/fabric/velvet-burgundy.json create mode 100644 assets/library/materials/fabric/wool-camel.json create mode 100644 assets/library/materials/fabric/wool-grey.json diff --git a/assets/library/materials/fabric/cotton-navy.json b/assets/library/materials/fabric/cotton-navy.json new file mode 100644 index 00000000..c699bc20 --- /dev/null +++ b/assets/library/materials/fabric/cotton-navy.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/cotton-navy", + "name": "Cotton, navy", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.019, 0.023, 0.0531], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.124, 0.1428, 0.246], + "fuzz_roughness": 0.5, + "specular_ior": 1.4701 + }, + "tags": ["natural-fibre", "fuzz", "matte", "blue", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #1f2a44 and fuzz colour sRGB #5a6a8c authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.5 authored. specular_ior 1.4701 is the measured n of cotton (cellulose) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/cotton-red.json b/assets/library/materials/fabric/cotton-red.json new file mode 100644 index 00000000..15f3c9ca --- /dev/null +++ b/assets/library/materials/fabric/cotton-red.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/cotton-red", + "name": "Cotton, red", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.2317, 0.0422, 0.0314], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.4754, 0.1772, 0.165], + "fuzz_roughness": 0.5, + "specular_ior": 1.4701 + }, + "tags": ["natural-fibre", "fuzz", "matte", "red", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #a3242c and fuzz colour sRGB #d8686e authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.5 authored. specular_ior 1.4701 is the measured n of cotton (cellulose) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/cotton-white.json b/assets/library/materials/fabric/cotton-white.json new file mode 100644 index 00000000..dd3cf73e --- /dev/null +++ b/assets/library/materials/fabric/cotton-white.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/cotton-white", + "name": "Cotton, white", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.8335, 0.8307, 0.7899], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [1.0, 1.0, 1.0], + "fuzz_roughness": 0.5, + "specular_ior": 1.4701 + }, + "tags": ["natural-fibre", "fuzz", "matte", "white", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #ecebe5 and fuzz colour sRGB #ffffff authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.5 authored. specular_ior 1.4701 is the measured n of cotton (cellulose) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/denim-blue.json b/assets/library/materials/fabric/denim-blue.json new file mode 100644 index 00000000..ad697fca --- /dev/null +++ b/assets/library/materials/fabric/denim-blue.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/denim-blue", + "name": "Denim, indigo", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.0414, 0.0565, 0.1224], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.3174, 0.3619, 0.499], + "fuzz_roughness": 0.55, + "specular_ior": 1.4701 + }, + "tags": ["natural-fibre", "fuzz", "matte", "blue", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #2c4466 and fuzz colour sRGB #8fa3bf authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.55 authored. specular_ior 1.4701 is the measured n of cotton (cellulose) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/felt-charcoal.json b/assets/library/materials/fabric/felt-charcoal.json new file mode 100644 index 00000000..0f974a27 --- /dev/null +++ b/assets/library/materials/fabric/felt-charcoal.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/felt-charcoal", + "name": "Felt, charcoal", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.0439, 0.0438, 0.0463], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.2022, 0.2017, 0.214], + "fuzz_roughness": 0.8, + "specular_ior": 1.55 + }, + "tags": ["natural-fibre", "fuzz", "matte", "grey", "apparel"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #3b3b3d and fuzz colour sRGB #7c7c80 authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.8 authored. specular_ior 1.55 authored: the commonly quoted index of keratin fibre (wool).", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/linen-natural.json b/assets/library/materials/fabric/linen-natural.json new file mode 100644 index 00000000..d659190d --- /dev/null +++ b/assets/library/materials/fabric/linen-natural.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/linen-natural", + "name": "Linen, natural", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.546, 0.5067, 0.3814], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.7549, 0.719, 0.5859], + "fuzz_roughness": 0.6, + "specular_ior": 1.4701 + }, + "tags": ["natural-fibre", "fuzz", "matte", "brown", "apparel"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #c9bca2 and fuzz colour sRGB #e6dcc6 authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.6 authored. specular_ior 1.4701 is the measured n of linen (cellulose) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/polyester-black.json b/assets/library/materials/fabric/polyester-black.json new file mode 100644 index 00000000..5810196f --- /dev/null +++ b/assets/library/materials/fabric/polyester-black.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/polyester-black", + "name": "Polyester, black", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.007, 0.007, 0.007], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.1022, 0.1022, 0.1022], + "fuzz_roughness": 0.45, + "specular_ior": 1.5693 + }, + "tags": ["synthetic-fibre", "fuzz", "matte", "black", "apparel"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #141414 and fuzz colour sRGB #5a5a5a authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.45 authored. specular_ior 1.5693 is the measured n of polyester (PET) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/polyester-grey.json b/assets/library/materials/fabric/polyester-grey.json new file mode 100644 index 00000000..d62f4be8 --- /dev/null +++ b/assets/library/materials/fabric/polyester-grey.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/polyester-grey", + "name": "Polyester, grey", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.198, 0.2013, 0.2139], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.4619, 0.4673, 0.4878], + "fuzz_roughness": 0.45, + "specular_ior": 1.5693 + }, + "tags": ["synthetic-fibre", "fuzz", "matte", "grey", "apparel"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #7a7c80 and fuzz colour sRGB #b4b6ba authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.45 authored. specular_ior 1.5693 is the measured n of polyester (PET) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/silk-ivory.json b/assets/library/materials/fabric/silk-ivory.json new file mode 100644 index 00000000..d64d370c --- /dev/null +++ b/assets/library/materials/fabric/silk-ivory.json @@ -0,0 +1,29 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/silk-ivory", + "name": "Silk, ivory", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.8046, 0.7712, 0.6442], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_weight": 0.6, + "specular_roughness": 0.35, + "specular_ior": 1.5503, + "specular_roughness_anisotropy": 0.5, + "fuzz_weight": 0.3, + "fuzz_color": [1.0, 1.0, 1.0], + "fuzz_roughness": 0.4 + }, + "tags": ["natural-fibre", "fuzz", "satin", "anisotropic", "white", "apparel"], + "source": { + "kind": "published", + "reference": "G. Perotto, Y. Zhang, D. Naskar, N. Patel, D. L. Kaplan, S. C. Kundu, F. G. Omenetto. The optical properties of regenerated silk fibroin films obtained from different sources. Appl. Phys. Lett. 111, 103702 (2017); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/other/silk/Bombyx%20mori/nk/Perotto-crystallized.yml"], + "notes": "Smooth filament silk: a stronger, anisotropic specular along the threads and little fuzz. specular_ior 1.5503 is the measured n of crystallised Bombyx mori fibroin at 587.6 nm. Colour sRGB #ece3cf, specular weight 0.6, roughness 0.35, anisotropy 0.5 and fuzz 0.3 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "specular_roughness_anisotropy", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/velvet-black.json b/assets/library/materials/fabric/velvet-black.json new file mode 100644 index 00000000..10a98cb6 --- /dev/null +++ b/assets/library/materials/fabric/velvet-black.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/velvet-black", + "name": "Velvet, black", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.0037, 0.0037, 0.0037], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.147, 0.147, 0.147], + "fuzz_roughness": 0.3, + "specular_ior": 1.5693 + }, + "tags": ["synthetic-fibre", "fuzz", "matte", "black", "furniture"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #0c0c0c and fuzz colour sRGB #6b6b6b authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.3 authored, low for the upright pile of velvet. specular_ior 1.5693 is the measured n of polyester (PET) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/velvet-burgundy.json b/assets/library/materials/fabric/velvet-burgundy.json new file mode 100644 index 00000000..1c7d355a --- /dev/null +++ b/assets/library/materials/fabric/velvet-burgundy.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/velvet-burgundy", + "name": "Velvet, burgundy", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.044, 0.009, 0.0109], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.2924, 0.0896, 0.1048], + "fuzz_roughness": 0.3, + "specular_ior": 1.5693 + }, + "tags": ["synthetic-fibre", "fuzz", "matte", "red", "furniture"], + "source": { + "kind": "published", + "reference": "X. Zhang, J. Qiu, X. Li, J. Zhao, L. Liu. Complex refractive indices measurements of polymers in visible and near-infrared bands. Appl. Opt. 59, 2337-2344 (2020) (0.4-2 µm); X. Zhang, J. Qiu, J. Zhao, X. Li, L. Liu. Complex refractive indices measurements of polymers in infrared bands. J. Quant. Spectrosc. Radiat. Transf. 252, 107063 (2020) (2-20 µm); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C10H8O4)n%20-%20polyethylene%20terephthalate/nk/Zhang.yml"], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #4a0e1a and fuzz colour sRGB #b0475a authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.3 authored, low for the upright pile of velvet. specular_ior 1.5693 is the measured n of polyester (PET) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/wool-camel.json b/assets/library/materials/fabric/wool-camel.json new file mode 100644 index 00000000..febaa5d9 --- /dev/null +++ b/assets/library/materials/fabric/wool-camel.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/wool-camel", + "name": "Wool, camel", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.3103, 0.2161, 0.1002], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.5797, 0.469, 0.292], + "fuzz_roughness": 0.7, + "specular_ior": 1.55 + }, + "tags": ["natural-fibre", "fuzz", "matte", "brown", "apparel"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #a77d50 and fuzz colour sRGB #d6b48c authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.7 authored. specular_ior 1.55 authored: the commonly quoted index of keratin fibre (wool).", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/fabric/wool-grey.json b/assets/library/materials/fabric/wool-grey.json new file mode 100644 index 00000000..3ee7ddd4 --- /dev/null +++ b/assets/library/materials/fabric/wool-grey.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "fabric/wool-grey", + "name": "Wool, grey", + "category": "Fabric", + "type": "fabric", + "params": { + "base_color": [0.2086, 0.2053, 0.1902], + "base_metalness": 0.0, + "base_diffuse_roughness": 1.0, + "specular_weight": 0.25, + "specular_roughness": 0.8, + "fuzz_weight": 1.0, + "fuzz_color": [0.5304, 0.5217, 0.4851], + "fuzz_roughness": 0.7, + "specular_ior": 1.55 + }, + "tags": ["natural-fibre", "fuzz", "matte", "grey", "apparel"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Woven or felted fibre: a rough diffuse base with a weak specular and a fuzz layer for the fibres standing off the surface. base_color sRGB #7f7d78 and fuzz colour sRGB #c2bfb8 authored (fuzz lighter, as stray fibres scatter un-dyed light); fuzz roughness 0.7 authored. specular_ior 1.55 authored: the commonly quoted index of keratin fibre (wool).", + "authored": ["base_color", "base_diffuse_roughness", "specular_weight", "specular_roughness", "fuzz_color", "fuzz_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} From f307c0cd2b36b5675cfdf7a209296c1dbc4a812a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 167/494] feat(library): add base settings for wood presets Ten species and finishes giving the average tone, finish roughness and lacquer coat, with the measured cellulose index; tagged as needing the wood graph for grain. Ran the library validator. --- assets/library/materials/wood/ash-oiled.json | 25 +++++++++++++++++ .../library/materials/wood/cherry-oiled.json | 25 +++++++++++++++++ .../materials/wood/ebony-polished.json | 27 +++++++++++++++++++ .../materials/wood/maple-lacquered.json | 27 +++++++++++++++++++ .../library/materials/wood/oak-lacquered.json | 27 +++++++++++++++++++ assets/library/materials/wood/oak-oiled.json | 25 +++++++++++++++++ assets/library/materials/wood/pine-raw.json | 25 +++++++++++++++++ assets/library/materials/wood/teak-oiled.json | 25 +++++++++++++++++ .../materials/wood/walnut-lacquered.json | 27 +++++++++++++++++++ .../library/materials/wood/walnut-oiled.json | 25 +++++++++++++++++ 10 files changed, 258 insertions(+) create mode 100644 assets/library/materials/wood/ash-oiled.json create mode 100644 assets/library/materials/wood/cherry-oiled.json create mode 100644 assets/library/materials/wood/ebony-polished.json create mode 100644 assets/library/materials/wood/maple-lacquered.json create mode 100644 assets/library/materials/wood/oak-lacquered.json create mode 100644 assets/library/materials/wood/oak-oiled.json create mode 100644 assets/library/materials/wood/pine-raw.json create mode 100644 assets/library/materials/wood/teak-oiled.json create mode 100644 assets/library/materials/wood/walnut-lacquered.json create mode 100644 assets/library/materials/wood/walnut-oiled.json diff --git a/assets/library/materials/wood/ash-oiled.json b/assets/library/materials/wood/ash-oiled.json new file mode 100644 index 00000000..11f7d337 --- /dev/null +++ b/assets/library/materials/wood/ash-oiled.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/ash-oiled", + "name": "Ash, oiled", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.5423, 0.4648, 0.3015], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.4, + "coat_weight": 0.0 + }, + "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #cdb48f authored as the species' average tone. Oil-finished wood keeps its texture: no film, roughness 0.4 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/cherry-oiled.json b/assets/library/materials/wood/cherry-oiled.json new file mode 100644 index 00000000..f84c1816 --- /dev/null +++ b/assets/library/materials/wood/cherry-oiled.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/cherry-oiled", + "name": "Cherry, oiled", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.2348, 0.1169, 0.0547], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.4, + "coat_weight": 0.0 + }, + "tags": ["wood", "satin", "red", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #9a5a3a authored as the species' average tone. Oil-finished wood keeps its texture: no film, roughness 0.4 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/ebony-polished.json b/assets/library/materials/wood/ebony-polished.json new file mode 100644 index 00000000..8fcf0e9c --- /dev/null +++ b/assets/library/materials/wood/ebony-polished.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/ebony-polished", + "name": "Ebony, polished", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.0199, 0.0157, 0.0122], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.45, + "coat_weight": 1.0, + "coat_roughness": 0.06, + "coat_ior": 1.5 + }, + "tags": ["wood", "gloss", "black", "needs-graph", "furniture", "coat"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #2a211c authored as the species' average tone. Lacquer film as a coat with roughness 0.06 and ior 1.5 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/maple-lacquered.json b/assets/library/materials/wood/maple-lacquered.json new file mode 100644 index 00000000..94e3f084 --- /dev/null +++ b/assets/library/materials/wood/maple-lacquered.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/maple-lacquered", + "name": "Maple, lacquered", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.6597, 0.5625, 0.3569], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.45, + "coat_weight": 1.0, + "coat_roughness": 0.06, + "coat_ior": 1.5 + }, + "tags": ["wood", "gloss", "yellow", "needs-graph", "furniture", "coat"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #e0c49a authored as the species' average tone. Lacquer film as a coat with roughness 0.06 and ior 1.5 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/oak-lacquered.json b/assets/library/materials/wood/oak-lacquered.json new file mode 100644 index 00000000..858cdc93 --- /dev/null +++ b/assets/library/materials/wood/oak-lacquered.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/oak-lacquered", + "name": "Oak, lacquered", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.3573, 0.2647, 0.1257], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.45, + "coat_weight": 1.0, + "coat_roughness": 0.06, + "coat_ior": 1.5 + }, + "tags": ["wood", "gloss", "brown", "needs-graph", "furniture", "coat"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #b08a5a authored as the species' average tone. Lacquer film as a coat with roughness 0.06 and ior 1.5 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/oak-oiled.json b/assets/library/materials/wood/oak-oiled.json new file mode 100644 index 00000000..a698d286 --- /dev/null +++ b/assets/library/materials/wood/oak-oiled.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/oak-oiled", + "name": "Oak, oiled", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.3573, 0.2647, 0.1257], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.4, + "coat_weight": 0.0 + }, + "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #b08a5a authored as the species' average tone. Oil-finished wood keeps its texture: no film, roughness 0.4 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/pine-raw.json b/assets/library/materials/wood/pine-raw.json new file mode 100644 index 00000000..fdf74dd7 --- /dev/null +++ b/assets/library/materials/wood/pine-raw.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/pine-raw", + "name": "Pine, raw", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.6693, 0.5688, 0.3231], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.65, + "coat_weight": 0.0 + }, + "tags": ["wood", "matte", "yellow", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #e2c591 authored as the species' average tone. Raw sawn or sanded wood, roughness 0.65 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/teak-oiled.json b/assets/library/materials/wood/teak-oiled.json new file mode 100644 index 00000000..6409b29b --- /dev/null +++ b/assets/library/materials/wood/teak-oiled.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/teak-oiled", + "name": "Teak, oiled", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.2492, 0.1554, 0.0618], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.4, + "coat_weight": 0.0 + }, + "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #9a6a3c authored as the species' average tone. Oil-finished wood keeps its texture: no film, roughness 0.4 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/walnut-lacquered.json b/assets/library/materials/wood/walnut-lacquered.json new file mode 100644 index 00000000..da07b0c7 --- /dev/null +++ b/assets/library/materials/wood/walnut-lacquered.json @@ -0,0 +1,27 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/walnut-lacquered", + "name": "Walnut, lacquered", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.0885, 0.0582, 0.034], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.45, + "coat_weight": 1.0, + "coat_roughness": 0.06, + "coat_ior": 1.5 + }, + "tags": ["wood", "gloss", "brown", "needs-graph", "furniture", "coat"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #5e4230 authored as the species' average tone. Lacquer film as a coat with roughness 0.06 and ior 1.5 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "coat_roughness", "coat_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/wood/walnut-oiled.json b/assets/library/materials/wood/walnut-oiled.json new file mode 100644 index 00000000..f2d4e090 --- /dev/null +++ b/assets/library/materials/wood/walnut-oiled.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "wood/walnut-oiled", + "name": "Walnut, oiled", + "category": "Wood", + "type": "wood", + "params": { + "base_color": [0.0885, 0.0582, 0.034], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_ior": 1.4701, + "specular_roughness": 0.4, + "coat_weight": 0.0 + }, + "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], + "source": { + "kind": "published", + "reference": "N. Sultanova, S. Kasarova, I. Nikolov. Dispersion properties of optical polymers. Acta Physica Polonica A 116, 585-587 (2009) (fit of the experimental data with the Sellmeier dispersion formula: Mikhail Polyanskiy); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/(C6H10O5)n%20-%20cellulose/nk/Sultanova.yml"], + "notes": "Base settings only: grain, rays and ring contrast come from the type's wood graph, which this preset does not carry yet. base_color sRGB #5e4230 authored as the species' average tone. Oil-finished wood keeps its texture: no film, roughness 0.4 (authored). specular_ior 1.4701 is the measured n of cellulose, the main constituent of wood cell walls.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} From 9fe4e7c15181fa7669de51b52228daf916809c37 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 168/494] feat(library): add base settings for stone presets Marble, travertine, limestone, granite, sandstone, slate and concrete with calcite or quartz indices from measured data and authored tones; tagged as needing the stone graph. Ran the library validator. --- assets/library/materials/stone/concrete.json | 25 +++++++++++++++++ .../stone/granite-black-polished.json | 25 +++++++++++++++++ .../materials/stone/granite-grey-honed.json | 25 +++++++++++++++++ assets/library/materials/stone/limestone.json | 25 +++++++++++++++++ .../stone/marble-black-polished.json | 25 +++++++++++++++++ .../materials/stone/marble-white-honed.json | 28 +++++++++++++++++++ .../stone/marble-white-polished.json | 28 +++++++++++++++++++ assets/library/materials/stone/sandstone.json | 25 +++++++++++++++++ assets/library/materials/stone/slate.json | 25 +++++++++++++++++ .../materials/stone/travertine-honed.json | 25 +++++++++++++++++ 10 files changed, 256 insertions(+) create mode 100644 assets/library/materials/stone/concrete.json create mode 100644 assets/library/materials/stone/granite-black-polished.json create mode 100644 assets/library/materials/stone/granite-grey-honed.json create mode 100644 assets/library/materials/stone/limestone.json create mode 100644 assets/library/materials/stone/marble-black-polished.json create mode 100644 assets/library/materials/stone/marble-white-honed.json create mode 100644 assets/library/materials/stone/marble-white-polished.json create mode 100644 assets/library/materials/stone/sandstone.json create mode 100644 assets/library/materials/stone/slate.json create mode 100644 assets/library/materials/stone/travertine-honed.json diff --git a/assets/library/materials/stone/concrete.json b/assets/library/materials/stone/concrete.json new file mode 100644 index 00000000..58395884 --- /dev/null +++ b/assets/library/materials/stone/concrete.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/concrete", + "name": "Concrete, smooth", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.3278, 0.3235, 0.3037], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.65, + "specular_ior": 1.5443, + "coat_weight": 0.0 + }, + "tags": ["stone", "matte", "grey", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #9c9a95 authored as the stone's average tone; roughness 0.65 authored for the finish. specular_ior 1.5443 is the measured n of quartz (ordinary ray), concrete's aggregate at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/granite-black-polished.json b/assets/library/materials/stone/granite-black-polished.json new file mode 100644 index 00000000..43b53e49 --- /dev/null +++ b/assets/library/materials/stone/granite-black-polished.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/granite-black-polished", + "name": "Granite, black polished", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.0168, 0.0168, 0.0168], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.08, + "specular_ior": 1.5443, + "coat_weight": 0.0 + }, + "tags": ["stone", "polished", "black", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #232323 authored as the stone's average tone; roughness 0.08 authored for the finish. specular_ior 1.5443 is the measured n of quartz (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/granite-grey-honed.json b/assets/library/materials/stone/granite-grey-honed.json new file mode 100644 index 00000000..417aca14 --- /dev/null +++ b/assets/library/materials/stone/granite-grey-honed.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/granite-grey-honed", + "name": "Granite, grey honed", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.2562, 0.2543, 0.2473], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.35, + "specular_ior": 1.5443, + "coat_weight": 0.0 + }, + "tags": ["stone", "satin", "grey", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #8b8a88 authored as the stone's average tone; roughness 0.35 authored for the finish. specular_ior 1.5443 is the measured n of quartz (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/limestone.json b/assets/library/materials/stone/limestone.json new file mode 100644 index 00000000..0de68d54 --- /dev/null +++ b/assets/library/materials/stone/limestone.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/limestone", + "name": "Limestone, sawn", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.5949, 0.5671, 0.4524], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.6, + "specular_ior": 1.6585, + "coat_weight": 0.0 + }, + "tags": ["stone", "matte", "white", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaCO3/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #cfc6b0 authored as the stone's average tone; roughness 0.6 authored for the finish. specular_ior 1.6585 is the measured n of calcite (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/marble-black-polished.json b/assets/library/materials/stone/marble-black-polished.json new file mode 100644 index 00000000..05b4f7cd --- /dev/null +++ b/assets/library/materials/stone/marble-black-polished.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/marble-black-polished", + "name": "Marble, black polished", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.0117, 0.0116, 0.0128], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.08, + "specular_ior": 1.6585, + "coat_weight": 0.0 + }, + "tags": ["stone", "polished", "black", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaCO3/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #1c1c1e authored as the stone's average tone; roughness 0.08 authored for the finish. specular_ior 1.6585 is the measured n of calcite (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/marble-white-honed.json b/assets/library/materials/stone/marble-white-honed.json new file mode 100644 index 00000000..83eac07f --- /dev/null +++ b/assets/library/materials/stone/marble-white-honed.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/marble-white-honed", + "name": "Marble, white honed", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.7799, 0.7691, 0.723], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.35, + "specular_ior": 1.6585, + "coat_weight": 0.0, + "subsurface_weight": 0.5, + "subsurface_color": [0.7799, 0.7691, 0.723], + "subsurface_radius": 0.005 + }, + "tags": ["stone", "satin", "white", "subsurface", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaCO3/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #e6e3dc authored as the stone's average tone; roughness 0.35 authored for the finish. specular_ior 1.6585 is the measured n of calcite (ordinary ray) at 587.6 nm. White marble is translucent: subsurface weight 0.5 with a 5 mm mean free path, authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "subsurface_weight", "subsurface_color", "subsurface_radius"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/marble-white-polished.json b/assets/library/materials/stone/marble-white-polished.json new file mode 100644 index 00000000..d81594e7 --- /dev/null +++ b/assets/library/materials/stone/marble-white-polished.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/marble-white-polished", + "name": "Marble, white polished", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.8194, 0.808, 0.7671], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.08, + "specular_ior": 1.6585, + "coat_weight": 0.0, + "subsurface_weight": 0.5, + "subsurface_color": [0.8194, 0.808, 0.7671], + "subsurface_radius": 0.005 + }, + "tags": ["stone", "polished", "white", "subsurface", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaCO3/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #ebe8e2 authored as the stone's average tone; roughness 0.08 authored for the finish. specular_ior 1.6585 is the measured n of calcite (ordinary ray) at 587.6 nm. White marble is translucent: subsurface weight 0.5 with a 5 mm mean free path, authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "subsurface_weight", "subsurface_color", "subsurface_radius"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/sandstone.json b/assets/library/materials/stone/sandstone.json new file mode 100644 index 00000000..21fb01ea --- /dev/null +++ b/assets/library/materials/stone/sandstone.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/sandstone", + "name": "Sandstone, sawn", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.4985, 0.3977, 0.2237], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.7, + "specular_ior": 1.5443, + "coat_weight": 0.0 + }, + "tags": ["stone", "matte", "brown", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #c9a77a authored as the stone's average tone; roughness 0.7 authored for the finish. specular_ior 1.5443 is the measured n of quartz (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/slate.json b/assets/library/materials/stone/slate.json new file mode 100644 index 00000000..df58439a --- /dev/null +++ b/assets/library/materials/stone/slate.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/slate", + "name": "Slate, riven", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.0728, 0.0777, 0.089], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.55, + "specular_ior": 1.5443, + "coat_weight": 0.0 + }, + "tags": ["stone", "matte", "grey", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #4a4f55 authored as the stone's average tone; roughness 0.55 authored for the finish. specular_ior 1.5443 is the measured n of quartz (ordinary ray), slate's main mineral with micas at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/stone/travertine-honed.json b/assets/library/materials/stone/travertine-honed.json new file mode 100644 index 00000000..18e63abf --- /dev/null +++ b/assets/library/materials/stone/travertine-honed.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "stone/travertine-honed", + "name": "Travertine, honed", + "category": "Stone", + "type": "stone", + "params": { + "base_color": [0.6226, 0.5699, 0.4163], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.5, + "specular_roughness": 0.4, + "specular_ior": 1.6585, + "coat_weight": 0.0 + }, + "tags": ["stone", "satin", "brown", "needs-graph", "architectural"], + "source": { + "kind": "published", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaCO3/nk/Ghosh-o.yml"], + "notes": "Base settings only: veins, grains and speckle come from the type's stone graph, which this preset does not carry yet. base_color sRGB #d6c6a8 authored as the stone's average tone; roughness 0.4 authored for the finish. specular_ior 1.6585 is the measured n of calcite (ordinary ray) at 587.6 nm.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} From 808cd3dd3dd5dce57070e10b21e59a2fc1b27929 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 169/494] feat(library): add glazed, unglazed and porcelain ceramic presets Glazes as a coat with the measured soda-lime glass index, unglazed bodies with the coat off, porcelain with subsurface and technical alumina with the sapphire index. Ran the library validator. --- .../materials/ceramic/alumina-technical.json | 25 +++++++++++++++ .../ceramic/bisque-white-unglazed.json | 25 +++++++++++++++ .../materials/ceramic/glazed-black.json | 28 ++++++++++++++++ .../materials/ceramic/glazed-celadon.json | 28 ++++++++++++++++ .../materials/ceramic/glazed-cobalt-blue.json | 28 ++++++++++++++++ .../materials/ceramic/glazed-tile-white.json | 28 ++++++++++++++++ .../materials/ceramic/glazed-white.json | 28 ++++++++++++++++ .../materials/ceramic/porcelain-glazed.json | 32 +++++++++++++++++++ .../ceramic/stoneware-matte-glaze.json | 28 ++++++++++++++++ .../ceramic/terracotta-unglazed.json | 25 +++++++++++++++ 10 files changed, 275 insertions(+) create mode 100644 assets/library/materials/ceramic/alumina-technical.json create mode 100644 assets/library/materials/ceramic/bisque-white-unglazed.json create mode 100644 assets/library/materials/ceramic/glazed-black.json create mode 100644 assets/library/materials/ceramic/glazed-celadon.json create mode 100644 assets/library/materials/ceramic/glazed-cobalt-blue.json create mode 100644 assets/library/materials/ceramic/glazed-tile-white.json create mode 100644 assets/library/materials/ceramic/glazed-white.json create mode 100644 assets/library/materials/ceramic/porcelain-glazed.json create mode 100644 assets/library/materials/ceramic/stoneware-matte-glaze.json create mode 100644 assets/library/materials/ceramic/terracotta-unglazed.json diff --git a/assets/library/materials/ceramic/alumina-technical.json b/assets/library/materials/ceramic/alumina-technical.json new file mode 100644 index 00000000..4ae84cac --- /dev/null +++ b/assets/library/materials/ceramic/alumina-technical.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/alumina-technical", + "name": "Alumina ceramic, technical", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.8871, 0.88, 0.8305], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.3, + "specular_ior": 1.7682, + "coat_weight": 0.0 + }, + "tags": ["ceramic", "satin", "white", "opaque", "industrial"], + "source": { + "kind": "published", + "reference": "I. H. Malitson. Refraction and dispersion of synthetic sapphire. J. Opt. Soc. Am. 52, 1377-1379 (1962); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al2O3/nk/Malitson.yml"], + "notes": "Sintered aluminium oxide, as in insulators and wear parts. specular_ior 1.7682 is the measured ordinary index of sapphire (Al2O3) at 587.6 nm. Colour sRGB #f3f1ea and roughness 0.3 (ground finish) authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/bisque-white-unglazed.json b/assets/library/materials/ceramic/bisque-white-unglazed.json new file mode 100644 index 00000000..2a1bc2e8 --- /dev/null +++ b/assets/library/materials/ceramic/bisque-white-unglazed.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/bisque-white-unglazed", + "name": "Bisque, unglazed white", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.8161, 0.7934, 0.7138], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.8, + "specular_roughness": 0.8, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["ceramic", "matte", "white", "opaque", "tableware"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Unglazed porous body, white body after the first firing: coat off, very rough. Colour sRGB #ece6da, roughness 0.8, diffuse roughness 0.8 and ior 1.5 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/glazed-black.json b/assets/library/materials/ceramic/glazed-black.json new file mode 100644 index 00000000..14f6c62a --- /dev/null +++ b/assets/library/materials/ceramic/glazed-black.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/glazed-black", + "name": "Glazed ceramic, black", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.007, 0.007, 0.007], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "black", "opaque", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #141414, body roughness 0.4 and ior 1.5, and glaze roughness 0.03 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/glazed-celadon.json b/assets/library/materials/ceramic/glazed-celadon.json new file mode 100644 index 00000000..7da84943 --- /dev/null +++ b/assets/library/materials/ceramic/glazed-celadon.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/glazed-celadon", + "name": "Glazed ceramic, celadon", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.4434, 0.5327, 0.3996], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.05, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "green", "opaque", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #a8c3a6, body roughness 0.4 and ior 1.5, and glaze roughness 0.05 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/glazed-cobalt-blue.json b/assets/library/materials/ceramic/glazed-cobalt-blue.json new file mode 100644 index 00000000..4079f8d6 --- /dev/null +++ b/assets/library/materials/ceramic/glazed-cobalt-blue.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/glazed-cobalt-blue", + "name": "Glazed ceramic, cobalt blue", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.0364, 0.0473, 0.2443], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "blue", "opaque", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #1d3d8f, body roughness 0.4 and ior 1.5, and glaze roughness 0.03 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/glazed-tile-white.json b/assets/library/materials/ceramic/glazed-tile-white.json new file mode 100644 index 00000000..eadda18f --- /dev/null +++ b/assets/library/materials/ceramic/glazed-tile-white.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/glazed-tile-white", + "name": "Glazed tile, white", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.8663, 0.8632, 0.8282], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "white", "opaque", "architectural"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #f0efea, body roughness 0.4 and ior 1.5, and glaze roughness 0.02 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/glazed-white.json b/assets/library/materials/ceramic/glazed-white.json new file mode 100644 index 00000000..da038a26 --- /dev/null +++ b/assets/library/materials/ceramic/glazed-white.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/glazed-white", + "name": "Glazed ceramic, white", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.8828, 0.8797, 0.8443], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.03, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "white", "opaque", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #f2f1ec, body roughness 0.4 and ior 1.5, and glaze roughness 0.03 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/porcelain-glazed.json b/assets/library/materials/ceramic/porcelain-glazed.json new file mode 100644 index 00000000..6c72a40b --- /dev/null +++ b/assets/library/materials/ceramic/porcelain-glazed.json @@ -0,0 +1,32 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/porcelain-glazed", + "name": "Porcelain, glazed", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.8998, 0.8964, 0.8676], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.2, + "specular_roughness": 0.3, + "specular_ior": 1.5, + "subsurface_weight": 0.4, + "subsurface_color": [0.8923, 0.8806, 0.8307], + "subsurface_radius": 0.003, + "subsurface_radius_scale": [1.0, 0.85, 0.7], + "coat_weight": 1.0, + "coat_roughness": 0.02, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "gloss", "coat", "subsurface", "white", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Vitrified porcelain is slightly translucent: subsurface weight 0.4, 3 mm mean free path, warmer in red (authored). Glaze coat_ior 1.5234 is the measured n of soda-lime glass; colours sRGB #f4f3ef and #f4f1ea, roughness values authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "subsurface_weight", "subsurface_color", "subsurface_radius", "subsurface_radius_scale", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/stoneware-matte-glaze.json b/assets/library/materials/ceramic/stoneware-matte-glaze.json new file mode 100644 index 00000000..b67e4318 --- /dev/null +++ b/assets/library/materials/ceramic/stoneware-matte-glaze.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/stoneware-matte-glaze", + "name": "Stoneware, matte glaze", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.6022, 0.5798, 0.5084], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.3, + "specular_roughness": 0.4, + "specular_ior": 1.5, + "coat_weight": 1.0, + "coat_roughness": 0.35, + "coat_ior": 1.5234, + "coat_color": [1.0, 1.0, 1.0] + }, + "tags": ["ceramic", "matte", "coat", "grey", "opaque", "tableware"], + "source": { + "kind": "published", + "reference": "M. Rubin. Optical properties of soda lime silica glasses. Sol. Energy Mater. 12, 275-288 (1985); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/glass/misc/soda-lime/nk/Rubin-clear.yml"], + "notes": "Fired body under a glaze. The glaze is a silicate glass, so coat_ior 1.5234 is the measured n of soda-lime glass at 587.6 nm. Body colour sRGB #cfc8bb, body roughness 0.4 and ior 1.5, and glaze roughness 0.35 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior", "coat_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/ceramic/terracotta-unglazed.json b/assets/library/materials/ceramic/terracotta-unglazed.json new file mode 100644 index 00000000..191ad063 --- /dev/null +++ b/assets/library/materials/ceramic/terracotta-unglazed.json @@ -0,0 +1,25 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "ceramic/terracotta-unglazed", + "name": "Terracotta, unglazed", + "category": "Ceramic", + "type": "ceramic", + "params": { + "base_color": [0.327, 0.145, 0.0635], + "base_metalness": 0.0, + "base_diffuse_roughness": 0.8, + "specular_roughness": 0.8, + "specular_ior": 1.5, + "coat_weight": 0.0 + }, + "tags": ["ceramic", "matte", "orange", "opaque", "architectural"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Unglazed porous body, iron-rich earthenware fired red: coat off, very rough. Colour sRGB #b5623d, roughness 0.8, diffuse roughness 0.8 and ior 1.5 authored.", + "authored": ["base_color", "base_diffuse_roughness", "specular_roughness", "specular_ior"] + }, + "licence": "Apache-2.0" +} From 70c6f592b815a32f8aa8eb81b5cbccb2ff2da249 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:03:20 -0500 Subject: [PATCH 170/494] feat(library): add emissive presets with luminance in nits Displays, fluorescent, incandescent and sodium lamps at published luminances, colours from D65, blackbody or emission lines normalised to luminance 1, plus a few authored product-lighting emitters. Ran the library validator. --- .../emissive/display-white-srgb.json | 24 +++++++++++++++++++ .../emissive/electroluminescent-green.json | 24 +++++++++++++++++++ .../emissive/fluorescent-tube-4000k.json | 24 +++++++++++++++++++ .../materials/emissive/hdr-display-peak.json | 24 +++++++++++++++++++ .../emissive/incandescent-frosted-2700k.json | 24 +++++++++++++++++++ .../materials/emissive/indicator-led-red.json | 24 +++++++++++++++++++ .../materials/emissive/light-box-6500k.json | 24 +++++++++++++++++++ .../materials/emissive/monitor-white-lcd.json | 24 +++++++++++++++++++ .../emissive/sodium-lamp-low-pressure.json | 24 +++++++++++++++++++ 9 files changed, 216 insertions(+) create mode 100644 assets/library/materials/emissive/display-white-srgb.json create mode 100644 assets/library/materials/emissive/electroluminescent-green.json create mode 100644 assets/library/materials/emissive/fluorescent-tube-4000k.json create mode 100644 assets/library/materials/emissive/hdr-display-peak.json create mode 100644 assets/library/materials/emissive/incandescent-frosted-2700k.json create mode 100644 assets/library/materials/emissive/indicator-led-red.json create mode 100644 assets/library/materials/emissive/light-box-6500k.json create mode 100644 assets/library/materials/emissive/monitor-white-lcd.json create mode 100644 assets/library/materials/emissive/sodium-lamp-low-pressure.json diff --git a/assets/library/materials/emissive/display-white-srgb.json b/assets/library/materials/emissive/display-white-srgb.json new file mode 100644 index 00000000..e64d3889 --- /dev/null +++ b/assets/library/materials/emissive/display-white-srgb.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/display-white-srgb", + "name": "Display white, sRGB reference", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 80.0, + "emission_color": [0.9036, 1.0316, 1.092] + }, + "tags": ["light-source", "emissive", "display", "white", "electronics"], + "source": { + "kind": "published", + "reference": "IEC 61966-2-1 (sRGB) reference display luminance 80 cd/m2; Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 80 nits, the sRGB reference display white. emission_color is CIE D65 (the sRGB white point) normalised to luminance 1. Base black, roughness 0.3 for the screen's front glass, authored.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/electroluminescent-green.json b/assets/library/materials/emissive/electroluminescent-green.json new file mode 100644 index 00000000..40eb6f56 --- /dev/null +++ b/assets/library/materials/emissive/electroluminescent-green.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/electroluminescent-green", + "name": "Electroluminescent panel, green", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 30.0, + "emission_color": [0.0, 1.4378, 0.5737] + }, + "tags": ["light-source", "emissive", "green", "display"], + "source": { + "kind": "published", + "reference": "Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 30 nits, a green electroluminescent source. emission_color is a band centred at 510 nm, 25 nm wide (authored from the typical zinc sulphide copper phosphor), normalised to luminance 1. Roughness authored.", + "authored": ["emission_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/fluorescent-tube-4000k.json b/assets/library/materials/emissive/fluorescent-tube-4000k.json new file mode 100644 index 00000000..ca1b63b3 --- /dev/null +++ b/assets/library/materials/emissive/fluorescent-tube-4000k.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/fluorescent-tube-4000k", + "name": "Fluorescent tube, 4000 K", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 12000.0, + "emission_color": [1.0966, 0.9883, 0.6569] + }, + "tags": ["light-source", "emissive", "white", "lighting"], + "source": { + "kind": "published", + "reference": "Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 12000 nits, a fluorescent lamp. emission_color is a 4000 K blackbody normalised to luminance 1; the colour temperature is authored (neutral white tube). Roughness authored.", + "authored": ["emission_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/hdr-display-peak.json b/assets/library/materials/emissive/hdr-display-peak.json new file mode 100644 index 00000000..4fda5f2f --- /dev/null +++ b/assets/library/materials/emissive/hdr-display-peak.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/hdr-display-peak", + "name": "HDR display, peak white", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 1000.0, + "emission_color": [0.9036, 1.0316, 1.092] + }, + "tags": ["light-source", "emissive", "display", "white", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Luminance 1000 nits authored: the peak level HDR televisions and monitors are commonly graded to. D65 white normalised to luminance 1. Roughness authored.", + "authored": ["base_color", "specular_roughness", "emission_luminance", "emission_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/incandescent-frosted-2700k.json b/assets/library/materials/emissive/incandescent-frosted-2700k.json new file mode 100644 index 00000000..aefc2253 --- /dev/null +++ b/assets/library/materials/emissive/incandescent-frosted-2700k.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/incandescent-frosted-2700k", + "name": "Incandescent bulb, frosted", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 130000.0, + "emission_color": [1.3466, 0.9131, 0.3332] + }, + "tags": ["light-source", "emissive", "orange", "lighting"], + "source": { + "kind": "published", + "reference": "Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 130000 nits, a frosted incandescent bulb. emission_color is a 2700 K blackbody normalised to luminance 1, the usual colour temperature of a household tungsten lamp (authored). Roughness authored.", + "authored": ["emission_color", "specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/indicator-led-red.json b/assets/library/materials/emissive/indicator-led-red.json new file mode 100644 index 00000000..62024430 --- /dev/null +++ b/assets/library/materials/emissive/indicator-led-red.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/indicator-led-red", + "name": "Indicator LED, red", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 5000.0, + "emission_color": [3.5049, 0.0667, 0.0175] + }, + "tags": ["light-source", "emissive", "red", "electronics"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "A small red status LED seen through its diffusing lens: 5000 nits authored; emission_color a 630 nm band 10 nm wide (typical AlGaInP red), normalised to luminance 1. Roughness authored.", + "authored": ["base_color", "specular_roughness", "emission_luminance", "emission_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/light-box-6500k.json b/assets/library/materials/emissive/light-box-6500k.json new file mode 100644 index 00000000..35ec9ba7 --- /dev/null +++ b/assets/library/materials/emissive/light-box-6500k.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/light-box-6500k", + "name": "Light box, daylight", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 2000.0, + "emission_color": [0.9036, 1.0316, 1.092] + }, + "tags": ["light-source", "emissive", "white", "lighting"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "A diffuser panel for product lighting: 2000 nits authored, bright enough to key a product without clipping a typical exposure. D65 white normalised to luminance 1. Roughness authored.", + "authored": ["base_color", "specular_roughness", "emission_luminance", "emission_color"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/monitor-white-lcd.json b/assets/library/materials/emissive/monitor-white-lcd.json new file mode 100644 index 00000000..9634dc6a --- /dev/null +++ b/assets/library/materials/emissive/monitor-white-lcd.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/monitor-white-lcd", + "name": "LCD monitor, white", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 250.0, + "emission_color": [0.9036, 1.0316, 1.092] + }, + "tags": ["light-source", "emissive", "display", "white", "electronics"], + "source": { + "kind": "published", + "reference": "Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 250 nits, the peak of a typical LCD monitor. emission_color is D65 normalised to luminance 1. Roughness authored.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/emissive/sodium-lamp-low-pressure.json b/assets/library/materials/emissive/sodium-lamp-low-pressure.json new file mode 100644 index 00000000..e0d771ab --- /dev/null +++ b/assets/library/materials/emissive/sodium-lamp-low-pressure.json @@ -0,0 +1,24 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "emissive/sodium-lamp-low-pressure", + "name": "Sodium lamp, low pressure", + "category": "Emissive", + "type": "emissive", + "params": { + "base_color": [0.0, 0.0, 0.0], + "base_metalness": 0.0, + "specular_roughness": 0.3, + "emission_luminance": 75000.0, + "emission_color": [1.9191, 0.7077, 0.0099] + }, + "tags": ["light-source", "emissive", "orange", "lighting"], + "source": { + "kind": "published", + "reference": "Orders of magnitude (luminance), Wikipedia, luminance table and its cited sources", + "urls": ["https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance"], + "notes": "Luminance 75000 nits, a low-pressure sodium lamp. emission_color is the 589.3 nm sodium D line, integrated with CIE 1931 and normalised to luminance 1 (it lies inside the ACEScg gamut). Roughness authored.", + "authored": ["specular_roughness"] + }, + "licence": "Apache-2.0" +} From 726745296f9aa39b4aebf9349314951a2a78133d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:08 -0500 Subject: [PATCH 171/494] feat(library): add water, oils and sugar liquids from measured indices Water with its measured index and absorption colour, ethanol, glycerol and oils from database indices, and syrups and juices from the USDA sucrose index table at stated Brix levels. Ran the library validator. --- .../library/materials/liquid/apple-juice.json | 26 +++++++++++++++++ assets/library/materials/liquid/cola.json | 26 +++++++++++++++++ assets/library/materials/liquid/ethanol.json | 28 +++++++++++++++++++ assets/library/materials/liquid/glycerol.json | 28 +++++++++++++++++++ assets/library/materials/liquid/honey.json | 26 +++++++++++++++++ .../library/materials/liquid/maple-syrup.json | 26 +++++++++++++++++ .../library/materials/liquid/olive-oil.json | 26 +++++++++++++++++ .../materials/liquid/vegetable-oil.json | 26 +++++++++++++++++ assets/library/materials/liquid/water.json | 28 +++++++++++++++++++ 9 files changed, 240 insertions(+) create mode 100644 assets/library/materials/liquid/apple-juice.json create mode 100644 assets/library/materials/liquid/cola.json create mode 100644 assets/library/materials/liquid/ethanol.json create mode 100644 assets/library/materials/liquid/glycerol.json create mode 100644 assets/library/materials/liquid/honey.json create mode 100644 assets/library/materials/liquid/maple-syrup.json create mode 100644 assets/library/materials/liquid/olive-oil.json create mode 100644 assets/library/materials/liquid/vegetable-oil.json create mode 100644 assets/library/materials/liquid/water.json diff --git a/assets/library/materials/liquid/apple-juice.json b/assets/library/materials/liquid/apple-juice.json new file mode 100644 index 00000000..d06b08e5 --- /dev/null +++ b/assets/library/materials/liquid/apple-juice.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/apple-juice", + "name": "Apple juice, clear", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.3506, + "transmission_weight": 1.0, + "transmission_color": [0.5318, 0.3446, 0.0697], + "transmission_depth": 0.05 + }, + "tags": ["beverage", "transparent", "tinted", "orange", "kitchen"], + "source": { + "kind": "published", + "reference": "USDA AMS, Sucrose Conversion Table, SCI Division Technical Procedures Manual, Appendix XV (refractive index of sucrose solutions at 20 C, ICUMSA basis)", + "urls": ["https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf"], + "notes": "Clear apple juice is about 11 to 12 degrees Brix; specular_ior 1.3506 is the tabulated index of a 11.8 degree Brix sucrose solution at 20 C (the Brix level is authored). transmission_color authored as sRGB #d89a2a, the colour through a glass's width of 5 cm.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/cola.json b/assets/library/materials/liquid/cola.json new file mode 100644 index 00000000..14bd7b25 --- /dev/null +++ b/assets/library/materials/liquid/cola.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/cola", + "name": "Cola", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.3487, + "transmission_weight": 1.0, + "transmission_color": [0.0296, 0.0125, 0.0046], + "transmission_depth": 0.02 + }, + "tags": ["beverage", "transparent", "tinted", "brown", "kitchen"], + "source": { + "kind": "published", + "reference": "USDA AMS, Sucrose Conversion Table, SCI Division Technical Procedures Manual, Appendix XV (refractive index of sucrose solutions at 20 C, ICUMSA basis)", + "urls": ["https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf"], + "notes": "Cola carries about 10.6 g of sugar per 100 g; specular_ior 1.3487 is the tabulated index of a 10.6 degree Brix sucrose solution at 20 C (the Brix level is authored). transmission_color authored as sRGB #3a1a0a, the colour through 2 cm.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/ethanol.json b/assets/library/materials/liquid/ethanol.json new file mode 100644 index 00000000..ac72c96f --- /dev/null +++ b/assets/library/materials/liquid/ethanol.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/ethanol", + "name": "Ethanol", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.3617, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 59.4 + }, + "tags": ["transparent", "clear"], + "source": { + "kind": "measured", + "reference": "J. Rheims, J Köser, T Wriedt. Refractive-index measurements in the near-IR using an Abbe refractometer. Meas. Sci. Technol. 8, 601-605 (1997); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/C2H6O%20-%20ethanol/nk/Rheims.yml"], + "notes": "Clear spirit base (pure ethanol). specular_ior 1.3617 and Abbe number 59.4 from measured n; absorption negligible at product scale.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/glycerol.json b/assets/library/materials/liquid/glycerol.json new file mode 100644 index 00000000..a93bdc62 --- /dev/null +++ b/assets/library/materials/liquid/glycerol.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/glycerol", + "name": "Glycerol", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4713, + "transmission_weight": 1.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 64.4 + }, + "tags": ["transparent", "clear"], + "source": { + "kind": "measured", + "reference": "V. Gupta, O. Aftenieva, P. T. Probst, S. Sarkar, A. M. Steiner, N. Vogel, A. Fery, T. A. F. König. Advanced colloidal sensors enabled by an out-of-plane lattice resonance. Adv. Photonics Res. 2022, 2200152 (see supporting information); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/C3H8O3%20-%20glycerol/nk/Gupta.yml"], + "notes": "Clear viscous glycerol. specular_ior 1.4713 and Abbe number 64.4 from measured n; absorption negligible at product scale.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/honey.json b/assets/library/materials/liquid/honey.json new file mode 100644 index 00000000..dd2e9c8c --- /dev/null +++ b/assets/library/materials/liquid/honey.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/honey", + "name": "Honey", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4906, + "transmission_weight": 1.0, + "transmission_color": [0.4447, 0.274, 0.0451], + "transmission_depth": 0.02 + }, + "tags": ["food", "transparent", "tinted", "orange", "kitchen"], + "source": { + "kind": "published", + "reference": "USDA AMS, Sucrose Conversion Table, SCI Division Technical Procedures Manual, Appendix XV (refractive index of sucrose solutions at 20 C, ICUMSA basis)", + "urls": ["https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf"], + "notes": "Honey is about 80 degrees Brix (17 to 20 percent water); specular_ior 1.4906 is the tabulated index of a 80.0 degree Brix sucrose solution at 20 C (the Brix level is authored). transmission_color authored as sRGB #c98a12, the colour through a jar's depth of 2 cm.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/maple-syrup.json b/assets/library/materials/liquid/maple-syrup.json new file mode 100644 index 00000000..a46b7fe2 --- /dev/null +++ b/assets/library/materials/liquid/maple-syrup.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/maple-syrup", + "name": "Maple syrup", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4558, + "transmission_weight": 1.0, + "transmission_color": [0.2243, 0.0926, 0.0203], + "transmission_depth": 0.02 + }, + "tags": ["food", "transparent", "tinted", "brown", "kitchen"], + "source": { + "kind": "published", + "reference": "USDA AMS, Sucrose Conversion Table, SCI Division Technical Procedures Manual, Appendix XV (refractive index of sucrose solutions at 20 C, ICUMSA basis)", + "urls": ["https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf"], + "notes": "Maple syrup is standardised at about 66 degrees Brix; specular_ior 1.4558 is the tabulated index of a 66.0 degree Brix sucrose solution at 20 C (the Brix level is authored). transmission_color authored as sRGB #9a4e12, the colour through 2 cm.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/olive-oil.json b/assets/library/materials/liquid/olive-oil.json new file mode 100644 index 00000000..b0ebe08a --- /dev/null +++ b/assets/library/materials/liquid/olive-oil.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/olive-oil", + "name": "Olive oil", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4695, + "transmission_weight": 1.0, + "transmission_color": [0.4424, 0.4318, 0.0776], + "transmission_depth": 0.05 + }, + "tags": ["oil", "food", "transparent", "tinted", "yellow", "kitchen"], + "source": { + "kind": "published", + "reference": "S. H. Jones, M. D. King, A. D. Ward. Atmospherically relevant core-shell aerosol studied using optical trapping and Mie scattering. Chem. Commun. 51, 4914-4917 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/C18H34O2%20-%20oleic%20acid/nk/Jones.yml"], + "notes": "specular_ior 1.4695 is the measured n of oleic acid at 587.6 nm; vegetable oils are mostly oleic and linoleic triglycerides and their standard index range (olive oil 1.4677 to 1.4705) contains it. transmission_color authored as sRGB #b8b02a, the oil's colour through 0.05 m, a bottle's width.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/vegetable-oil.json b/assets/library/materials/liquid/vegetable-oil.json new file mode 100644 index 00000000..858c6a10 --- /dev/null +++ b/assets/library/materials/liquid/vegetable-oil.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/vegetable-oil", + "name": "Vegetable oil, light", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4695, + "transmission_weight": 1.0, + "transmission_color": [0.7114, 0.6298, 0.1739], + "transmission_depth": 0.05 + }, + "tags": ["oil", "food", "transparent", "tinted", "yellow", "kitchen"], + "source": { + "kind": "published", + "reference": "S. H. Jones, M. D. King, A. D. Ward. Atmospherically relevant core-shell aerosol studied using optical trapping and Mie scattering. Chem. Commun. 51, 4914-4917 (2015); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/organic/C18H34O2%20-%20oleic%20acid/nk/Jones.yml"], + "notes": "specular_ior 1.4695 is the measured n of oleic acid at 587.6 nm; vegetable oils are mostly oleic and linoleic triglycerides and their standard index range (olive oil 1.4677 to 1.4705) contains it. transmission_color authored as sRGB #e8cf5a, the oil's colour through 0.05 m, a bottle's width.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/water.json b/assets/library/materials/liquid/water.json new file mode 100644 index 00000000..6865e9d2 --- /dev/null +++ b/assets/library/materials/liquid/water.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/water", + "name": "Water", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.3334, + "transmission_weight": 1.0, + "transmission_color": [0.4782, 0.8, 0.8848], + "transmission_depth": 4.0, + "transmission_dispersion_scale": 0.0, + "transmission_dispersion_abbe_number": 55.8 + }, + "tags": ["water", "transparent", "clear", "beverage"], + "source": { + "kind": "measured", + "reference": "M. Daimon and A. Masumura. Measurement of the refractive index of distilled water from the near-infrared region to the ultraviolet region. Appl. Opt. 46, 3811-3820 (2007); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024); G. M. Hale and M. R. Querry. Optical constants of water in the 200-nm to 200-µm wavelength region. Appl. Opt. 12, 555-563 (1973) See also Segelstein 1981 for more recent data from the same group.; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/H2O/nk/Daimon-20.0C.yml", "https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/H2O/nk/Hale.yml"], + "notes": "Pure water at 20 C: specular_ior 1.3334 and Abbe number 55.8 from Daimon and Masumura's measured n. transmission_color is the Beer-Lambert transmittance of Hale and Querry's measured absorption k through transmission_depth 4 m (CIE 1931 under D65): water's own faint blue, only visible in deep volumes. The 4 m depth was chosen so the colour keeps its hue in RGB; it is the same absorption at every scale.", + "authored": ["transmission_depth"] + }, + "licence": "Apache-2.0" +} From 39b4e165177a015083802d10fe52e1162de68a26 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:08 -0500 Subject: [PATCH 172/494] feat(library): add drinks and scattering liquids Wine, beer, coffee, tea and motor oil with authored indices and transmission colours, and milk and orange juice through subsurface scattering. Ran the library validator. --- .../library/materials/liquid/beer-lager.json | 26 +++++++++++++++++ .../materials/liquid/coffee-black.json | 26 +++++++++++++++++ assets/library/materials/liquid/milk.json | 28 +++++++++++++++++++ .../library/materials/liquid/motor-oil.json | 26 +++++++++++++++++ .../materials/liquid/orange-juice.json | 28 +++++++++++++++++++ assets/library/materials/liquid/red-wine.json | 26 +++++++++++++++++ assets/library/materials/liquid/tea.json | 26 +++++++++++++++++ .../library/materials/liquid/white-wine.json | 26 +++++++++++++++++ 8 files changed, 212 insertions(+) create mode 100644 assets/library/materials/liquid/beer-lager.json create mode 100644 assets/library/materials/liquid/coffee-black.json create mode 100644 assets/library/materials/liquid/milk.json create mode 100644 assets/library/materials/liquid/motor-oil.json create mode 100644 assets/library/materials/liquid/orange-juice.json create mode 100644 assets/library/materials/liquid/red-wine.json create mode 100644 assets/library/materials/liquid/tea.json create mode 100644 assets/library/materials/liquid/white-wine.json diff --git a/assets/library/materials/liquid/beer-lager.json b/assets/library/materials/liquid/beer-lager.json new file mode 100644 index 00000000..a8e9e489 --- /dev/null +++ b/assets/library/materials/liquid/beer-lager.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/beer-lager", + "name": "Beer, lager", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.341, + "transmission_weight": 1.0, + "transmission_color": [0.5139, 0.3425, 0.0591], + "transmission_depth": 0.05 + }, + "tags": ["transparent", "tinted", "gold", "beverage"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Lager at about 5 percent ethanol and 3 to 4 degrees of residual extract: index 1.341 authored. transmission_color authored as sRGB #d49a1c, the colour through transmission_depth 0.05 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/coffee-black.json b/assets/library/materials/liquid/coffee-black.json new file mode 100644 index 00000000..486050af --- /dev/null +++ b/assets/library/materials/liquid/coffee-black.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/coffee-black", + "name": "Coffee, black", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.335, + "transmission_weight": 1.0, + "transmission_color": [0.0167, 0.0081, 0.0034], + "transmission_depth": 0.005 + }, + "tags": ["transparent", "tinted", "brown", "beverage"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Brewed coffee is about 1.5 percent dissolved solids: index 1.335 authored just above water. transmission_color authored as sRGB #2a1408, the colour through transmission_depth 0.005 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/milk.json b/assets/library/materials/liquid/milk.json new file mode 100644 index 00000000..3cccf632 --- /dev/null +++ b/assets/library/materials/liquid/milk.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/milk", + "name": "Milk", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [0.9127, 0.9052, 0.8618], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.347, + "transmission_weight": 0.0, + "subsurface_weight": 1.0, + "subsurface_color": [0.9127, 0.9052, 0.8618], + "subsurface_radius": 0.0005, + "subsurface_radius_scale": [1.0, 0.9, 0.75] + }, + "tags": ["beverage", "food", "subsurface", "translucent", "white"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Whole milk: fat globules and casein micelles scatter strongly, so it is modelled with subsurface (transmission off); mean free path 0.5 mm, shorter in blue, authored. Index 1.347 authored within the published 1.344 to 1.349 of milk at 20 C.", + "authored": ["base_color", "specular_roughness", "specular_ior", "subsurface_color", "subsurface_radius", "subsurface_radius_scale"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/motor-oil.json b/assets/library/materials/liquid/motor-oil.json new file mode 100644 index 00000000..e094167e --- /dev/null +++ b/assets/library/materials/liquid/motor-oil.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/motor-oil", + "name": "Motor oil", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.48, + "transmission_weight": 1.0, + "transmission_color": [0.2956, 0.1761, 0.0348], + "transmission_depth": 0.02 + }, + "tags": ["transparent", "tinted", "orange", "oil", "industrial"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Mineral base oil: index 1.48 authored, typical of paraffinic lubricating oils. transmission_color authored as sRGB #a8701a, the colour through transmission_depth 0.02 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/orange-juice.json b/assets/library/materials/liquid/orange-juice.json new file mode 100644 index 00000000..1697439d --- /dev/null +++ b/assets/library/materials/liquid/orange-juice.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/orange-juice", + "name": "Orange juice", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [0.6597, 0.3592, 0.0629], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.3506, + "transmission_weight": 0.0, + "subsurface_weight": 1.0, + "subsurface_color": [0.6597, 0.3592, 0.0629], + "subsurface_radius": 0.002, + "subsurface_radius_scale": [1.0, 0.7, 0.4] + }, + "tags": ["beverage", "food", "subsurface", "translucent", "orange"], + "source": { + "kind": "published", + "reference": "USDA AMS, Sucrose Conversion Table, SCI Division Technical Procedures Manual, Appendix XV (refractive index of sucrose solutions at 20 C, ICUMSA basis)", + "urls": ["https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf"], + "notes": "Orange juice carries pulp and cloud that scatter: subsurface (transmission off), 2 mm mean free path, colour sRGB #f39a1a, authored. specular_ior is the tabulated index of an 11.8 degree Brix sucrose solution (USDA's minimum for orange juice from concentrate; the Brix level is authored).", + "authored": ["base_color", "subsurface_color", "subsurface_radius", "subsurface_radius_scale"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/red-wine.json b/assets/library/materials/liquid/red-wine.json new file mode 100644 index 00000000..ce0e1e0a --- /dev/null +++ b/assets/library/materials/liquid/red-wine.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/red-wine", + "name": "Red wine", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.343, + "transmission_weight": 1.0, + "transmission_color": [0.0642, 0.0101, 0.0114], + "transmission_depth": 0.01 + }, + "tags": ["transparent", "tinted", "red", "beverage"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "About 12 percent ethanol in water with a little residual sugar and extract: index 1.343 authored between water (1.333) and the mixture's components. transmission_color authored as sRGB #5a0a1a, the colour through transmission_depth 0.01 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/tea.json b/assets/library/materials/liquid/tea.json new file mode 100644 index 00000000..898559d6 --- /dev/null +++ b/assets/library/materials/liquid/tea.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/tea", + "name": "Tea", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.334, + "transmission_weight": 1.0, + "transmission_color": [0.2217, 0.0855, 0.0202], + "transmission_depth": 0.03 + }, + "tags": ["transparent", "tinted", "brown", "beverage"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Brewed black tea, under 1 percent solids: index 1.334 authored just above water. transmission_color authored as sRGB #9a4a14, the colour through transmission_depth 0.03 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/liquid/white-wine.json b/assets/library/materials/liquid/white-wine.json new file mode 100644 index 00000000..1403067c --- /dev/null +++ b/assets/library/materials/liquid/white-wine.json @@ -0,0 +1,26 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "liquid/white-wine", + "name": "White wine", + "category": "Liquid", + "type": "liquid", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.342, + "transmission_weight": 1.0, + "transmission_color": [0.7255, 0.6752, 0.3111], + "transmission_depth": 0.05 + }, + "tags": ["transparent", "tinted", "yellow", "beverage"], + "source": { + "kind": "authored", + "reference": "", + "urls": [], + "notes": "Dry white wine: index 1.342 authored as for red wine with less extract. transmission_color authored as sRGB #e6d68a, the colour through transmission_depth 0.05 m. Smooth free surface (roughness 0).", + "authored": ["base_color", "specular_roughness", "specular_ior", "transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} From 1822c46dc2062daaec723f004027ffefb32a8d74 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:46 -0500 Subject: [PATCH 173/494] feat(library): add gems with measured index and Abbe number Diamond, corundum, quartz varieties, spinel, fluorite, chrysoberyl and lab-grown stones with dispersion on, indices and Abbe numbers from database n data, and authored body colours. Ran the library validator. --- assets/library/materials/gem/amethyst.json | 28 +++++++++++++++++++ assets/library/materials/gem/chrysoberyl.json | 28 +++++++++++++++++++ assets/library/materials/gem/citrine.json | 28 +++++++++++++++++++ .../library/materials/gem/cubic-zirconia.json | 28 +++++++++++++++++++ assets/library/materials/gem/diamond.json | 28 +++++++++++++++++++ .../materials/gem/fluorite-purple.json | 28 +++++++++++++++++++ assets/library/materials/gem/moissanite.json | 28 +++++++++++++++++++ .../library/materials/gem/rock-crystal.json | 28 +++++++++++++++++++ assets/library/materials/gem/ruby.json | 28 +++++++++++++++++++ .../library/materials/gem/sapphire-blue.json | 28 +++++++++++++++++++ .../library/materials/gem/smoky-quartz.json | 28 +++++++++++++++++++ assets/library/materials/gem/spinel-red.json | 28 +++++++++++++++++++ .../library/materials/gem/white-sapphire.json | 28 +++++++++++++++++++ assets/library/materials/gem/yag.json | 28 +++++++++++++++++++ 14 files changed, 392 insertions(+) create mode 100644 assets/library/materials/gem/amethyst.json create mode 100644 assets/library/materials/gem/chrysoberyl.json create mode 100644 assets/library/materials/gem/citrine.json create mode 100644 assets/library/materials/gem/cubic-zirconia.json create mode 100644 assets/library/materials/gem/diamond.json create mode 100644 assets/library/materials/gem/fluorite-purple.json create mode 100644 assets/library/materials/gem/moissanite.json create mode 100644 assets/library/materials/gem/rock-crystal.json create mode 100644 assets/library/materials/gem/ruby.json create mode 100644 assets/library/materials/gem/sapphire-blue.json create mode 100644 assets/library/materials/gem/smoky-quartz.json create mode 100644 assets/library/materials/gem/spinel-red.json create mode 100644 assets/library/materials/gem/white-sapphire.json create mode 100644 assets/library/materials/gem/yag.json diff --git a/assets/library/materials/gem/amethyst.json b/assets/library/materials/gem/amethyst.json new file mode 100644 index 00000000..03ac8443 --- /dev/null +++ b/assets/library/materials/gem/amethyst.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/amethyst", + "name": "Amethyst", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5443, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.7, + "transmission_color": [0.2051, 0.0959, 0.4307], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "purple", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.5443 is the measured n at 587.6 nm and the Abbe number 69.7 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled). transmission_color authored as sRGB #8a4fb8, the violet of iron colour centres in quartz, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/chrysoberyl.json b/assets/library/materials/gem/chrysoberyl.json new file mode 100644 index 00000000..02cee621 --- /dev/null +++ b/assets/library/materials/gem/chrysoberyl.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/chrysoberyl", + "name": "Chrysoberyl", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7428, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 73.9, + "transmission_color": [0.5463, 0.4991, 0.1266], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "yellow", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "J. Walling, O. Peterson, H. Jenssen, R. Morris, E. O'Dell. Tunable alexandrite lasers. IEEE J. Quantum Electron., 16, 1302-1315 (1980); P. Loiko, A. Major. Dispersive properties of alexandrite and beryllium hexaaluminate crystals. Opt. Mater. Express, 6, 2177-2183 (2016) * Ref. 2 provides a dispersion formula based on the experimental data from Ref. 1; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/BeAl2O4/nk/Walling-alpha.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.7428 is the measured n at 587.6 nm and the Abbe number 73.9 is (nd - 1)/(nF - nC) from the same data. transmission_color authored as sRGB #cdbb4a, the greenish yellow of iron in chrysoberyl, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/citrine.json b/assets/library/materials/gem/citrine.json new file mode 100644 index 00000000..6b94bb0e --- /dev/null +++ b/assets/library/materials/gem/citrine.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/citrine", + "name": "Citrine", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5443, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.7, + "transmission_color": [0.6174, 0.41, 0.0788], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "yellow", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.5443 is the measured n at 587.6 nm and the Abbe number 69.7 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled). transmission_color authored as sRGB #e6a72a, the golden yellow of heated or iron-bearing quartz, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/cubic-zirconia.json b/assets/library/materials/gem/cubic-zirconia.json new file mode 100644 index 00000000..725355e2 --- /dev/null +++ b/assets/library/materials/gem/cubic-zirconia.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/cubic-zirconia", + "name": "Cubic zirconia", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 2.1476, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 33.5, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery", "synthetic"], + "source": { + "kind": "measured", + "reference": "R.A. Synowicki and T. E. Tiwald. Optical properties of bulk c-ZrO2, c-MgO and a-As2S3 determined by variable angle spectroscopic ellipsometry. Thin Solid Films 455-456, 248-255 (2004) Calculation scripts (Python): Synowicki 2004 - ZrO2.py, Synowicki 2004 - Aux funcs.py; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/ZrO2/nk/Synowicki.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 2.1476 is the measured n at 587.6 nm and the Abbe number 33.5 is (nd - 1)/(nF - nC) from the same data.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/diamond.json b/assets/library/materials/gem/diamond.json new file mode 100644 index 00000000..5f696c31 --- /dev/null +++ b/assets/library/materials/gem/diamond.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/diamond", + "name": "Diamond", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 2.4175, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 55.3, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], + "source": { + "kind": "measured", + "reference": "F. Peter. Über Brechungsindizes und Absorptionskonstanten des Diamanten zwischen 644 und 226 mμ. Zeitschrift für Physik 15, 358-368 (1923); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/C/nk/Peter.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 2.4175 is the measured n at 587.6 nm and the Abbe number 55.3 is (nd - 1)/(nF - nC) from the same data.", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/fluorite-purple.json b/assets/library/materials/gem/fluorite-purple.json new file mode 100644 index 00000000..3eb43ab8 --- /dev/null +++ b/assets/library/materials/gem/fluorite-purple.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/fluorite-purple", + "name": "Fluorite, purple", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.4338, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 95.0, + "transmission_color": [0.2893, 0.2026, 0.5296], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "purple", "tinted", "mineral"], + "source": { + "kind": "measured", + "reference": "I. H. Malitson. A redetermination of some optical properties of calcium fluoride. Appl. Opt. 2, 1103-1107 (1963); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/CaF2/nk/Malitson.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.4338 is the measured n at 587.6 nm and the Abbe number 95.0 is (nd - 1)/(nF - nC) from the same data. transmission_color authored as sRGB #9a78c8, the lavender of colour centres in fluorite, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/moissanite.json b/assets/library/materials/gem/moissanite.json new file mode 100644 index 00000000..3b867497 --- /dev/null +++ b/assets/library/materials/gem/moissanite.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/moissanite", + "name": "Moissanite", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 2.648, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 26.0, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery", "synthetic"], + "source": { + "kind": "measured", + "reference": "S. Wang, M. Zhan, G. Wang, H. Xuan, W. Zhang, C. Liu, C. Xu, Y. Liu, Z. Wei, X. Chen. 4H-SiC: A new nonlinear material for midinfrared lasers. Laser Photonics Rev. 7, 831-838 (2013); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiC/nk/Wang-6H-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 2.648 is the measured n at 587.6 nm and the Abbe number 26.0 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled).", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/rock-crystal.json b/assets/library/materials/gem/rock-crystal.json new file mode 100644 index 00000000..bdea1b04 --- /dev/null +++ b/assets/library/materials/gem/rock-crystal.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/rock-crystal", + "name": "Quartz, rock crystal", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5443, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.7, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "mineral"], + "source": { + "kind": "measured", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.5443 is the measured n at 587.6 nm and the Abbe number 69.7 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled).", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/ruby.json b/assets/library/materials/gem/ruby.json new file mode 100644 index 00000000..4f7a4ac4 --- /dev/null +++ b/assets/library/materials/gem/ruby.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/ruby", + "name": "Ruby", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7682, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 72.3, + "transmission_color": [0.3261, 0.0421, 0.0333], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "I. H. Malitson and M. J. Dodge. Refractive index and birefringence of synthetic sapphire. J. Opt. Soc. Am. 62, 1405 (1972); M. J. Dodge. \"Refractive index\" in Handbook of Laser Science and Technology, Volume IV, Optical Materials: Part 2, CRC Press, Boca Raton, 1986, p. 30 * Ref. 1 is a talk abstract in a conference program; Ref. 2 provides a dispersion formula; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al2O3/nk/Malitson-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.7682 is the measured n at 587.6 nm and the Abbe number 72.3 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled). transmission_color authored as sRGB #c0102c, the red of chromium in corundum, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/sapphire-blue.json b/assets/library/materials/gem/sapphire-blue.json new file mode 100644 index 00000000..8d2841d0 --- /dev/null +++ b/assets/library/materials/gem/sapphire-blue.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/sapphire-blue", + "name": "Sapphire, blue", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7682, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 72.3, + "transmission_color": [0.0425, 0.0516, 0.3463], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "I. H. Malitson and M. J. Dodge. Refractive index and birefringence of synthetic sapphire. J. Opt. Soc. Am. 62, 1405 (1972); M. J. Dodge. \"Refractive index\" in Handbook of Laser Science and Technology, Volume IV, Optical Materials: Part 2, CRC Press, Boca Raton, 1986, p. 30 * Ref. 1 is a talk abstract in a conference program; Ref. 2 provides a dispersion formula; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al2O3/nk/Malitson-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.7682 is the measured n at 587.6 nm and the Abbe number 72.3 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled). transmission_color authored as sRGB #1c3fa8, the cornflower blue of iron and titanium in corundum, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/smoky-quartz.json b/assets/library/materials/gem/smoky-quartz.json new file mode 100644 index 00000000..afa4d3da --- /dev/null +++ b/assets/library/materials/gem/smoky-quartz.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/smoky-quartz", + "name": "Quartz, smoky", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.5443, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.7, + "transmission_color": [0.1664, 0.1315, 0.0878], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "brown", "tinted", "mineral"], + "source": { + "kind": "measured", + "reference": "G. Ghosh. Dispersion-equation coefficients for the refractive index and birefringence of calcite and quartz crystals. Opt. Commun. 163, 95-102 (1999); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/SiO2/nk/Ghosh-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.5443 is the measured n at 587.6 nm and the Abbe number 69.7 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled). transmission_color authored as sRGB #7a6450, the grey-brown of irradiated aluminium centres in quartz, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/spinel-red.json b/assets/library/materials/gem/spinel-red.json new file mode 100644 index 00000000..88822915 --- /dev/null +++ b/assets/library/materials/gem/spinel-red.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/spinel-red", + "name": "Spinel, red", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7162, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 60.7, + "transmission_color": [0.3305, 0.0509, 0.057], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], + "source": { + "kind": "measured", + "reference": "W. J. Tropf and M. E. Thomas, Magnesium aluminum spinel (MgAlO4), in E. D. Palik (ed.), Handbook of Optical Constants of Solids II, Academic Press, Orlando, 1991, pp. 881-8952) Handbook of Optics, 3rd edition, Vol. 4. McGraw-Hill 2009* Ref. 2 provides improved Sellmeier equation based on data from Ref. 1; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/MgAl2O4/nk/Tropf.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.7162 is the measured n at 587.6 nm and the Abbe number 60.7 is (nd - 1)/(nF - nC) from the same data. transmission_color authored as sRGB #c02040, chromium red spinel, reached through 0.005 m, a typical stone's depth.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/white-sapphire.json b/assets/library/materials/gem/white-sapphire.json new file mode 100644 index 00000000..35955ff0 --- /dev/null +++ b/assets/library/materials/gem/white-sapphire.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/white-sapphire", + "name": "Sapphire, colourless", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.7682, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 72.3, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], + "source": { + "kind": "measured", + "reference": "I. H. Malitson and M. J. Dodge. Refractive index and birefringence of synthetic sapphire. J. Opt. Soc. Am. 62, 1405 (1972); M. J. Dodge. \"Refractive index\" in Handbook of Laser Science and Technology, Volume IV, Optical Materials: Part 2, CRC Press, Boca Raton, 1986, p. 30 * Ref. 1 is a talk abstract in a conference program; Ref. 2 provides a dispersion formula; M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Al2O3/nk/Malitson-o.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.7682 is the measured n at 587.6 nm and the Abbe number 72.3 is (nd - 1)/(nF - nC) from the same data (ordinary ray; the small birefringence is not modelled).", + "authored": [] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/yag.json b/assets/library/materials/gem/yag.json new file mode 100644 index 00000000..d8c9a254 --- /dev/null +++ b/assets/library/materials/gem/yag.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/yag", + "name": "YAG, colourless", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.8328, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 52.6, + "transmission_color": [1.0, 1.0, 1.0], + "transmission_depth": 0.0 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "optics", "synthetic"], + "source": { + "kind": "measured", + "reference": "D. E. Zelmon, D. L. Small and R. Page. Refractive-index measurements of undoped yttrium aluminum garnet from 0.4 to 5.0 μm. Appl. Opt. 37, 4933-4935 (1998); M. N. Polyanskiy, Refractiveindex.info database of optical constants, Sci. Data 11, 94 (2024)", + "urls": ["https://github.com/polyanskiy/refractiveindex.info-database/blob/e6d15e364f70de1cad8a96a20f75689f2fba8b21/database/data/main/Y3Al5O12/nk/Zelmon.yml"], + "notes": "Faceted stone, dispersion on. specular_ior 1.8328 is the measured n at 587.6 nm and the Abbe number 52.6 is (nd - 1)/(nF - nC) from the same data.", + "authored": [] + }, + "licence": "Apache-2.0" +} From 687e68ab8494573b12ea1d951a0800d6a004b505 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:46 -0500 Subject: [PATCH 174/494] feat(library): add gems from published gemmological tables Emerald, aquamarine, peridot, topaz, garnet, tourmaline and zircon from published index ranges, with Abbe numbers converted from their B-G dispersion. Ran the library validator. --- assets/library/materials/gem/aquamarine.json | 28 +++++++++++++++++++ assets/library/materials/gem/emerald.json | 28 +++++++++++++++++++ .../materials/gem/garnet-almandine.json | 28 +++++++++++++++++++ assets/library/materials/gem/peridot.json | 28 +++++++++++++++++++ assets/library/materials/gem/topaz-blue.json | 28 +++++++++++++++++++ .../materials/gem/tourmaline-green.json | 28 +++++++++++++++++++ .../materials/gem/tourmaline-pink.json | 28 +++++++++++++++++++ assets/library/materials/gem/zircon.json | 28 +++++++++++++++++++ 8 files changed, 224 insertions(+) create mode 100644 assets/library/materials/gem/aquamarine.json create mode 100644 assets/library/materials/gem/emerald.json create mode 100644 assets/library/materials/gem/garnet-almandine.json create mode 100644 assets/library/materials/gem/peridot.json create mode 100644 assets/library/materials/gem/topaz-blue.json create mode 100644 assets/library/materials/gem/tourmaline-green.json create mode 100644 assets/library/materials/gem/tourmaline-pink.json create mode 100644 assets/library/materials/gem/zircon.json diff --git a/assets/library/materials/gem/aquamarine.json b/assets/library/materials/gem/aquamarine.json new file mode 100644 index 00000000..44784c4e --- /dev/null +++ b/assets/library/materials/gem/aquamarine.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/aquamarine", + "name": "Aquamarine", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.58, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 70.9, + "transmission_color": [0.3989, 0.5757, 0.7192], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table; LibreTexts Geosciences, Gemology, Emerald: dispersion 0.014", + "urls": ["https://cameo.mfa.org/wiki/Gemstone", "https://geo.libretexts.org/Bookshelves/Geology/Gemology/16%3A_Gemstones/16.04%3A_Beryl/16.4.03%3A_Emerald"], + "notes": "Faceted stone, dispersion on. specular_ior 1.58: the mid value of beryl's ordinary index 1.574 to 1.586 (CAMEO); beryl dispersion 0.014 (LibreTexts Gemology). The Abbe number 70.9 is converted from the published B-G dispersion 0.014 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #8ccbe0, the sea blue of iron in beryl, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/emerald.json b/assets/library/materials/gem/emerald.json new file mode 100644 index 00000000..fe9988f6 --- /dev/null +++ b/assets/library/materials/gem/emerald.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/emerald", + "name": "Emerald", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.58, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 70.9, + "transmission_color": [0.123, 0.2985, 0.1246], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "GIA Gem Encyclopedia, Emerald: refractive index 1.577 to 1.583; LibreTexts Geosciences, Gemology, Emerald: dispersion 0.014", + "urls": ["https://www.gia.edu/emerald/gem-overview", "https://geo.libretexts.org/Bookshelves/Geology/Gemology/16%3A_Gemstones/16.04%3A_Beryl/16.4.03%3A_Emerald"], + "notes": "Faceted stone, dispersion on. specular_ior 1.58: the mid value of 1.577 to 1.583 (GIA); dispersion 0.014 from LibreTexts Gemology. The Abbe number 70.9 is converted from the published B-G dispersion 0.014 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #1f9a5a, the green of chromium and vanadium in beryl, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/garnet-almandine.json b/assets/library/materials/gem/garnet-almandine.json new file mode 100644 index 00000000..71f35ded --- /dev/null +++ b/assets/library/materials/gem/garnet-almandine.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/garnet-almandine", + "name": "Garnet, almandine", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.81, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 57.7, + "transmission_color": [0.1225, 0.0203, 0.0201], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.81: the mid value of 1.79 to 1.83 (CAMEO). The Abbe number 57.7 is converted from the published B-G dispersion 0.024 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #7a1424, deep purplish red almandine, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/peridot.json b/assets/library/materials/gem/peridot.json new file mode 100644 index 00000000..f9e894e2 --- /dev/null +++ b/assets/library/materials/gem/peridot.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/peridot", + "name": "Peridot", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.67, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 57.3, + "transmission_color": [0.3782, 0.506, 0.0846], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.67: the mid value of the beta index 1.652 to 1.698 (CAMEO). The Abbe number 57.3 is converted from the published B-G dispersion 0.02 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #9ac02a, olive green of iron in olivine, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/topaz-blue.json b/assets/library/materials/gem/topaz-blue.json new file mode 100644 index 00000000..fbbbfcf0 --- /dev/null +++ b/assets/library/materials/gem/topaz-blue.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/topaz-blue", + "name": "Topaz, blue", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.62, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 75.8, + "transmission_color": [0.2282, 0.3752, 0.6423], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.62: the beta index of 1.609 to 1.631 (CAMEO), mid value. The Abbe number 75.8 is converted from the published B-G dispersion 0.014 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #5aa8d8, the sky blue of treated topaz, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/tourmaline-green.json b/assets/library/materials/gem/tourmaline-green.json new file mode 100644 index 00000000..50e5db0d --- /dev/null +++ b/assets/library/materials/gem/tourmaline-green.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/tourmaline-green", + "name": "Tourmaline, green", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.645, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.0, + "transmission_color": [0.1155, 0.2368, 0.0883], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.645: between the extraordinary 1.610 to 1.650 and ordinary 1.635 to 1.675 indices (CAMEO). The Abbe number 69.0 is converted from the published B-G dispersion 0.016 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #3a8a4a, the green of iron in verdelite, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/tourmaline-pink.json b/assets/library/materials/gem/tourmaline-pink.json new file mode 100644 index 00000000..52168d61 --- /dev/null +++ b/assets/library/materials/gem/tourmaline-pink.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/tourmaline-pink", + "name": "Tourmaline, pink", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.645, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 69.0, + "transmission_color": [0.5213, 0.1887, 0.3122], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "pink", "tinted", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.645: between the extraordinary 1.610 to 1.650 and ordinary 1.635 to 1.675 indices (CAMEO). The Abbe number 69.0 is converted from the published B-G dispersion 0.016 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #e06a9a, the pink of manganese in rubellite, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} diff --git a/assets/library/materials/gem/zircon.json b/assets/library/materials/gem/zircon.json new file mode 100644 index 00000000..598f4787 --- /dev/null +++ b/assets/library/materials/gem/zircon.json @@ -0,0 +1,28 @@ +{ + "format": "formshot-material-preset", + "version": 1, + "id": "gem/zircon", + "name": "Zircon, colourless", + "category": "Gem", + "type": "gem", + "params": { + "base_color": [1.0, 1.0, 1.0], + "base_metalness": 0.0, + "specular_roughness": 0.0, + "specular_ior": 1.94, + "transmission_weight": 1.0, + "transmission_dispersion_scale": 1.0, + "transmission_dispersion_abbe_number": 33.5, + "transmission_color": [0.9597, 0.9561, 0.9262], + "transmission_depth": 0.005 + }, + "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], + "source": { + "kind": "published", + "reference": "Museum of Fine Arts Boston, CAMEO: Conservation and Art Materials Encyclopedia Online, Properties of Gemstones table", + "urls": ["https://cameo.mfa.org/wiki/Gemstone"], + "notes": "Faceted stone, dispersion on. specular_ior 1.94: the mid value of the ordinary 1.923 to 1.960 (CAMEO). The Abbe number 33.5 is converted from the published B-G dispersion 0.048 (nG - nB) with nF - nC = 0.5845 (nG - nB), Cauchy's two-term relation. transmission_color authored as sRGB #fbfaf6, near colourless, through 0.005 m.", + "authored": ["transmission_color", "transmission_depth"] + }, + "licence": "Apache-2.0" +} From eb0d64c9eadea7edc6ea725995e54044c9d0615a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:04:59 -0500 Subject: [PATCH 175/494] feat(library): add the material preset index Lists all 249 presets in the window's category order, then by name, with type, tags, file and SHA-256 so thumbnail caches can key on content. Ran the library validator against the index and every preset; the library is 408 KB. --- assets/library/materials/index.json | 270 ++++++++++++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 assets/library/materials/index.json diff --git a/assets/library/materials/index.json b/assets/library/materials/index.json new file mode 100644 index 00000000..bac20f87 --- /dev/null +++ b/assets/library/materials/index.json @@ -0,0 +1,270 @@ +{ + "format": "formshot-material-index", + "version": 1, + "count": 249, + "categories": [ + {"name": "Metal", "folder": "metal", "count": 73}, + {"name": "Plastic", "folder": "plastic", "count": 37}, + {"name": "Glass", "folder": "glass", "count": 17}, + {"name": "Paint", "folder": "paint", "count": 22}, + {"name": "Rubber", "folder": "rubber", "count": 9}, + {"name": "Fabric", "folder": "fabric", "count": 13}, + {"name": "Wood", "folder": "wood", "count": 10}, + {"name": "Stone", "folder": "stone", "count": 10}, + {"name": "Ceramic", "folder": "ceramic", "count": 10}, + {"name": "Liquid", "folder": "liquid", "count": 17}, + {"name": "Gem", "folder": "gem", "count": 22}, + {"name": "Emissive", "folder": "emissive", "count": 9} + ], + "presets": [ + {"id": "metal/aluminium-anodised-black", "name": "Aluminium, anodised black", "category": "Metal", "type": "metal", "tags": ["anodised", "black", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-black.json", "sha256": "e3319368e21485873c0a3b5584fef499c8e822086a025bb5d5d15f4b49707e26"}, + {"id": "metal/aluminium-anodised-blue", "name": "Aluminium, anodised blue", "category": "Metal", "type": "metal", "tags": ["anodised", "blue", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-blue.json", "sha256": "dbb15e75bf823ae3f3dfa4b222d9e9971393ae76f1ff4341b4dd3385667bccd6"}, + {"id": "metal/aluminium-anodised-bronze", "name": "Aluminium, anodised bronze", "category": "Metal", "type": "metal", "tags": ["anodised", "brown", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-bronze.json", "sha256": "ce2b034542fd9f9726878f5f26222fae9d72c4f2e032ee78000ed02be78e4672"}, + {"id": "metal/aluminium-anodised-gold", "name": "Aluminium, anodised gold", "category": "Metal", "type": "metal", "tags": ["anodised", "gold", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-gold.json", "sha256": "dfd778541d7bd49fbd4dc6998a402cff4a6134de3e7980c645d853908b557800"}, + {"id": "metal/aluminium-anodised-green", "name": "Aluminium, anodised green", "category": "Metal", "type": "metal", "tags": ["anodised", "green", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-green.json", "sha256": "76a5ea0d49c602c4116bdf38527cb73cc700acf657c0f22ff15687bf1d4a7532"}, + {"id": "metal/aluminium-anodised-purple", "name": "Aluminium, anodised purple", "category": "Metal", "type": "metal", "tags": ["anodised", "purple", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-purple.json", "sha256": "3c5d57e19fd2e50230f323656b691b98ea73f63efb05c32ccbc3af4a7347d9aa"}, + {"id": "metal/aluminium-anodised-red", "name": "Aluminium, anodised red", "category": "Metal", "type": "metal", "tags": ["anodised", "red", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-red.json", "sha256": "e47a965ff2a6700c901661c475d369665dc3bd1ac19731d49d2f53f5a38139c9"}, + {"id": "metal/aluminium-anodised-rose", "name": "Aluminium, anodised rose", "category": "Metal", "type": "metal", "tags": ["anodised", "pink", "satin", "coat", "electronics"], "file": "metal/aluminium-anodised-rose.json", "sha256": "79009dc5590e467a4dc0c117c477664d4856ac66f39257e8b70714849abe5112"}, + {"id": "metal/aluminium-as-cast", "name": "Aluminium, as cast", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "electronics", "rough", "opaque"], "file": "metal/aluminium-as-cast.json", "sha256": "2625f0c3f013c75b0f20fb5db358dccbf5e5050724aa2b0893d95e1abeced0c7"}, + {"id": "metal/aluminium-bead-blasted", "name": "Aluminium, bead blasted", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "electronics", "rough", "opaque"], "file": "metal/aluminium-bead-blasted.json", "sha256": "5efa38a7b957f4490c38a0babaa680a276cde3e0d110111df8a35ee7bed3b5c3"}, + {"id": "metal/aluminium-brushed", "name": "Aluminium, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "silver", "electronics", "brushed", "opaque", "anisotropic"], "file": "metal/aluminium-brushed.json", "sha256": "1b5804d9ab98f1289b91bc65ec50928a5767bf84726e68d402293fed4993bf82"}, + {"id": "metal/aluminium-polished", "name": "Aluminium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], "file": "metal/aluminium-polished.json", "sha256": "d28b1b611eb8f56181f542816289c9f08835e00bd55bbd34d1da2d5cd4b77d9a"}, + {"id": "metal/aluminium-satin", "name": "Aluminium, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "electronics", "satin", "opaque"], "file": "metal/aluminium-satin.json", "sha256": "55e62f68e122063083f0229840a341b6ca0cebda706cc0fcf1b7def4cdc3b1a2"}, + {"id": "metal/beryllium-polished", "name": "Beryllium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/beryllium-polished.json", "sha256": "1aa06f880b5e6bded0fe4d962a4ec6fc10da8ad2d7fee193ffac65921f8a72b5"}, + {"id": "metal/bismuth-polished", "name": "Bismuth, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "polished", "opaque"], "file": "metal/bismuth-polished.json", "sha256": "5f674958eb28cf639362128eca9d2b17a2465b9d31e089e9ef10bdfe392d6ce7"}, + {"id": "metal/brass-polished", "name": "Brass (Cu70 Zn30), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "gold", "architectural", "polished", "opaque"], "file": "metal/brass-polished.json", "sha256": "a47d30ea57e458d5610bcd7f65fa1e749480f0e954726078c866ddc1d6b38c0c"}, + {"id": "metal/brass-brushed", "name": "Brass, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["alloy", "gold", "architectural", "brushed", "opaque", "anisotropic"], "file": "metal/brass-brushed.json", "sha256": "3be116c60408e12b486b50177ebb744e69868f9267b46065934a20dc3f586a9f"}, + {"id": "metal/brass-satin", "name": "Brass, satin", "category": "Metal", "type": "metal", "tags": ["alloy", "gold", "architectural", "satin", "opaque"], "file": "metal/brass-satin.json", "sha256": "960a9c4d858584965ecebb2aa69899b55a85dd68b887b3285d260ca9a3a469b5"}, + {"id": "metal/chromium-polished", "name": "Chromium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "automotive", "polished", "opaque"], "file": "metal/chromium-polished.json", "sha256": "3829789728a79166c9c2a54695aca55ce5ede8f24a3b79121c448c7973d8ee0f"}, + {"id": "metal/chromium-satin", "name": "Chromium, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "automotive", "satin", "opaque"], "file": "metal/chromium-satin.json", "sha256": "50299c5d3b85ef58b5a0395392946f4d0cbba6a45859c413e7ef5e7bff87cb98"}, + {"id": "metal/cobalt-polished", "name": "Cobalt, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], "file": "metal/cobalt-polished.json", "sha256": "6409c98616a099464513afaf825cbe09813c60de510471542db3c2e7c4db4c86"}, + {"id": "metal/copper-bead-blasted", "name": "Copper, bead blasted", "category": "Metal", "type": "metal", "tags": ["pure-metal", "orange", "kitchen", "rough", "opaque"], "file": "metal/copper-bead-blasted.json", "sha256": "59d1bb03f8c92676601b2ce4a3e652df7fb750f5e6c6f74e296640d02e0da1e7"}, + {"id": "metal/copper-brushed", "name": "Copper, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "orange", "kitchen", "brushed", "opaque", "anisotropic"], "file": "metal/copper-brushed.json", "sha256": "fdddce96524ccd25067abe8bc005cbe82dada9937803266b93affc185e3b292f"}, + {"id": "metal/copper-polished", "name": "Copper, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "orange", "kitchen", "polished", "opaque"], "file": "metal/copper-polished.json", "sha256": "60199167394ccb582bf2fdd6ba246bff6584a2449744b979ca7fc3f38f0d6d31"}, + {"id": "metal/copper-satin", "name": "Copper, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "orange", "kitchen", "satin", "opaque"], "file": "metal/copper-satin.json", "sha256": "bef260eecbd70c0d7fdbbeeb3edeaaf7a479927cd6211879d7265c598a3de8df"}, + {"id": "metal/electrum-polished", "name": "Electrum (Au50 Ag50), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], "file": "metal/electrum-polished.json", "sha256": "48add1c8c0e2b1454e6542ad644b5e99285f839ce8f2f1ec0f6f37d487f3c543"}, + {"id": "metal/gilding-metal-polished", "name": "Gilding metal (Cu90 Zn10), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "orange", "polished", "opaque"], "file": "metal/gilding-metal-polished.json", "sha256": "40fc1d0dd4da229d4ca27274c9a21da097d028c322d1dbc55313638a10edf6eb"}, + {"id": "metal/gold-brushed", "name": "Gold, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "gold", "jewellery", "brushed", "opaque", "anisotropic"], "file": "metal/gold-brushed.json", "sha256": "1d4b377df9f05fad198e151412d92e2066e975101d11ede5681e3edabb76b35a"}, + {"id": "metal/gold-polished", "name": "Gold, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "gold", "jewellery", "polished", "opaque"], "file": "metal/gold-polished.json", "sha256": "5ddd0a5c230892ad269d5f5778b85993bfa05c573bb93e40d56e76148a60014c"}, + {"id": "metal/gold-satin", "name": "Gold, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "gold", "jewellery", "satin", "opaque"], "file": "metal/gold-satin.json", "sha256": "811a90b6b10977ec52aed29f3e7f5c1228e171585cff14dfc3359bc5d9a3d3ee"}, + {"id": "metal/gold-silver-au60-polished", "name": "Gold-silver alloy (Au60 Ag40), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], "file": "metal/gold-silver-au60-polished.json", "sha256": "9b89c9f515dc775d61480f562cfdb5731c417c606747233ebbfe5a346b237a70"}, + {"id": "metal/gold-silver-au80-polished", "name": "Gold-silver alloy (Au80 Ag20), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "gold", "jewellery", "polished", "opaque"], "file": "metal/gold-silver-au80-polished.json", "sha256": "d2a52ac26f9fa234f3f9d11e33b28aedb412c2ee12338b3eb356988b487b9eb8"}, + {"id": "metal/iridium-polished", "name": "Iridium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "polished", "opaque"], "file": "metal/iridium-polished.json", "sha256": "69b5a06626ab69bdf481f09c57924abf9fc7ac57090df0ce285f287795f9c206"}, + {"id": "metal/iron-as-cast", "name": "Iron, as cast", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], "file": "metal/iron-as-cast.json", "sha256": "1a68f3c9d428b0a1a0c18dc4d54d556420a10e936f523f1b14b60ee7938a5635"}, + {"id": "metal/iron-bead-blasted", "name": "Iron, bead blasted", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], "file": "metal/iron-bead-blasted.json", "sha256": "55d69418aaddce0f35f03a1d36664a7041cb4bb08018df4a63f2d0a6506a9c40"}, + {"id": "metal/iron-polished", "name": "Iron, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/iron-polished.json", "sha256": "d04cd74175cf597341a12f4641693656397425e0a6837436b9796d948746dfd6"}, + {"id": "metal/iron-satin", "name": "Iron, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "satin", "opaque"], "file": "metal/iron-satin.json", "sha256": "0c429270766c95a3be8c83da5efe1bd3f48a89afa73a075c35b5254d69215c72"}, + {"id": "metal/lead-polished", "name": "Lead, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/lead-polished.json", "sha256": "288a4862a79ea22f11c5584a1a68f2456311b19060246e4850f0ba8ad20a37a6"}, + {"id": "metal/magnesium-polished", "name": "Magnesium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], "file": "metal/magnesium-polished.json", "sha256": "45100b01131f6abf5188dda1452dc46721a21e69c478949df0b284864ece612a"}, + {"id": "metal/mercury-polished", "name": "Mercury (liquid), polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "polished", "opaque"], "file": "metal/mercury-polished.json", "sha256": "74d905938f30e63a4ac1a98f57facdaf7c1c8b64c50ac29d432fdefd04d21b57"}, + {"id": "metal/molybdenum-polished", "name": "Molybdenum, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/molybdenum-polished.json", "sha256": "cd8912a20fc3e8cb7a62566758ea559466a62c70f86f12ae754dc5d85e7f7de8"}, + {"id": "metal/nickel-brushed", "name": "Nickel, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "silver", "industrial", "brushed", "opaque", "anisotropic"], "file": "metal/nickel-brushed.json", "sha256": "eec3c0e42779786e4edad7a2d6bd0c07588c85b00b78640bb3c242b758660642"}, + {"id": "metal/nickel-polished", "name": "Nickel, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "industrial", "polished", "opaque"], "file": "metal/nickel-polished.json", "sha256": "eda3d5f480c35c6e77077356dbaedeaf986f187b28e6d59881e7c1731cf0a11c"}, + {"id": "metal/nickel-satin", "name": "Nickel, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "industrial", "satin", "opaque"], "file": "metal/nickel-satin.json", "sha256": "eb4c6c3a87ccb0820802294ed924a16b1c39f59f06388c722d1b0293f26909c7"}, + {"id": "metal/niobium-polished", "name": "Niobium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "jewellery", "polished", "opaque"], "file": "metal/niobium-polished.json", "sha256": "20cdba04836498e49ef1a91e841e46828b2df27bdf6940de4048166124bb4f12"}, + {"id": "metal/palladium-polished", "name": "Palladium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], "file": "metal/palladium-polished.json", "sha256": "cfd6806e859e737effb1d5b45da7e83b82991759af7d78ecb019957c894d1b2b"}, + {"id": "metal/platinum-polished", "name": "Platinum, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], "file": "metal/platinum-polished.json", "sha256": "fc7f698415f8da212439f7de3a6f9ff8824cc15f9a82ac13986f7dae8d098b72"}, + {"id": "metal/red-brass-polished", "name": "Red brass (Cu85 Zn15), polished", "category": "Metal", "type": "metal", "tags": ["alloy", "orange", "polished", "opaque"], "file": "metal/red-brass-polished.json", "sha256": "b2deca162ded2c8b846edc3a453a82b6c91e372607a99b30137b2de2af5455b6"}, + {"id": "metal/rhodium-polished", "name": "Rhodium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], "file": "metal/rhodium-polished.json", "sha256": "6d0eac0b891e436582f2e91f76cc6ac9265dd6146f82fefc9ce7f4faa65e506e"}, + {"id": "metal/rose-gold-polished", "name": "Rose gold, polished", "category": "Metal", "type": "metal", "tags": ["alloy", "pink", "polished", "jewellery", "opaque"], "file": "metal/rose-gold-polished.json", "sha256": "4ab001ab291dfcf43a7081aaa8b4e63ba9268e8e35881a9c5c48167876567673"}, + {"id": "metal/silver-brushed", "name": "Silver, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "silver", "jewellery", "brushed", "opaque", "anisotropic"], "file": "metal/silver-brushed.json", "sha256": "bb85ffeba267af3781bff1db1b136679443522a7c421c116ef457dd81be4f41d"}, + {"id": "metal/silver-polished", "name": "Silver, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "jewellery", "polished", "opaque"], "file": "metal/silver-polished.json", "sha256": "b0cf03d436ce886ea7488499ef78ae32cfad0abffeb10c21704706b6fdcc7d49"}, + {"id": "metal/silver-satin", "name": "Silver, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "silver", "jewellery", "satin", "opaque"], "file": "metal/silver-satin.json", "sha256": "0bf4f22f89efa922d5eb9a286a2a256c60aff57e6157cf24740a54e070f2c85e"}, + {"id": "metal/stainless-steel-austenitic-polished", "name": "Stainless steel, austenitic, polished", "category": "Metal", "type": "metal", "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], "file": "metal/stainless-steel-austenitic-polished.json", "sha256": "bdc9b907ad3ed70a3a6117279593608d4c9742892490d89611845f1f4cd72e32"}, + {"id": "metal/stainless-steel-bead-blasted", "name": "Stainless steel, bead blasted", "category": "Metal", "type": "metal", "tags": ["alloy", "silver", "kitchen", "rough", "opaque"], "file": "metal/stainless-steel-bead-blasted.json", "sha256": "6e5714d71d366131f5d022085c4b8a1855d4ff9e2e63055e5d1ee1f2e0ae660c"}, + {"id": "metal/stainless-steel-brushed", "name": "Stainless steel, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["alloy", "silver", "kitchen", "brushed", "opaque", "anisotropic"], "file": "metal/stainless-steel-brushed.json", "sha256": "a663ee78b9359d5b6f7b8695cc0c550d4ce7b1e40e6a2a2f129037edc50a5154"}, + {"id": "metal/stainless-steel-ferritic-polished", "name": "Stainless steel, ferritic, polished", "category": "Metal", "type": "metal", "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], "file": "metal/stainless-steel-ferritic-polished.json", "sha256": "e0cd93d608204aaa8ff3654c9bd4ad18b40363a75e6bfadd4f2dcd86a3ef817e"}, + {"id": "metal/stainless-steel-mirror", "name": "Stainless steel, mirror", "category": "Metal", "type": "metal", "tags": ["alloy", "silver", "kitchen", "polished", "opaque"], "file": "metal/stainless-steel-mirror.json", "sha256": "fbf9ed4ed6c9ee4e446d443b82751f83d62baa597ba707d4ed3d8bc3526e5544"}, + {"id": "metal/stainless-steel-satin", "name": "Stainless steel, satin", "category": "Metal", "type": "metal", "tags": ["alloy", "silver", "kitchen", "satin", "opaque"], "file": "metal/stainless-steel-satin.json", "sha256": "0360e514e0d0c529fba6cebca8f5c0f8dd162d60ad0a8c2035eb1c6ccd74eb9f"}, + {"id": "metal/titanium-nitride-polished", "name": "Titanium nitride coating, polished", "category": "Metal", "type": "metal", "tags": ["coating", "gold", "industrial", "polished", "opaque"], "file": "metal/titanium-nitride-polished.json", "sha256": "3257456396bdfbc305cbc88230c5d889511b214f50740fa76ee5e0aca3f9d8c3"}, + {"id": "metal/titanium-anodised-blue", "name": "Titanium, anodised blue", "category": "Metal", "type": "metal", "tags": ["anodised", "blue", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-blue.json", "sha256": "c4920cbcb9a0f58fc994916da506d115ab0e5c82c6606ec99f64f64b660fea08"}, + {"id": "metal/titanium-anodised-bronze", "name": "Titanium, anodised bronze", "category": "Metal", "type": "metal", "tags": ["anodised", "brown", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-bronze.json", "sha256": "fb70a8d0acdb9e716faf3f0c579df2c31e666ab54d23849e05eac7d2537ebe1e"}, + {"id": "metal/titanium-anodised-gold", "name": "Titanium, anodised gold", "category": "Metal", "type": "metal", "tags": ["anodised", "gold", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-gold.json", "sha256": "68056219754cea202c66df590d761e9f390d70b37d10cc47cceeeda1219e12d0"}, + {"id": "metal/titanium-anodised-light-blue", "name": "Titanium, anodised light blue", "category": "Metal", "type": "metal", "tags": ["anodised", "blue", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-light-blue.json", "sha256": "67f69831efd0f08d7df5695a1a6b66799be976a94d6ea9ef0a08c51620e6c5fd"}, + {"id": "metal/titanium-anodised-magenta", "name": "Titanium, anodised magenta", "category": "Metal", "type": "metal", "tags": ["anodised", "pink", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-magenta.json", "sha256": "164ee778a21abb313fccc7c5e2b986adbbbb001867d0c94bb49554db1fe48234"}, + {"id": "metal/titanium-anodised-purple", "name": "Titanium, anodised purple", "category": "Metal", "type": "metal", "tags": ["anodised", "purple", "thin-film", "polished", "jewellery"], "file": "metal/titanium-anodised-purple.json", "sha256": "f776d2619076910aaf4b393c1c0eeaaed4c6459706d98aca229b0476b2dedc36"}, + {"id": "metal/titanium-bead-blasted", "name": "Titanium, bead blasted", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "rough", "opaque"], "file": "metal/titanium-bead-blasted.json", "sha256": "aba9d62d2847e32810de2edd042208452ffbbe2188ff3ff916ad84dacb3b1a82"}, + {"id": "metal/titanium-brushed", "name": "Titanium, brushed", "category": "Metal", "type": "metal_brushed", "tags": ["pure-metal", "grey", "industrial", "brushed", "opaque", "anisotropic"], "file": "metal/titanium-brushed.json", "sha256": "08ffe60e37b211a344ef82882177bc92acd55e54b98216423b2f8a57f6e21eb7"}, + {"id": "metal/titanium-polished", "name": "Titanium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/titanium-polished.json", "sha256": "6c424eb99a6bbf055451e8ebecd92e3a34a5e85c5b7ecb2116b6973c0c1b81ac"}, + {"id": "metal/titanium-satin", "name": "Titanium, satin", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "satin", "opaque"], "file": "metal/titanium-satin.json", "sha256": "bc6ee61e2dc8b4c1057364169b00eee9087ec218e8f833e0a01182132488b6ef"}, + {"id": "metal/tungsten-polished", "name": "Tungsten, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/tungsten-polished.json", "sha256": "e44f12134699ff3ac81a019c1848d80d7f87ae7ac9f74441b9d29d4cc8ae80cb"}, + {"id": "metal/vanadium-polished", "name": "Vanadium, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/vanadium-polished.json", "sha256": "b614288b606bcda8e94710b542e422538ffb561b30fa0b4db26d1bc7ee2961a1"}, + {"id": "metal/zinc-polished", "name": "Zinc, polished", "category": "Metal", "type": "metal", "tags": ["pure-metal", "grey", "industrial", "polished", "opaque"], "file": "metal/zinc-polished.json", "sha256": "732763d7c33b676e9c874beeb324f6069120fe13a8324981930ab3983fd0ec5f"}, + {"id": "plastic/abs-black-gloss", "name": "ABS, black gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "black", "opaque", "electronics"], "file": "plastic/abs-black-gloss.json", "sha256": "4d16b80d20f34472a8f9c37df9f6edf4fc83444a0818456a16b818f7167446df"}, + {"id": "plastic/abs-black-matte", "name": "ABS, black matte", "category": "Plastic", "type": "plastic", "tags": ["polymer", "matte", "black", "opaque", "electronics"], "file": "plastic/abs-black-matte.json", "sha256": "3a42d07ff55cc8de366a1a48385e2d2512e55ee762c1d0345451671c1ab2ef57"}, + {"id": "plastic/abs-black-satin", "name": "ABS, black satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "black", "opaque", "electronics"], "file": "plastic/abs-black-satin.json", "sha256": "02e5784012240c61e66a2dd7ba7464e249f2592282ae531d5c13391fc3ffe665"}, + {"id": "plastic/abs-blue-gloss", "name": "ABS, blue gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "blue", "opaque", "electronics"], "file": "plastic/abs-blue-gloss.json", "sha256": "52f74212813da0dd7d47ad06e378a920921a53087f742716cee2841d67e27c9b"}, + {"id": "plastic/abs-grey-gloss", "name": "ABS, grey gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "grey", "opaque", "electronics"], "file": "plastic/abs-grey-gloss.json", "sha256": "3fa4cb6639685dd81e5f745a6dfbdfd253d934280502694346d4c60fdb73d7cf"}, + {"id": "plastic/abs-grey-matte", "name": "ABS, grey matte", "category": "Plastic", "type": "plastic", "tags": ["polymer", "matte", "grey", "opaque", "electronics"], "file": "plastic/abs-grey-matte.json", "sha256": "ee1f4fe47ada2c7390c93c551f5f3f1099c0a3e170a34a38311d84d0819907cf"}, + {"id": "plastic/abs-red-gloss", "name": "ABS, red gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "red", "opaque", "electronics"], "file": "plastic/abs-red-gloss.json", "sha256": "8c600ffea716f96b94d25473d504244106fa653ad13a35065250ca60bad77218"}, + {"id": "plastic/abs-white-gloss", "name": "ABS, white gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "white", "opaque", "electronics"], "file": "plastic/abs-white-gloss.json", "sha256": "57a178493b5e38397e400a6631bbb2a7fbac703c8381b5a910a12285a27f1510"}, + {"id": "plastic/abs-yellow-gloss", "name": "ABS, yellow gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "yellow", "opaque", "electronics"], "file": "plastic/abs-yellow-gloss.json", "sha256": "499ed022faa4650fa3b7d10a40f42395ec02f0b7a4da263541199129ad8f6444"}, + {"id": "plastic/acetal-black-satin", "name": "Acetal, black satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "black", "opaque", "industrial"], "file": "plastic/acetal-black-satin.json", "sha256": "f502bd6be2bf8fa3214de2dff203f40a1596a6a8573a1ea922aea69d22e7298d"}, + {"id": "plastic/acetal-white-satin", "name": "Acetal, white satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "white", "opaque", "industrial"], "file": "plastic/acetal-white-satin.json", "sha256": "9a9d2bb08090ab48544a4d6a1ce631f26acc219f6d571cf2f4d3aef3b479cb53"}, + {"id": "plastic/acrylic-amber", "name": "Acrylic, amber tint", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "orange", "tinted", "gloss"], "file": "plastic/acrylic-amber.json", "sha256": "9685d7957b03adfc20e428191f40737e660ba1e52f65a7d577af870aee5f71ff"}, + {"id": "plastic/acrylic-blue", "name": "Acrylic, blue tint", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "blue", "tinted", "gloss"], "file": "plastic/acrylic-blue.json", "sha256": "630ba0f369926d2a60b20e0921bfd05e375ef04b482f20cee5853dcc59789607"}, + {"id": "plastic/acrylic-clear", "name": "Acrylic, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "architectural"], "file": "plastic/acrylic-clear.json", "sha256": "68cdd2e4161e24ab1ab15730d4d33c3cb97182b64c29fb045ad33aa5538c893c"}, + {"id": "plastic/acrylic-frosted", "name": "Acrylic, frosted", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "frosted", "translucent"], "file": "plastic/acrylic-frosted.json", "sha256": "392f606204345a830d2d5bac4c2bd76fba414294bc6ced731589bbb1b0135146"}, + {"id": "plastic/acrylic-red", "name": "Acrylic, red tint", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "red", "tinted", "gloss"], "file": "plastic/acrylic-red.json", "sha256": "559c03caf34c7aafd923b8e2f46067c1f7b3da05a5ff90b387d0528f35100ebb"}, + {"id": "plastic/acrylic-smoke", "name": "Acrylic, smoke grey", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "grey", "tinted", "gloss"], "file": "plastic/acrylic-smoke.json", "sha256": "eab9bf428c62445057f1bca187fdc5f699612d69e16dda6cb5c0df8d91e878ff"}, + {"id": "plastic/cr39-clear", "name": "CR-39 lens resin, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "optics"], "file": "plastic/cr39-clear.json", "sha256": "881640bfa8655f703903e4a45c5e1105949365e94bd1145112ca2c9780cd354b"}, + {"id": "plastic/cellulose-acetate-clear", "name": "Cellulose acetate, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "apparel"], "file": "plastic/cellulose-acetate-clear.json", "sha256": "3708e0f4aeee6b68360295183184de0f5602e8c903124ca90cc4f3993f36ef7b"}, + {"id": "plastic/hdpe-natural", "name": "HDPE, natural translucent", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "white", "translucent", "subsurface", "packaging"], "file": "plastic/hdpe-natural.json", "sha256": "7590a3717c0c335f03f174c7a232466ff9cb6c420ae114b8860ab263f3987f5b"}, + {"id": "plastic/hdpe-white-matte", "name": "HDPE, white matte", "category": "Plastic", "type": "plastic", "tags": ["polymer", "matte", "white", "opaque", "packaging"], "file": "plastic/hdpe-white-matte.json", "sha256": "626b032a49ba0d646c0d8cc58fd3a9a2b9076bb88d8b7fbbd0c737f08bee552c"}, + {"id": "plastic/nylon-black-matte", "name": "Nylon, black matte", "category": "Plastic", "type": "plastic", "tags": ["polymer", "matte", "black", "opaque", "industrial"], "file": "plastic/nylon-black-matte.json", "sha256": "6103525b2de9155a04a0e55fb47632c850c3e560ae50bb16ff19274f152f1884"}, + {"id": "plastic/nylon-natural-matte", "name": "Nylon, natural matte", "category": "Plastic", "type": "plastic", "tags": ["polymer", "matte", "white", "opaque", "industrial"], "file": "plastic/nylon-natural-matte.json", "sha256": "f0bdae950a2b2f12d4d0a2ed1e51b07e8dfdb385ff856a2f0f847af26ef2c812"}, + {"id": "plastic/pet-amber", "name": "PET, amber bottle tint", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "brown", "tinted", "packaging"], "file": "plastic/pet-amber.json", "sha256": "cce163d890c153821da5a4b814762d3ae189127aae7fcec56676f4627a9f5cb6"}, + {"id": "plastic/pet-clear", "name": "PET, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "packaging"], "file": "plastic/pet-clear.json", "sha256": "60df5d5810d7f35bed6d21fe7d4b259cb969e58c9a90fca8563d52f9d6920ca2"}, + {"id": "plastic/pet-green", "name": "PET, green bottle tint", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "green", "tinted", "packaging"], "file": "plastic/pet-green.json", "sha256": "c956aa84f68c0b1db2e627079fbdb3d346d1777ac3d8f7263d7d4bac69fa4c3a"}, + {"id": "plastic/pla-orange-satin", "name": "PLA, orange satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "orange", "opaque", "industrial"], "file": "plastic/pla-orange-satin.json", "sha256": "983a1036799a9ef05b5630c6b89641f3a1642c622566cc89f8fe49783826c88b"}, + {"id": "plastic/pla-white-satin", "name": "PLA, white satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "white", "opaque", "industrial"], "file": "plastic/pla-white-satin.json", "sha256": "a241bf1a7af598fa55d820bd7cc3271a23d1dfc06e74214dfc5bca42974db8cd"}, + {"id": "plastic/pvc-grey-satin", "name": "PVC, grey satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "grey", "opaque", "architectural"], "file": "plastic/pvc-grey-satin.json", "sha256": "589f125f8cb822efa3938759746b5efdc4eba5698109d60e1211b14d3d752c2c"}, + {"id": "plastic/pvc-white-gloss", "name": "PVC, white gloss", "category": "Plastic", "type": "plastic", "tags": ["polymer", "gloss", "white", "opaque", "architectural"], "file": "plastic/pvc-white-gloss.json", "sha256": "475adf37975f6436b7d999b92bd5046189c72741d1dc9af8d6d0ad9a3da0b613"}, + {"id": "plastic/polycarbonate-clear", "name": "Polycarbonate, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "electronics"], "file": "plastic/polycarbonate-clear.json", "sha256": "223a44668abcee09575644a69e52528c5c0a2f3a2fb5302498917b5467a1c118"}, + {"id": "plastic/polycarbonate-frosted", "name": "Polycarbonate, frosted", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "frosted", "translucent", "lighting"], "file": "plastic/polycarbonate-frosted.json", "sha256": "733573726839288b51d6aab360ee432bda4826af870bd4fa34608f15a5a62d45"}, + {"id": "plastic/polypropylene-black-satin", "name": "Polypropylene, black satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "black", "opaque", "automotive"], "file": "plastic/polypropylene-black-satin.json", "sha256": "12d67291733275622dcc43160656451749904e5003649da11eb6308e646f705e"}, + {"id": "plastic/polypropylene-natural", "name": "Polypropylene, natural translucent", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "white", "translucent", "subsurface", "packaging"], "file": "plastic/polypropylene-natural.json", "sha256": "b927794f6c02662c8d556dfcc8ecb4d0551d66b6eaea94c3e70fe41fef9f19f8"}, + {"id": "plastic/polypropylene-white-satin", "name": "Polypropylene, white satin", "category": "Plastic", "type": "plastic", "tags": ["polymer", "satin", "white", "opaque", "packaging"], "file": "plastic/polypropylene-white-satin.json", "sha256": "95adc92079d0dd4fe3df67bcb001ebb69d49996cc19eee21f4c0930fafa763e1"}, + {"id": "plastic/polystyrene-clear", "name": "Polystyrene, clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "packaging"], "file": "plastic/polystyrene-clear.json", "sha256": "7fbd4bcabeb8e3860295165c80a56a5de25f00da43d38b233e8c0923d5aeb3e9"}, + {"id": "plastic/pdms-clear", "name": "Silicone (PDMS), clear", "category": "Plastic", "type": "plastic_clear", "tags": ["polymer", "transparent", "clear", "gloss", "elastomer"], "file": "plastic/pdms-clear.json", "sha256": "03fe343af8e7eb1216145cdbdbb7b9e7a58449bf4fe5f85ccd758fbe464c8966"}, + {"id": "glass/bottle-glass-amber", "name": "Bottle glass, amber", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "brown", "tinted", "packaging"], "file": "glass/bottle-glass-amber.json", "sha256": "4029884ec062191e388fab036749e361e16055e93f21b101f571f56d33632899"}, + {"id": "glass/bottle-glass-green", "name": "Bottle glass, green", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "green", "tinted", "packaging"], "file": "glass/bottle-glass-green.json", "sha256": "49629b2ea6ed3e81aad2c51fbcf1f849fd353d6b57249215eb7609bac9520fb8"}, + {"id": "glass/cobalt-blue-glass", "name": "Cobalt blue glass", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "blue", "tinted", "tableware"], "file": "glass/cobalt-blue-glass.json", "sha256": "f610826ddb3ba7bb21a6bb31495d1baed1b3abae0b5b2e866bba0fe7bd6627df"}, + {"id": "glass/dense-flint-n-sf11", "name": "Dense flint glass (N-SF11)", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "optics", "dispersion"], "file": "glass/dense-flint-n-sf11.json", "sha256": "5048ae10d577990cd054a8cd45b68c2bdb22ccc36a26d87eec8ef1446ed3d05c"}, + {"id": "glass/fused-silica", "name": "Fused silica", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "optics"], "file": "glass/fused-silica.json", "sha256": "3ef4166f1ac16c1b64e924f09f9fae9e8895773d51479b5f69e96bc0d109a179"}, + {"id": "glass/opal-glass", "name": "Opal glass", "category": "Glass", "type": "glass", "tags": ["glass", "translucent", "subsurface", "white", "lighting"], "file": "glass/opal-glass.json", "sha256": "d3338f2e6887558f708fa92b8c4aa929033fd65b0ce92a00975a75dab8fe6e11"}, + {"id": "glass/optical-crown-n-bk7", "name": "Optical crown glass (N-BK7)", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "optics"], "file": "glass/optical-crown-n-bk7.json", "sha256": "bfe8308c84aa1f7dd6237deccd3a9588626f7ca79166a94644c58ea705a8c221"}, + {"id": "glass/optical-flint-n-f2", "name": "Optical flint glass (N-F2)", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "optics", "dispersion"], "file": "glass/optical-flint-n-f2.json", "sha256": "8ec949ee1545de949149c983d2cc1051f776aef2f0eb2ba8bf434dcd03e4a330"}, + {"id": "glass/window-glass-bronze", "name": "Window glass, bronze tint", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "brown", "tinted", "architectural"], "file": "glass/window-glass-bronze.json", "sha256": "3fb400bf3f9d5b572be08a88e832c5624ef5df908f491933d2dd09b9157b6306"}, + {"id": "glass/window-glass-clear", "name": "Window glass, clear", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "architectural"], "file": "glass/window-glass-clear.json", "sha256": "4953d7a83227a69611f29f7240a35114967374bf3df4bfeb158ddb169a764ff8"}, + {"id": "glass/window-glass-frosted", "name": "Window glass, frosted", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "frosted", "translucent", "architectural"], "file": "glass/window-glass-frosted.json", "sha256": "97e7c4024b2c8caa52f9018a2f86f37f37609737e93fa92c8b7835f5b797eb04"}, + {"id": "glass/window-glass-green", "name": "Window glass, green tint", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "green", "tinted", "architectural"], "file": "glass/window-glass-green.json", "sha256": "4c2d3e976daf72be7a2aecfceee7ec0e3620274c7390376995fb9b1bf7c46c45"}, + {"id": "glass/window-glass-grey", "name": "Window glass, grey tint", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "grey", "tinted", "architectural"], "file": "glass/window-glass-grey.json", "sha256": "b1d199a6445b54afb55ce6056bfeb1fcb0091ec5f53b958faeb0134baa2c572a"}, + {"id": "glass/window-glass-low-iron", "name": "Window glass, low iron", "category": "Glass", "type": "glass", "tags": ["glass", "transparent", "clear", "architectural"], "file": "glass/window-glass-low-iron.json", "sha256": "8d6ec233790b015bcfe859b1ba9b1b543f801a5dd684d3270eeac32177c130e6"}, + {"id": "glass/window-pane-thin-bronze", "name": "Window pane, thin bronze", "category": "Glass", "type": "glass_thin", "tags": ["glass", "transparent", "brown", "tinted", "architectural", "thin-walled"], "file": "glass/window-pane-thin-bronze.json", "sha256": "2f1f1db44a5cc691623233d4bd0821d89a52ed04ba0f92d4a0ca703376900a79"}, + {"id": "glass/window-pane-thin-frosted", "name": "Window pane, thin frosted", "category": "Glass", "type": "glass_thin", "tags": ["glass", "transparent", "clear", "frosted", "architectural", "thin-walled"], "file": "glass/window-pane-thin-frosted.json", "sha256": "43ad7758c481df4cffa6bcf6a8a72928584872f5b4b8d2e67a72138c767e7b27"}, + {"id": "glass/window-pane-thin", "name": "Window pane, thin shell", "category": "Glass", "type": "glass_thin", "tags": ["glass", "transparent", "clear", "architectural", "thin-walled"], "file": "glass/window-pane-thin.json", "sha256": "d03d5f3c89efab99e2ebad6e630797087233daeab72a7b6c5750f69b4a295e9e"}, + {"id": "paint/gloss-black", "name": "Gloss enamel, black", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "black", "opaque", "automotive"], "file": "paint/gloss-black.json", "sha256": "76ae12bde364f02188699ef2d48b0d388e855f090afeeeaba33a10032fb62139"}, + {"id": "paint/gloss-blue", "name": "Gloss enamel, blue", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "blue", "opaque", "automotive"], "file": "paint/gloss-blue.json", "sha256": "7f11ee1c5644a171ed5fda407537f58b3c219569652e7f5fd63ae51d4e4e65dc"}, + {"id": "paint/gloss-green", "name": "Gloss enamel, green", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "green", "opaque", "automotive"], "file": "paint/gloss-green.json", "sha256": "9afe034ecdd27497d5e8d3768c25a07f02a43ff9ff121c0fe4b6164e3ac68281"}, + {"id": "paint/gloss-orange", "name": "Gloss enamel, orange", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "orange", "opaque", "industrial"], "file": "paint/gloss-orange.json", "sha256": "9339cdd63f8f08b142931428e79744cdcd95f66d811b95d3ea97255e0051aa1e"}, + {"id": "paint/gloss-red", "name": "Gloss enamel, red", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "red", "opaque", "automotive"], "file": "paint/gloss-red.json", "sha256": "9e14205e538acd2f1569d2dce8383535de349e2d4809f4b764be4e8a0f67daea"}, + {"id": "paint/gloss-white", "name": "Gloss enamel, white", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "white", "opaque", "furniture"], "file": "paint/gloss-white.json", "sha256": "ea8755af517ae5e62f8a13c2246f112092fbe1b92203139da0e70f76a8b7b25c"}, + {"id": "paint/gloss-yellow", "name": "Gloss enamel, yellow", "category": "Paint", "type": "paint", "tags": ["paint", "gloss", "coat", "yellow", "opaque", "industrial"], "file": "paint/gloss-yellow.json", "sha256": "04c3c8236ec18a73fd729366251131c68b6f200981a0aa3f93ba893ba31ad273"}, + {"id": "paint/matte-black", "name": "Matte paint, black", "category": "Paint", "type": "paint", "tags": ["paint", "matte", "black", "opaque", "industrial"], "file": "paint/matte-black.json", "sha256": "658e4c9925f15cca983890cba809b277b71a2663cdc9079616d07bd35eed4eab"}, + {"id": "paint/matte-sage", "name": "Matte paint, sage green", "category": "Paint", "type": "paint", "tags": ["paint", "matte", "green", "opaque", "architectural"], "file": "paint/matte-sage.json", "sha256": "444d02eebda9b90de51d2f71e4ac8c3b8f42e0bc82b5ab1d8c0d513cd57facc4"}, + {"id": "paint/matte-terracotta", "name": "Matte paint, terracotta", "category": "Paint", "type": "paint", "tags": ["paint", "matte", "orange", "opaque", "architectural"], "file": "paint/matte-terracotta.json", "sha256": "318f23ba653db2d950d20d0bdd4accf132fd273a8475e528fdeaf0dbd1753c0a"}, + {"id": "paint/matte-white", "name": "Matte paint, white", "category": "Paint", "type": "paint", "tags": ["paint", "matte", "white", "opaque", "architectural"], "file": "paint/matte-white.json", "sha256": "a6fbfed5b02e4825c27403a3d7bc6e82a48e3f9d308c6d57b332a705e3c623b4"}, + {"id": "paint/metallic-black", "name": "Metallic paint, black", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "black", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-black.json", "sha256": "fcae9e243ebde50585b6edd70f5c735cab9161334e1e690414a6a77fa0c30e1d"}, + {"id": "paint/metallic-blue", "name": "Metallic paint, blue", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "blue", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-blue.json", "sha256": "18b73f9ab409bee929cf0f62770ec79c020d8ab4d5d849be4b4f9a5b72f48085"}, + {"id": "paint/metallic-champagne", "name": "Metallic paint, champagne", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "gold", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-champagne.json", "sha256": "9978f42f32d0e31445a76ed4febb1c4bb395c87c4850e2c8f159ec390a732f3e"}, + {"id": "paint/metallic-gunmetal", "name": "Metallic paint, gunmetal", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "grey", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-gunmetal.json", "sha256": "926384a686464dcb957795ddd8ccea1e987f24381964f3017a99cdeaa3384ff3"}, + {"id": "paint/metallic-red", "name": "Metallic paint, red", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "red", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-red.json", "sha256": "37ba392160e1421c489c22a81417daa3a32457fe0cd1c6b23b65f9d60d850e8b"}, + {"id": "paint/metallic-silver", "name": "Metallic paint, silver", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "silver", "gloss", "automotive", "needs-graph"], "file": "paint/metallic-silver.json", "sha256": "4c4307f097f8c0cc29b82fa84b0d935ad12cd4c784c153724c4af8c64d719149"}, + {"id": "paint/pearl-blue", "name": "Pearl paint, blue", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "thin-film", "blue", "gloss", "automotive", "needs-graph"], "file": "paint/pearl-blue.json", "sha256": "fd4cca065fdc0ef59ab8d284537b51149a095b015814de16ad83928232dd4918"}, + {"id": "paint/pearl-white", "name": "Pearl paint, white", "category": "Paint", "type": "paint_metallic", "tags": ["paint", "coat", "thin-film", "white", "gloss", "automotive", "needs-graph"], "file": "paint/pearl-white.json", "sha256": "5a0e86bfb1cfcfb78c82a744bdfd2d91db27149cee4f140ad38a2379e338a6de"}, + {"id": "paint/satin-blue", "name": "Satin paint, blue", "category": "Paint", "type": "paint", "tags": ["paint", "satin", "coat", "blue", "opaque", "furniture"], "file": "paint/satin-blue.json", "sha256": "46b0d166b8980a02038d79ec2e3cd6a3bc14c0c412075b6c9afd8c8ba8a2f704"}, + {"id": "paint/satin-grey", "name": "Satin paint, grey", "category": "Paint", "type": "paint", "tags": ["paint", "satin", "coat", "grey", "opaque", "architectural"], "file": "paint/satin-grey.json", "sha256": "93f58c82eeeff3a93196a205de1937f5600ec02938331b86f5b67a3eb1486529"}, + {"id": "paint/satin-white", "name": "Satin paint, white", "category": "Paint", "type": "paint", "tags": ["paint", "satin", "coat", "white", "opaque", "architectural"], "file": "paint/satin-white.json", "sha256": "cf68321d59e8e123de208d2208eed35fd38fc62e10af6200c71540d0e49f8ae4"}, + {"id": "rubber/black-rubber-matte", "name": "Black rubber, matte", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "black", "opaque", "industrial"], "file": "rubber/black-rubber-matte.json", "sha256": "b7ed77663bf4013b2c3210a2e510a5f339d9107dc2cfd7cc4a61b8c251bcdd52"}, + {"id": "rubber/black-rubber-satin", "name": "Black rubber, satin", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "satin", "black", "opaque", "industrial"], "file": "rubber/black-rubber-satin.json", "sha256": "b9b59849b41846501f4bacb437a7b0b1dabb48c0105874efe746e36be72954c8"}, + {"id": "rubber/epdm-grey", "name": "EPDM rubber, grey", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "grey", "opaque", "architectural"], "file": "rubber/epdm-grey.json", "sha256": "0285c80ffb31952055f50a91d3807b91f99a2c054d12def958568e027a4cd773"}, + {"id": "rubber/gum-rubber-natural", "name": "Gum rubber, natural", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "brown", "opaque", "apparel"], "file": "rubber/gum-rubber-natural.json", "sha256": "9ba8b5413f4604ad7e9558bf8f1d771a61cce6a14de60fdef9ab956b31c3694a"}, + {"id": "rubber/nitrile-blue", "name": "Nitrile rubber, blue", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "blue", "opaque", "industrial"], "file": "rubber/nitrile-blue.json", "sha256": "05a9be46f2f332dbdafb9a19b86fa6ae492d4f24198e627b4753da9c85c02983"}, + {"id": "rubber/silicone-rubber-red", "name": "Silicone rubber, red", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "satin", "red", "subsurface", "kitchen"], "file": "rubber/silicone-rubber-red.json", "sha256": "2ae609af296b91b4f3b797916046a8753504d35863d38b9e15f4959223fb6bf9"}, + {"id": "rubber/silicone-rubber-white", "name": "Silicone rubber, white", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "satin", "white", "subsurface", "kitchen"], "file": "rubber/silicone-rubber-white.json", "sha256": "0b96c86673b0f2573962fc18f83478635ea75edb18ab47a2e8e9408ecfc73340"}, + {"id": "rubber/soft-touch-black", "name": "Soft-touch coating, black", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "black", "opaque", "electronics"], "file": "rubber/soft-touch-black.json", "sha256": "115d6e6bab0f84f8087dade3c07af56ddd2f0ed032bc863c7b9ec97ba49f5dd4"}, + {"id": "rubber/tyre-rubber", "name": "Tyre rubber", "category": "Rubber", "type": "rubber", "tags": ["elastomer", "matte", "black", "opaque", "automotive"], "file": "rubber/tyre-rubber.json", "sha256": "3690d7ff5816dc5c040d26ec56c13ef48a3b701df7cdb74d89086c34db999cb4"}, + {"id": "fabric/cotton-navy", "name": "Cotton, navy", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "blue", "apparel"], "file": "fabric/cotton-navy.json", "sha256": "bb572102a71a0f38b5f6cc9511ed2a399bcdf03333db1ca95eda353b29fcafad"}, + {"id": "fabric/cotton-red", "name": "Cotton, red", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "red", "apparel"], "file": "fabric/cotton-red.json", "sha256": "df137464a30bbb4816592627be73659ffb85cb31f89db6eb8fbc56cd0a852ef8"}, + {"id": "fabric/cotton-white", "name": "Cotton, white", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "white", "apparel"], "file": "fabric/cotton-white.json", "sha256": "d2caaa1dff7750de0f4cd4a24d616c2b6d1e3584c20f7a6ada4784ed433b8902"}, + {"id": "fabric/denim-blue", "name": "Denim, indigo", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "blue", "apparel"], "file": "fabric/denim-blue.json", "sha256": "39548cac6e912a6bc8b49dccfaa32d3acb3d0a7f9c439dc77514be3270c5256c"}, + {"id": "fabric/felt-charcoal", "name": "Felt, charcoal", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "grey", "apparel"], "file": "fabric/felt-charcoal.json", "sha256": "3196022b46798182706e3a77b7206087a7e4381b6f6852af20724d554905e52d"}, + {"id": "fabric/linen-natural", "name": "Linen, natural", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "brown", "apparel"], "file": "fabric/linen-natural.json", "sha256": "7f7cf0db2f51d9ea819642a6f0a11045c7c3d38f17c199b160bf1789605defa7"}, + {"id": "fabric/polyester-black", "name": "Polyester, black", "category": "Fabric", "type": "fabric", "tags": ["synthetic-fibre", "fuzz", "matte", "black", "apparel"], "file": "fabric/polyester-black.json", "sha256": "df408732c7bddde9e12fcdfecf883e281a5304d8c5564598a0cc73bb9fe80401"}, + {"id": "fabric/polyester-grey", "name": "Polyester, grey", "category": "Fabric", "type": "fabric", "tags": ["synthetic-fibre", "fuzz", "matte", "grey", "apparel"], "file": "fabric/polyester-grey.json", "sha256": "8087f505e16b83dbffe9acb5952aa5618c9d98de1c58b50a28038f52b0e0e030"}, + {"id": "fabric/silk-ivory", "name": "Silk, ivory", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "satin", "anisotropic", "white", "apparel"], "file": "fabric/silk-ivory.json", "sha256": "1e6260dec76b10961565dbc661e96ed339993a59ab4f06573b1e4bfffa47abad"}, + {"id": "fabric/velvet-black", "name": "Velvet, black", "category": "Fabric", "type": "fabric", "tags": ["synthetic-fibre", "fuzz", "matte", "black", "furniture"], "file": "fabric/velvet-black.json", "sha256": "d0cd41bd9b09d97ad7f4b46a2a45163087afc0867d62c855a03dad3e29b075d7"}, + {"id": "fabric/velvet-burgundy", "name": "Velvet, burgundy", "category": "Fabric", "type": "fabric", "tags": ["synthetic-fibre", "fuzz", "matte", "red", "furniture"], "file": "fabric/velvet-burgundy.json", "sha256": "ecd3af61748c656cabf98483ac3d7de303e7a406cab19c8774dd7e91fdc04086"}, + {"id": "fabric/wool-camel", "name": "Wool, camel", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "brown", "apparel"], "file": "fabric/wool-camel.json", "sha256": "fac618974c9926d232d6d389198947886aaca388466a618d6877729cc5f71642"}, + {"id": "fabric/wool-grey", "name": "Wool, grey", "category": "Fabric", "type": "fabric", "tags": ["natural-fibre", "fuzz", "matte", "grey", "apparel"], "file": "fabric/wool-grey.json", "sha256": "3a788e8c274ceb537501fcd22f4d748536774783467c02ebaf3930fa8f36c714"}, + {"id": "wood/ash-oiled", "name": "Ash, oiled", "category": "Wood", "type": "wood", "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], "file": "wood/ash-oiled.json", "sha256": "e9496d61be7a1c8422aa9b14d49db523c100cb1424486b57e0d6bb4a10c4360d"}, + {"id": "wood/cherry-oiled", "name": "Cherry, oiled", "category": "Wood", "type": "wood", "tags": ["wood", "satin", "red", "needs-graph", "furniture"], "file": "wood/cherry-oiled.json", "sha256": "7497998ac807953e0418069caebb174b6f110b6c5ef6e950535cf31c071940bf"}, + {"id": "wood/ebony-polished", "name": "Ebony, polished", "category": "Wood", "type": "wood", "tags": ["wood", "gloss", "black", "needs-graph", "furniture", "coat"], "file": "wood/ebony-polished.json", "sha256": "50c69af92af19f2e6911cb3c7b1f0f847c946e78c489f6f6dfe286b3cea05898"}, + {"id": "wood/maple-lacquered", "name": "Maple, lacquered", "category": "Wood", "type": "wood", "tags": ["wood", "gloss", "yellow", "needs-graph", "furniture", "coat"], "file": "wood/maple-lacquered.json", "sha256": "5ca75fd20a85eecd248e31384f03968b84a3a2f080eec2bd7cd40761b3a4d884"}, + {"id": "wood/oak-lacquered", "name": "Oak, lacquered", "category": "Wood", "type": "wood", "tags": ["wood", "gloss", "brown", "needs-graph", "furniture", "coat"], "file": "wood/oak-lacquered.json", "sha256": "e5c10b31e3204f0b45da2d6fb63c12f861021e4b74131e60a9947628a2c1f424"}, + {"id": "wood/oak-oiled", "name": "Oak, oiled", "category": "Wood", "type": "wood", "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], "file": "wood/oak-oiled.json", "sha256": "7d04f2d8ebe0f75ed54060ef5ce4801710405eabf6840264f7e595a8136b65f7"}, + {"id": "wood/pine-raw", "name": "Pine, raw", "category": "Wood", "type": "wood", "tags": ["wood", "matte", "yellow", "needs-graph", "furniture"], "file": "wood/pine-raw.json", "sha256": "d29bab325b9bc13d61e83ba0f08a3019750cfe53ed246458dbff510b8fae56f3"}, + {"id": "wood/teak-oiled", "name": "Teak, oiled", "category": "Wood", "type": "wood", "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], "file": "wood/teak-oiled.json", "sha256": "0386c4472db41a7d87c6fd31ba6e4f89e1072c9ef812d6cc8e544d49d7b7ae11"}, + {"id": "wood/walnut-lacquered", "name": "Walnut, lacquered", "category": "Wood", "type": "wood", "tags": ["wood", "gloss", "brown", "needs-graph", "furniture", "coat"], "file": "wood/walnut-lacquered.json", "sha256": "1afdaf72df5f1e12359d15a86fe77b8d0e42df3a6c1a4ee46ea5539e4b8e7432"}, + {"id": "wood/walnut-oiled", "name": "Walnut, oiled", "category": "Wood", "type": "wood", "tags": ["wood", "satin", "brown", "needs-graph", "furniture"], "file": "wood/walnut-oiled.json", "sha256": "01f188938a2c3eb4a98bd483a89d0e439b34f0c5b1ed25f272b7bb1dd2a09199"}, + {"id": "stone/concrete", "name": "Concrete, smooth", "category": "Stone", "type": "stone", "tags": ["stone", "matte", "grey", "needs-graph", "architectural"], "file": "stone/concrete.json", "sha256": "feacea5b86844001119c6d98aea44f3f7172e1fa112f134516c6adf08163ca9b"}, + {"id": "stone/granite-black-polished", "name": "Granite, black polished", "category": "Stone", "type": "stone", "tags": ["stone", "polished", "black", "needs-graph", "architectural"], "file": "stone/granite-black-polished.json", "sha256": "3f80626f5b1a49c45df16c9e0e3a43c2abbca0e8213f1c73f56ecdedf53d3d56"}, + {"id": "stone/granite-grey-honed", "name": "Granite, grey honed", "category": "Stone", "type": "stone", "tags": ["stone", "satin", "grey", "needs-graph", "architectural"], "file": "stone/granite-grey-honed.json", "sha256": "0f86dd653488f33c28bc781e4a0909ff52fe9a7675095c4c4805a658e629d777"}, + {"id": "stone/limestone", "name": "Limestone, sawn", "category": "Stone", "type": "stone", "tags": ["stone", "matte", "white", "needs-graph", "architectural"], "file": "stone/limestone.json", "sha256": "e73277652fce9c4aef6810ff1bb404a625d8c01ffd966804cc16e82ab3345c5d"}, + {"id": "stone/marble-black-polished", "name": "Marble, black polished", "category": "Stone", "type": "stone", "tags": ["stone", "polished", "black", "needs-graph", "architectural"], "file": "stone/marble-black-polished.json", "sha256": "7ce8d47a5177d89a72f43fa871051d3b3e5649b2256a57269e0092326942bf5d"}, + {"id": "stone/marble-white-honed", "name": "Marble, white honed", "category": "Stone", "type": "stone", "tags": ["stone", "satin", "white", "subsurface", "needs-graph", "architectural"], "file": "stone/marble-white-honed.json", "sha256": "7c22da53ec0ba4f6529468cde4fc6de72fddb4bc505466374911fe8dbcdee7d5"}, + {"id": "stone/marble-white-polished", "name": "Marble, white polished", "category": "Stone", "type": "stone", "tags": ["stone", "polished", "white", "subsurface", "needs-graph", "architectural"], "file": "stone/marble-white-polished.json", "sha256": "80e2498c82e8bd3ec345d48e29d6c8b4409978c19b5b902e42a851d0c804fd07"}, + {"id": "stone/sandstone", "name": "Sandstone, sawn", "category": "Stone", "type": "stone", "tags": ["stone", "matte", "brown", "needs-graph", "architectural"], "file": "stone/sandstone.json", "sha256": "1c9759f7230134335eb070b9e96c8a4dfdf801f574e355fc134f9b6a1582c80c"}, + {"id": "stone/slate", "name": "Slate, riven", "category": "Stone", "type": "stone", "tags": ["stone", "matte", "grey", "needs-graph", "architectural"], "file": "stone/slate.json", "sha256": "14c954be6812b0f64e07432372ad49f05d650225fbd1c5dd14c5f4b75650eab9"}, + {"id": "stone/travertine-honed", "name": "Travertine, honed", "category": "Stone", "type": "stone", "tags": ["stone", "satin", "brown", "needs-graph", "architectural"], "file": "stone/travertine-honed.json", "sha256": "df637c1208687cc73e4f9c91e279f077d9fa6d6a7e5aedcb6ea9d2abd42ada89"}, + {"id": "ceramic/alumina-technical", "name": "Alumina ceramic, technical", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "satin", "white", "opaque", "industrial"], "file": "ceramic/alumina-technical.json", "sha256": "1f9bd95a209d968d8bc7c72bfcd0a2e5f4ff35fcd2defc58f85fb000d9bca4c0"}, + {"id": "ceramic/bisque-white-unglazed", "name": "Bisque, unglazed white", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "matte", "white", "opaque", "tableware"], "file": "ceramic/bisque-white-unglazed.json", "sha256": "a9c6ecaabb8e8215e3fd6123bee9c530469bfd2ad4b22cb4317a7a7356aad46d"}, + {"id": "ceramic/glazed-black", "name": "Glazed ceramic, black", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "black", "opaque", "tableware"], "file": "ceramic/glazed-black.json", "sha256": "2a3e5c33ea3ecf36a86362452cae197f1dddd251054da8be6857d649e74998d8"}, + {"id": "ceramic/glazed-celadon", "name": "Glazed ceramic, celadon", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "green", "opaque", "tableware"], "file": "ceramic/glazed-celadon.json", "sha256": "5c9d2669ba87f1113fea7d5368fcbea4c48c9d7590ed28280c90a3a04875c405"}, + {"id": "ceramic/glazed-cobalt-blue", "name": "Glazed ceramic, cobalt blue", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "blue", "opaque", "tableware"], "file": "ceramic/glazed-cobalt-blue.json", "sha256": "ff94ebe40b4ee27ea9a5edc9d27bbf55281adcb06b414e2ae848b1139bc1809b"}, + {"id": "ceramic/glazed-white", "name": "Glazed ceramic, white", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "white", "opaque", "tableware"], "file": "ceramic/glazed-white.json", "sha256": "48f33659c08505c5384abb9a65424c05ceebd7daa071f5c071aad6057eafac85"}, + {"id": "ceramic/glazed-tile-white", "name": "Glazed tile, white", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "white", "opaque", "architectural"], "file": "ceramic/glazed-tile-white.json", "sha256": "a7225d5efde799356f3b00126823d5ada67f69c47e2f6a9ce1f8fe1fc333045f"}, + {"id": "ceramic/porcelain-glazed", "name": "Porcelain, glazed", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "gloss", "coat", "subsurface", "white", "tableware"], "file": "ceramic/porcelain-glazed.json", "sha256": "2d57ed2a847b184c2722d3b8405ab42e49655ef39d28ce810d249ab5920270cf"}, + {"id": "ceramic/stoneware-matte-glaze", "name": "Stoneware, matte glaze", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "matte", "coat", "grey", "opaque", "tableware"], "file": "ceramic/stoneware-matte-glaze.json", "sha256": "212fd0b7fc896ec04c1f50165ccd5b6c8504c8e8b86c265c69215def90e9548b"}, + {"id": "ceramic/terracotta-unglazed", "name": "Terracotta, unglazed", "category": "Ceramic", "type": "ceramic", "tags": ["ceramic", "matte", "orange", "opaque", "architectural"], "file": "ceramic/terracotta-unglazed.json", "sha256": "1c6b132ec4eab7e8a3e107e3e178bd8f563ddb3d10fbae6c5eb575c76862ee2e"}, + {"id": "liquid/apple-juice", "name": "Apple juice, clear", "category": "Liquid", "type": "liquid", "tags": ["beverage", "transparent", "tinted", "orange", "kitchen"], "file": "liquid/apple-juice.json", "sha256": "8630409c49f91b427600d6c39e473c24f24ce6ab067206af21760e5aebcc42a1"}, + {"id": "liquid/beer-lager", "name": "Beer, lager", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "gold", "beverage"], "file": "liquid/beer-lager.json", "sha256": "e2408e561b7ab89c4f72e5be2ab9d30afc6c1d3a1582437bd7111f4e9bf9fb42"}, + {"id": "liquid/coffee-black", "name": "Coffee, black", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "brown", "beverage"], "file": "liquid/coffee-black.json", "sha256": "4b05e9b149de894812a557ce83660b1c7ad52474c48614ab9a4ab289b054b720"}, + {"id": "liquid/cola", "name": "Cola", "category": "Liquid", "type": "liquid", "tags": ["beverage", "transparent", "tinted", "brown", "kitchen"], "file": "liquid/cola.json", "sha256": "e835bba437d1745fed25b515c92b6ba30a48c358490e18ef60748a1ddd7918b6"}, + {"id": "liquid/ethanol", "name": "Ethanol", "category": "Liquid", "type": "liquid", "tags": ["transparent", "clear"], "file": "liquid/ethanol.json", "sha256": "fa76e240cf86133aa7e5830b14f90a3de486c809939655a5c856741e43677c17"}, + {"id": "liquid/glycerol", "name": "Glycerol", "category": "Liquid", "type": "liquid", "tags": ["transparent", "clear"], "file": "liquid/glycerol.json", "sha256": "4309d7465da2dd8dc0870f257976aa1eb5501b0fe16e67f8875fb3241a9de7be"}, + {"id": "liquid/honey", "name": "Honey", "category": "Liquid", "type": "liquid", "tags": ["food", "transparent", "tinted", "orange", "kitchen"], "file": "liquid/honey.json", "sha256": "e817ee53f8cd5085146b535f323903a69a98a139c5b5b71e3fc451839c3dc0de"}, + {"id": "liquid/maple-syrup", "name": "Maple syrup", "category": "Liquid", "type": "liquid", "tags": ["food", "transparent", "tinted", "brown", "kitchen"], "file": "liquid/maple-syrup.json", "sha256": "8495455bce6f2328302a65a745e0f85456bd637a45f863203b3ebf695af6176f"}, + {"id": "liquid/milk", "name": "Milk", "category": "Liquid", "type": "liquid", "tags": ["beverage", "food", "subsurface", "translucent", "white"], "file": "liquid/milk.json", "sha256": "ec0da264af5b0ee55ce7e1b44ed88ca1d8015e675d5bc81eb64992763c152e58"}, + {"id": "liquid/motor-oil", "name": "Motor oil", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "orange", "oil", "industrial"], "file": "liquid/motor-oil.json", "sha256": "7e777178375ef0a7f9838f5d2870312d6837bdb4b12cc8e474930a75ca4a326a"}, + {"id": "liquid/olive-oil", "name": "Olive oil", "category": "Liquid", "type": "liquid", "tags": ["oil", "food", "transparent", "tinted", "yellow", "kitchen"], "file": "liquid/olive-oil.json", "sha256": "f09cf0febc9b99db12d110b2c0eaf4f3ab99a3dba0ca9877f83b038d8b9aa172"}, + {"id": "liquid/orange-juice", "name": "Orange juice", "category": "Liquid", "type": "liquid", "tags": ["beverage", "food", "subsurface", "translucent", "orange"], "file": "liquid/orange-juice.json", "sha256": "3b8ee25460a0131b195bd05ea5539faf5f8b151e9a3accef681f1e6034895c3f"}, + {"id": "liquid/red-wine", "name": "Red wine", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "red", "beverage"], "file": "liquid/red-wine.json", "sha256": "a88e662df285590a84d8db89fdba1e3b30eb0df0eead74671194bcd34109ae07"}, + {"id": "liquid/tea", "name": "Tea", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "brown", "beverage"], "file": "liquid/tea.json", "sha256": "d31d936ef165ba5d4c73180a821cc47a56b7437eaf31ce361a49b96b2ce9f4b2"}, + {"id": "liquid/vegetable-oil", "name": "Vegetable oil, light", "category": "Liquid", "type": "liquid", "tags": ["oil", "food", "transparent", "tinted", "yellow", "kitchen"], "file": "liquid/vegetable-oil.json", "sha256": "94693ce1986f622fb862de2e2716c3aa62bc4e2ce5503609a11e16dfcb5988ca"}, + {"id": "liquid/water", "name": "Water", "category": "Liquid", "type": "liquid", "tags": ["water", "transparent", "clear", "beverage"], "file": "liquid/water.json", "sha256": "847f47e26168952709c358d42c1e9e15309bcef19583ce33f6b9a5027cab2119"}, + {"id": "liquid/white-wine", "name": "White wine", "category": "Liquid", "type": "liquid", "tags": ["transparent", "tinted", "yellow", "beverage"], "file": "liquid/white-wine.json", "sha256": "7dc1a398878696716a8fde34d25560d8e863a9db7250ee21d61f1aa23b5bf600"}, + {"id": "gem/amethyst", "name": "Amethyst", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "purple", "tinted", "jewellery"], "file": "gem/amethyst.json", "sha256": "da291f5ca5c06caef9505922138f27e5e500a648aff3e9ebc2b29fe2c298cd5d"}, + {"id": "gem/aquamarine", "name": "Aquamarine", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], "file": "gem/aquamarine.json", "sha256": "2a4a5d97119bd47fb41fc79b0348ca76a42a05cb7f79695e6e47c338ad88e0ee"}, + {"id": "gem/chrysoberyl", "name": "Chrysoberyl", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "yellow", "tinted", "jewellery"], "file": "gem/chrysoberyl.json", "sha256": "ac64f658588af4539acff998842e094892b1dbafcfe3a79b074ba8dd6f9bfa85"}, + {"id": "gem/citrine", "name": "Citrine", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "yellow", "tinted", "jewellery"], "file": "gem/citrine.json", "sha256": "17f0fb5ed1a8ce7adc479bd0a6f3a63abefc169265ab98711428dbda579d3e44"}, + {"id": "gem/cubic-zirconia", "name": "Cubic zirconia", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery", "synthetic"], "file": "gem/cubic-zirconia.json", "sha256": "5ecf2429f24db5e8e7f56a93cba3918358fe9d9bbff8fff799d3d92710084ee5"}, + {"id": "gem/diamond", "name": "Diamond", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], "file": "gem/diamond.json", "sha256": "8836774a0905122b63bb2fa2b2e2dcd79dc22e5212f748bcdcbec835477501d6"}, + {"id": "gem/emerald", "name": "Emerald", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], "file": "gem/emerald.json", "sha256": "9634d6833d996627eeab60f5b8340c1c24598692a7bfdcf6094518bc5476f1f5"}, + {"id": "gem/fluorite-purple", "name": "Fluorite, purple", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "purple", "tinted", "mineral"], "file": "gem/fluorite-purple.json", "sha256": "1bfd1d92f7c578434d7110382fb82c1f727174027700d1c4d0c6f80dd940a7fe"}, + {"id": "gem/garnet-almandine", "name": "Garnet, almandine", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], "file": "gem/garnet-almandine.json", "sha256": "9d4b26f808967fe1048c2d43796b2e75c308c924523316e423cea720828a5d2f"}, + {"id": "gem/moissanite", "name": "Moissanite", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery", "synthetic"], "file": "gem/moissanite.json", "sha256": "479cf259ad0b497ac12da8c123f859267cb263b8a3f7061d2899ca26e0bc512e"}, + {"id": "gem/peridot", "name": "Peridot", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], "file": "gem/peridot.json", "sha256": "e8fbb0dd44e7603cf99329a8be2bdbafd1d66f7598ffb56de5a055fd2f82f296"}, + {"id": "gem/rock-crystal", "name": "Quartz, rock crystal", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "mineral"], "file": "gem/rock-crystal.json", "sha256": "7010dbd11a905b52baf774e0988827d7feceea2a105548cbd98b0a862aa69959"}, + {"id": "gem/smoky-quartz", "name": "Quartz, smoky", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "brown", "tinted", "mineral"], "file": "gem/smoky-quartz.json", "sha256": "a3ae97d64a0dfd01ec0c415eb4fdc65be406e86ebca6bcaa553125ea8fe7c581"}, + {"id": "gem/ruby", "name": "Ruby", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], "file": "gem/ruby.json", "sha256": "28018171b7ba83e880a6f61c432f52ead70137c4d2ec44d73ebe064926160e2b"}, + {"id": "gem/sapphire-blue", "name": "Sapphire, blue", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], "file": "gem/sapphire-blue.json", "sha256": "7e94d8143dcbef9e22a4e533b0d7b1f1566f6024676da47e57b502a53dcf7ccf"}, + {"id": "gem/white-sapphire", "name": "Sapphire, colourless", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], "file": "gem/white-sapphire.json", "sha256": "8fc99ba64d9d031b285289096b06785e51074a3b6dbb5ff12e7bca25384b7aff"}, + {"id": "gem/spinel-red", "name": "Spinel, red", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "red", "tinted", "jewellery"], "file": "gem/spinel-red.json", "sha256": "9d34550f1ff16a906b562cb1eaac2c758801c05d5d6e8bcb2e95368ea0305bf5"}, + {"id": "gem/topaz-blue", "name": "Topaz, blue", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "blue", "tinted", "jewellery"], "file": "gem/topaz-blue.json", "sha256": "91981c5c043aeb9e490f83729e5e3794f32b7ddba0a3ee5659a304a130c5cecf"}, + {"id": "gem/tourmaline-green", "name": "Tourmaline, green", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "green", "tinted", "jewellery"], "file": "gem/tourmaline-green.json", "sha256": "54ae3fc276f51c191b4109f30d55cbfec5cb32b3ff965270d8af61675448116e"}, + {"id": "gem/tourmaline-pink", "name": "Tourmaline, pink", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "pink", "tinted", "jewellery"], "file": "gem/tourmaline-pink.json", "sha256": "b95f2947e8b81894293b2ff8fd6e937de2aad7cb2ea85d4709814bf0a61d30ec"}, + {"id": "gem/yag", "name": "YAG, colourless", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "optics", "synthetic"], "file": "gem/yag.json", "sha256": "002bb08504366b2db7ba4810439876e342e2f8502a6651a1b57e398b7c0c77cf"}, + {"id": "gem/zircon", "name": "Zircon, colourless", "category": "Gem", "type": "gem", "tags": ["crystal", "transparent", "dispersion", "clear", "jewellery"], "file": "gem/zircon.json", "sha256": "35716c19b1d8c9b6dc2361d6d4f4d16b711b76782db79c948c76c9dd2ae1e2e3"}, + {"id": "emissive/display-white-srgb", "name": "Display white, sRGB reference", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "display", "white", "electronics"], "file": "emissive/display-white-srgb.json", "sha256": "ce60fdd12d195b43ee2b7ddf5a5848299d082ea397ba051855722c4ec15275f4"}, + {"id": "emissive/electroluminescent-green", "name": "Electroluminescent panel, green", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "green", "display"], "file": "emissive/electroluminescent-green.json", "sha256": "6821292fc731da73bdcddb03210411ff3011bc4893dd668ae23f6ab84873ae85"}, + {"id": "emissive/fluorescent-tube-4000k", "name": "Fluorescent tube, 4000 K", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "white", "lighting"], "file": "emissive/fluorescent-tube-4000k.json", "sha256": "4c0c992723757a6e3f2aa748747ddc131639f08c803f438e26df69c428f38aa6"}, + {"id": "emissive/hdr-display-peak", "name": "HDR display, peak white", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "display", "white", "electronics"], "file": "emissive/hdr-display-peak.json", "sha256": "0ea75be8cd983d44478934879b822afd730f06f30fd85e02321b5c538e51793c"}, + {"id": "emissive/incandescent-frosted-2700k", "name": "Incandescent bulb, frosted", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "orange", "lighting"], "file": "emissive/incandescent-frosted-2700k.json", "sha256": "cf471630c28c4ce332be7acfd414d34d78eafd7499d3d6d8210ae5075576bfcc"}, + {"id": "emissive/indicator-led-red", "name": "Indicator LED, red", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "red", "electronics"], "file": "emissive/indicator-led-red.json", "sha256": "2f2111d92eb738021c1de7a09448ded7a5d3ddcac17011edfaf77511195e8bc1"}, + {"id": "emissive/monitor-white-lcd", "name": "LCD monitor, white", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "display", "white", "electronics"], "file": "emissive/monitor-white-lcd.json", "sha256": "223ebb08068a406b9ddda7a7027b949a24cdbb67f854676c096901697cbcddc5"}, + {"id": "emissive/light-box-6500k", "name": "Light box, daylight", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "white", "lighting"], "file": "emissive/light-box-6500k.json", "sha256": "69cc4c7c0985be5a2dcd52d4983ffd5b4cd7cf9979425a3955537c036b3acdf0"}, + {"id": "emissive/sodium-lamp-low-pressure", "name": "Sodium lamp, low pressure", "category": "Emissive", "type": "emissive", "tags": ["light-source", "emissive", "orange", "lighting"], "file": "emissive/sodium-lamp-low-pressure.json", "sha256": "9ee60465bf69a8db46c1d30c0d402ae7c53c8ce05869c338bbc908e2d567ac76"} + ] +} From 4e9fb7c307ff041246fe70a8d0b8a33ced332063 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:06:25 -0500 Subject: [PATCH 176/494] docs(library): state the measured metal fit error and the beryl source Corrects the README's bound on the F82 fit error to the computed worst case and lists the gemmology page used for beryl dispersion. Checked the figures against the conversion output. --- assets/library/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/library/README.md b/assets/library/README.md index d5291817..96dab60f 100644 --- a/assets/library/README.md +++ b/assets/library/README.md @@ -28,13 +28,14 @@ Material presets for the Library window. Every preset here is our own work, writ | USDA AMS, Sucrose Conversion Table, Technical Procedures Manual Appendix XV, https://www.ams.usda.gov/sites/default/files/media/SucroseConversionTableXV.pdf | Refractive index of sugar solutions (juices, syrups, soft drinks) | US federal government work | | Museum of Fine Arts Boston, CAMEO, Gemstone properties table, https://cameo.mfa.org/wiki/Gemstone | Refractive index and dispersion of gems without n data in the database | Facts cited, nothing copied | | GIA Gem Encyclopedia, emerald facts, https://www.gia.edu/emerald/gem-overview | Emerald refractive index | Facts cited, nothing copied | +| LibreTexts Geosciences, Gemology, Emerald, https://geo.libretexts.org/Bookshelves/Geology/Gemology/16%3A_Gemstones/16.04%3A_Beryl/16.4.03%3A_Emerald | Beryl dispersion (emerald, aquamarine) | Facts cited, nothing copied | | Orders of magnitude (luminance), https://en.wikipedia.org/wiki/Orders_of_magnitude_(illuminance)#Luminance | Luminance of displays and lamps | Facts cited, nothing copied | Only numbers are taken from these sources; the presets, names and notes are ours. ## How the numbers were made -- Metals: the base colour is the normal-incidence Fresnel reflectance of the measured n and k, and the edge tint (`specular_color`) is the F82 tint of the OpenPBR metal model: the ratio of the true reflectance at 82 degrees (cosine 1/7) to the Schlick curve through the base colour. Each reflectance spectrum (380 to 780 nm, 5 nm steps) is integrated against the CIE 1931 colour matching functions under D65, normalised so a perfect reflector is white, converted to linear sRGB and then to ACEScg with the engine's matrix. The fitted F0 and tint reproduce the true reflectance at every angle to within 0.04 (most metals within 0.02). +- Metals: the base colour is the normal-incidence Fresnel reflectance of the measured n and k, and the edge tint (`specular_color`) is the F82 tint of the OpenPBR metal model: the ratio of the true reflectance at 82 degrees (cosine 1/7) to the Schlick curve through the base colour. Each reflectance spectrum (380 to 780 nm, 5 nm steps) is integrated against the CIE 1931 colour matching functions under D65, normalised so a perfect reflector is white, converted to linear sRGB and then to ACEScg with the engine's matrix. The fitted F0 and tint reproduce the true reflectance at every angle to within 0.043 (27 of the 32 measured metals within 0.03); each preset's notes give its own figure. - Dielectrics: `specular_ior` is n at 587.6 nm; the Abbe number is (nd - 1) / (nF - nC) at 587.6, 486.1 and 656.3 nm. For gems quoted with a B-G dispersion (nG - nB), the Abbe number uses nF - nC = 0.5845 (nG - nB), which follows from Cauchy's two-term formula. - Absorbing transparent materials (water, window glasses): `transmission_color` is the Beer-Lambert transmittance exp(-4 pi k d / lambda) at `transmission_depth` d, integrated to a colour like the metals. - Emitters: `emission_color` is the colour of a blackbody at the lamp's colour temperature, or of the emission line, normalised to luminance 1. From 94720255b50f6cc4594af26e1aa7be379ce1f5a3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:00:44 -0500 Subject: [PATCH 177/494] feat(materials): add the register program and its binary encoding Program holds a constant input block, a register instruction list, a constant pool and a write-back table, with encode, encode_f32, decode, check and a disassembler. Ran cargo clippy -p fsh-materials. --- native/crates/fsh-materials/Cargo.toml | 1 + native/crates/fsh-materials/src/lib.rs | 2 + native/crates/fsh-materials/src/program.rs | 555 +++++++++++++++++++++ 3 files changed, 558 insertions(+) create mode 100644 native/crates/fsh-materials/src/program.rs diff --git a/native/crates/fsh-materials/Cargo.toml b/native/crates/fsh-materials/Cargo.toml index 99621225..b731cead 100644 --- a/native/crates/fsh-materials/Cargo.toml +++ b/native/crates/fsh-materials/Cargo.toml @@ -7,3 +7,4 @@ publish = false [dependencies] fsh-core = { path = "../fsh-core" } +serde = { version = "1", features = ["derive"] } diff --git a/native/crates/fsh-materials/src/lib.rs b/native/crates/fsh-materials/src/lib.rs index 77496253..8a058d8f 100644 --- a/native/crates/fsh-materials/src/lib.rs +++ b/native/crates/fsh-materials/src/lib.rs @@ -5,8 +5,10 @@ mod fresnel; mod ggx; mod inputs; mod lobes; +pub mod program; mod tables; pub use bsdf::{Bsdf, BsdfSample, LobeFlags, ShadingFrame}; pub use inputs::SurfaceInputs; +pub use program::{DecodeError, Field, Filter, Instr, Op, Output, Program, Wrap, MAX_UV_SETS, REGISTERS}; pub use tables::{energy_tables, warm_up, EnergyTables}; diff --git a/native/crates/fsh-materials/src/program.rs b/native/crates/fsh-materials/src/program.rs new file mode 100644 index 00000000..4856d923 --- /dev/null +++ b/native/crates/fsh-materials/src/program.rs @@ -0,0 +1,555 @@ +use crate::inputs::SurfaceInputs; +use core::fmt::Write as _; + +/// Number of vec4 registers a program may use. +pub const REGISTERS: usize = 32; +/// First word of an encoded program ("PM"). +pub const PROGRAM_MAGIC: u32 = 0x4d50; +/// Encoding version. +pub const PROGRAM_VERSION: u32 = 1; +/// Words before the first instruction in an encoded program. +pub const PROGRAM_HEADER_WORDS: usize = 8; +/// Uv sets a hit can carry. +pub const MAX_UV_SETS: usize = 4; + +/// The program reads uv set 0 (set n is `NEED_UV0 << n`). +pub const NEED_UV0: u32 = 1 << 0; +/// The program reads a tangent frame. +pub const NEED_TANGENT: u32 = 1 << 4; +/// The program samples textures. +pub const NEED_TEXTURES: u32 = 1 << 5; +/// The program evaluates procedurals. +pub const NEED_PROCEDURAL: u32 = 1 << 6; +/// The program writes the shading normal. +pub const NEED_NORMAL: u32 = 1 << 7; +/// The program bumps (evaluates offset points). +pub const NEED_BUMP: u32 = 1 << 8; + +/// One instruction kind; the numbers are the binary encoding. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +#[repr(u8)] +pub enum Op { + /// Nothing. + Nop = 0, + /// `dst = consts[a..a+4]`. + Const = 1, + /// `dst` = shading-point input `flags & 15` at bump offset `flags >> 4`; `a` is the uv set. + Input = 2, + /// `dst.i = a[(flags >> 2i) & 3]`. + Swizzle = 3, + /// `dst = (a.x, b.x, c.x, 0)`. + Combine = 4, + /// `a + b`. + Add = 5, + /// `a - b`. + Sub = 6, + /// `a * b`. + Mul = 7, + /// `a / b`, 0 where b is 0. + Div = 8, + /// `min(a, b)`. + Min = 9, + /// `max(a, b)`. + Max = 10, + /// `max(a, 0)^b`, 0 when not finite. + Pow = 11, + /// `a + (b - a) * c.x`. + Lerp = 12, + /// `min(max(a, b), c)`. + Clamp = 13, + /// `1 - a`. + Invert = 14, + /// ACEScg luminance of `a.xyz`, splatted. + Luminance = 15, + /// Colour ramp at `a.x`, stops at `consts[b]`, interpolation `flags`. + Ramp = 16, + /// Uv transform of `a` by `consts[b..b+6]`. + Xform2 = 17, + /// Projection of position `a` (flags 0 planar, 1 cylindrical, 2 spherical). + Project = 18, + /// Texture `b` at uv `a`, fallback `consts[c..c+4]`, wrap and filter in `flags`. + Tex = 19, + /// Box-projected texture `b` at position `a`, fallback and transform at `consts[c..c+11]`. + TexBox = 20, + /// Tangent-space normal map: colour `a`, strength `b.x`, flags bit 0 flips y. + NormalMap = 21, + /// Normal `a` bent by heights `b = (h, h_u, h_v)`. + Bump = 22, + /// Procedural `flags`, output `b`, argument registers listed at `consts[a]`. + Proc = 23, +} + +impl Op { + /// Every opcode in encoding order. + pub const ALL: [Op; 24] = [ + Op::Nop, + Op::Const, + Op::Input, + Op::Swizzle, + Op::Combine, + Op::Add, + Op::Sub, + Op::Mul, + Op::Div, + Op::Min, + Op::Max, + Op::Pow, + Op::Lerp, + Op::Clamp, + Op::Invert, + Op::Luminance, + Op::Ramp, + Op::Xform2, + Op::Project, + Op::Tex, + Op::TexBox, + Op::NormalMap, + Op::Bump, + Op::Proc, + ]; + + /// Opcode from its number. + pub fn from_u8(v: u8) -> Option { + Self::ALL.get(v as usize).copied() + } + + /// Lower-case mnemonic. + pub fn name(self) -> &'static str { + match self { + Op::Nop => "nop", + Op::Const => "const", + Op::Input => "input", + Op::Swizzle => "swizzle", + Op::Combine => "combine", + Op::Add => "add", + Op::Sub => "sub", + Op::Mul => "mul", + Op::Div => "div", + Op::Min => "min", + Op::Max => "max", + Op::Pow => "pow", + Op::Lerp => "lerp", + Op::Clamp => "clamp", + Op::Invert => "invert", + Op::Luminance => "luminance", + Op::Ramp => "ramp", + Op::Xform2 => "xform2", + Op::Project => "project", + Op::Tex => "tex", + Op::TexBox => "texbox", + Op::NormalMap => "normalmap", + Op::Bump => "bump", + Op::Proc => "proc", + } + } +} + +/// Shading-point inputs read by `Op::Input` (`flags & 15`). +pub mod input { + /// World position, footprint in w. + pub const POSITION: u8 = 0; + /// Object position, footprint in w. + pub const POSITION_OBJECT: u8 = 1; + /// World shading normal. + pub const NORMAL: u8 = 2; + /// World geometric normal. + pub const GEOMETRIC_NORMAL: u8 = 3; + /// Object shading normal. + pub const NORMAL_OBJECT: u8 = 4; + /// Uv set `a` as (u, v, uv footprint, 0). + pub const UV: u8 = 5; + /// World tangent, sign in w. + pub const TANGENT: u8 = 6; + /// Footprint in x. + pub const FOOTPRINT: u8 = 7; + /// Bump offset along u (`flags` high nibble). + pub const OFFSET_U: u8 = 1; + /// Bump offset along v (`flags` high nibble). + pub const OFFSET_V: u8 = 2; +} + +/// Texture coordinate wrapping. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum Wrap { + /// Tile. + #[default] + Repeat, + /// Clamp to the edge texel. + Clamp, + /// Tile, mirrored every other tile. + Mirror, +} + +/// Texture filtering. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum Filter { + /// Nearest texel of level 0. + Nearest, + /// Bilinear on level 0. + Bilinear, + /// Bilinear on the two mip levels the footprint selects, blended. + #[default] + Trilinear, +} + +impl Wrap { + /// Two-bit code. + pub fn code(self) -> u8 { + self as u8 + } + + /// From the two-bit code. + pub fn from_code(v: u8) -> Wrap { + match v & 3 { + 1 => Wrap::Clamp, + 2 => Wrap::Mirror, + _ => Wrap::Repeat, + } + } +} + +impl Filter { + /// Two-bit code. + pub fn code(self) -> u8 { + self as u8 + } + + /// From the two-bit code. + pub fn from_code(v: u8) -> Filter { + match v & 3 { + 0 => Filter::Nearest, + 1 => Filter::Bilinear, + _ => Filter::Trilinear, + } + } +} + +/// A surface input a program writes; the numbers are the binary encoding. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[repr(u8)] +pub enum Field { + /// `base_weight`. + BaseWeight = 0, + /// `base_color`. + BaseColor = 1, + /// `base_metalness`. + BaseMetalness = 2, + /// `base_diffuse_roughness`. + BaseDiffuseRoughness = 3, + /// `specular_weight`. + SpecularWeight = 4, + /// `specular_color`. + SpecularColor = 5, + /// `specular_roughness`. + SpecularRoughness = 6, + /// `specular_ior`. + SpecularIor = 7, + /// `specular_anisotropy`. + SpecularAnisotropy = 8, + /// `transmission_weight`. + TransmissionWeight = 9, + /// `transmission_color`. + TransmissionColor = 10, + /// `coat_weight`. + CoatWeight = 11, + /// `coat_color`. + CoatColor = 12, + /// `coat_roughness`. + CoatRoughness = 13, + /// `coat_ior`. + CoatIor = 14, + /// `fuzz_weight`. + FuzzWeight = 15, + /// `fuzz_color`. + FuzzColor = 16, + /// `fuzz_roughness`. + FuzzRoughness = 17, + /// `emission`, scene units. + Emission = 18, + /// `opacity`. + Opacity = 19, + /// Shading normal, world space. + Normal = 20, + /// Displacement in metres along the normal (not applied per hit). + Displacement = 21, +} + +impl Field { + /// Every field in encoding order. + pub const ALL: [Field; 22] = [ + Field::BaseWeight, + Field::BaseColor, + Field::BaseMetalness, + Field::BaseDiffuseRoughness, + Field::SpecularWeight, + Field::SpecularColor, + Field::SpecularRoughness, + Field::SpecularIor, + Field::SpecularAnisotropy, + Field::TransmissionWeight, + Field::TransmissionColor, + Field::CoatWeight, + Field::CoatColor, + Field::CoatRoughness, + Field::CoatIor, + Field::FuzzWeight, + Field::FuzzColor, + Field::FuzzRoughness, + Field::Emission, + Field::Opacity, + Field::Normal, + Field::Displacement, + ]; + + /// Field from its number. + pub fn from_u8(v: u8) -> Option { + Self::ALL.get(v as usize).copied() + } + + /// True for colour fields (three components). + pub fn is_colour(self) -> bool { + matches!( + self, + Field::BaseColor + | Field::SpecularColor + | Field::TransmissionColor + | Field::CoatColor + | Field::FuzzColor + | Field::Emission + ) + } + + /// Name as in `SurfaceInputs`. + pub fn name(self) -> &'static str { + match self { + Field::BaseWeight => "base_weight", + Field::BaseColor => "base_color", + Field::BaseMetalness => "base_metalness", + Field::BaseDiffuseRoughness => "base_diffuse_roughness", + Field::SpecularWeight => "specular_weight", + Field::SpecularColor => "specular_color", + Field::SpecularRoughness => "specular_roughness", + Field::SpecularIor => "specular_ior", + Field::SpecularAnisotropy => "specular_anisotropy", + Field::TransmissionWeight => "transmission_weight", + Field::TransmissionColor => "transmission_color", + Field::CoatWeight => "coat_weight", + Field::CoatColor => "coat_color", + Field::CoatRoughness => "coat_roughness", + Field::CoatIor => "coat_ior", + Field::FuzzWeight => "fuzz_weight", + Field::FuzzColor => "fuzz_color", + Field::FuzzRoughness => "fuzz_roughness", + Field::Emission => "emission", + Field::Opacity => "opacity", + Field::Normal => "normal", + Field::Displacement => "displacement", + } + } +} + +/// One instruction: opcode, destination register, small flags and three operands. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Instr { + /// Opcode. + pub op: Op, + /// Destination register. + pub dst: u8, + /// Opcode-specific small operand. + pub flags: u8, + /// First operand. + pub a: u32, + /// Second operand. + pub b: u32, + /// Third operand. + pub c: u32, +} + +impl Instr { + /// Instruction with all fields. + pub fn new(op: Op, dst: u8, flags: u8, a: u32, b: u32, c: u32) -> Self { + Self { op, dst, flags, a, b, c } + } +} + +/// Write-back of one register into one field after the code ran. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Output { + /// Field written. + pub field: Field, + /// Source register. + pub reg: u8, +} + +/// A compiled material: a constant block plus a register program that overrides fields per hit. +#[derive(Clone, Debug, PartialEq)] +pub struct Program { + /// Constant inputs (sanitised); what a constant program evaluates to. + pub base: SurfaceInputs, + /// Instructions; empty for a constant program. + pub code: Vec, + /// Constant pool. + pub consts: Vec, + /// Write-back table applied in order after the code. + pub outputs: Vec, + /// Registers used. + pub registers: u32, + /// `NEED_*` bits. + pub needs: u32, + /// Snapshot texture indices sampled, sorted and unique. + pub textures: Vec, +} + +impl Default for Program { + fn default() -> Self { + Self::constant(SurfaceInputs::default().sanitized()) + } +} + +/// Why an encoded program could not be read. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct DecodeError(pub String); + +impl core::fmt::Display for DecodeError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "bad program: {}", self.0) + } +} + +impl std::error::Error for DecodeError {} + +impl Program { + /// A program that evaluates to `base` and runs nothing. + pub fn constant(base: SurfaceInputs) -> Self { + Self { base, code: Vec::new(), consts: Vec::new(), outputs: Vec::new(), registers: 0, needs: 0, textures: Vec::new() } + } + + /// True when nothing varies: use `base` and skip the interpreter. + pub fn is_constant(&self) -> bool { + self.code.is_empty() && self.outputs.is_empty() + } + + /// The binary form (without `base`), every word below 2^24 except constants. + pub fn encode(&self) -> Vec { + let mut w = Vec::with_capacity(PROGRAM_HEADER_WORDS + self.code.len() * 4 + self.consts.len() + self.outputs.len()); + w.extend_from_slice(&[ + PROGRAM_MAGIC, + PROGRAM_VERSION, + self.code.len() as u32, + self.consts.len() as u32, + self.outputs.len() as u32, + self.registers, + self.needs, + 0, + ]); + for i in &self.code { + w.extend_from_slice(&[i.op as u32 | (i.dst as u32) << 8 | (i.flags as u32) << 16, i.a, i.b, i.c]); + } + w.extend(self.consts.iter().map(|c| c.to_bits())); + w.extend(self.outputs.iter().map(|o| o.field as u32 | (o.reg as u32) << 8)); + w + } + + /// The binary form for the GPU `tables` buffer: integer words as exact floats, constants as themselves. + pub fn encode_f32(&self) -> Vec { + let words = self.encode(); + let first_const = PROGRAM_HEADER_WORDS + self.code.len() * 4; + let last_const = first_const + self.consts.len(); + words + .iter() + .enumerate() + .map(|(i, w)| if (first_const..last_const).contains(&i) { f32::from_bits(*w) } else { *w as f32 }) + .collect() + } + + /// Reads `encode()` output back (with the given base block). + pub fn decode(words: &[u32], base: SurfaceInputs) -> Result { + let bad = |m: &str| DecodeError(m.to_string()); + if words.len() < PROGRAM_HEADER_WORDS || words[0] != PROGRAM_MAGIC { + return Err(bad("missing header")); + } + if words[1] != PROGRAM_VERSION { + return Err(bad("unknown version")); + } + let (n, k, o) = (words[2] as usize, words[3] as usize, words[4] as usize); + if words.len() != PROGRAM_HEADER_WORDS + n * 4 + k + o { + return Err(bad("length does not match the header")); + } + let mut code = Vec::with_capacity(n); + for i in 0..n { + let at = PROGRAM_HEADER_WORDS + i * 4; + let w0 = words[at]; + let op = Op::from_u8((w0 & 0xff) as u8).ok_or_else(|| bad("unknown opcode"))?; + code.push(Instr::new(op, (w0 >> 8 & 0xff) as u8, (w0 >> 16 & 0xff) as u8, words[at + 1], words[at + 2], words[at + 3])); + } + let c0 = PROGRAM_HEADER_WORDS + n * 4; + let consts = words[c0..c0 + k].iter().map(|w| f32::from_bits(*w)).collect(); + let mut outputs = Vec::with_capacity(o); + for w in &words[c0 + k..] { + let field = Field::from_u8((w & 0xff) as u8).ok_or_else(|| bad("unknown field"))?; + outputs.push(Output { field, reg: (w >> 8 & 0xff) as u8 }); + } + let mut textures: Vec = + code.iter().filter(|i: &&Instr| matches!(i.op, Op::Tex | Op::TexBox)).map(|i| i.b).collect(); + textures.sort_unstable(); + textures.dedup(); + Ok(Program { base, code, consts, outputs, registers: words[5], needs: words[6], textures }) + } + + /// Checks register numbers, constant ranges and opcodes, so the interpreter never indexes out of range. + pub fn check(&self) -> Result<(), DecodeError> { + let bad = |m: String| Err(DecodeError(m)); + let regs = REGISTERS as u32; + let k = self.consts.len() as u32; + for (pc, i) in self.code.iter().enumerate() { + if i.dst as u32 >= regs { + return bad(format!("instruction {pc} writes register {}", i.dst)); + } + let reg = |r: u32| r < regs; + let ok = match i.op { + Op::Nop => true, + Op::Const => i.a + 4 <= k, + Op::Input => (i.a as usize) < MAX_UV_SETS, + Op::Swizzle | Op::Invert | Op::Luminance | Op::Project => reg(i.a), + Op::Combine | Op::Lerp | Op::Clamp => reg(i.a) && reg(i.b) && reg(i.c), + Op::Add | Op::Sub | Op::Mul | Op::Div | Op::Min | Op::Max | Op::Pow | Op::NormalMap | Op::Bump => { + reg(i.a) && reg(i.b) + } + Op::Ramp => reg(i.a) && i.b < k && i.b + 1 + 5 * self.consts[i.b as usize].max(0.0) as u32 <= k, + Op::Xform2 => reg(i.a) && i.b + 6 <= k, + Op::Tex => reg(i.a) && i.c + 4 <= k, + Op::TexBox => reg(i.a) && i.c + 11 <= k, + Op::Proc => { + i.a < k && { + let n = self.consts[i.a as usize].max(0.0) as u32; + i.a + 1 + n <= k && (0..n).all(|j| reg(self.consts[(i.a + 1 + j) as usize] as u32)) + } + } + }; + if !ok { + return bad(format!("instruction {pc} ({}) has an operand out of range", i.op.name())); + } + } + if let Some(o) = self.outputs.iter().find(|o| o.reg as u32 >= regs) { + return bad(format!("output {} reads register {}", o.field.name(), o.reg)); + } + Ok(()) + } + + /// Readable listing, one instruction per line. + pub fn disassemble(&self) -> String { + let mut s = String::new(); + for (pc, i) in self.code.iter().enumerate() { + let _ = writeln!(s, "{pc:3} {:<9} r{} f{} {} {} {}", i.op.name(), i.dst, i.flags, i.a, i.b, i.c); + } + for o in &self.outputs { + let _ = writeln!(s, " out {} <- r{}", o.field.name(), o.reg); + } + if !self.consts.is_empty() { + let _ = writeln!(s, " consts {:?}", self.consts); + } + s + } +} From 44808d0dc80e640cc5f9132761ef4f8948054c89 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:02:36 -0500 Subject: [PATCH 178/494] feat(materials): add the program interpreter, texture and procedural seams Program::evaluate runs a program at a HitContext into SurfaceInputs and a shading normal, with uv transforms, projections, box mapping, normal maps and surface-gradient bump. Texture lookups go through the TextureSampler trait (NoTextures returns the fallback) and procedurals through stubbed entry points. Ran cargo clippy -p fsh-materials. --- native/crates/fsh-materials/src/interp.rs | 403 ++++++++++++++++++ native/crates/fsh-materials/src/lib.rs | 6 + native/crates/fsh-materials/src/procedural.rs | 98 +++++ native/crates/fsh-materials/src/texture.rs | 95 +++++ 4 files changed, 602 insertions(+) create mode 100644 native/crates/fsh-materials/src/interp.rs create mode 100644 native/crates/fsh-materials/src/procedural.rs create mode 100644 native/crates/fsh-materials/src/texture.rs diff --git a/native/crates/fsh-materials/src/interp.rs b/native/crates/fsh-materials/src/interp.rs new file mode 100644 index 00000000..97e69edc --- /dev/null +++ b/native/crates/fsh-materials/src/interp.rs @@ -0,0 +1,403 @@ +use crate::inputs::SurfaceInputs; +use crate::procedural::{procedural, ProcKind}; +use crate::program::{input, Field, Filter, Instr, Op, Program, Wrap, MAX_UV_SETS, REGISTERS}; +use crate::texture::TextureSampler; +use fsh_core::color::ACESCG_LUMINANCE; +use fsh_core::math::{smoothstep, INV_PI, TWO_PI}; +use fsh_core::{orthonormal_basis, Rgb, Vec2, Vec3}; + +/// Everything a program may read at one shading point. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct HitContext { + /// World position (metres). + pub p: Vec3, + /// Object-space position (metres). + pub p_object: Vec3, + /// Unit geometric normal, world space. + pub ng: Vec3, + /// Unit shading normal, world space. + pub ns: Vec3, + /// Unit shading normal, object space. + pub n_object: Vec3, + /// Uv sets (unused entries zero). + pub uv: [Vec2; MAX_UV_SETS], + /// Uv sets the mesh has. + pub uv_count: u32, + /// World dP/du of uv set 0; an orthonormal frame around `ns` when the mesh has no uvs. + pub dpdu: Vec3, + /// World dP/dv of uv set 0. + pub dpdv: Vec3, + /// Object-space dP/du. + pub dpdu_object: Vec3, + /// Object-space dP/dv. + pub dpdv_object: Vec3, + /// Unit mesh tangent, world space; zero when the mesh has none. + pub tangent: Vec3, + /// Handedness of the mesh tangent frame (+1 or -1). + pub tangent_sign: f32, + /// World width of the pixel footprint at the hit (metres). + pub footprint: f32, +} + +impl Default for HitContext { + fn default() -> Self { + Self { + p: Vec3::ZERO, + p_object: Vec3::ZERO, + ng: Vec3::Z, + ns: Vec3::Z, + n_object: Vec3::Z, + uv: [Vec2::ZERO; MAX_UV_SETS], + uv_count: 0, + dpdu: Vec3::X, + dpdv: Vec3::Y, + dpdu_object: Vec3::X, + dpdv_object: Vec3::Y, + tangent: Vec3::ZERO, + tangent_sign: 1.0, + footprint: 0.0, + } + } +} + +/// What a program produced at one shading point. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Shaded { + /// Sanitised surface inputs. + pub inputs: SurfaceInputs, + /// Shading normal to use (the incoming one when the program leaves it). + pub normal: Vec3, + /// True when the program wrote the normal. + pub normal_changed: bool, + /// Displacement in metres (not applied per hit). + pub displacement: f32, +} + +type V4 = [f32; 4]; + +fn v3(v: V4) -> Vec3 { + Vec3::new(v[0], v[1], v[2]) +} + +fn v4(v: Vec3, w: f32) -> V4 { + [v.x, v.y, v.z, w] +} + +fn zip(a: V4, b: V4, f: impl Fn(f32, f32) -> f32) -> V4 { + [f(a[0], b[0]), f(a[1], b[1]), f(a[2], b[2]), f(a[3], b[3])] +} + +fn map(a: V4, f: impl Fn(f32) -> f32) -> V4 { + [f(a[0]), f(a[1]), f(a[2]), f(a[3])] +} + +fn konst(consts: &[f32], at: u32, n: usize) -> &[f32] { + let s = (at as usize).min(consts.len()); + &consts[s..(s + n).min(consts.len())] +} + +fn ramp(x: f32, consts: &[f32], at: u32, mode: u8) -> V4 { + let n = consts.get(at as usize).copied().unwrap_or(0.0).max(0.0) as usize; + let stops = konst(consts, at + 1, n * 5); + let n = stops.len() / 5; + if n == 0 { + return [0.0; 4]; + } + let stop = |i: usize| -> (f32, V4) { (stops[i * 5], [stops[i * 5 + 1], stops[i * 5 + 2], stops[i * 5 + 3], stops[i * 5 + 4]]) }; + let x = if x.is_finite() { x } else { 0.0 }; + if x <= stop(0).0 { + return stop(0).1; + } + for i in 1..n { + let (p1, c1) = stop(i); + if x < p1 { + let (p0, c0) = stop(i - 1); + if mode == 1 { + return c0; + } + let span = p1 - p0; + let t = if span > 0.0 { (x - p0) / span } else { 1.0 }; + let t = if mode == 2 { smoothstep(0.0, 1.0, t) } else { t }; + return zip(c0, c1, |a, b| a + (b - a) * t); + } + } + stop(n - 1).1 +} + +fn xform2(a: V4, k: &[f32]) -> V4 { + if k.len() < 6 { + return a; + } + let (sx, sy, c, s, ox, oy) = (k[0], k[1], k[2], k[3], k[4], k[5]); + let (u, v) = (a[0] * sx, a[1] * sy); + [c * u - s * v + ox, s * u + c * v + oy, a[2] * sx.abs().max(sy.abs()), a[3]] +} + +fn project(a: V4, kind: u8) -> V4 { + let (x, y, z, w) = (a[0], a[1], a[2], a[3]); + match kind { + 1 => { + let r = (x * x + z * z).sqrt().max(1.0e-3); + [x.atan2(z) / TWO_PI + 0.5, y, w * (1.0 / (TWO_PI * r)).max(1.0), 0.0] + } + 2 => { + let len = (x * x + y * y + z * z).sqrt(); + let v = if len > 0.0 { (y / len).clamp(-1.0, 1.0).acos() * INV_PI } else { 0.5 }; + [x.atan2(z) / TWO_PI + 0.5, v, w * INV_PI / len.max(1.0e-3), 0.0] + } + _ => [x, y, w, 0.0], + } +} + +/// Result of a pure instruction on known operand values, or `None` when the instruction depends on the hit. +pub fn fold(i: &Instr, a: V4, b: V4, c: V4, consts: &[f32]) -> Option { + Some(match i.op { + Op::Nop => return None, + Op::Const => { + let k = konst(consts, i.a, 4); + [k.first().copied().unwrap_or(0.0), k.get(1).copied().unwrap_or(0.0), k.get(2).copied().unwrap_or(0.0), k.get(3).copied().unwrap_or(0.0)] + } + Op::Swizzle => { + let s = |n: u32| a[((i.flags as u32 >> (2 * n)) & 3) as usize]; + [s(0), s(1), s(2), s(3)] + } + Op::Combine => [a[0], b[0], c[0], 0.0], + Op::Add => zip(a, b, |x, y| x + y), + Op::Sub => zip(a, b, |x, y| x - y), + Op::Mul => zip(a, b, |x, y| x * y), + Op::Div => zip(a, b, |x, y| if y == 0.0 { 0.0 } else { x / y }), + Op::Min => zip(a, b, f32::min), + Op::Max => zip(a, b, f32::max), + Op::Pow => zip(a, b, |x, y| { + let r = x.max(0.0).powf(y); + if r.is_finite() { + r + } else { + 0.0 + } + }), + Op::Lerp => zip(a, b, |x, y| x + (y - x) * c[0]), + Op::Clamp => [0, 1, 2, 3].map(|n| a[n].max(b[n]).min(c[n])), + Op::Invert => map(a, |x| 1.0 - x), + Op::Luminance => { + let l = a[0] * ACESCG_LUMINANCE[0] + a[1] * ACESCG_LUMINANCE[1] + a[2] * ACESCG_LUMINANCE[2]; + [l; 4] + } + Op::Ramp => ramp(a[0], consts, i.b, i.flags), + Op::Xform2 => xform2(a, konst(consts, i.b, 6)), + Op::Project => project(a, i.flags), + Op::Input | Op::Tex | Op::TexBox | Op::NormalMap | Op::Bump | Op::Proc => return None, + }) +} + +fn bump_step(ctx: &HitContext) -> (f32, f32) { + let eps = (0.5 * ctx.footprint).clamp(1.0e-6, 1.0e-2); + let lu = ctx.dpdu.length(); + let lv = ctx.dpdv.length(); + let du = if lu > 0.0 && lu.is_finite() { eps / lu } else { 0.0 }; + let dv = if lv > 0.0 && lv.is_finite() { eps / lv } else { 0.0 }; + (du, dv) +} + +fn uv_footprint(ctx: &HitContext) -> f32 { + let area = ctx.dpdu.cross(ctx.dpdv).length(); + if area > 0.0 && area.is_finite() { + ctx.footprint / area.sqrt() + } else { + 0.0 + } +} + +fn read_input(ctx: &HitContext, which: u8, offset: u8, set: u32) -> V4 { + let (du, dv) = bump_step(ctx); + let (su, sv) = match offset { + input::OFFSET_U => (du, 0.0), + input::OFFSET_V => (0.0, dv), + _ => (0.0, 0.0), + }; + let fp = ctx.footprint; + match which { + input::POSITION => v4(ctx.p + ctx.dpdu * su + ctx.dpdv * sv, fp), + input::POSITION_OBJECT => v4(ctx.p_object + ctx.dpdu_object * su + ctx.dpdv_object * sv, fp), + input::NORMAL => v4(ctx.ns, 0.0), + input::GEOMETRIC_NORMAL => v4(ctx.ng, 0.0), + input::NORMAL_OBJECT => v4(ctx.n_object, 0.0), + input::UV => { + let uv = ctx.uv.get(set as usize).copied().unwrap_or(Vec2::ZERO); + [uv.x + su, uv.y + sv, uv_footprint(ctx), 0.0] + } + input::TANGENT => v4(ctx.tangent, ctx.tangent_sign), + input::FOOTPRINT => [fp, 0.0, 0.0, 0.0], + _ => [0.0; 4], + } +} + +fn tangent_frame(ctx: &HitContext, n: Vec3) -> (Vec3, Vec3) { + let raw = if ctx.tangent.length_squared() > 0.0 { ctx.tangent } else { ctx.dpdu }; + let t = (raw - n * n.dot(raw)).try_normalize().filter(|t| t.is_finite()).unwrap_or_else(|| orthonormal_basis(n).0); + let sign = if ctx.tangent.length_squared() > 0.0 { + if ctx.tangent_sign < 0.0 { + -1.0 + } else { + 1.0 + } + } else if n.cross(t).dot(ctx.dpdv) < 0.0 { + -1.0 + } else { + 1.0 + }; + (t, n.cross(t) * sign) +} + +fn unit_or(v: Vec3, d: Vec3) -> Vec3 { + v.try_normalize().filter(|n| n.is_finite()).unwrap_or(d) +} + +fn normal_map(ctx: &HitContext, c: V4, strength: f32, flip_y: bool) -> V4 { + let n = ctx.ns; + let (t, b) = tangent_frame(ctx, n); + let mut x = (2.0 * c[0] - 1.0) * strength; + let mut y = (2.0 * c[1] - 1.0) * strength; + let z = 2.0 * c[2] - 1.0; + if flip_y { + y = -y; + } + if !x.is_finite() || !y.is_finite() { + x = 0.0; + y = 0.0; + } + v4(unit_or(t * x + b * y + n * z.max(0.0), n), 0.0) +} + +fn bump(ctx: &HitContext, base: V4, h: V4) -> V4 { + let n = unit_or(v3(base), ctx.ns); + let (du, dv) = bump_step(ctx); + let dhdu = if du > 0.0 { (h[1] - h[0]) / du } else { 0.0 }; + let dhdv = if dv > 0.0 { (h[2] - h[0]) / dv } else { 0.0 }; + let r1 = ctx.dpdv.cross(n); + let r2 = n.cross(ctx.dpdu); + let det = ctx.dpdu.dot(r1); + let grad = (r1 * dhdu + r2 * dhdv) * if det < 0.0 { -1.0 } else { 1.0 }; + v4(unit_or(n * det.abs() - grad, n), 0.0) +} + +fn tex_box(ctx: &HitContext, i: &Instr, a: V4, k: &[f32], tex: &dyn TextureSampler) -> V4 { + let fallback = [k[0], k[1], k[2], k[3]]; + let (sx, sy, c, s, ox, oy, blend) = (k[4], k[5], k[6], k[7], k[8], k[9], k[10]); + let n = if i.flags & 16 != 0 { ctx.ns } else { ctx.n_object }; + let raw = [n.x.abs(), n.y.abs(), n.z.abs()].map(|v| (v - blend.clamp(0.0, 1.0) * 0.5).max(0.0).powi(4)); + let sum: f32 = raw.iter().sum(); + let w = if sum > 0.0 && sum.is_finite() { + raw.map(|v| v / sum) + } else { + let mut d = [0.0; 3]; + d[Vec3::new(n.x.abs(), n.y.abs(), n.z.abs()).max_dimension()] = 1.0; + d + }; + let planes = [[a[2], a[1]], [a[0], a[2]], [a[0], a[1]]]; + let wrap = Wrap::from_code(i.flags); + let filter = Filter::from_code(i.flags >> 2); + let mut out = [0.0; 4]; + for axis in 0..3 { + if w[axis] <= 0.0 { + continue; + } + let uv = xform2([planes[axis][0], planes[axis][1], a[3], 0.0], &[sx, sy, c, s, ox, oy]); + let v = tex.sample(i.b, Vec2::new(uv[0], uv[1]), uv[2], wrap, filter, fallback); + out = zip(out, v, |o, x| o + x * w[axis]); + } + out +} + +fn set_field(m: &mut SurfaceInputs, f: Field, v: V4) { + let c = Rgb::new(v[0], v[1], v[2]); + match f { + Field::BaseWeight => m.base_weight = v[0], + Field::BaseColor => m.base_color = c, + Field::BaseMetalness => m.base_metalness = v[0], + Field::BaseDiffuseRoughness => m.base_diffuse_roughness = v[0], + Field::SpecularWeight => m.specular_weight = v[0], + Field::SpecularColor => m.specular_color = c, + Field::SpecularRoughness => m.specular_roughness = v[0], + Field::SpecularIor => m.specular_ior = v[0], + Field::SpecularAnisotropy => m.specular_anisotropy = v[0], + Field::TransmissionWeight => m.transmission_weight = v[0], + Field::TransmissionColor => m.transmission_color = c, + Field::CoatWeight => m.coat_weight = v[0], + Field::CoatColor => m.coat_color = c, + Field::CoatRoughness => m.coat_roughness = v[0], + Field::CoatIor => m.coat_ior = v[0], + Field::FuzzWeight => m.fuzz_weight = v[0], + Field::FuzzColor => m.fuzz_color = c, + Field::FuzzRoughness => m.fuzz_roughness = v[0], + Field::Emission => m.emission = c, + Field::Opacity => m.opacity = v[0], + Field::Normal | Field::Displacement => {} + } +} + +impl Program { + /// Runs the program at one hit. A constant program returns `base` and the incoming normal without running. + pub fn evaluate(&self, ctx: &HitContext, tex: &dyn TextureSampler) -> Shaded { + let mut out = Shaded { inputs: self.base, normal: ctx.ns, normal_changed: false, displacement: 0.0 }; + if self.is_constant() { + return out; + } + let mut r = [[0.0f32; 4]; REGISTERS]; + let reg = |r: &[V4; REGISTERS], n: u32| r.get(n as usize).copied().unwrap_or([0.0; 4]); + for i in &self.code { + let (a, b, c) = (reg(&r, i.a), reg(&r, i.b), reg(&r, i.c)); + let v = match i.op { + Op::Input => read_input(ctx, i.flags & 15, i.flags >> 4, i.a), + Op::Tex => { + let k = konst(&self.consts, i.c, 4); + let fallback = [0, 1, 2, 3].map(|n| k.get(n).copied().unwrap_or(0.0)); + let wrap = Wrap::from_code(i.flags); + let filter = Filter::from_code(i.flags >> 2); + tex.sample(i.b, Vec2::new(a[0], a[1]), a[2], wrap, filter, fallback) + } + Op::TexBox => { + let k = konst(&self.consts, i.c, 11); + if k.len() < 11 { + [0.0; 4] + } else { + tex_box(ctx, i, a, k, tex) + } + } + Op::NormalMap => normal_map(ctx, a, b[0], i.flags & 1 != 0), + Op::Bump => bump(ctx, a, b), + Op::Proc => { + let n = self.consts.get(i.a as usize).copied().unwrap_or(0.0).max(0.0) as usize; + let regs = konst(&self.consts, i.a + 1, n.min(16)); + let mut args = [[0.0f32; 4]; 16]; + for (slot, rn) in args.iter_mut().zip(regs) { + *slot = reg(&r, *rn as u32); + } + match ProcKind::from_u8(i.flags) { + Some(kind) => procedural(kind, i.b, &args[..regs.len()]), + None => [0.0; 4], + } + } + _ => fold(i, a, b, c, &self.consts).unwrap_or([0.0; 4]), + }; + if let Some(d) = r.get_mut(i.dst as usize) { + *d = v; + } + } + for o in &self.outputs { + let v = reg(&r, o.reg as u32); + match o.field { + Field::Normal => { + if let Some(n) = v3(v).try_normalize().filter(|n| n.is_finite()) { + out.normal = n; + out.normal_changed = true; + } + } + Field::Displacement => out.displacement = if v[0].is_finite() { v[0] } else { 0.0 }, + f => set_field(&mut out.inputs, f, v), + } + } + out.inputs = out.inputs.sanitized(); + out + } +} diff --git a/native/crates/fsh-materials/src/lib.rs b/native/crates/fsh-materials/src/lib.rs index 8a058d8f..a9679c14 100644 --- a/native/crates/fsh-materials/src/lib.rs +++ b/native/crates/fsh-materials/src/lib.rs @@ -4,11 +4,17 @@ mod bsdf; mod fresnel; mod ggx; mod inputs; +mod interp; mod lobes; +mod procedural; pub mod program; mod tables; +mod texture; pub use bsdf::{Bsdf, BsdfSample, LobeFlags, ShadingFrame}; pub use inputs::SurfaceInputs; +pub use interp::{fold, HitContext, Shaded}; +pub use procedural::{procedural, ProcKind, ProcOutput}; +pub use texture::{ColourSpace, NoTextures, TextureImage, TextureLevel, TextureSampler, TextureSet, Texels}; pub use program::{DecodeError, Field, Filter, Instr, Op, Output, Program, Wrap, MAX_UV_SETS, REGISTERS}; pub use tables::{energy_tables, warm_up, EnergyTables}; diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs new file mode 100644 index 00000000..4fe33a61 --- /dev/null +++ b/native/crates/fsh-materials/src/procedural.rs @@ -0,0 +1,98 @@ +/// Procedural pattern kinds; the numbers are the `Op::Proc` flags. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[repr(u8)] +pub enum ProcKind { + /// Gradient noise. + Noise = 0, + /// Fractal sum of noise octaves. + Fbm = 1, + /// Cellular (Worley) pattern. + Voronoi = 2, + /// Three-dimensional checker. + Checker = 3, + /// Gradient along an axis or radius. + Gradient = 4, + /// Bands or rings. + Wave = 5, + /// Brushed-metal streaks (a height). + Brushed = 6, + /// Metallic flakes (a normal and a mask). + Flakes = 7, + /// Wood rings. + Wood = 8, + /// Marble veins. + Marble = 9, +} + +/// What one procedural output carries. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum ProcOutput { + /// A scalar in x. + Value, + /// A colour in xyz, alpha 1 in w. + Colour, + /// A vector in xyz. + Vector, + /// A world normal in xyz; zero means "leave the normal". + Normal, +} + +impl ProcKind { + /// Every kind in flag order. + pub const ALL: [ProcKind; 10] = [ + ProcKind::Noise, + ProcKind::Fbm, + ProcKind::Voronoi, + ProcKind::Checker, + ProcKind::Gradient, + ProcKind::Wave, + ProcKind::Brushed, + ProcKind::Flakes, + ProcKind::Wood, + ProcKind::Marble, + ]; + + /// Kind from its flag value. + pub fn from_u8(v: u8) -> Option { + Self::ALL.get(v as usize).copied() + } + + /// Graph node id of the kind. + pub fn id(self) -> &'static str { + match self { + ProcKind::Noise => "noise", + ProcKind::Fbm => "fbm", + ProcKind::Voronoi => "voronoi", + ProcKind::Checker => "checker", + ProcKind::Gradient => "gradient", + ProcKind::Wave => "wave", + ProcKind::Brushed => "brushed", + ProcKind::Flakes => "flakes", + ProcKind::Wood => "wood", + ProcKind::Marble => "marble", + } + } + + /// Outputs in index order (the `output` argument of `procedural`). + pub fn outputs(self) -> &'static [ProcOutput] { + use ProcOutput::*; + match self { + ProcKind::Noise | ProcKind::Fbm | ProcKind::Gradient | ProcKind::Wave => &[Value, Colour], + ProcKind::Voronoi => &[Value, Colour, Vector], + ProcKind::Checker | ProcKind::Wood | ProcKind::Marble => &[Colour, Value], + ProcKind::Brushed => &[Value], + ProcKind::Flakes => &[Normal, Value, Colour], + } + } +} + +/// Evaluates output `output` of a procedural. `args[0]` is the coordinate (xyz, footprint in w), then the kind's +/// inputs in catalogue order (floats in x, colours in xyz), then the settings vector (seed, mode 1, mode 2, 0). +pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { + match kind.outputs().get(output as usize) { + Some(ProcOutput::Value) => [0.5, 0.5, 0.5, 1.0], + Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], + Some(ProcOutput::Vector) => args.first().copied().unwrap_or([0.0; 4]), + Some(ProcOutput::Normal) | None => [0.0; 4], + } +} diff --git a/native/crates/fsh-materials/src/texture.rs b/native/crates/fsh-materials/src/texture.rs new file mode 100644 index 00000000..39245915 --- /dev/null +++ b/native/crates/fsh-materials/src/texture.rs @@ -0,0 +1,95 @@ +use crate::program::{Filter, Wrap}; +use fsh_core::Vec2; +use std::sync::Arc; + +/// How texel values become shading values. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum ColourSpace { + /// sRGB transfer and primaries: decode, then convert to ACEScg. + #[default] + Srgb, + /// Linear values with sRGB primaries: convert to ACEScg. + Linear, + /// Linear ACEScg: used as stored. + Acescg, + /// Non-colour data (roughness, normals, heights): used as stored. + Data, +} + +impl ColourSpace { + /// Directory code used by the GPU packing (0 srgb, 1 linear, 2 acescg, 3 data). + pub fn code(self) -> u32 { + self as u32 + } + + /// Parses "srgb", "linear", "acescg" or "data" (also "raw" and "non_color" for data). + pub fn parse(s: &str) -> Option { + match s.trim().to_ascii_lowercase().as_str() { + "srgb" | "s_rgb" => Some(ColourSpace::Srgb), + "linear" | "linear_srgb" => Some(ColourSpace::Linear), + "acescg" | "aces_cg" => Some(ColourSpace::Acescg), + "data" | "raw" | "non_color" | "non_colour" => Some(ColourSpace::Data), + _ => None, + } + } +} + +/// Texel storage of one mip level, row-major, row 0 at v = 1 (the top of the image). +#[derive(Clone, Debug, PartialEq)] +pub enum Texels { + /// Four bytes per texel (sRGB encoded when the image's colour space is sRGB). + Rgba8(Vec), + /// Four floats per texel. + RgbaF32(Vec), +} + +/// One mip level. +#[derive(Clone, Debug, PartialEq)] +pub struct TextureLevel { + /// Width in texels. + pub width: u32, + /// Height in texels. + pub height: u32, + /// Texels. + pub texels: Texels, +} + +/// A decoded image with its mip pyramid (level 0 first). +#[derive(Clone, Debug, PartialEq)] +pub struct TextureImage { + /// How texel values are interpreted. + pub colour_space: ColourSpace, + /// Mip levels, level 0 first; one level when mipmaps were not wanted. + pub levels: Vec, +} + +/// Pixels for every texture a snapshot names, in `RenderSnapshot::textures` order; `None` is a missing image. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct TextureSet { + /// Images by snapshot texture index. + pub images: Vec>>, +} + +impl TextureSet { + /// Image at a snapshot texture index. + pub fn get(&self, texture: u32) -> Option<&TextureImage> { + self.images.get(texture as usize).and_then(|i| i.as_deref()) + } +} + +/// Texture lookups at a shading point; returns linear ACEScg (colour spaces) or raw values (data), RGBA. +pub trait TextureSampler { + /// Filtered value of `texture` at `uv` for a footprint `footprint` uv units wide; `fallback` when it has no pixels. + fn sample(&self, texture: u32, uv: Vec2, footprint: f32, wrap: Wrap, filter: Filter, fallback: [f32; 4]) -> [f32; 4]; +} + +/// A sampler without pixels: every lookup gives the fallback. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct NoTextures; + +impl TextureSampler for NoTextures { + fn sample(&self, _texture: u32, _uv: Vec2, _footprint: f32, _wrap: Wrap, _filter: Filter, fallback: [f32; 4]) -> [f32; 4] { + fallback + } +} From 9d1317a8ed299111518451f6c99580fd53ef5512 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:06:56 -0500 Subject: [PATCH 179/494] feat(scene): add texture slots and the material graph to materials Material gains slots (an image texture per input with projection, transform, wrap, filter, channel and remap) and an optional node graph with typed sockets, links and outputs, validated for types, settings, texture keys and cycles. Both fields always serialise so fsh-format knows them; old documents load with them empty. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/Cargo.toml | 1 + native/crates/fsh-scene/src/document.rs | 4 +- native/crates/fsh-scene/src/graph.rs | 885 ++++++++++++++++++++++++ native/crates/fsh-scene/src/lib.rs | 8 + native/crates/fsh-scene/src/material.rs | 59 +- native/crates/fsh-scene/src/slots.rs | 429 ++++++++++++ 6 files changed, 1381 insertions(+), 5 deletions(-) create mode 100644 native/crates/fsh-scene/src/graph.rs create mode 100644 native/crates/fsh-scene/src/slots.rs diff --git a/native/crates/fsh-scene/Cargo.toml b/native/crates/fsh-scene/Cargo.toml index 12a89a9a..b3a4c75b 100644 --- a/native/crates/fsh-scene/Cargo.toml +++ b/native/crates/fsh-scene/Cargo.toml @@ -7,5 +7,6 @@ publish = false [dependencies] fsh-core = { path = "../fsh-core" } +fsh-materials = { path = "../fsh-materials" } serde = { version = "1", features = ["derive", "rc"] } serde_json = "1" diff --git a/native/crates/fsh-scene/src/document.rs b/native/crates/fsh-scene/src/document.rs index 73b7792b..0faa1ad1 100644 --- a/native/crates/fsh-scene/src/document.rs +++ b/native/crates/fsh-scene/src/document.rs @@ -132,9 +132,7 @@ impl Document { nonzero(k.raw(), "material")?; keys.observe(k.raw()); m.validate()?; - if let Some(t) = m.textures.iter().find(|t| !d.textures.contains_key(t)) { - return Err(SceneError::UnknownTexture(*t)); - } + m.validate_refs(&d.textures)?; } for (id, n) in &d.nodes { nonzero(id.raw(), "node")?; diff --git a/native/crates/fsh-scene/src/graph.rs b/native/crates/fsh-scene/src/graph.rs new file mode 100644 index 00000000..9045cc39 --- /dev/null +++ b/native/crates/fsh-scene/src/graph.rs @@ -0,0 +1,885 @@ +use crate::error::{Result, SceneError}; +use crate::material::TextureRef; +use crate::ser; +use crate::slots::{validate_projection, MapProjection, MaterialInput, UvTransform}; +use fsh_core::TextureKey; +use fsh_materials::{ColourSpace, Filter, ProcKind, Wrap}; +use serde::{Deserialize, Serialize}; +use serde_json::{json, Value}; +use std::collections::{BTreeMap, BTreeSet}; + +/// Most nodes a graph may hold. +pub const MAX_GRAPH_NODES: usize = 256; +/// Most stops a colour ramp may hold. +pub const MAX_RAMP_STOPS: usize = 16; + +/// Value type of a socket. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum SocketType { + /// One number. + Float, + /// ACEScg colour. + Colour, + /// Position or texture coordinate. + Vector, + /// Unit world normal. + Normal, +} + +impl SocketType { + /// True when a value of type `self` may feed an input of type `to` (Cycles-style implicit conversions). + pub fn converts_to(self, to: SocketType) -> bool { + use SocketType::*; + match (self, to) { + (a, b) if a == b => true, + (Normal, Vector) | (Vector, Normal) => true, + (Normal, _) | (_, Normal) => false, + _ => true, + } + } +} + +/// One socket of a node kind. +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] +pub struct SocketSpec { + /// Socket name. + pub name: &'static str, + /// Value type. + pub ty: SocketType, + /// Value when unlinked (floats use x). + pub default: [f32; 3], +} + +/// One setting of a node kind (not a socket). +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] +pub struct SettingSpec { + /// Field name in the node JSON. + pub name: &'static str, + /// "enum", "u32", "bool", "texture", "projection", "transform", "colour_space", "wrap", "filter", "rgba", "stops", "value". + pub kind: &'static str, + /// Allowed values of an enum. + pub values: &'static [&'static str], +} + +/// A node kind: its sockets and settings. +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] +pub struct GraphKind { + /// Kind id (the node's `kind`). + pub id: &'static str, + /// English label. + pub label: &'static str, + /// Input sockets in order. + pub inputs: &'static [SocketSpec], + /// Output sockets in order. + pub outputs: &'static [SocketSpec], + /// Settings. + pub settings: &'static [SettingSpec], + /// Procedural evaluated by `fsh_materials::procedural`, if any. + #[serde(skip)] + pub procedural: Option, +} + +const fn s(name: &'static str, ty: SocketType, d: f32) -> SocketSpec { + SocketSpec { name, ty, default: [d, d, d] } +} + +const fn c(name: &'static str, r: f32, g: f32, b: f32) -> SocketSpec { + SocketSpec { name, ty: SocketType::Colour, default: [r, g, b] } +} + +const fn e(name: &'static str, values: &'static [&'static str]) -> SettingSpec { + SettingSpec { name, kind: "enum", values } +} + +const fn k(name: &'static str, kind: &'static str) -> SettingSpec { + SettingSpec { name, kind, values: &[] } +} + +use SocketType::{Float as F, Normal as N, Vector as V}; + +const VEC: SocketSpec = s("vector", V, 0.0); +const SEED: SettingSpec = k("seed", "u32"); +const VALUE: SocketSpec = s("value", F, 0.0); +const COLOUR: SocketSpec = c("colour", 0.0, 0.0, 0.0); + +static KINDS: &[GraphKind] = &[ + GraphKind { id: "constant", label: "Constant", inputs: &[], outputs: &[s("value", F, 0.0)], settings: &[k("value", "value")], procedural: None }, + GraphKind { + id: "texture", + label: "Image texture", + inputs: &[VEC], + outputs: &[COLOUR, s("alpha", F, 1.0)], + settings: &[ + k("texture", "texture"), + k("projection", "projection"), + k("transform", "transform"), + e("wrap", &["repeat", "clamp", "mirror"]), + e("filter", &["nearest", "bilinear", "trilinear"]), + k("colour_space", "colour_space"), + k("fallback", "rgba"), + ], + procedural: None, + }, + GraphKind { + id: "mapping", + label: "Mapping", + inputs: &[], + outputs: &[VEC], + settings: &[k("projection", "projection"), k("transform", "transform")], + procedural: None, + }, + GraphKind { + id: "mix", + label: "Mix", + inputs: &[c("a", 0.0, 0.0, 0.0), c("b", 1.0, 1.0, 1.0), s("factor", F, 0.5)], + outputs: &[c("result", 0.0, 0.0, 0.0)], + settings: &[], + procedural: None, + }, + GraphKind { + id: "math", + label: "Math", + inputs: &[s("a", F, 0.0), s("b", F, 0.0), s("c", F, 0.0)], + outputs: &[VALUE], + settings: &[e("op", &["add", "subtract", "multiply", "divide", "minimum", "maximum", "lerp", "clamp", "power", "invert"])], + procedural: None, + }, + GraphKind { + id: "colour_ramp", + label: "Colour ramp", + inputs: &[s("factor", F, 0.5)], + outputs: &[COLOUR, s("alpha", F, 1.0)], + settings: &[k("stops", "stops"), e("interpolation", &["linear", "constant", "smooth"])], + procedural: None, + }, + GraphKind { + id: "normal_map", + label: "Normal map", + inputs: &[c("colour", 0.5, 0.5, 1.0), s("strength", F, 1.0)], + outputs: &[s("normal", N, 0.0)], + settings: &[k("flip_y", "bool")], + procedural: None, + }, + GraphKind { + id: "bump", + label: "Bump", + inputs: &[s("height", F, 0.0), s("strength", F, 0.001), s("normal", N, 0.0)], + outputs: &[s("normal", N, 0.0)], + settings: &[], + procedural: None, + }, + GraphKind { + id: "noise", + label: "Noise", + inputs: &[VEC, s("scale", F, 5.0), s("detail", F, 2.0), s("roughness", F, 0.5), s("distortion", F, 0.0)], + outputs: &[VALUE, COLOUR], + settings: &[SEED], + procedural: Some(ProcKind::Noise), + }, + GraphKind { + id: "fbm", + label: "Fractal noise", + inputs: &[VEC, s("scale", F, 5.0), s("octaves", F, 6.0), s("lacunarity", F, 2.0), s("gain", F, 0.5)], + outputs: &[VALUE, COLOUR], + settings: &[SEED], + procedural: Some(ProcKind::Fbm), + }, + GraphKind { + id: "voronoi", + label: "Voronoi", + inputs: &[VEC, s("scale", F, 5.0), s("randomness", F, 1.0)], + outputs: &[s("distance", F, 0.0), COLOUR, s("position", V, 0.0)], + settings: &[SEED, e("metric", &["euclidean", "manhattan", "chebyshev"]), e("feature", &["f1", "f2", "edge"])], + procedural: Some(ProcKind::Voronoi), + }, + GraphKind { + id: "checker", + label: "Checker", + inputs: &[VEC, s("scale", F, 5.0), c("colour1", 0.8, 0.8, 0.8), c("colour2", 0.2, 0.2, 0.2)], + outputs: &[COLOUR, VALUE], + settings: &[], + procedural: Some(ProcKind::Checker), + }, + GraphKind { + id: "gradient", + label: "Gradient", + inputs: &[VEC], + outputs: &[VALUE, COLOUR], + settings: &[e("gradient", &["linear", "quadratic", "radial", "spherical"])], + procedural: Some(ProcKind::Gradient), + }, + GraphKind { + id: "wave", + label: "Wave", + inputs: &[VEC, s("scale", F, 5.0), s("distortion", F, 0.0), s("detail", F, 2.0), s("phase", F, 0.0)], + outputs: &[VALUE, COLOUR], + settings: &[SEED, e("wave", &["bands", "rings"]), e("profile", &["sine", "saw", "triangle"])], + procedural: Some(ProcKind::Wave), + }, + GraphKind { + id: "brushed", + label: "Brushed", + inputs: &[VEC, s("scale", F, 200.0), s("length", F, 0.05), s("strength", F, 1.0)], + outputs: &[VALUE], + settings: &[SEED], + procedural: Some(ProcKind::Brushed), + }, + GraphKind { + id: "flakes", + label: "Flakes", + inputs: &[VEC, s("scale", F, 2000.0), s("density", F, 0.5), s("spread", F, 0.3)], + outputs: &[s("normal", N, 0.0), s("mask", F, 0.0), COLOUR], + settings: &[SEED], + procedural: Some(ProcKind::Flakes), + }, + GraphKind { + id: "wood", + label: "Wood", + inputs: &[VEC, s("scale", F, 1.0), s("rings", F, 20.0), s("distortion", F, 0.5), c("colour1", 0.45, 0.28, 0.14), c("colour2", 0.2, 0.1, 0.05)], + outputs: &[COLOUR, VALUE], + settings: &[SEED], + procedural: Some(ProcKind::Wood), + }, + GraphKind { + id: "marble", + label: "Marble", + inputs: &[VEC, s("scale", F, 1.0), s("veins", F, 4.0), s("distortion", F, 1.0), c("colour1", 0.85, 0.84, 0.82), c("colour2", 0.3, 0.3, 0.32)], + outputs: &[COLOUR, VALUE], + settings: &[SEED], + procedural: Some(ProcKind::Marble), + }, +]; + +/// Every node kind, in catalogue order. +pub fn graph_kinds() -> &'static [GraphKind] { + KINDS +} + +/// A node kind by id. +pub fn graph_kind(id: &str) -> Option<&'static GraphKind> { + KINDS.iter().find(|k| k.id == id) +} + +/// Every node kind as JSON for the material page. +pub fn graph_kinds_json() -> Value { + Value::Array( + KINDS + .iter() + .map(|k| { + let mut v = serde_json::to_value(k).unwrap_or(Value::Null); + v["procedural"] = json!(k.procedural.is_some()); + v + }) + .collect(), + ) +} + +/// An unlinked socket value: a number or an rgb triple. +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SocketValue { + /// One number. + Float(f32), + /// Three numbers. + Colour([f32; 3]), +} + +impl SocketValue { + /// As a vec4 (floats splatted, w 1). + pub fn vec4(self) -> [f32; 4] { + match self { + SocketValue::Float(v) => [v, v, v, 1.0], + SocketValue::Colour(c) => [c[0], c[1], c[2], 1.0], + } + } + + fn finite(self) -> bool { + self.vec4().iter().all(|v| v.is_finite()) + } +} + +/// Arithmetic of a math node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum MathOp { + /// a + b. + #[default] + Add, + /// a - b. + Subtract, + /// a * b. + Multiply, + /// a / b (0 where b is 0). + Divide, + /// min(a, b). + Minimum, + /// max(a, b). + Maximum, + /// a + (b - a) * c. + Lerp, + /// min(max(a, b), c). + Clamp, + /// max(a, 0)^b. + Power, + /// 1 - a. + Invert, +} + +/// Interpolation between ramp stops. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum RampInterpolation { + /// Straight lines. + #[default] + Linear, + /// Steps (the left stop's colour). + Constant, + /// Smoothstep between stops. + Smooth, +} + +/// One colour ramp stop. +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +pub struct RampStop { + /// Position along the factor. + pub position: f32, + /// Colour and alpha. + pub colour: [f32; 4], +} + +/// Distance metric of a voronoi node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum VoronoiMetric { + /// Straight-line distance. + #[default] + Euclidean, + /// Sum of axis distances. + Manhattan, + /// Largest axis distance. + Chebyshev, +} + +/// Feature of a voronoi node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum VoronoiFeature { + /// Nearest point. + #[default] + F1, + /// Second nearest point. + F2, + /// Distance to the cell edge. + Edge, +} + +/// Shape of a gradient node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum GradientKind { + /// Along x. + #[default] + Linear, + /// Along x, squared. + Quadratic, + /// Angle around z. + Radial, + /// Distance from the origin. + Spherical, +} + +/// Shape of a wave node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum WaveKind { + /// Straight bands. + #[default] + Bands, + /// Concentric rings. + Rings, +} + +/// Profile of a wave node. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum WaveProfile { + /// Sine. + #[default] + Sine, + /// Sawtooth. + Saw, + /// Triangle. + Triangle, +} + +fn grey_fallback() -> [f32; 4] { + [0.5, 0.5, 0.5, 1.0] +} + +fn default_stops() -> Vec { + vec![RampStop { position: 0.0, colour: [0.0, 0.0, 0.0, 1.0] }, RampStop { position: 1.0, colour: [1.0, 1.0, 1.0, 1.0] }] +} + +/// What a node does, with its settings; JSON tagged by `kind`. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind", rename_all = "snake_case")] +pub enum GraphOp { + /// A fixed value. + Constant { + /// Number or rgb. + value: SocketValue, + }, + /// An image texture. + Texture { + /// Document texture; null samples the fallback. + #[serde(default, with = "ser::key_opt")] + texture: Option, + /// Coordinate source when `vector` is unlinked. + #[serde(default)] + projection: MapProjection, + /// Coordinate transform. + #[serde(default)] + transform: UvTransform, + /// Wrapping. + #[serde(default)] + wrap: Wrap, + /// Filtering. + #[serde(default)] + filter: Filter, + /// Colour space; sRGB when absent. + #[serde(default)] + colour_space: Option, + /// Value without an image. + #[serde(default = "grey_fallback")] + fallback: [f32; 4], + }, + /// Texture coordinates from a projection and a transform. + Mapping { + /// Projection. + #[serde(default)] + projection: MapProjection, + /// Transform. + #[serde(default)] + transform: UvTransform, + }, + /// Linear blend of two colours. + Mix {}, + /// Arithmetic on floats. + Math { + /// Operation. + #[serde(default)] + op: MathOp, + }, + /// Colour ramp. + ColourRamp { + /// Stops, sorted by position. + #[serde(default = "default_stops")] + stops: Vec, + /// Interpolation. + #[serde(default)] + interpolation: RampInterpolation, + }, + /// Tangent-space normal map. + NormalMap { + /// Green points down (DirectX). + #[serde(default)] + flip_y: bool, + }, + /// Bump from a height. + Bump {}, + /// Gradient noise. + Noise { + /// Seed. + #[serde(default)] + seed: u32, + }, + /// Fractal noise. + Fbm { + /// Seed. + #[serde(default)] + seed: u32, + }, + /// Cellular pattern. + Voronoi { + /// Seed. + #[serde(default)] + seed: u32, + /// Metric. + #[serde(default)] + metric: VoronoiMetric, + /// Feature. + #[serde(default)] + feature: VoronoiFeature, + }, + /// Checker. + Checker {}, + /// Gradient. + Gradient { + /// Shape. + #[serde(default)] + gradient: GradientKind, + }, + /// Bands or rings. + Wave { + /// Seed. + #[serde(default)] + seed: u32, + /// Shape. + #[serde(default)] + wave: WaveKind, + /// Profile. + #[serde(default)] + profile: WaveProfile, + }, + /// Brushed streaks. + Brushed { + /// Seed. + #[serde(default)] + seed: u32, + }, + /// Metallic flakes. + Flakes { + /// Seed. + #[serde(default)] + seed: u32, + }, + /// Wood rings. + Wood { + /// Seed. + #[serde(default)] + seed: u32, + }, + /// Marble veins. + Marble { + /// Seed. + #[serde(default)] + seed: u32, + }, +} + +impl GraphOp { + /// Kind id. + pub fn kind_id(&self) -> &'static str { + match self { + GraphOp::Constant { .. } => "constant", + GraphOp::Texture { .. } => "texture", + GraphOp::Mapping { .. } => "mapping", + GraphOp::Mix {} => "mix", + GraphOp::Math { .. } => "math", + GraphOp::ColourRamp { .. } => "colour_ramp", + GraphOp::NormalMap { .. } => "normal_map", + GraphOp::Bump {} => "bump", + GraphOp::Noise { .. } => "noise", + GraphOp::Fbm { .. } => "fbm", + GraphOp::Voronoi { .. } => "voronoi", + GraphOp::Checker {} => "checker", + GraphOp::Gradient { .. } => "gradient", + GraphOp::Wave { .. } => "wave", + GraphOp::Brushed { .. } => "brushed", + GraphOp::Flakes { .. } => "flakes", + GraphOp::Wood { .. } => "wood", + GraphOp::Marble { .. } => "marble", + } + } + + /// The kind's catalogue entry. + pub fn kind(&self) -> &'static GraphKind { + graph_kind(self.kind_id()).unwrap_or(&KINDS[0]) + } + + /// Type of an output socket (a constant's type follows its value). + pub fn output_type(&self, socket: &str) -> Option { + if let GraphOp::Constant { value } = self { + return (socket == "value").then_some(match value { + SocketValue::Float(_) => SocketType::Float, + SocketValue::Colour(_) => SocketType::Colour, + }); + } + self.kind().outputs.iter().find(|s| s.name == socket).map(|s| s.ty) + } + + /// Spec of an input socket. + pub fn input(&self, socket: &str) -> Option<&'static SocketSpec> { + self.kind().inputs.iter().find(|s| s.name == socket) + } + + /// Settings vector of a procedural: (seed, mode 1, mode 2, 0). + pub fn procedural_settings(&self) -> [f32; 4] { + match *self { + GraphOp::Noise { seed } | GraphOp::Fbm { seed } | GraphOp::Brushed { seed } | GraphOp::Flakes { seed } => { + [seed as f32, 0.0, 0.0, 0.0] + } + GraphOp::Wood { seed } | GraphOp::Marble { seed } => [seed as f32, 0.0, 0.0, 0.0], + GraphOp::Voronoi { seed, metric, feature } => [seed as f32, metric as u8 as f32, feature as u8 as f32, 0.0], + GraphOp::Gradient { gradient } => [0.0, gradient as u8 as f32, 0.0, 0.0], + GraphOp::Wave { seed, wave, profile } => [seed as f32, wave as u8 as f32, profile as u8 as f32, 0.0], + _ => [0.0; 4], + } + } + + /// The texture a node samples. + pub fn texture(&self) -> Option { + match self { + GraphOp::Texture { texture, .. } => *texture, + _ => None, + } + } + + fn validate(&self, field: &str, textures: &BTreeMap) -> Result<()> { + match self { + GraphOp::Constant { value } if !value.finite() => Err(SceneError::value(field, "value must be finite")), + GraphOp::Texture { texture, projection, transform, fallback, .. } => { + if let Some(t) = texture { + if !textures.contains_key(t) { + return Err(SceneError::UnknownTexture(*t)); + } + } + validate_projection(projection, field)?; + transform.validate(field)?; + if !fallback.iter().all(|v| v.is_finite()) { + return Err(SceneError::value(field, "fallback must be finite")); + } + Ok(()) + } + GraphOp::Mapping { projection, transform } => { + validate_projection(projection, field)?; + transform.validate(field) + } + GraphOp::ColourRamp { stops, .. } => { + if stops.is_empty() || stops.len() > MAX_RAMP_STOPS { + return Err(SceneError::value(field, format!("a ramp needs 1 to {MAX_RAMP_STOPS} stops"))); + } + if stops.iter().any(|s| !s.position.is_finite() || !s.colour.iter().all(|v| v.is_finite())) { + return Err(SceneError::value(field, "ramp stops must be finite")); + } + if stops.windows(2).any(|w| w[1].position < w[0].position) { + return Err(SceneError::value(field, "ramp stops must be sorted by position")); + } + Ok(()) + } + _ => Ok(()), + } + } +} + +/// A graph node: what it does, its unlinked input values and its place on the canvas. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GraphNode { + /// Kind and settings. + #[serde(flatten)] + pub op: GraphOp, + /// Values of unlinked inputs (absent inputs use the kind's default). + #[serde(default)] + pub inputs: BTreeMap, + /// Canvas position. + #[serde(default)] + pub position: [f32; 2], + /// Optional label. + #[serde(default)] + pub label: String, +} + +impl GraphNode { + /// Node with default inputs. + pub fn new(op: GraphOp) -> Self { + Self { op, inputs: BTreeMap::new(), position: [0.0, 0.0], label: String::new() } + } + + /// Sets an unlinked input value. + pub fn with(mut self, socket: &str, value: SocketValue) -> Self { + self.inputs.insert(socket.to_string(), value); + self + } + + /// Value of an unlinked input (vec4), the kind's default when unset. + pub fn input_value(&self, socket: &str) -> [f32; 4] { + if let Some(v) = self.inputs.get(socket) { + return v.vec4(); + } + self.op.input(socket).map(|s| [s.default[0], s.default[1], s.default[2], 1.0]).unwrap_or([0.0, 0.0, 0.0, 1.0]) + } +} + +/// A node socket: `[node, "socket"]`. +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub struct SocketRef(pub u32, pub String); + +impl SocketRef { + /// Socket of a node. + pub fn new(node: u32, socket: &str) -> Self { + Self(node, socket.to_string()) + } +} + +/// A connection from an output socket to an input socket. +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Link { + /// Output socket. + pub from: SocketRef, + /// Input socket. + pub to: SocketRef, +} + +/// A material's node graph; its outputs drive material inputs. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct MaterialGraph { + /// Nodes by id. + pub nodes: BTreeMap, + /// Links, sorted by (to, from). + pub links: Vec, + /// Material input driven by each output socket. + pub outputs: BTreeMap, +} + +impl MaterialGraph { + /// Empty graph. + pub fn new() -> Self { + Self::default() + } + + /// Adds a node and returns its id (one past the largest id). + pub fn add(&mut self, node: GraphNode) -> u32 { + let id = self.nodes.keys().next_back().copied().unwrap_or(0) + 1; + self.nodes.insert(id, node); + id + } + + /// Links an output socket to an input socket. + pub fn link(&mut self, from: u32, from_socket: &str, to: u32, to_socket: &str) { + self.links.push(Link { from: SocketRef::new(from, from_socket), to: SocketRef::new(to, to_socket) }); + self.normalize(); + } + + /// Drives a material input from an output socket. + pub fn output(&mut self, input: MaterialInput, node: u32, socket: &str) { + self.outputs.insert(input, SocketRef::new(node, socket)); + } + + /// Sorts and deduplicates links so serialisation is stable. + pub fn normalize(&mut self) { + self.links.sort_by(|a, b| (&a.to, &a.from).cmp(&(&b.to, &b.from))); + self.links.dedup(); + } + + /// The link feeding an input socket. + pub fn link_into(&self, node: u32, socket: &str) -> Option<&SocketRef> { + self.links.iter().find(|l| l.to.0 == node && l.to.1 == socket).map(|l| &l.from) + } + + /// Texture keys the graph samples. + pub fn texture_keys(&self) -> Vec { + let mut v: Vec = self.nodes.values().filter_map(|n| n.op.texture()).collect(); + v.sort_unstable(); + v.dedup(); + v + } + + /// Rewrites texture keys through `f` (imports and texture removal). + pub fn map_textures(&mut self, f: impl Fn(TextureKey) -> Option) { + for n in self.nodes.values_mut() { + if let GraphOp::Texture { texture, .. } = &mut n.op { + *texture = texture.and_then(&f); + } + } + } + + /// Checks structure, types, settings and texture references; graphs must have no cycles. + pub fn validate(&self, textures: &BTreeMap) -> Result<()> { + let bad = |m: String| Err(SceneError::value("graph", m)); + if self.nodes.len() > MAX_GRAPH_NODES { + return bad(format!("has {} nodes; at most {MAX_GRAPH_NODES} are allowed", self.nodes.len())); + } + for (id, n) in &self.nodes { + if *id == 0 { + return bad("node id 0 is not allowed".into()); + } + let field = format!("graph.nodes.{id}"); + n.op.validate(&field, textures)?; + for (name, v) in &n.inputs { + let Some(spec) = n.op.input(name) else { + return bad(format!("node {id} ({}) has no input {name}", n.op.kind_id())); + }; + if !v.finite() { + return bad(format!("node {id} input {name} must be finite")); + } + if spec.ty == SocketType::Float && matches!(v, SocketValue::Colour(_)) { + return bad(format!("node {id} input {name} takes a number")); + } + } + } + let mut fed = BTreeSet::new(); + for l in &self.links { + let (Some(from), Some(to)) = (self.nodes.get(&l.from.0), self.nodes.get(&l.to.0)) else { + return bad(format!("link {} {} -> {} {} names a missing node", l.from.0, l.from.1, l.to.0, l.to.1)); + }; + let Some(ft) = from.op.output_type(&l.from.1) else { + return bad(format!("node {} ({}) has no output {}", l.from.0, from.op.kind_id(), l.from.1)); + }; + let Some(spec) = to.op.input(&l.to.1) else { + return bad(format!("node {} ({}) has no input {}", l.to.0, to.op.kind_id(), l.to.1)); + }; + if !ft.converts_to(spec.ty) { + return bad(format!("{:?} output {} {} cannot feed {:?} input {} {}", ft, l.from.0, l.from.1, spec.ty, l.to.0, l.to.1)); + } + if !fed.insert((l.to.0, l.to.1.clone())) { + return bad(format!("input {} {} has more than one link", l.to.0, l.to.1)); + } + } + for (input, r) in &self.outputs { + if *input == MaterialInput::Bump { + return bad("bump is not a graph output; link a bump node into normal".into()); + } + let Some(n) = self.nodes.get(&r.0) else { + return bad(format!("output {} names missing node {}", input.name(), r.0)); + }; + let Some(ty) = n.op.output_type(&r.1) else { + return bad(format!("node {} ({}) has no output {}", r.0, n.op.kind_id(), r.1)); + }; + let want = match input { + MaterialInput::Normal => SocketType::Normal, + i if i.is_colour() => SocketType::Colour, + _ => SocketType::Float, + }; + if !ty.converts_to(want) { + return bad(format!("{:?} output {} {} cannot drive {}", ty, r.0, r.1, input.name())); + } + } + self.order().map(|_| ()) + } + + /// Node ids in dependency order (inputs before users); fails on a cycle. + pub fn order(&self) -> Result> { + let mut state: BTreeMap = BTreeMap::new(); + let mut out = Vec::with_capacity(self.nodes.len()); + for start in self.nodes.keys() { + if state.contains_key(start) { + continue; + } + let mut stack = vec![(*start, false)]; + while let Some((id, done)) = stack.pop() { + if done { + state.insert(id, 2); + out.push(id); + continue; + } + match state.get(&id) { + Some(2) => continue, + Some(1) => return Err(SceneError::value("graph", format!("has a cycle through node {id}"))), + _ => {} + } + state.insert(id, 1); + stack.push((id, true)); + for l in self.links.iter().filter(|l| l.to.0 == id) { + match state.get(&l.from.0) { + Some(1) => return Err(SceneError::value("graph", format!("has a cycle through node {}", l.from.0))), + Some(2) => {} + _ => stack.push((l.from.0, false)), + } + } + } + } + Ok(out) + } +} diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index 36557e52..6c6c17ab 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -6,6 +6,7 @@ mod command; mod document; mod editor; mod error; +mod graph; mod history; mod material; mod mesh; @@ -14,6 +15,7 @@ pub mod primitives; pub mod ser; mod selection; mod settings; +mod slots; mod snapshot; mod tx; @@ -28,8 +30,14 @@ pub use command::{ pub use document::{Document, DocumentData, FORMAT_VERSION}; pub use editor::{Editor, Outcome}; pub use error::{Result, SceneError}; +pub use graph::{ + graph_kind, graph_kinds, graph_kinds_json, GradientKind, GraphKind, GraphNode, GraphOp, Link, MaterialGraph, + MathOp, RampInterpolation, RampStop, SettingSpec, SocketRef, SocketSpec, SocketType, SocketValue, VoronoiFeature, + VoronoiMetric, WaveKind, WaveProfile, MAX_GRAPH_NODES, MAX_RAMP_STOPS, +}; pub use history::History; pub use material::{Material, SurfaceParams, TextureRef, TextureRole}; +pub use slots::{validate_projection, Channel, CoordSpace, MapProjection, MaterialInput, TextureSlot, UvTransform}; pub use mesh::Mesh; pub use node::{ CapMode, Cutaway, CutawayShape, Light, LightColour, LightShape, Node, NodeKind, PowerUnit, RayVisibility, Trs, diff --git a/native/crates/fsh-scene/src/material.rs b/native/crates/fsh-scene/src/material.rs index 3f1c8d04..8b588511 100644 --- a/native/crates/fsh-scene/src/material.rs +++ b/native/crates/fsh-scene/src/material.rs @@ -1,7 +1,10 @@ use crate::error::{non_negative, range, Result, SceneError}; +use crate::graph::MaterialGraph; use crate::ser; +use crate::slots::{MaterialInput, TextureSlot}; use fsh_core::{Rgb, TextureKey}; use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; /// Parameters of one layered physically based surface (field names follow the OpenPBR Surface parameter names). #[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] @@ -237,18 +240,67 @@ pub struct Material { /// Textures this material uses. #[serde(with = "ser::key_vec")] pub textures: Vec, + /// Image textures driving inputs, by input. + pub slots: BTreeMap, + /// Node graph whose outputs drive inputs (over slots and constants). + pub graph: Option>, } impl Default for Material { fn default() -> Self { - Self { name: "Material".into(), type_id: "generic".into(), params: SurfaceParams::default(), textures: Vec::new() } + Self { + name: "Material".into(), + type_id: "generic".into(), + params: SurfaceParams::default(), + textures: Vec::new(), + slots: BTreeMap::new(), + graph: None, + } } } impl Material { /// Material with a name, type and parameters. pub fn new(name: impl Into, type_id: impl Into, params: SurfaceParams) -> Self { - Self { name: name.into(), type_id: type_id.into(), params, textures: Vec::new() } + Self { name: name.into(), type_id: type_id.into(), params, ..Default::default() } + } + + /// Every texture key the material refers to (list, slots and graph), sorted and unique. + pub fn texture_keys(&self) -> Vec { + let mut v: Vec = self.textures.clone(); + v.extend(self.slots.values().map(|s| s.texture)); + if let Some(g) = &self.graph { + v.extend(g.texture_keys()); + } + v.sort_unstable(); + v.dedup(); + v + } + + /// Checks slots and graph against the document's textures. + pub fn validate_refs(&self, textures: &BTreeMap) -> Result<()> { + if let Some(t) = self.texture_keys().into_iter().find(|t| !textures.contains_key(t)) { + return Err(SceneError::UnknownTexture(t)); + } + if let Some(g) = &self.graph { + g.validate(textures)?; + } + Ok(()) + } + + /// Rewrites texture keys in the list, slots and graph; slots whose texture maps to `None` are dropped. + pub fn map_textures(&mut self, f: impl Fn(TextureKey) -> Option) { + self.textures = self.textures.iter().filter_map(|t| f(*t)).collect(); + self.slots.retain(|_, s| match f(s.texture) { + Some(t) => { + s.texture = t; + true + } + None => false, + }); + if let Some(g) = &mut self.graph { + g.map_textures(&f); + } } /// Checks parameters and name. @@ -259,6 +311,9 @@ impl Material { if self.textures.iter().any(|t| !t.is_some()) { return Err(SceneError::value("material.textures", "contains the zero key")); } + for (input, slot) in &self.slots { + slot.validate(*input)?; + } self.params.validate() } } diff --git a/native/crates/fsh-scene/src/slots.rs b/native/crates/fsh-scene/src/slots.rs new file mode 100644 index 00000000..98effd78 --- /dev/null +++ b/native/crates/fsh-scene/src/slots.rs @@ -0,0 +1,429 @@ +use crate::error::{Result, SceneError}; +use crate::material::SurfaceParams; +use crate::ser; +use fsh_core::TextureKey; +use fsh_materials::{ColourSpace, Field, Filter, Wrap, MAX_UV_SETS}; +use serde::{Deserialize, Serialize}; + +/// A material input a texture slot or a graph output can drive (SurfaceParams field names plus geometry inputs). +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum MaterialInput { + /// `base_weight`. + BaseWeight, + /// `base_color`. + BaseColor, + /// `base_metalness`. + BaseMetalness, + /// `base_diffuse_roughness`. + BaseDiffuseRoughness, + /// `specular_weight`. + SpecularWeight, + /// `specular_color`. + SpecularColor, + /// `specular_roughness`. + SpecularRoughness, + /// `specular_ior`. + SpecularIor, + /// `specular_roughness_anisotropy`. + SpecularRoughnessAnisotropy, + /// `transmission_weight`. + TransmissionWeight, + /// `transmission_color`. + TransmissionColor, + /// `coat_weight`. + CoatWeight, + /// `coat_color`. + CoatColor, + /// `coat_roughness`. + CoatRoughness, + /// `coat_ior`. + CoatIor, + /// `fuzz_weight`. + FuzzWeight, + /// `fuzz_color`. + FuzzColor, + /// `fuzz_roughness`. + FuzzRoughness, + /// `emission_color` (scaled by `emission_luminance`). + EmissionColor, + /// `geometry_opacity`. + GeometryOpacity, + /// Shading normal (tangent-space normal map, or a graph normal). + Normal, + /// Bump height (slots only; graphs use a bump node). + Bump, + /// Displacement height (stored; not applied per hit). + Displacement, +} + +impl MaterialInput { + /// Every input in order. + pub const ALL: [MaterialInput; 23] = [ + MaterialInput::BaseWeight, + MaterialInput::BaseColor, + MaterialInput::BaseMetalness, + MaterialInput::BaseDiffuseRoughness, + MaterialInput::SpecularWeight, + MaterialInput::SpecularColor, + MaterialInput::SpecularRoughness, + MaterialInput::SpecularIor, + MaterialInput::SpecularRoughnessAnisotropy, + MaterialInput::TransmissionWeight, + MaterialInput::TransmissionColor, + MaterialInput::CoatWeight, + MaterialInput::CoatColor, + MaterialInput::CoatRoughness, + MaterialInput::CoatIor, + MaterialInput::FuzzWeight, + MaterialInput::FuzzColor, + MaterialInput::FuzzRoughness, + MaterialInput::EmissionColor, + MaterialInput::GeometryOpacity, + MaterialInput::Normal, + MaterialInput::Bump, + MaterialInput::Displacement, + ]; + + /// Inputs that accept a texture slot. + pub const SLOTTABLE: [MaterialInput; 11] = [ + MaterialInput::BaseColor, + MaterialInput::SpecularRoughness, + MaterialInput::BaseMetalness, + MaterialInput::SpecularWeight, + MaterialInput::CoatWeight, + MaterialInput::CoatRoughness, + MaterialInput::EmissionColor, + MaterialInput::GeometryOpacity, + MaterialInput::Normal, + MaterialInput::Bump, + MaterialInput::Displacement, + ]; + + /// True when a texture slot may drive this input. + pub fn slottable(self) -> bool { + Self::SLOTTABLE.contains(&self) + } + + /// JSON name. + pub fn name(self) -> &'static str { + match self { + MaterialInput::BaseWeight => "base_weight", + MaterialInput::BaseColor => "base_color", + MaterialInput::BaseMetalness => "base_metalness", + MaterialInput::BaseDiffuseRoughness => "base_diffuse_roughness", + MaterialInput::SpecularWeight => "specular_weight", + MaterialInput::SpecularColor => "specular_color", + MaterialInput::SpecularRoughness => "specular_roughness", + MaterialInput::SpecularIor => "specular_ior", + MaterialInput::SpecularRoughnessAnisotropy => "specular_roughness_anisotropy", + MaterialInput::TransmissionWeight => "transmission_weight", + MaterialInput::TransmissionColor => "transmission_color", + MaterialInput::CoatWeight => "coat_weight", + MaterialInput::CoatColor => "coat_color", + MaterialInput::CoatRoughness => "coat_roughness", + MaterialInput::CoatIor => "coat_ior", + MaterialInput::FuzzWeight => "fuzz_weight", + MaterialInput::FuzzColor => "fuzz_color", + MaterialInput::FuzzRoughness => "fuzz_roughness", + MaterialInput::EmissionColor => "emission_color", + MaterialInput::GeometryOpacity => "geometry_opacity", + MaterialInput::Normal => "normal", + MaterialInput::Bump => "bump", + MaterialInput::Displacement => "displacement", + } + } + + /// Input by JSON name. + pub fn parse(s: &str) -> Option { + Self::ALL.iter().copied().find(|i| i.name() == s) + } + + /// True for colour inputs. + pub fn is_colour(self) -> bool { + matches!( + self, + MaterialInput::BaseColor + | MaterialInput::SpecularColor + | MaterialInput::TransmissionColor + | MaterialInput::CoatColor + | MaterialInput::FuzzColor + | MaterialInput::EmissionColor + ) + } + + /// Program field written for this input (bump writes the normal). + pub fn field(self) -> Field { + match self { + MaterialInput::BaseWeight => Field::BaseWeight, + MaterialInput::BaseColor => Field::BaseColor, + MaterialInput::BaseMetalness => Field::BaseMetalness, + MaterialInput::BaseDiffuseRoughness => Field::BaseDiffuseRoughness, + MaterialInput::SpecularWeight => Field::SpecularWeight, + MaterialInput::SpecularColor => Field::SpecularColor, + MaterialInput::SpecularRoughness => Field::SpecularRoughness, + MaterialInput::SpecularIor => Field::SpecularIor, + MaterialInput::SpecularRoughnessAnisotropy => Field::SpecularAnisotropy, + MaterialInput::TransmissionWeight => Field::TransmissionWeight, + MaterialInput::TransmissionColor => Field::TransmissionColor, + MaterialInput::CoatWeight => Field::CoatWeight, + MaterialInput::CoatColor => Field::CoatColor, + MaterialInput::CoatRoughness => Field::CoatRoughness, + MaterialInput::CoatIor => Field::CoatIor, + MaterialInput::FuzzWeight => Field::FuzzWeight, + MaterialInput::FuzzColor => Field::FuzzColor, + MaterialInput::FuzzRoughness => Field::FuzzRoughness, + MaterialInput::EmissionColor => Field::Emission, + MaterialInput::GeometryOpacity => Field::Opacity, + MaterialInput::Normal | MaterialInput::Bump => Field::Normal, + MaterialInput::Displacement => Field::Displacement, + } + } + + /// The constant value of this input in a parameter block (rgb, alpha 1; scalars splatted; geometry inputs 0). + pub fn constant(self, p: &SurfaceParams) -> [f32; 4] { + let c = |c: fsh_core::Rgb| [c.r, c.g, c.b, 1.0]; + let s = |v: f32| [v, v, v, 1.0]; + match self { + MaterialInput::BaseWeight => s(p.base_weight), + MaterialInput::BaseColor => c(p.base_color), + MaterialInput::BaseMetalness => s(p.base_metalness), + MaterialInput::BaseDiffuseRoughness => s(p.base_diffuse_roughness), + MaterialInput::SpecularWeight => s(p.specular_weight), + MaterialInput::SpecularColor => c(p.specular_color), + MaterialInput::SpecularRoughness => s(p.specular_roughness), + MaterialInput::SpecularIor => s(p.specular_ior), + MaterialInput::SpecularRoughnessAnisotropy => s(p.specular_roughness_anisotropy), + MaterialInput::TransmissionWeight => s(p.transmission_weight), + MaterialInput::TransmissionColor => c(p.transmission_color), + MaterialInput::CoatWeight => s(p.coat_weight), + MaterialInput::CoatColor => c(p.coat_color), + MaterialInput::CoatRoughness => s(p.coat_roughness), + MaterialInput::CoatIor => s(p.coat_ior), + MaterialInput::FuzzWeight => s(p.fuzz_weight), + MaterialInput::FuzzColor => c(p.fuzz_color), + MaterialInput::FuzzRoughness => s(p.fuzz_roughness), + MaterialInput::EmissionColor => c(p.emission_color), + MaterialInput::GeometryOpacity => s(p.geometry_opacity), + MaterialInput::Normal => [0.5, 0.5, 1.0, 1.0], + MaterialInput::Bump | MaterialInput::Displacement => [0.0, 0.0, 0.0, 1.0], + } + } +} + +/// How a slot finds its texture coordinate. +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "kind", rename_all = "snake_case")] +pub enum MapProjection { + /// A mesh uv set. + Uv { + /// Uv set index (0..4). + #[serde(default)] + set: u32, + }, + /// Three axis planes blended by the normal (triplanar). + Box { + /// Blend width, 0 (hard seams) to 1. + #[serde(default = "half")] + blend: f32, + }, + /// Along object Z onto the XY plane. + Planar, + /// Around object Y. + Cylindrical, + /// Around the object origin. + Spherical, +} + +fn half() -> f32 { + 0.5 +} + +impl Default for MapProjection { + fn default() -> Self { + MapProjection::Uv { set: 0 } + } +} + +/// Space a projection reads positions in. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum CoordSpace { + /// Object space: the pattern moves with the part. + #[default] + Object, + /// World space. + World, +} + +/// Offset, scale and rotation applied to texture coordinates: `uv' = R(rotation) * (uv * scale) + offset`. +#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct UvTransform { + /// Added after rotation. + pub offset: [f32; 2], + /// Repeats per uv unit, or per metre for projections. + pub scale: [f32; 2], + /// Radians, counter-clockwise. + pub rotation: f32, + /// Space projections read positions in. + pub space: CoordSpace, +} + +impl Default for UvTransform { + fn default() -> Self { + Self { offset: [0.0, 0.0], scale: [1.0, 1.0], rotation: 0.0, space: CoordSpace::Object } + } +} + +impl UvTransform { + /// Checks the values are finite. + pub fn validate(&self, field: &str) -> Result<()> { + if !(self.offset.iter().chain(&self.scale).all(|v| v.is_finite()) && self.rotation.is_finite()) { + return Err(SceneError::value(field, "offset, scale and rotation must be finite")); + } + Ok(()) + } + + /// Program constants `(sx, sy, cos, sin, ox, oy)`. + pub fn consts(&self) -> [f32; 6] { + let (s, c) = self.rotation.sin_cos(); + [self.scale[0], self.scale[1], c, s, self.offset[0], self.offset[1]] + } + + /// True when the transform changes nothing. + pub fn is_identity(&self) -> bool { + self.offset == [0.0, 0.0] && self.scale == [1.0, 1.0] && self.rotation == 0.0 + } +} + +/// Which texel channel a scalar input reads. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum Channel { + /// All three colour channels (colour inputs). + Rgb, + /// Red. + #[default] + R, + /// Green. + G, + /// Blue. + B, + /// Alpha. + A, + /// ACEScg luminance of rgb. + Luminance, +} + +/// An image texture driving one material input. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct TextureSlot { + /// Document texture. + #[serde(with = "ser::key")] + pub texture: TextureKey, + /// Coordinate source. + pub projection: MapProjection, + /// Coordinate transform. + pub transform: UvTransform, + /// Wrapping outside 0..1. + pub wrap: Wrap, + /// Filtering. + pub filter: Filter, + /// Colour space override; by default sRGB for colour inputs and data otherwise. + pub colour_space: Option, + /// Channel scalar inputs read. + pub channel: Channel, + /// Scalar inputs: value = range[0] + t * (range[1] - range[0]). + pub range: [f32; 2], + /// Scalar inputs: t = 1 - t before the range. + pub invert: bool, + /// Multiply by the input's constant value (glTF factor semantics). + pub multiply: bool, + /// Normal: tangent xy scale; bump: metres of height per unit; displacement: metres per unit. + pub strength: f32, + /// Normal: the green channel points down (DirectX convention). + pub flip_y: bool, + /// Value when the image is missing; the input's constant when absent. + pub fallback: Option<[f32; 4]>, +} + +impl Default for TextureSlot { + fn default() -> Self { + Self { + texture: TextureKey::NONE, + projection: MapProjection::default(), + transform: UvTransform::default(), + wrap: Wrap::Repeat, + filter: Filter::Trilinear, + colour_space: None, + channel: Channel::R, + range: [0.0, 1.0], + invert: false, + multiply: false, + strength: 1.0, + flip_y: false, + fallback: None, + } + } +} + +impl TextureSlot { + /// Default slot for an input (bump strength 1 mm). + pub fn for_input(input: MaterialInput, texture: TextureKey) -> Self { + let strength = match input { + MaterialInput::Bump => 0.001, + MaterialInput::Displacement => 0.01, + _ => 1.0, + }; + Self { texture, strength, ..Default::default() } + } + + /// Checks values against their ranges. + pub fn validate(&self, input: MaterialInput) -> Result<()> { + let f = |s: &str| format!("slots.{}.{s}", input.name()); + if !input.slottable() { + return Err(SceneError::value(f("input"), "takes no texture slot")); + } + if !self.texture.is_some() { + return Err(SceneError::value(f("texture"), "must name a texture")); + } + validate_projection(&self.projection, &f("projection"))?; + self.transform.validate(&f("transform"))?; + if !self.range.iter().all(|v| v.is_finite()) { + return Err(SceneError::value(f("range"), "must be finite")); + } + if !self.strength.is_finite() || self.strength.abs() > 1.0e3 { + return Err(SceneError::value(f("strength"), "must be finite and at most 1000 in size")); + } + if self.fallback.is_some_and(|c| !c.iter().all(|v| v.is_finite())) { + return Err(SceneError::value(f("fallback"), "must be finite")); + } + Ok(()) + } + + /// Colour space used: the override, else sRGB for colour inputs and data otherwise. + pub fn colour_space_for(&self, input: MaterialInput, hint: Option<&str>) -> ColourSpace { + self.colour_space.or_else(|| if input.is_colour() { hint.and_then(ColourSpace::parse) } else { None }).unwrap_or( + if input.is_colour() { + ColourSpace::Srgb + } else { + ColourSpace::Data + }, + ) + } +} + +/// Checks a projection's numbers. +pub fn validate_projection(p: &MapProjection, field: &str) -> Result<()> { + match p { + MapProjection::Uv { set } if *set as usize >= MAX_UV_SETS => { + Err(SceneError::value(field, format!("uv set {set} is outside 0..{}", MAX_UV_SETS - 1))) + } + MapProjection::Box { blend } if !(blend.is_finite() && (0.0..=1.0).contains(blend)) => { + Err(SceneError::value(field, "blend must be within 0..1")) + } + _ => Ok(()), + } +} From 3f1884d22a2cd15e85763846a76e64ee3b911a84 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:08:09 -0500 Subject: [PATCH 180/494] feat(scene): add the material type registry Eighteen material types as presets of SurfaceParams with the parameters each page shows, ranges and units, preset graphs for wood, stone and metallic paint, and measured metal colours converted to ACEScg. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/lib.rs | 2 + native/crates/fsh-scene/src/types.rs | 397 +++++++++++++++++++++++++++ 2 files changed, 399 insertions(+) create mode 100644 native/crates/fsh-scene/src/types.rs diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index 6c6c17ab..bf3dd984 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -18,6 +18,7 @@ mod settings; mod slots; mod snapshot; mod tx; +mod types; pub use catalogue::{catalogue, catalogue_json, CommandInfo}; pub use command::{ @@ -53,3 +54,4 @@ pub use snapshot::{ SCENE_UNITS_PER_NIT, }; pub use tx::UndoRecord; +pub use types::{material_type, material_types, metal_colour, types_json, MaterialType, ParamKind, ParamSpec, METALS}; diff --git a/native/crates/fsh-scene/src/types.rs b/native/crates/fsh-scene/src/types.rs new file mode 100644 index 00000000..647d74f1 --- /dev/null +++ b/native/crates/fsh-scene/src/types.rs @@ -0,0 +1,397 @@ +use crate::graph::{GraphNode, GraphOp, MaterialGraph, MathOp, SocketValue}; +use crate::material::{Material, SurfaceParams}; +use crate::slots::MaterialInput; +use fsh_core::Rgb; +use serde::Serialize; +use serde_json::{json, Value}; +use std::sync::OnceLock; + +/// How a parameter is edited. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ParamKind { + /// A number between `min` and `max`. + Float, + /// An ACEScg colour. + Colour, + /// On or off. + Bool, +} + +/// One parameter a type's page shows. +#[derive(Clone, Copy, Debug, PartialEq, Serialize)] +pub struct ParamSpec { + /// `SurfaceParams` field name. + pub field: &'static str, + /// Editor kind. + pub kind: ParamKind, + /// Lowest value. + pub min: f32, + /// Highest value (the slider's end; validation may allow more). + pub max: f32, + /// Unit: "", "nits", "m" or "um". + pub unit: &'static str, +} + +impl ParamSpec { + /// True when a texture slot may drive the parameter. + pub fn slot(&self) -> bool { + MaterialInput::parse(self.field).is_some_and(MaterialInput::slottable) + } +} + +/// A material type: a preset of the one surface model and the parameters its page shows. +#[derive(Clone, Debug, PartialEq)] +pub struct MaterialType { + /// Stable id. + pub id: &'static str, + /// English display name. + pub name: &'static str, + /// Library category. + pub category: &'static str, + /// Default parameters. + pub params: SurfaceParams, + /// Parameters the page shows, in order. + pub shown: &'static [ParamSpec], + /// The look needs a graph. + pub needs_graph: bool, + /// Graph a new material of this type starts with. + pub graph: Option, +} + +impl MaterialType { + /// A new material of this type. + pub fn material(&self, name: Option<&str>) -> Material { + let mut m = Material::new(name.filter(|n| !n.trim().is_empty()).unwrap_or(self.name), self.id, self.params); + m.graph = self.graph.clone().map(Box::new); + m + } + + /// JSON entry for `material.types`. + pub fn json(&self) -> Value { + json!({ + "id": self.id, + "name": self.name, + "category": self.category, + "needs_graph": self.needs_graph, + "params": serde_json::to_value(self.params).unwrap_or(Value::Null), + "shown": self.shown.iter().map(|p| { + let mut v = serde_json::to_value(p).unwrap_or(Value::Null); + v["slot"] = json!(p.slot()); + v + }).collect::>(), + "graph": self.graph.as_ref().and_then(|g| serde_json::to_value(g).ok()).unwrap_or(Value::Null), + }) + } +} + +const fn f(field: &'static str, min: f32, max: f32) -> ParamSpec { + ParamSpec { field, kind: ParamKind::Float, min, max, unit: "" } +} + +const fn u(field: &'static str, min: f32, max: f32, unit: &'static str) -> ParamSpec { + ParamSpec { field, kind: ParamKind::Float, min, max, unit } +} + +const fn c(field: &'static str) -> ParamSpec { + ParamSpec { field, kind: ParamKind::Colour, min: 0.0, max: 1.0, unit: "" } +} + +const fn b(field: &'static str) -> ParamSpec { + ParamSpec { field, kind: ParamKind::Bool, min: 0.0, max: 1.0, unit: "" } +} + +const BASE: ParamSpec = c("base_color"); +const ROUGH: ParamSpec = f("specular_roughness", 0.0, 1.0); +const IOR: ParamSpec = f("specular_ior", 1.0, 4.0); +const METAL: ParamSpec = f("base_metalness", 0.0, 1.0); +const SPEC: ParamSpec = f("specular_weight", 0.0, 1.0); +const ANISO: ParamSpec = f("specular_roughness_anisotropy", 0.0, 1.0); +const EDGE: ParamSpec = c("specular_color"); +const DIFF_ROUGH: ParamSpec = f("base_diffuse_roughness", 0.0, 1.0); +const TRANS: ParamSpec = f("transmission_weight", 0.0, 1.0); +const TRANS_COL: ParamSpec = c("transmission_color"); +const TRANS_DEPTH: ParamSpec = u("transmission_depth", 0.0, 1.0, "m"); +const ABBE: ParamSpec = f("transmission_dispersion_abbe_number", 1.0, 200.0); +const DISPERSION: ParamSpec = f("transmission_dispersion_scale", 0.0, 1.0); +const COAT: ParamSpec = f("coat_weight", 0.0, 1.0); +const COAT_ROUGH: ParamSpec = f("coat_roughness", 0.0, 1.0); +const COAT_COL: ParamSpec = c("coat_color"); +const COAT_IOR: ParamSpec = f("coat_ior", 1.0, 3.0); +const FUZZ: ParamSpec = f("fuzz_weight", 0.0, 1.0); +const FUZZ_COL: ParamSpec = c("fuzz_color"); +const FUZZ_ROUGH: ParamSpec = f("fuzz_roughness", 0.0, 1.0); +const LUM: ParamSpec = u("emission_luminance", 0.0, 10000.0, "nits"); +const EMIT_COL: ParamSpec = c("emission_color"); +const OPACITY: ParamSpec = f("geometry_opacity", 0.0, 1.0); +const THIN: ParamSpec = b("geometry_thin_walled"); +const SSS: ParamSpec = f("subsurface_weight", 0.0, 1.0); +const SSS_COL: ParamSpec = c("subsurface_color"); +const SSS_RADIUS: ParamSpec = u("subsurface_radius", 0.0, 0.1, "m"); +const FILM: ParamSpec = f("thin_film_weight", 0.0, 1.0); +const FILM_THICK: ParamSpec = u("thin_film_thickness", 0.0, 2.0, "um"); +const FILM_IOR: ParamSpec = f("thin_film_ior", 1.0, 3.0); + +static GENERIC: &[ParamSpec] = &[ + BASE, METAL, DIFF_ROUGH, SPEC, EDGE, ROUGH, IOR, ANISO, TRANS, TRANS_COL, TRANS_DEPTH, SSS, SSS_COL, SSS_RADIUS, COAT, + COAT_COL, COAT_ROUGH, COAT_IOR, FUZZ, FUZZ_COL, FUZZ_ROUGH, FILM, FILM_THICK, FILM_IOR, LUM, EMIT_COL, OPACITY, THIN, +]; +static PLASTIC: &[ParamSpec] = &[BASE, ROUGH, IOR, SPEC, COAT, COAT_ROUGH, OPACITY]; +static CLEAR: &[ParamSpec] = &[TRANS_COL, TRANS_DEPTH, ROUGH, IOR, BASE, THIN, OPACITY]; +static METAL_PAGE: &[ParamSpec] = &[BASE, EDGE, ROUGH, ANISO, COAT, COAT_ROUGH]; +static PAINT: &[ParamSpec] = &[BASE, ROUGH, COAT, COAT_COL, COAT_ROUGH, COAT_IOR]; +static PAINT_METAL: &[ParamSpec] = &[BASE, METAL, ROUGH, EDGE, COAT, COAT_COL, COAT_ROUGH, COAT_IOR]; +static GLASS: &[ParamSpec] = &[TRANS_COL, TRANS_DEPTH, ROUGH, IOR, DISPERSION, ABBE, THIN]; +static GEM: &[ParamSpec] = &[TRANS_COL, TRANS_DEPTH, ROUGH, IOR, DISPERSION, ABBE]; +static RUBBER: &[ParamSpec] = &[BASE, ROUGH, DIFF_ROUGH, SPEC, IOR]; +static FABRIC: &[ParamSpec] = &[BASE, DIFF_ROUGH, FUZZ, FUZZ_COL, FUZZ_ROUGH, SPEC, ROUGH]; +static CERAMIC: &[ParamSpec] = &[BASE, ROUGH, COAT, COAT_ROUGH, COAT_IOR]; +static DIFFUSE: &[ParamSpec] = &[BASE, DIFF_ROUGH]; +static EMISSIVE: &[ParamSpec] = &[EMIT_COL, LUM, BASE, OPACITY]; +static TEXTURED: &[ParamSpec] = &[BASE, ROUGH, DIFF_ROUGH, SPEC, COAT, COAT_ROUGH]; + +/// Measured metal colours: id, English name, normal-incidence reflectance in linear sRGB (Real-Time Rendering +/// 4th edition, table 9.2). +pub static METALS: &[(&str, &str, [f32; 3])] = &[ + ("iron", "Iron", [0.560, 0.570, 0.580]), + ("silver", "Silver", [0.972, 0.960, 0.915]), + ("aluminium", "Aluminium", [0.913, 0.921, 0.925]), + ("gold", "Gold", [1.000, 0.766, 0.336]), + ("copper", "Copper", [0.955, 0.637, 0.538]), + ("chromium", "Chromium", [0.550, 0.556, 0.554]), + ("nickel", "Nickel", [0.660, 0.609, 0.526]), + ("titanium", "Titanium", [0.542, 0.497, 0.449]), + ("cobalt", "Cobalt", [0.662, 0.655, 0.634]), + ("platinum", "Platinum", [0.672, 0.637, 0.585]), +]; + +/// A measured metal's base colour in ACEScg (clamped to 0..1). +pub fn metal_colour(id: &str) -> Option { + METALS.iter().find(|m| m.0 == id).map(|m| lin(m.2)) +} + +fn lin(c: [f32; 3]) -> Rgb { + Rgb::from_linear_srgb(c).clamp(0.0, 1.0) +} + +fn flakes_graph() -> MaterialGraph { + let mut g = MaterialGraph::new(); + let flakes = g.add(GraphNode::new(GraphOp::Flakes { seed: 0 })); + let rough = g.add( + GraphNode::new(GraphOp::Math { op: MathOp::Lerp }) + .with("a", SocketValue::Float(0.35)) + .with("b", SocketValue::Float(0.12)), + ); + let metal = g.add( + GraphNode::new(GraphOp::Math { op: MathOp::Lerp }) + .with("a", SocketValue::Float(0.5)) + .with("b", SocketValue::Float(0.9)), + ); + g.link(flakes, "mask", rough, "c"); + g.link(flakes, "mask", metal, "c"); + g.output(MaterialInput::SpecularRoughness, rough, "value"); + g.output(MaterialInput::BaseMetalness, metal, "value"); + g.nodes.entry(rough).and_modify(|n| n.position = [240.0, -60.0]); + g.nodes.entry(metal).and_modify(|n| n.position = [240.0, 60.0]); + g +} + +fn pattern_graph(op: GraphOp) -> MaterialGraph { + let mut g = MaterialGraph::new(); + let n = g.add(GraphNode::new(op)); + g.output(MaterialInput::BaseColor, n, "colour"); + g +} + +fn build() -> Vec { + let d = SurfaceParams::default; + let metal = SurfaceParams { + base_metalness: 1.0, + base_color: lin(METALS[2].2), + specular_roughness: 0.2, + ..d() + }; + let glass = SurfaceParams { + base_color: Rgb::WHITE, + transmission_weight: 1.0, + specular_roughness: 0.0, + specular_ior: 1.52, + ..d() + }; + let t = |id, name, category, params, shown, graph: Option| MaterialType { + id, + name, + category, + params, + shown, + needs_graph: graph.is_some(), + graph, + }; + vec![ + t("generic", "Generic", "Generic", d(), GENERIC, None), + t( + "plastic", + "Plastic", + "Plastic", + SurfaceParams { base_color: lin([0.6, 0.6, 0.6]), specular_roughness: 0.3, specular_ior: 1.49, ..d() }, + PLASTIC, + None, + ), + t( + "plastic_clear", + "Clear plastic", + "Plastic", + SurfaceParams { specular_roughness: 0.02, specular_ior: 1.49, ..glass }, + CLEAR, + None, + ), + t("metal", "Metal", "Metal", metal, METAL_PAGE, None), + t( + "metal_brushed", + "Brushed metal", + "Metal", + SurfaceParams { specular_roughness: 0.3, specular_roughness_anisotropy: 0.7, ..metal }, + METAL_PAGE, + None, + ), + t( + "paint", + "Paint", + "Paint", + SurfaceParams { + base_color: lin([0.5, 0.03, 0.03]), + specular_roughness: 0.4, + coat_weight: 1.0, + coat_roughness: 0.03, + coat_ior: 1.5, + ..d() + }, + PAINT, + None, + ), + t( + "paint_metallic", + "Metallic paint", + "Paint", + SurfaceParams { + base_color: lin([0.08, 0.15, 0.45]), + base_metalness: 0.6, + specular_roughness: 0.35, + coat_weight: 1.0, + coat_roughness: 0.02, + coat_ior: 1.5, + ..d() + }, + PAINT_METAL, + Some(flakes_graph()), + ), + t("glass", "Glass", "Glass", glass, GLASS, None), + t("glass_thin", "Thin glass", "Glass", SurfaceParams { geometry_thin_walled: true, ..glass }, GLASS, None), + t("liquid", "Liquid", "Liquid", SurfaceParams { specular_ior: 1.333, ..glass }, GLASS, None), + t( + "gem", + "Gem", + "Gem", + SurfaceParams { + specular_ior: 2.417, + transmission_dispersion_scale: 1.0, + transmission_dispersion_abbe_number: 55.0, + ..glass + }, + GEM, + None, + ), + t( + "rubber", + "Rubber", + "Rubber", + SurfaceParams { + base_color: lin([0.04, 0.04, 0.04]), + specular_roughness: 0.6, + specular_ior: 1.52, + base_diffuse_roughness: 0.5, + ..d() + }, + RUBBER, + None, + ), + t( + "fabric", + "Fabric", + "Fabric", + SurfaceParams { + base_color: lin([0.3, 0.3, 0.35]), + specular_weight: 0.25, + specular_roughness: 0.8, + base_diffuse_roughness: 1.0, + fuzz_weight: 1.0, + fuzz_roughness: 0.5, + ..d() + }, + FABRIC, + None, + ), + t( + "ceramic", + "Ceramic", + "Ceramic", + SurfaceParams { + base_color: lin([0.8, 0.8, 0.8]), + specular_roughness: 0.4, + coat_weight: 1.0, + coat_roughness: 0.05, + coat_ior: 1.5, + ..d() + }, + CERAMIC, + None, + ), + t("diffuse", "Diffuse", "Generic", SurfaceParams { specular_weight: 0.0, base_diffuse_roughness: 0.5, ..d() }, DIFFUSE, None), + t( + "emissive", + "Emissive", + "Emissive", + SurfaceParams { base_color: Rgb::BLACK, emission_luminance: 500.0, emission_color: Rgb::WHITE, ..d() }, + EMISSIVE, + None, + ), + t( + "wood", + "Wood", + "Wood", + SurfaceParams { specular_roughness: 0.45, base_diffuse_roughness: 0.3, ..d() }, + TEXTURED, + Some(pattern_graph(GraphOp::Wood { seed: 0 })), + ), + t( + "stone", + "Stone", + "Stone", + SurfaceParams { specular_roughness: 0.5, base_diffuse_roughness: 0.5, ..d() }, + TEXTURED, + Some(pattern_graph(GraphOp::Marble { seed: 0 })), + ), + ] +} + +/// Every material type, in catalogue order. +pub fn material_types() -> &'static [MaterialType] { + static TYPES: OnceLock> = OnceLock::new(); + TYPES.get_or_init(build) +} + +/// A material type by id. +pub fn material_type(id: &str) -> Option<&'static MaterialType> { + material_types().iter().find(|t| t.id == id) +} + +/// The registry as JSON: `{types, metals}`. +pub fn types_json() -> Value { + json!({ + "types": material_types().iter().map(MaterialType::json).collect::>(), + "metals": METALS.iter().map(|(id, name, _)| { + let c = metal_colour(id).unwrap_or(Rgb::WHITE); + json!({"id": id, "name": name, "base_color": [c.r, c.g, c.b]}) + }).collect::>(), + }) +} From 77f90f268224cc4d0649f053d987f38356aa71cc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:11:02 -0500 Subject: [PATCH 181/494] feat(scene): compile materials to programs in the render snapshot The compiler turns constants, texture slots and graphs into one register program with constant folding, dead-code removal and liveness register allocation; materials with nothing varying compile to a constant program. RenderMaterial carries the program and RenderSnapshot the deduplicated texture list. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/compile.rs | 657 ++++++++++++++++++++++++ native/crates/fsh-scene/src/lib.rs | 4 +- native/crates/fsh-scene/src/snapshot.rs | 31 +- 3 files changed, 688 insertions(+), 4 deletions(-) create mode 100644 native/crates/fsh-scene/src/compile.rs diff --git a/native/crates/fsh-scene/src/compile.rs b/native/crates/fsh-scene/src/compile.rs new file mode 100644 index 00000000..7a3f962c --- /dev/null +++ b/native/crates/fsh-scene/src/compile.rs @@ -0,0 +1,657 @@ +use crate::error::{Result, SceneError}; +use crate::graph::{GraphNode, GraphOp, MaterialGraph, MathOp, RampInterpolation, SocketType}; +use crate::material::{Material, SurfaceParams, TextureRef}; +use crate::slots::{Channel, CoordSpace, MapProjection, MaterialInput, TextureSlot, UvTransform}; +use crate::snapshot::{RenderTexture, SCENE_UNITS_PER_NIT}; +use fsh_core::TextureKey; +use fsh_materials::program::{input, NEED_BUMP, NEED_NORMAL, NEED_PROCEDURAL, NEED_TANGENT, NEED_TEXTURES, NEED_UV0}; +use fsh_materials::{fold, ColourSpace, Field, Filter, Instr, Op, Output, Program, SurfaceInputs, Wrap, REGISTERS}; +use std::collections::BTreeMap; + +/// Snapshot textures collected while compiling, deduplicated by (path, colour space). +#[derive(Clone, Debug)] +pub struct TextureTable<'d> { + doc: &'d BTreeMap, + /// Textures in index order. + pub list: Vec, +} + +impl<'d> TextureTable<'d> { + /// Empty table over a document's texture references. + pub fn new(doc: &'d BTreeMap) -> Self { + Self { doc, list: Vec::new() } + } + + fn hint(&self, key: TextureKey) -> Option<&'d str> { + self.doc.get(&key).and_then(|t| t.colour_space.as_deref()) + } + + fn index(&mut self, key: TextureKey, colour_space: ColourSpace, filter: Filter) -> Option { + let t = self.doc.get(&key)?; + let mips = filter == Filter::Trilinear; + if let Some(i) = self.list.iter().position(|r| r.path == t.path && r.colour_space == colour_space) { + self.list[i].mipmaps |= mips; + return Some(i as u32); + } + self.list.push(RenderTexture { key, path: t.path.clone(), colour_space, mipmaps: mips }); + Some(self.list.len() as u32 - 1) + } +} + +/// Constant surface inputs of a parameter block (emission in scene units), sanitised; the same values the CPU +/// renderer derives for an untextured material. +pub fn base_inputs(p: &SurfaceParams) -> SurfaceInputs { + SurfaceInputs { + base_weight: p.base_weight, + base_color: p.base_color, + base_metalness: p.base_metalness, + base_diffuse_roughness: p.base_diffuse_roughness, + specular_weight: p.specular_weight, + specular_color: p.specular_color, + specular_roughness: p.specular_roughness, + specular_ior: p.specular_ior, + specular_anisotropy: p.specular_roughness_anisotropy, + transmission_weight: p.transmission_weight, + transmission_color: p.transmission_color, + coat_weight: p.coat_weight, + coat_color: p.coat_color, + coat_roughness: p.coat_roughness, + coat_ior: p.coat_ior, + fuzz_weight: p.fuzz_weight, + fuzz_color: p.fuzz_color, + fuzz_roughness: p.fuzz_roughness, + emission: p.emission_color * (p.emission_luminance * SCENE_UNITS_PER_NIT), + opacity: p.geometry_opacity, + thin_walled: p.geometry_thin_walled, + } + .sanitized() +} + +type V4 = [f32; 4]; + +#[derive(Clone, Copy, Debug, PartialEq)] +enum Val { + K(V4), + R(u32), +} + +#[derive(Clone, Debug)] +struct VInstr { + op: Op, + dst: u32, + flags: u8, + a: u32, + b: u32, + c: u32, + args: Vec, +} + +fn reg_operands(op: Op) -> [bool; 3] { + match op { + Op::Nop | Op::Const | Op::Input | Op::Proc => [false; 3], + Op::Swizzle | Op::Invert | Op::Luminance | Op::Project | Op::Ramp | Op::Xform2 | Op::Tex | Op::TexBox => { + [true, false, false] + } + Op::Combine | Op::Lerp | Op::Clamp => [true; 3], + Op::Add | Op::Sub | Op::Mul | Op::Div | Op::Min | Op::Max | Op::Pow | Op::NormalMap | Op::Bump => { + [true, true, false] + } + } +} + +const SPLAT_X: u8 = 0; +const SPLAT_Y: u8 = 0b01_01_01_01; +const SPLAT_Z: u8 = 0b10_10_10_10; +const SPLAT_W: u8 = 0b11_11_11_11; + +struct Emitter<'t, 'd> { + code: Vec, + consts: Vec, + next: u32, + kregs: BTreeMap<[u32; 4], u32>, + needs: u32, + table: &'t mut TextureTable<'d>, + memo: BTreeMap<(u32, String, u8), (Val, SocketType)>, +} + +fn splat(v: f32) -> V4 { + [v; 4] +} + +impl<'t, 'd> Emitter<'t, 'd> { + fn pool(&mut self, vals: &[f32]) -> u32 { + let at = self.consts.len() as u32; + self.consts.extend_from_slice(vals); + at + } + + fn push(&mut self, op: Op, flags: u8, a: u32, b: u32, c: u32, args: Vec) -> Val { + let dst = self.next; + self.next += 1; + self.code.push(VInstr { op, dst, flags, a, b, c, args }); + Val::R(dst) + } + + fn reg(&mut self, v: Val) -> u32 { + match v { + Val::R(r) => r, + Val::K(k) => { + let bits = k.map(f32::to_bits); + if let Some(r) = self.kregs.get(&bits) { + return *r; + } + let at = self.pool(&k); + let Val::R(r) = self.push(Op::Const, 0, at, 0, 0, Vec::new()) else { unreachable!() }; + self.kregs.insert(bits, r); + r + } + } + } + + fn pure(&mut self, op: Op, flags: u8, a: Val, b: Val, c: Val, imm_b: Option) -> Val { + if let (Val::K(x), Val::K(y), Val::K(z)) = (a, if imm_b.is_some() { Val::K([0.0; 4]) } else { b }, c) { + let i = Instr::new(op, 0, flags, 0, imm_b.unwrap_or(0), 0); + if let Some(v) = fold(&i, x, y, z, &self.consts) { + return Val::K(v); + } + } + let [ra, rb, rc] = reg_operands(op); + let a = if ra { self.reg(a) } else { 0 }; + let b = match imm_b { + Some(k) => k, + None if rb => self.reg(b), + None => 0, + }; + let c = if rc { self.reg(c) } else { 0 }; + self.push(op, flags, a, b, c, Vec::new()) + } + + fn bin(&mut self, op: Op, a: Val, b: Val) -> Val { + self.pure(op, 0, a, b, Val::K([0.0; 4]), None) + } + + fn un(&mut self, op: Op, a: Val) -> Val { + self.pure(op, 0, a, Val::K([0.0; 4]), Val::K([0.0; 4]), None) + } + + fn tri(&mut self, op: Op, a: Val, b: Val, c: Val) -> Val { + self.pure(op, 0, a, b, c, None) + } + + fn swizzle(&mut self, a: Val, sel: u8) -> Val { + self.pure(Op::Swizzle, sel, a, Val::K([0.0; 4]), Val::K([0.0; 4]), None) + } + + fn input(&mut self, which: u8, offset: u8, set: u32) -> Val { + match which { + input::UV => self.needs |= NEED_UV0 << set.min(3), + input::TANGENT => self.needs |= NEED_TANGENT, + _ => {} + } + let offset = if matches!(which, input::POSITION | input::POSITION_OBJECT | input::UV) { offset } else { 0 }; + self.push(Op::Input, which | offset << 4, set, 0, 0, Vec::new()) + } + + fn convert(&mut self, v: Val, from: SocketType, to: SocketType) -> Val { + match (from, to) { + (SocketType::Colour | SocketType::Vector, SocketType::Float) => self.un(Op::Luminance, v), + _ => v, + } + } + + fn xform(&mut self, coord: Val, t: &UvTransform) -> Val { + if t.is_identity() { + return coord; + } + let k = self.pool(&t.consts()); + self.pure(Op::Xform2, 0, coord, Val::K([0.0; 4]), Val::K([0.0; 4]), Some(k)) + } + + fn position(&mut self, space: CoordSpace, offset: u8) -> Val { + let which = if space == CoordSpace::World { input::POSITION } else { input::POSITION_OBJECT }; + self.input(which, offset, 0) + } + + fn coordinate(&mut self, projection: &MapProjection, t: &UvTransform, offset: u8) -> Val { + let raw = match *projection { + MapProjection::Uv { set } => self.input(input::UV, offset, set), + MapProjection::Box { .. } => return self.position(t.space, offset), + MapProjection::Planar => { + let p = self.position(t.space, offset); + self.pure(Op::Project, 0, p, Val::K([0.0; 4]), Val::K([0.0; 4]), None) + } + MapProjection::Cylindrical => { + let p = self.position(t.space, offset); + self.pure(Op::Project, 1, p, Val::K([0.0; 4]), Val::K([0.0; 4]), None) + } + MapProjection::Spherical => { + let p = self.position(t.space, offset); + self.pure(Op::Project, 2, p, Val::K([0.0; 4]), Val::K([0.0; 4]), None) + } + }; + self.xform(raw, t) + } + + #[allow(clippy::too_many_arguments)] + fn sample( + &mut self, + texture: Option, + coord: Option, + projection: &MapProjection, + t: &UvTransform, + wrap: Wrap, + filter: Filter, + fallback: V4, + offset: u8, + ) -> Val { + let Some(index) = texture else { return Val::K(fallback) }; + self.needs |= NEED_TEXTURES; + let flags = wrap.code() | filter.code() << 2; + if let (MapProjection::Box { blend }, None) = (projection, coord) { + let p = self.position(t.space, offset); + let p = self.reg(p); + let x = t.consts(); + let k = self.pool(&[fallback[0], fallback[1], fallback[2], fallback[3], x[0], x[1], x[2], x[3], x[4], x[5], *blend]); + let world = if t.space == CoordSpace::World { 16 } else { 0 }; + return self.push(Op::TexBox, flags | world, p, index, k, Vec::new()); + } + let coord = match coord { + Some(c) => self.xform(c, t), + None => self.coordinate(projection, t, offset), + }; + let coord = self.reg(coord); + let k = self.pool(&fallback); + self.push(Op::Tex, flags, coord, index, k, Vec::new()) + } + + fn node_out(&mut self, g: &MaterialGraph, id: u32, socket: &str, offset: u8, depth: u32) -> Result<(Val, SocketType)> { + let key = (id, socket.to_string(), offset); + if let Some(v) = self.memo.get(&key) { + return Ok(*v); + } + if depth > 512 { + return Err(SceneError::value("graph", "is nested too deeply")); + } + let node = g.nodes.get(&id).ok_or_else(|| SceneError::value("graph", format!("names missing node {id}")))?; + let ty = node.op.output_type(socket).ok_or_else(|| SceneError::value("graph", format!("node {id} has no output {socket}")))?; + let v = self.eval_node(g, id, node, socket, offset, depth)?; + self.memo.insert(key, (v, ty)); + Ok((v, ty)) + } + + fn node_in(&mut self, g: &MaterialGraph, id: u32, node: &GraphNode, socket: &str, offset: u8, depth: u32) -> Result { + let want = node.op.input(socket).map(|s| s.ty).unwrap_or(SocketType::Float); + if let Some(from) = g.link_into(id, socket) { + let (v, ty) = self.node_out(g, from.0, &from.1, offset, depth + 1)?; + return Ok(self.convert(v, ty, want)); + } + Ok(match want { + SocketType::Normal => self.input(input::NORMAL, 0, 0), + SocketType::Float => Val::K(splat(node.input_value(socket)[0])), + _ => Val::K(node.input_value(socket)), + }) + } + + fn eval_node(&mut self, g: &MaterialGraph, id: u32, node: &GraphNode, socket: &str, offset: u8, depth: u32) -> Result { + let inp = |e: &mut Self, s: &str| e.node_in(g, id, node, s, offset, depth); + Ok(match &node.op { + GraphOp::Constant { value } => Val::K(value.vec4()), + GraphOp::Texture { texture, projection, transform, wrap, filter, colour_space, fallback } => { + let cs = colour_space.or_else(|| texture.and_then(|t| self.table.hint(t)).and_then(ColourSpace::parse)); + let index = texture.and_then(|t| self.table.index(t, cs.unwrap_or(ColourSpace::Srgb), *filter)); + let coord = match g.link_into(id, "vector") { + Some(from) => Some(self.node_out(g, from.0, &from.1, offset, depth + 1)?.0), + None => None, + }; + let v = self.sample(index, coord, projection, transform, *wrap, *filter, *fallback, offset); + if socket == "alpha" { + self.swizzle(v, SPLAT_W) + } else { + v + } + } + GraphOp::Mapping { projection, transform } => self.coordinate(projection, transform, offset), + GraphOp::Mix {} => { + let (a, b, f) = (inp(self, "a")?, inp(self, "b")?, inp(self, "factor")?); + self.tri(Op::Lerp, a, b, f) + } + GraphOp::Math { op } => { + let (a, b, c) = (inp(self, "a")?, inp(self, "b")?, inp(self, "c")?); + match op { + MathOp::Add => self.bin(Op::Add, a, b), + MathOp::Subtract => self.bin(Op::Sub, a, b), + MathOp::Multiply => self.bin(Op::Mul, a, b), + MathOp::Divide => self.bin(Op::Div, a, b), + MathOp::Minimum => self.bin(Op::Min, a, b), + MathOp::Maximum => self.bin(Op::Max, a, b), + MathOp::Power => self.bin(Op::Pow, a, b), + MathOp::Lerp => self.tri(Op::Lerp, a, b, c), + MathOp::Clamp => self.tri(Op::Clamp, a, b, c), + MathOp::Invert => self.un(Op::Invert, a), + } + } + GraphOp::ColourRamp { stops, interpolation } => { + let f = inp(self, "factor")?; + let mut k = vec![stops.len() as f32]; + for s in stops { + k.extend_from_slice(&[s.position, s.colour[0], s.colour[1], s.colour[2], s.colour[3]]); + } + let at = self.pool(&k); + let mode = match interpolation { + RampInterpolation::Linear => 0, + RampInterpolation::Constant => 1, + RampInterpolation::Smooth => 2, + }; + let v = self.pure(Op::Ramp, mode, f, Val::K([0.0; 4]), Val::K([0.0; 4]), Some(at)); + if socket == "alpha" { + self.swizzle(v, SPLAT_W) + } else { + v + } + } + GraphOp::NormalMap { flip_y } => { + let (c, s) = (inp(self, "colour")?, inp(self, "strength")?); + self.normal_map(c, s, *flip_y) + } + GraphOp::Bump {} => { + let n = inp(self, "normal")?; + let s = inp(self, "strength")?; + let mut h = [Val::K([0.0; 4]); 3]; + for (o, slot) in h.iter_mut().enumerate() { + *slot = self.node_in(g, id, node, "height", o as u8, depth)?; + } + self.bump(n, h, s) + } + op => { + let kind = op.kind(); + let Some(proc_kind) = kind.procedural else { return Ok(Val::K([0.0; 4])) }; + self.needs |= NEED_PROCEDURAL; + let mut args = Vec::with_capacity(kind.inputs.len() + 1); + for spec in kind.inputs { + let v = if spec.name == "vector" && g.link_into(id, "vector").is_none() { + self.position(CoordSpace::Object, offset) + } else { + inp(self, spec.name)? + }; + args.push(self.reg(v)); + } + let settings = self.reg(Val::K(op.procedural_settings())); + args.push(settings); + let output = kind.outputs.iter().position(|o| o.name == socket).unwrap_or(0) as u32; + self.push(Op::Proc, proc_kind as u8, 0, output, 0, args) + } + }) + } + + fn normal_map(&mut self, colour: Val, strength: Val, flip_y: bool) -> Val { + self.needs |= NEED_TANGENT; + let (c, s) = (self.reg(colour), self.reg(strength)); + self.push(Op::NormalMap, flip_y as u8, c, s, 0, Vec::new()) + } + + fn bump(&mut self, normal: Val, heights: [Val; 3], strength: Val) -> Val { + if heights.iter().all(|h| matches!(h, Val::K(_))) { + return normal; + } + self.needs |= NEED_BUMP | NEED_TANGENT; + let scaled = heights.map(|h| self.bin(Op::Mul, h, strength)); + let packed = self.tri(Op::Combine, scaled[0], scaled[1], scaled[2]); + let (n, p) = (self.reg(normal), self.reg(packed)); + self.push(Op::Bump, 0, n, p, 0, Vec::new()) + } + + fn slot_texel(&mut self, input: MaterialInput, slot: &TextureSlot, constant: V4, offset: u8) -> Val { + let cs = slot.colour_space_for(input, self.table.hint(slot.texture)); + let index = self.table.index(slot.texture, cs, slot.filter); + let fallback = slot.fallback.unwrap_or_else(|| fallback_texel(input, slot, constant)); + self.sample(index, None, &slot.projection, &slot.transform, slot.wrap, slot.filter, fallback, offset) + } + + fn scalar(&mut self, v: Val, channel: Channel) -> Val { + match channel { + Channel::R => self.swizzle(v, SPLAT_X), + Channel::G => self.swizzle(v, SPLAT_Y), + Channel::B => self.swizzle(v, SPLAT_Z), + Channel::A => self.swizzle(v, SPLAT_W), + Channel::Rgb | Channel::Luminance => self.un(Op::Luminance, v), + } + } + + fn slot_value(&mut self, input: MaterialInput, slot: &TextureSlot, constant: V4) -> Val { + let t = self.slot_texel(input, slot, constant, 0); + if input.is_colour() { + let v = match slot.channel { + Channel::Rgb => t, + ch => self.scalar(t, ch), + }; + let v = if slot.invert { self.un(Op::Invert, v) } else { v }; + return if slot.multiply { self.bin(Op::Mul, v, Val::K(constant)) } else { v }; + } + let v = self.scalar(t, slot.channel); + let v = self.remap(v, slot); + if slot.multiply { + self.bin(Op::Mul, v, Val::K(splat(constant[0]))) + } else { + v + } + } + + fn remap(&mut self, v: Val, slot: &TextureSlot) -> Val { + let v = if slot.invert { self.un(Op::Invert, v) } else { v }; + if slot.range == [0.0, 1.0] { + return v; + } + self.tri(Op::Lerp, Val::K(splat(slot.range[0])), Val::K(splat(slot.range[1])), v) + } + + fn slot_height(&mut self, slot: &TextureSlot, input: MaterialInput, offset: u8) -> Val { + let t = self.slot_texel(input, slot, [0.0, 0.0, 0.0, 1.0], offset); + let v = self.scalar(t, slot.channel); + self.remap(v, slot) + } +} + +fn fallback_texel(input: MaterialInput, slot: &TextureSlot, constant: V4) -> V4 { + match input { + MaterialInput::Normal => return [0.5, 0.5, 1.0, 1.0], + MaterialInput::Bump | MaterialInput::Displacement => return [0.0, 0.0, 0.0, 0.0], + _ => {} + } + if input.is_colour() { + return if slot.multiply { [1.0; 4] } else { constant }; + } + let target = if slot.multiply { 1.0 } else { constant[0] }; + let span = slot.range[1] - slot.range[0]; + let t = if span != 0.0 { (target - slot.range[0]) / span } else { 0.0 }; + let t = if slot.invert { 1.0 - t } else { t }; + splat(t) +} + +fn set_base(m: &mut SurfaceInputs, f: Field, v: V4) { + let c = fsh_core::Rgb::new(v[0], v[1], v[2]); + match f { + Field::BaseWeight => m.base_weight = v[0], + Field::BaseColor => m.base_color = c, + Field::BaseMetalness => m.base_metalness = v[0], + Field::BaseDiffuseRoughness => m.base_diffuse_roughness = v[0], + Field::SpecularWeight => m.specular_weight = v[0], + Field::SpecularColor => m.specular_color = c, + Field::SpecularRoughness => m.specular_roughness = v[0], + Field::SpecularIor => m.specular_ior = v[0], + Field::SpecularAnisotropy => m.specular_anisotropy = v[0], + Field::TransmissionWeight => m.transmission_weight = v[0], + Field::TransmissionColor => m.transmission_color = c, + Field::CoatWeight => m.coat_weight = v[0], + Field::CoatColor => m.coat_color = c, + Field::CoatRoughness => m.coat_roughness = v[0], + Field::CoatIor => m.coat_ior = v[0], + Field::FuzzWeight => m.fuzz_weight = v[0], + Field::FuzzColor => m.fuzz_color = c, + Field::FuzzRoughness => m.fuzz_roughness = v[0], + Field::Emission => m.emission = c, + Field::Opacity => m.opacity = v[0], + Field::Normal | Field::Displacement => {} + } +} + +fn allocate(code: Vec, outputs: &[(Field, u32)], consts: &mut Vec) -> Result<(Vec, Vec, u32)> { + let mut live = vec![false; code.len()]; + let mut needed: std::collections::BTreeSet = outputs.iter().map(|o| o.1).collect(); + for (i, ins) in code.iter().enumerate().rev() { + if !needed.contains(&ins.dst) { + continue; + } + live[i] = true; + let [ra, rb, rc] = reg_operands(ins.op); + for (on, r) in [(ra, ins.a), (rb, ins.b), (rc, ins.c)] { + if on { + needed.insert(r); + } + } + needed.extend(ins.args.iter().copied()); + } + let code: Vec = code.into_iter().zip(live).filter(|(_, l)| *l).map(|(c, _)| c).collect(); + let mut last: BTreeMap = BTreeMap::new(); + for (i, ins) in code.iter().enumerate() { + let [ra, rb, rc] = reg_operands(ins.op); + for (on, r) in [(ra, ins.a), (rb, ins.b), (rc, ins.c)] { + if on { + last.insert(r, i); + } + } + for r in &ins.args { + last.insert(*r, i); + } + } + for (_, r) in outputs { + last.insert(*r, usize::MAX); + } + let mut phys: BTreeMap = BTreeMap::new(); + let mut free: Vec = (0..REGISTERS as u8).rev().collect(); + let mut used = 0u32; + let mut out = Vec::with_capacity(code.len()); + for (i, ins) in code.iter().enumerate() { + let map = |phys: &BTreeMap, r: u32| phys.get(&r).copied().unwrap_or(0) as u32; + let [ra, rb, rc] = reg_operands(ins.op); + let a = if ra { map(&phys, ins.a) } else { ins.a }; + let b = if rb { map(&phys, ins.b) } else { ins.b }; + let c = if rc { map(&phys, ins.c) } else { ins.c }; + let a = if ins.op == Op::Proc { + let mut list = vec![ins.args.len() as f32]; + list.extend(ins.args.iter().map(|r| map(&phys, *r) as f32)); + let at = consts.len() as u32; + consts.extend(list); + at + } else { + a + }; + let mut operands: Vec = Vec::new(); + for (on, r) in [(ra, ins.a), (rb, ins.b), (rc, ins.c)] { + if on { + operands.push(r); + } + } + operands.extend(ins.args.iter().copied()); + operands.sort_unstable(); + operands.dedup(); + for r in operands { + if last.get(&r) == Some(&i) { + if let Some(p) = phys.remove(&r) { + free.push(p); + } + } + } + let dst = free.pop().ok_or_else(|| { + SceneError::value("graph", format!("needs more than {REGISTERS} registers; simplify the graph")) + })?; + used = used.max(dst as u32 + 1); + if last.contains_key(&ins.dst) { + phys.insert(ins.dst, dst); + } else { + free.push(dst); + } + out.push(Instr::new(ins.op, dst, ins.flags, a, b, c)); + } + let outs = outputs.iter().map(|(f, r)| Output { field: *f, reg: phys.get(r).copied().unwrap_or(0) }).collect(); + Ok((out, outs, used)) +} + +/// Compiles a material (constants, slots, graph) to a program; textures are added to `table`. +pub fn compile_material(m: &Material, table: &mut TextureTable) -> Result { + let mut base = base_inputs(&m.params); + if m.slots.is_empty() && m.graph.is_none() { + return Ok(Program::constant(base)); + } + let mut e = Emitter { code: Vec::new(), consts: Vec::new(), next: 0, kregs: BTreeMap::new(), needs: 0, table, memo: BTreeMap::new() }; + let g = m.graph.as_deref(); + let mut results: Vec<(MaterialInput, Val)> = Vec::new(); + for input in MaterialInput::ALL { + if matches!(input, MaterialInput::Normal | MaterialInput::Bump) { + continue; + } + let constant = input.constant(&m.params); + let from_graph = g.and_then(|g| g.outputs.get(&input).map(|r| (g, r))); + let v = if let Some((g, r)) = from_graph { + let (v, ty) = e.node_out(g, r.0, &r.1, 0, 0)?; + let want = if input.is_colour() { SocketType::Colour } else { SocketType::Float }; + e.convert(v, ty, want) + } else if let Some(slot) = m.slots.get(&input) { + if input == MaterialInput::Displacement { + let h = e.slot_height(slot, input, 0); + e.bin(Op::Mul, h, Val::K(splat(slot.strength))) + } else { + e.slot_value(input, slot, constant) + } + } else { + continue; + }; + results.push((input, v)); + } + let normal = match g.and_then(|g| g.outputs.get(&MaterialInput::Normal).map(|r| (g, r))) { + Some((g, r)) => Some(e.node_out(g, r.0, &r.1, 0, 0)?.0), + None => { + let mapped = m.slots.get(&MaterialInput::Normal).map(|slot| { + let t = e.slot_texel(MaterialInput::Normal, slot, [0.5, 0.5, 1.0, 1.0], 0); + e.normal_map(t, Val::K(splat(slot.strength)), slot.flip_y) + }); + match m.slots.get(&MaterialInput::Bump) { + Some(slot) => { + let n = mapped.unwrap_or_else(|| e.input(input::NORMAL, 0, 0)); + let h = [0u8, 1, 2].map(|o| e.slot_height(slot, MaterialInput::Bump, o)); + Some(e.bump(n, h, Val::K(splat(slot.strength)))) + } + None => mapped, + } + } + }; + let mut outputs: Vec<(Field, u32)> = Vec::new(); + for (input, v) in results { + let v = if input == MaterialInput::EmissionColor { + e.bin(Op::Mul, v, Val::K(splat(m.params.emission_luminance * SCENE_UNITS_PER_NIT))) + } else { + v + }; + match v { + Val::K(k) => set_base(&mut base, input.field(), k), + Val::R(r) => outputs.push((input.field(), r)), + } + } + if let Some(Val::R(r)) = normal { + e.needs |= NEED_NORMAL; + outputs.push((Field::Normal, r)); + } + let base = base.sanitized(); + let needs = e.needs; + let mut consts = std::mem::take(&mut e.consts); + let code = std::mem::take(&mut e.code); + if outputs.is_empty() { + return Ok(Program::constant(base)); + } + let (code, outs, registers) = allocate(code, &outputs, &mut consts)?; + let mut textures: Vec = code.iter().filter(|i| matches!(i.op, Op::Tex | Op::TexBox)).map(|i| i.b).collect(); + textures.sort_unstable(); + textures.dedup(); + let p = Program { base, code, consts, outputs: outs, registers, needs, textures }; + p.check().map_err(|err| SceneError::value("material", err.to_string()))?; + Ok(p) +} diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index bf3dd984..8e37eacd 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -3,6 +3,7 @@ mod catalogue; mod command; +mod compile; mod document; mod editor; mod error; @@ -28,6 +29,7 @@ pub use command::{ NodeList, PatchBlock, PatchNode, Rename, Reparent, SetLocked, SetMetadata, SetPartColour, SetPivot, SetRays, SetTransform, SetVisible, TextureAdd, TextureRefArgs, UnitsSetDisplay, }; +pub use compile::{base_inputs, compile_material, TextureTable}; pub use document::{Document, DocumentData, FORMAT_VERSION}; pub use editor::{Editor, Outcome}; pub use error::{Result, SceneError}; @@ -51,7 +53,7 @@ pub use settings::{ }; pub use snapshot::{ flatten, Instance, RenderCamera, RenderCutaway, RenderLight, RenderLightShape, RenderMaterial, RenderSnapshot, - SCENE_UNITS_PER_NIT, + RenderTexture, SCENE_UNITS_PER_NIT, }; pub use tx::UndoRecord; pub use types::{material_type, material_types, metal_colour, types_json, MaterialType, ParamKind, ParamSpec, METALS}; diff --git a/native/crates/fsh-scene/src/snapshot.rs b/native/crates/fsh-scene/src/snapshot.rs index b5f2aad1..611b0e1b 100644 --- a/native/crates/fsh-scene/src/snapshot.rs +++ b/native/crates/fsh-scene/src/snapshot.rs @@ -1,10 +1,12 @@ +use crate::compile::{base_inputs, compile_material, TextureTable}; use crate::document::Document; use crate::material::SurfaceParams; use crate::mesh::Mesh; use crate::node::{CapMode, CutawayShape, Light, LightShape, NodeKind, PowerUnit, RayVisibility}; use crate::settings::{Environment, Ground, ImageStyle, Projection, RenderSettings}; use fsh_core::math::PI; -use fsh_core::{Aabb, MaterialId, MaterialKey, MeshId, MeshKey, NodeId, Rgb, Transform, Vec3}; +use fsh_core::{Aabb, MaterialId, MaterialKey, MeshId, MeshKey, NodeId, Rgb, TextureKey, Transform, Vec3}; +use fsh_materials::{ColourSpace, Program}; use std::collections::BTreeMap; use std::sync::Arc; @@ -41,6 +43,21 @@ pub struct RenderMaterial { pub name: String, /// Surface parameters. pub params: SurfaceParams, + /// Compiled program; constant (`is_constant()`) for materials without slots or a varying graph. + pub program: Arc, +} + +/// An image a program samples; programs name it by its index in `RenderSnapshot::textures`. +#[derive(Clone, Debug, PartialEq)] +pub struct RenderTexture { + /// Document texture it came from (the first, when several share the image). + pub key: TextureKey, + /// File path, or `fshot:textures/...` for an image embedded in the project. + pub path: String, + /// How texel values are interpreted. + pub colour_space: ColourSpace, + /// Some user wants trilinear filtering, so build the mip pyramid. + pub mipmaps: bool, } /// A light's world-space geometry. @@ -140,6 +157,8 @@ pub struct RenderSnapshot { pub materials: Vec, /// Index of the default material (parts without one). pub default_material: MaterialId, + /// Images the programs sample, deduplicated by (path, colour space). + pub textures: Vec, /// Lights that are on. pub lights: Vec, /// Enabled, visible cutaways. @@ -287,12 +306,17 @@ type PartItem = (MeshKey, Option, Transform, u8, Option, NodeI pub fn flatten(doc: &Document) -> Arc { let mut materials: Vec = Vec::with_capacity(doc.materials().len() + 1); let mut material_index: BTreeMap = BTreeMap::new(); + let mut table = TextureTable::new(doc.textures()); for (k, m) in doc.materials() { material_index.insert(*k, MaterialId::from_index(materials.len())); - materials.push(RenderMaterial { key: *k, name: m.name.clone(), params: m.params }); + let program = compile_material(m, &mut table).unwrap_or_else(|_| Program::constant(base_inputs(&m.params))); + materials.push(RenderMaterial { key: *k, name: m.name.clone(), params: m.params, program: Arc::new(program) }); } + let textures = table.list; let default_material = MaterialId::from_index(materials.len()); - materials.push(RenderMaterial { key: MaterialKey::NONE, name: "Default".into(), params: SurfaceParams::default() }); + let params = SurfaceParams::default(); + let program = Arc::new(Program::constant(base_inputs(¶ms))); + materials.push(RenderMaterial { key: MaterialKey::NONE, name: "Default".into(), params, program }); let mut parts: Vec = Vec::new(); let mut lights = Vec::new(); @@ -390,6 +414,7 @@ pub fn flatten(doc: &Document) -> Arc { instances, materials, default_material, + textures, lights, cutaways, environment: doc.environment().clone(), From fa7b9403614fed7cb164ed6eede7b7b5a993d849 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:12:36 -0500 Subject: [PATCH 182/494] feat(scene): add slot, graph and type-preset material commands material.create takes a type and name, material.set_type can reset to the type's preset, and material.set_slot, material.clear_slot and material.set_graph edit slots and graphs with undo; texture.remove and scene.import follow textures into slots and graphs. Old journal arguments still parse. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/command.rs | 212 ++++++++++++++++++++++--- 1 file changed, 194 insertions(+), 18 deletions(-) diff --git a/native/crates/fsh-scene/src/command.rs b/native/crates/fsh-scene/src/command.rs index d15c6de5..ac80ef2a 100644 --- a/native/crates/fsh-scene/src/command.rs +++ b/native/crates/fsh-scene/src/command.rs @@ -1,6 +1,10 @@ +use crate::compile::{compile_material, TextureTable}; use crate::document::Document; use crate::error::{non_negative, Result, SceneError}; -use crate::material::{Material, SurfaceParams, TextureRef}; +use crate::graph::MaterialGraph; +use crate::material::{Material, SurfaceParams, TextureRef, TextureRole}; +use crate::slots::{MapProjection, MaterialInput, TextureSlot}; +use crate::types::material_type; use crate::mesh::Mesh; use crate::node::{Cutaway, Light, Node, NodeKind, RayVisibility, Trs}; use crate::primitives::Primitive; @@ -428,6 +432,58 @@ pub struct MaterialCreate { /// Material. #[serde(default)] pub material: Material, + /// Start from this material type's preset instead of `material` (dropped once resolved). + #[serde(default, rename = "type", skip_serializing_if = "Option::is_none")] + pub type_id: Option, + /// Name for the new material (dropped once resolved). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// `material.set_slot` arguments. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct MaterialSetSlot { + /// Material. + #[serde(alias = "material", with = "ser::key")] + pub key: MaterialKey, + /// Input the slot drives. + pub input: MaterialInput, + /// Partial `TextureSlot` merged onto the current slot (stored in history as the full slot). + #[serde(default)] + pub slot: Value, + /// Image file to add as a new texture in the same step. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + /// Colour-space hint for the new texture. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub colour_space: Option, + /// Key of the new texture; allocated when `path` is given. + #[serde(default, with = "ser::key_opt", skip_serializing_if = "Option::is_none")] + pub texture_key: Option, +} + +/// `material.clear_slot` arguments. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct MaterialClearSlot { + /// Material. + #[serde(alias = "material", with = "ser::key")] + pub key: MaterialKey, + /// Input whose slot goes. + pub input: MaterialInput, +} + +/// `material.set_graph` arguments. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct MaterialSetGraph { + /// Material. + #[serde(alias = "material", with = "ser::key")] + pub key: MaterialKey, + /// The whole graph, or null to remove it. + #[serde(default)] + pub graph: Option>, } /// `material.set_params` arguments. @@ -446,10 +502,17 @@ pub struct MaterialSetParams { #[serde(deny_unknown_fields)] pub struct MaterialSetType { /// Material. - #[serde(with = "ser::key")] + #[serde(alias = "material", with = "ser::key")] pub key: MaterialKey, /// Catalogue type id. + #[serde(alias = "type")] pub type_id: String, + /// Keep parameters and graph (true) or reset them to the type's preset (false). + #[serde(default = "yes")] + pub keep: bool, + /// The material after a reset, filled when resolved. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preset: Option>, } /// `material.assign` arguments. @@ -615,9 +678,12 @@ commands! { Import(Import) = "scene.import", Full, "Add imported meshes, materials, textures and nodes as one step."; MeshAdd(MeshAdd) = "mesh.add", None, "Add a mesh to the shared mesh store."; MeshRemove(MeshRef) = "mesh.remove", None, "Remove a mesh no part uses."; - MaterialCreate(MaterialCreate) = "material.create", None, "Create a material."; + MaterialCreate(MaterialCreate) = "material.create", None, "Create a material, from a material type's preset when type is given."; MaterialSetParams(MaterialSetParams) = "material.set_params", Region, "Change a material's surface parameters; give only the fields to change."; - MaterialSetType(MaterialSetType) = "material.set_type", None, "Change a material's catalogue type id."; + MaterialSetType(MaterialSetType) = "material.set_type", Region, "Change a material's type; keep false resets parameters and graph to the type's preset."; + MaterialSetSlot(MaterialSetSlot) = "material.set_slot", Region, "Drive a material input with an image texture (an existing texture or a new path); give only the slot fields to change."; + MaterialClearSlot(MaterialClearSlot) = "material.clear_slot", Region, "Remove the texture slot of a material input; the constant applies again."; + MaterialSetGraph(MaterialSetGraph) = "material.set_graph", Region, "Replace a material's node graph, or remove it with null."; MaterialAssign(MaterialAssign) = "material.assign", Region, "Assign a material to every part in the given nodes' subtrees."; MaterialRename(MaterialRename) = "material.rename", None, "Rename a material."; MaterialRemove(MaterialRef) = "material.remove", Region, "Remove a material; parts wearing it fall back to the default material."; @@ -720,6 +786,27 @@ fn default_name(name: &str, fallback: &str) -> String { } } +fn material_level(doc: &Document, key: MaterialKey) -> ChangeLevel { + if doc.parts_using_material(key).is_empty() { + ChangeLevel::None + } else { + ChangeLevel::Region + } +} + +fn role_of(input: MaterialInput) -> TextureRole { + match input { + MaterialInput::BaseColor => TextureRole::BaseColour, + MaterialInput::SpecularRoughness => TextureRole::Roughness, + MaterialInput::BaseMetalness => TextureRole::Metalness, + MaterialInput::Normal => TextureRole::Normal, + MaterialInput::Bump => TextureRole::Bump, + MaterialInput::GeometryOpacity => TextureRole::Opacity, + MaterialInput::EmissionColor => TextureRole::Emission, + _ => TextureRole::Other, + } +} + fn check_part_refs(doc: &Document, kind: &NodeKind) -> Result<()> { if let NodeKind::Part { mesh, material } = kind { if !doc.meshes().contains_key(mesh) { @@ -821,6 +908,7 @@ impl Command { Command::SetLight(a) | Command::SetCutaway(a) => k(a.id.raw()), Command::SetPivot(a) => k(a.id.raw()), Command::MaterialSetParams(a) => k(a.key.raw()), + Command::MaterialSetSlot(a) if a.path.is_none() => k(a.key.raw() << 5 | a.input as u64), Command::CameraSet(a) => k(a.index as u64), Command::EnvironmentSet(_) | Command::GroundSet(_) | Command::ImageSetStyle(_) | Command::RenderSetSettings(_) => k(0), _ => None, @@ -842,7 +930,45 @@ impl Command { Arc::make_mut(&mut a.mesh).validate()?; a.key = Some(fresh(doc, a.key)?); } - Command::MaterialCreate(a) => a.key = Some(fresh(doc, a.key)?), + Command::MaterialCreate(a) => { + if let Some(id) = a.type_id.take() { + let t = material_type(&id).ok_or_else(|| SceneError::value("type", format!("unknown material type \"{id}\"")))?; + a.material = t.material(a.name.as_deref()); + } else if let Some(n) = a.name.as_ref().filter(|n| !n.trim().is_empty()) { + a.material.name = n.clone(); + } + a.name = None; + a.key = Some(fresh(doc, a.key)?); + } + Command::MaterialSetType(a) => { + a.preset = None; + if !a.keep { + let t = material_type(&a.type_id) + .ok_or_else(|| SceneError::value("type", format!("unknown material type \"{}\"", a.type_id)))?; + let cur = doc.material(a.key).ok_or(SceneError::UnknownMaterial(a.key))?; + let mut m = t.material(Some(&cur.name)); + m.textures = cur.textures.clone(); + m.slots = cur.slots.clone(); + a.preset = Some(Box::new(m)); + } + } + Command::MaterialSetSlot(a) => { + let m = doc.material(a.key).ok_or(SceneError::UnknownMaterial(a.key))?; + let mut cur = m.slots.get(&a.input).cloned().unwrap_or_else(|| TextureSlot::for_input(a.input, TextureKey::NONE)); + if a.path.is_some() { + let key = fresh(doc, a.texture_key)?; + a.texture_key = Some(key); + cur.texture = key; + } else { + a.texture_key = None; + } + let texture = cur.texture; + let mut slot: TextureSlot = if a.slot.is_null() { cur } else { patched(&cur, &a.slot)? }; + if a.path.is_some() { + slot.texture = texture; + } + a.slot = full_value(&slot)?; + } Command::TextureAdd(a) => a.key = Some(fresh(doc, a.key)?), Command::Duplicate(a) => { let tops = top_level(doc, &a.ids)?; @@ -1074,9 +1200,7 @@ impl Command { return Err(SceneError::KeyNotFresh(key.raw())); } a.material.validate()?; - if let Some(t) = a.material.textures.iter().find(|t| !tx.doc.textures().contains_key(t)) { - return Err(SceneError::UnknownTexture(*t)); - } + a.material.validate_refs(tx.doc.textures())?; tx.doc.observe(key.raw()); tx.set_material(key, Some(a.material.clone())); Ok(Applied { level: ChangeLevel::None, created: vec![key.raw()] }) @@ -1093,8 +1217,63 @@ impl Command { if a.type_id.trim().is_empty() { return Err(SceneError::value("type_id", "must not be empty")); } - tx.material_mut(a.key)?.type_id = a.type_id.clone(); - Ok(Applied::at(ChangeLevel::None)) + let Some(preset) = &a.preset else { + tx.material_mut(a.key)?.type_id = a.type_id.clone(); + return Ok(Applied::at(ChangeLevel::None)); + }; + preset.validate()?; + preset.validate_refs(tx.doc.textures())?; + *tx.material_mut(a.key)? = (**preset).clone(); + Ok(Applied::at(material_level(tx.doc, a.key))) + } + Command::MaterialSetSlot(a) => { + let slot: TextureSlot = serde_json::from_value(a.slot.clone()).map_err(|e| SceneError::InvalidArguments(e.to_string()))?; + if tx.doc.material(a.key).is_none() { + return Err(SceneError::UnknownMaterial(a.key)); + } + if let Some(path) = &a.path { + let key = a.texture_key.ok_or_else(unresolved)?; + if !key.is_some() || tx.doc.textures().contains_key(&key) { + return Err(SceneError::KeyNotFresh(key.raw())); + } + let uv_set = match slot.projection { + MapProjection::Uv { set } => set, + _ => 0, + }; + let texture = TextureRef { path: path.clone(), role: role_of(a.input), uv_set, colour_space: a.colour_space.clone() }; + texture.validate()?; + tx.doc.observe(key.raw()); + tx.set_texture(key, Some(texture)); + tx.material_mut(a.key)?.textures.push(key); + } + slot.validate(a.input)?; + if !tx.doc.textures().contains_key(&slot.texture) { + return Err(SceneError::UnknownTexture(slot.texture)); + } + tx.material_mut(a.key)?.slots.insert(a.input, slot); + let mut created = Vec::new(); + if a.path.is_some() { + created.extend(a.texture_key.map(|k| k.raw())); + } + Ok(Applied { level: material_level(tx.doc, a.key), created }) + } + Command::MaterialClearSlot(a) => { + let m = tx.material_mut(a.key)?; + if m.slots.remove(&a.input).is_none() { + return Err(SceneError::value("input", format!("{} has no texture slot", a.input.name()))); + } + Ok(Applied::at(material_level(tx.doc, a.key))) + } + Command::MaterialSetGraph(a) => { + let mut m = tx.doc.material(a.key).ok_or(SceneError::UnknownMaterial(a.key))?.clone(); + m.graph = a.graph.clone().map(|mut g| { + g.normalize(); + g + }); + m.validate_refs(tx.doc.textures())?; + compile_material(&m, &mut TextureTable::new(tx.doc.textures()))?; + tx.material_mut(a.key)?.graph = m.graph; + Ok(Applied::at(material_level(tx.doc, a.key))) } Command::MaterialAssign(a) => { if let Some(m) = a.material { @@ -1156,9 +1335,10 @@ impl Command { return Err(SceneError::UnknownTexture(a.key)); } let users: Vec = - tx.doc.materials().iter().filter(|(_, m)| m.textures.contains(&a.key)).map(|(k, _)| *k).collect(); + tx.doc.materials().iter().filter(|(_, m)| m.texture_keys().contains(&a.key)).map(|(k, _)| *k).collect(); + let gone = a.key; for m in users { - tx.material_mut(m)?.textures.retain(|t| *t != a.key); + tx.material_mut(m)?.map_textures(|t| (t != gone).then_some(t)); } tx.set_texture(a.key, None); Ok(Applied::at(ChangeLevel::Region)) @@ -1345,9 +1525,7 @@ fn resolve_import(doc: &mut Document, p: &mut ImportPayload) -> Result<()> { return Err(SceneError::InvalidArguments(format!("material key {} appears twice in the payload", m.key))); } m.key = k; - for t in &mut m.material.textures { - *t = textures.get(t).copied().unwrap_or(*t); - } + m.material.map_textures(|t| Some(textures.get(&t).copied().unwrap_or(t))); } for n in &mut p.nodes { let k: NodeId = doc.alloc_key(); @@ -1407,9 +1585,7 @@ fn apply_import(tx: &mut Tx, a: &Import) -> Result { return Err(SceneError::KeyNotFresh(m.key.raw())); } m.material.validate()?; - if let Some(t) = m.material.textures.iter().find(|t| !tx.doc.textures().contains_key(t)) { - return Err(SceneError::UnknownTexture(*t)); - } + m.material.validate_refs(tx.doc.textures())?; tx.doc.observe(m.key.raw()); tx.set_material(m.key, Some(m.material.clone())); } From a261dcf1b2b5a9d76a90518e31add9cf997412cf Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:13:15 -0500 Subject: [PATCH 183/494] feat(scene): describe material slots and graphs in the catalogue Argument schemas for the new and extended material commands, including texture slots, projections, transforms and graphs; material.set_slot merges like material.set_params. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/catalogue.rs | 124 ++++++++++++++++++++++- 1 file changed, 121 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-scene/src/catalogue.rs b/native/crates/fsh-scene/src/catalogue.rs index 8a3b20d0..83417e94 100644 --- a/native/crates/fsh-scene/src/catalogue.rs +++ b/native/crates/fsh-scene/src/catalogue.rs @@ -1,5 +1,6 @@ use crate::command::{ChangeLevel, TABLE}; use crate::material::{SurfaceParams, TextureRef}; +use crate::slots::MaterialInput; use crate::node::{Light, RayVisibility}; use crate::settings::{Camera, DocumentInfo, Environment, Ground, ImageStyle, RenderSettings}; use serde::Serialize; @@ -26,6 +27,7 @@ const MERGEABLE: &[&str] = &[ "scene.set_cutaway", "scene.set_pivot", "material.set_params", + "material.set_slot", "camera.set", "environment.set", "ground.set", @@ -266,13 +268,96 @@ fn mesh_schema() -> Value { ) } +fn type_ids() -> Vec<&'static str> { + crate::types::material_types().iter().map(|t| t.id).collect() +} + +fn input_names(slottable: bool) -> Vec<&'static str> { + MaterialInput::ALL.iter().filter(|i| !slottable || i.slottable()).map(|i| i.name()).collect() +} + +fn projection_schema() -> Value { + json!({"oneOf": [ + {"type": "object", "properties": {"kind": {"const": "uv"}, "set": {"type": "integer", "minimum": 0, "maximum": 3, "default": 0}}, "required": ["kind"]}, + {"type": "object", "properties": {"kind": {"const": "box"}, "blend": {"type": "number", "minimum": 0, "maximum": 1, "default": 0.5}}, "required": ["kind"]}, + {"type": "object", "properties": {"kind": {"const": "planar"}}, "required": ["kind"]}, + {"type": "object", "properties": {"kind": {"const": "cylindrical"}}, "required": ["kind"]}, + {"type": "object", "properties": {"kind": {"const": "spherical"}}, "required": ["kind"]} + ], "description": "Coordinate source: a uv set, or a projection of the object-space position in metres"}) +} + +fn uv_transform_schema() -> Value { + let pair = |d: &str, v: f32| json!({"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2, "default": [v, v], "description": d}); + obj( + vec![ + ("offset", pair("Added after rotation", 0.0)), + ("scale", pair("Repeats per uv unit, or per metre for projections", 1.0)), + ("rotation", json!({"type": "number", "default": 0.0, "description": "Radians, counter-clockwise"})), + ("space", str_enum(&["object", "world"], "Space projections read positions in")), + ], + &[], + ) +} + +fn colour_space_schema() -> Value { + opt(str_enum(&["srgb", "linear", "acescg", "data"], "Colour space; by default sRGB for colour inputs and data otherwise")) +} + +fn slot_schema() -> Value { + obj( + vec![ + ("texture", key("Document texture")), + ("projection", projection_schema()), + ("transform", uv_transform_schema()), + ("wrap", str_enum(&["repeat", "clamp", "mirror"], "Wrapping outside 0..1")), + ("filter", str_enum(&["nearest", "bilinear", "trilinear"], "Filtering")), + ("colour_space", colour_space_schema()), + ("channel", str_enum(&["rgb", "r", "g", "b", "a", "luminance"], "Channel a number input reads (rgb reads the luminance)")), + ("range", json!({"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2, "default": [0.0, 1.0], "description": "Number inputs: value = range[0] + t * (range[1] - range[0])"})), + ("invert", boolean("t = 1 - t before the range")), + ("multiply", boolean("Multiply by the input's constant value")), + ("strength", json!({"type": "number", "description": "Normal: tangent xy scale; bump: metres of height per unit; displacement: metres per unit"})), + ("flip_y", boolean("Normal map green points down (DirectX)")), + ("fallback", opt(json!({"type": "array", "items": {"type": "number"}, "minItems": 4, "maxItems": 4, "description": "RGBA used when the image is missing; the input's constant when null"}))), + ], + &[], + ) +} + +fn graph_schema() -> Value { + let sock = json!({"type": "array", "prefixItems": [{"type": "integer", "minimum": 1}, {"type": "string"}], "minItems": 2, "maxItems": 2, "description": "[node id, socket name]"}); + let kinds: Vec<&str> = crate::graph::graph_kinds().iter().map(|k| k.id).collect(); + obj( + vec![ + ( + "nodes", + json!({"type": "object", "description": "Nodes by id (decimal string); settings sit beside kind (see material.node_kinds)", + "additionalProperties": {"type": "object", "properties": { + "kind": {"type": "string", "enum": kinds}, + "inputs": {"type": "object", "description": "Values of unlinked inputs: a number or [r, g, b]"}, + "position": {"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2}, + "label": {"type": "string"} + }, "required": ["kind"]}}), + ), + ("links", json!({"type": "array", "items": {"type": "object", "properties": {"from": sock, "to": sock}, "required": ["from", "to"]}})), + ( + "outputs", + json!({"type": "object", "description": "Material input driven by an output socket", "propertyNames": {"enum": input_names(false)}, "additionalProperties": sock}), + ), + ], + &[], + ) +} + fn material_schema() -> Value { obj( vec![ ("name", string("Display name")), - ("type_id", string("Catalogue type: generic, plastic, metal, glass, paint, ...")), + ("type_id", string("Material type id (material.types): generic, plastic, metal, glass, paint, ...")), ("params", describe(block::(), "Surface parameters")), ("textures", keys("Texture keys")), + ("slots", json!({"type": "object", "description": "Texture slots by input", "propertyNames": {"enum": input_names(true)}, "additionalProperties": slot_schema()})), + ("graph", opt(describe(graph_schema(), "Node graph"))), ], &[], ) @@ -385,12 +470,45 @@ fn schema(name: &str) -> Value { ), "mesh.add" => obj(vec![("key", key("Key; allocated when absent")), ("mesh", mesh_schema())], &["mesh"]), "mesh.remove" => obj(vec![("key", key("Mesh"))], &["key"]), - "material.create" => obj(vec![("key", key("Key; allocated when absent")), ("material", material_schema())], &[]), + "material.create" => obj( + vec![ + ("key", key("Key; allocated when absent")), + ("material", material_schema()), + ("type", str_enum(&type_ids(), "Start from this material type's preset (ignores material)")), + ("name", string("Name; the type's name when absent")), + ], + &[], + ), + "material.set_slot" => obj( + vec![ + ("key", key("Material (alias: material)")), + ("input", str_enum(&input_names(true), "Input the texture drives")), + ("slot", describe(slot_schema(), "Only the slot fields to change; a new slot starts from the defaults")), + ("path", string("Image file to add as a new texture in the same step (instead of slot.texture)")), + ("colour_space", string("Colour-space hint for the new texture")), + ], + &["key", "input"], + ), + "material.clear_slot" => obj( + vec![("key", key("Material (alias: material)")), ("input", str_enum(&input_names(true), "Input"))], + &["key", "input"], + ), + "material.set_graph" => obj( + vec![("key", key("Material (alias: material)")), ("graph", opt(describe(graph_schema(), "The whole graph; null removes it")))], + &["key", "graph"], + ), "material.set_params" => obj( vec![("key", key("Material")), ("values", describe(block::(), "Only the parameters to change"))], &["key", "values"], ), - "material.set_type" => obj(vec![("key", key("Material")), ("type_id", string("Catalogue type id"))], &["key", "type_id"]), + "material.set_type" => obj( + vec![ + ("key", key("Material (alias: material)")), + ("type_id", string("Material type id (alias: type); see material.types")), + ("keep", json!({"type": "boolean", "default": true, "description": "Keep parameters and graph; false resets them to the type's preset"})), + ], + &["key", "type_id"], + ), "material.assign" => obj( vec![("ids", keys("Nodes; every part beneath is assigned")), ("material", opt(key("Material; null for default")))], &["ids"], From 195fb8edca2b278c264ebfa0c2d054ee0dfc3874 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:20:22 -0500 Subject: [PATCH 184/494] feat(scene): bake raster preview maps with the program interpreter bake_preview evaluates a material over a uv grid on a flat 1 m square and returns base colour, roughness, metalness and normal maps for the window's raster view; fsh-scene re-exports fsh-materials for its users. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/lib.rs | 3 + native/crates/fsh-scene/src/preview.rs | 93 ++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 native/crates/fsh-scene/src/preview.rs diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index 8e37eacd..37384680 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -12,6 +12,7 @@ mod history; mod material; mod mesh; mod node; +mod preview; pub mod primitives; pub mod ser; mod selection; @@ -45,6 +46,8 @@ pub use mesh::Mesh; pub use node::{ CapMode, Cutaway, CutawayShape, Light, LightColour, LightShape, Node, NodeKind, PowerUnit, RayVisibility, Trs, }; +pub use fsh_materials; +pub use preview::{bake_preview, preview_hit, PreviewMaps, PREVIEW_MAX, PREVIEW_MIN}; pub use primitives::Primitive; pub use selection::{SelectMode, Selection, SelectionLevel}; pub use settings::{ diff --git a/native/crates/fsh-scene/src/preview.rs b/native/crates/fsh-scene/src/preview.rs new file mode 100644 index 00000000..0dfa517c --- /dev/null +++ b/native/crates/fsh-scene/src/preview.rs @@ -0,0 +1,93 @@ +use crate::compile::{compile_material, TextureTable}; +use crate::error::Result; +use crate::material::{Material, TextureRef}; +use crate::snapshot::RenderTexture; +use fsh_core::{TextureKey, Vec2, Vec3}; +use fsh_materials::{HitContext, Program, TextureSampler, MAX_UV_SETS}; +use std::collections::BTreeMap; + +/// Smallest preview map size. +pub const PREVIEW_MIN: u32 = 16; +/// Largest preview map size. +pub const PREVIEW_MAX: u32 = 512; + +/// Small maps baked in uv space for the window's raster material view; RGBA8, row 0 at v = 1. +#[derive(Clone, Debug, PartialEq)] +pub struct PreviewMaps { + /// Width and height in pixels. + pub size: u32, + /// The material has nothing varying; the maps are flat. + pub constant: bool, + /// The compiled program (its `base` holds the constant values). + pub program: Program, + /// Textures the program samples, by index (build the sampler for this list). + pub textures: Vec, + /// Base colour, sRGB encoded, opacity in alpha. + pub base_color: Vec, + /// Specular roughness, linear grey. + pub roughness: Vec, + /// Metalness, linear grey. + pub metalness: Vec, + /// Tangent-space normal, `0.5 + 0.5 n`. + pub normal: Vec, +} + +fn byte(v: f32) -> u8 { + (v.clamp(0.0, 1.0) * 255.0 + 0.5) as u8 +} + +/// The hit used for preview pixel (x, y): a 1 m square in the object XY plane facing +Z, uv from the pixel centre. +pub fn preview_hit(x: u32, y: u32, size: u32) -> HitContext { + let s = size.max(1) as f32; + let u = (x as f32 + 0.5) / s; + let v = 1.0 - (y as f32 + 0.5) / s; + let p = Vec3::new(u - 0.5, v - 0.5, 0.0); + HitContext { + p, + p_object: p, + uv: [Vec2::new(u, v); MAX_UV_SETS], + uv_count: 1, + tangent: Vec3::X, + tangent_sign: 1.0, + footprint: 1.0 / s, + ..HitContext::default() + } +} + +/// Bakes base colour, roughness, metalness and normal maps of a material with the CPU interpreter. +pub fn bake_preview( + m: &Material, + doc_textures: &BTreeMap, + size: u32, + sampler: &dyn TextureSampler, +) -> Result { + let size = size.clamp(PREVIEW_MIN, PREVIEW_MAX); + let mut table = TextureTable::new(doc_textures); + let program = compile_material(m, &mut table)?; + let n = (size * size * 4) as usize; + let (mut base, mut rough, mut metal, mut normal) = (vec![0u8; n], vec![0u8; n], vec![0u8; n], vec![0u8; n]); + for y in 0..size { + for x in 0..size { + let s = program.evaluate(&preview_hit(x, y, size), sampler); + let i = ((y * size + x) * 4) as usize; + let c = s.inputs.base_color.to_srgb8(); + base[i..i + 4].copy_from_slice(&[c[0], c[1], c[2], byte(s.inputs.opacity)]); + let r = byte(s.inputs.specular_roughness); + rough[i..i + 4].copy_from_slice(&[r, r, r, 255]); + let mt = byte(s.inputs.base_metalness); + metal[i..i + 4].copy_from_slice(&[mt, mt, mt, 255]); + let nn = s.normal; + normal[i..i + 4].copy_from_slice(&[byte(0.5 + 0.5 * nn.x), byte(0.5 + 0.5 * nn.y), byte(0.5 + 0.5 * nn.z), 255]); + } + } + Ok(PreviewMaps { + size, + constant: program.is_constant(), + program, + textures: table.list, + base_color: base, + roughness: rough, + metalness: metal, + normal, + }) +} From e6d258a162528e9872a0c498a71acbe6309010e5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:20:22 -0500 Subject: [PATCH 185/494] feat(commands): add material types, node kinds, program and preview commands The materials group answers material.types, material.node_kinds, material.program and material.preview_maps with argument schemas; document-changing material commands stay in the scene catalogue. Ran cargo clippy -p fsh-commands. --- .../crates/fsh-commands/src/ext/materials.rs | 153 +++++++++++++++++- 1 file changed, 148 insertions(+), 5 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/materials.rs b/native/crates/fsh-commands/src/ext/materials.rs index 6201a786..73d33999 100644 --- a/native/crates/fsh-commands/src/ext/materials.rs +++ b/native/crates/fsh-commands/src/ext/materials.rs @@ -2,11 +2,154 @@ use super::ExtCommand; use crate::engine::{Engine, State}; -use crate::error::Result; -use serde_json::Value; +use crate::error::{EngineError, Result}; +use crate::util::{base64, get_u32, key_of}; +use fsh_core::MaterialKey; +use fsh_scene::fsh_materials::{NoTextures, Program}; +use fsh_scene::{ + bake_preview, compile_material, graph_kinds_json, types_json, ChangeLevel, Material, MaterialInput, RenderTexture, + TextureTable, PREVIEW_MAX, PREVIEW_MIN, +}; +use serde_json::{json, Value}; -pub(super) static COMMANDS: &[ExtCommand] = &[]; +fn no_args() -> Value { + json!({"type": "object", "properties": {}, "additionalProperties": false}) +} + +fn material_arg() -> Value { + json!({"type": "object", "properties": { + "key": {"type": "integer", "minimum": 1, "description": "Material (alias: material)"}, + "material": {"type": "integer", "minimum": 1, "description": "Same as key"} + }, "additionalProperties": false}) +} + +fn preview_args() -> Value { + let mut s = material_arg(); + s["properties"]["size"] = json!({"type": "integer", "minimum": PREVIEW_MIN, "maximum": PREVIEW_MAX, "default": 128, "description": "Map width and height in pixels"}); + s +} + +pub(super) static COMMANDS: &[ExtCommand] = &[ + ExtCommand { + name: "material.types", + description: "The material types (id, name, category, default parameters, the parameters each page shows with ranges and units, preset graph) and the measured metal colours.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: no_args, + }, + ExtCommand { + name: "material.node_kinds", + description: "Material graph node kinds with their input and output sockets, defaults and settings, and the material inputs slots and graph outputs may drive.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: no_args, + }, + ExtCommand { + name: "material.program", + description: "A material's compiled program: whether it is constant, the instructions, constants, outputs, textures it samples and its encoded size.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: material_arg, + }, + ExtCommand { + name: "material.preview_maps", + description: "Small base colour, roughness, metalness and normal maps of a material baked in uv space by the CPU interpreter (base64 PNG), for the window's raster material view.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: preview_args, + }, +]; + +fn material<'a>(st: &'a State, args: &Value) -> Result<(MaterialKey, &'a Material)> { + let raw = args + .get("key") + .or_else(|| args.get("material")) + .and_then(key_of) + .ok_or_else(|| EngineError::args("needs key (a material key)"))?; + let key = MaterialKey(raw); + let m = st.editor.document().material(key).ok_or_else(|| EngineError::args(format!("no material with key {raw}")))?; + Ok((key, m)) +} + +fn textures_json(list: &[RenderTexture]) -> Value { + Value::Array( + list.iter() + .enumerate() + .map(|(i, t)| json!({"index": i, "key": t.key.raw(), "path": t.path, "colour_space": t.colour_space, "mipmaps": t.mipmaps})) + .collect(), + ) +} + +fn program_json(p: &Program) -> Value { + let rgb = |c: fsh_core::Rgb| json!([c.r, c.g, c.b]); + let b = &p.base; + json!({ + "constant": p.is_constant(), + "instructions": p.code.len(), + "registers": p.registers, + "needs": p.needs, + "constants": p.consts, + "outputs": p.outputs.iter().map(|o| json!({"field": o.field.name(), "register": o.reg})).collect::>(), + "encoded_words": if p.is_constant() { 0 } else { p.encode().len() }, + "disassembly": p.disassemble(), + "base": { + "base_weight": b.base_weight, "base_color": rgb(b.base_color), "base_metalness": b.base_metalness, + "base_diffuse_roughness": b.base_diffuse_roughness, "specular_weight": b.specular_weight, + "specular_color": rgb(b.specular_color), "specular_roughness": b.specular_roughness, "specular_ior": b.specular_ior, + "specular_anisotropy": b.specular_anisotropy, "transmission_weight": b.transmission_weight, + "transmission_color": rgb(b.transmission_color), "coat_weight": b.coat_weight, "coat_color": rgb(b.coat_color), + "coat_roughness": b.coat_roughness, "coat_ior": b.coat_ior, "fuzz_weight": b.fuzz_weight, + "fuzz_color": rgb(b.fuzz_color), "fuzz_roughness": b.fuzz_roughness, "emission": rgb(b.emission), + "opacity": b.opacity, "thin_walled": b.thin_walled, + }, + }) +} + +fn png(size: u32, rgba: &[u8]) -> Result { + Ok(base64(&fsh_io::write_png_rgba8(size, size, rgba)?)) +} + +fn preview(st: &State, args: &Value) -> Result { + let (key, m) = material(st, args)?; + let size = get_u32(args, "size")?.unwrap_or(128).clamp(PREVIEW_MIN, PREVIEW_MAX); + let maps = bake_preview(m, st.editor.document().textures(), size, &NoTextures)?; + let b = &maps.program.base; + let lin = b.base_color.to_linear_srgb(); + Ok(json!({ + "key": key.raw(), + "size": maps.size, + "constant": maps.constant, + "values": {"base_color": lin, "roughness": b.specular_roughness, "metalness": b.base_metalness, "opacity": b.opacity}, + "maps": { + "base_color": png(maps.size, &maps.base_color)?, + "roughness": png(maps.size, &maps.roughness)?, + "metalness": png(maps.size, &maps.metalness)?, + "normal": png(maps.size, &maps.normal)?, + }, + "textures": textures_json(&maps.textures), + })) +} -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { - None +pub(super) fn dispatch(_engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { + Some(match name { + "material.types" => Ok(types_json()), + "material.node_kinds" => Ok(json!({ + "kinds": graph_kinds_json(), + "inputs": MaterialInput::ALL.iter().map(|i| json!({"name": i.name(), "colour": i.is_colour(), "slot": i.slottable(), "graph": *i != MaterialInput::Bump})).collect::>(), + })), + "material.program" => material(st, args).and_then(|(key, m)| { + let mut table = TextureTable::new(st.editor.document().textures()); + let p = compile_material(m, &mut table)?; + let mut v = program_json(&p); + v["key"] = json!(key.raw()); + v["textures"] = textures_json(&table.list); + Ok(v) + }), + "material.preview_maps" => preview(st, args), + _ => return None, + }) } From f34c3ea53d5cebf5bfa579734c984ea0cafcccd0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:22:01 -0500 Subject: [PATCH 186/494] fix(scene): leave empty slots and graph out of material JSON Old documents now encode to the same bytes as before, so crash-journal fingerprints of older sessions still match; MATERIAL_FIELDS lists every field for readers that sort known from unknown fields. Ran cargo clippy -p fsh-scene. --- native/crates/fsh-scene/src/lib.rs | 2 +- native/crates/fsh-scene/src/material.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index 37384680..8ecbfb5f 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -40,7 +40,7 @@ pub use graph::{ VoronoiMetric, WaveKind, WaveProfile, MAX_GRAPH_NODES, MAX_RAMP_STOPS, }; pub use history::History; -pub use material::{Material, SurfaceParams, TextureRef, TextureRole}; +pub use material::{Material, SurfaceParams, TextureRef, TextureRole, MATERIAL_FIELDS}; pub use slots::{validate_projection, Channel, CoordSpace, MapProjection, MaterialInput, TextureSlot, UvTransform}; pub use mesh::Mesh; pub use node::{ diff --git a/native/crates/fsh-scene/src/material.rs b/native/crates/fsh-scene/src/material.rs index 8b588511..c93bfaac 100644 --- a/native/crates/fsh-scene/src/material.rs +++ b/native/crates/fsh-scene/src/material.rs @@ -240,12 +240,18 @@ pub struct Material { /// Textures this material uses. #[serde(with = "ser::key_vec")] pub textures: Vec, - /// Image textures driving inputs, by input. + /// Image textures driving inputs, by input (left out of the JSON when empty). + #[serde(skip_serializing_if = "BTreeMap::is_empty")] pub slots: BTreeMap, - /// Node graph whose outputs drive inputs (over slots and constants). + /// Node graph whose outputs drive inputs over slots and constants (left out of the JSON when absent). + #[serde(skip_serializing_if = "Option::is_none")] pub graph: Option>, } +/// Every field a material's JSON may hold, including those left out when empty (for readers that keep unknown +/// fields apart). +pub const MATERIAL_FIELDS: [&str; 6] = ["name", "type_id", "params", "textures", "slots", "graph"]; + impl Default for Material { fn default() -> Self { Self { From f82350c007088699c96db5410a022f1ae3b7ede0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:36:19 -0500 Subject: [PATCH 187/494] fix(scene): read graph node ids from string keys in commands Command arguments pass through serde's buffered content, which does not turn "1" into a number, so material.create with a type that has a graph failed; graph nodes now serialise their ids as decimal strings and parse them back. Ran the mat-core check program (material.create for all 18 types). --- native/crates/fsh-scene/src/graph.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/native/crates/fsh-scene/src/graph.rs b/native/crates/fsh-scene/src/graph.rs index 9045cc39..3f48203f 100644 --- a/native/crates/fsh-scene/src/graph.rs +++ b/native/crates/fsh-scene/src/graph.rs @@ -701,6 +701,26 @@ impl GraphNode { } } +mod node_map { + use super::GraphNode; + use serde::{Deserialize, Deserializer, Serializer}; + use std::collections::BTreeMap; + + pub fn serialize(m: &BTreeMap, s: S) -> Result { + s.collect_map(m.iter().map(|(k, v)| (k.to_string(), v))) + } + + pub fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result, D::Error> { + let raw = BTreeMap::::deserialize(d)?; + let mut out = BTreeMap::new(); + for (k, v) in raw { + let id = k.trim().parse::().map_err(|_| serde::de::Error::custom(format!("node id \"{k}\" is not a number")))?; + out.insert(id, v); + } + Ok(out) + } +} + /// A node socket: `[node, "socket"]`. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct SocketRef(pub u32, pub String); @@ -726,6 +746,7 @@ pub struct Link { #[serde(default)] pub struct MaterialGraph { /// Nodes by id. + #[serde(with = "node_map")] pub nodes: BTreeMap, /// Links, sorted by (to, from). pub links: Vec, From 282f260cd0ff6b9931fc6ab8323cee069897ede4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:36:19 -0500 Subject: [PATCH 188/494] fix(scene): default slot channel to rgb A colour slot now reads all three channels by default and a number slot reads the luminance, which equals the value on grey maps; r, g, b and a stay available for packed maps. Ran the mat-core check program. --- native/crates/fsh-scene/src/slots.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-scene/src/slots.rs b/native/crates/fsh-scene/src/slots.rs index 98effd78..90ffb08a 100644 --- a/native/crates/fsh-scene/src/slots.rs +++ b/native/crates/fsh-scene/src/slots.rs @@ -301,10 +301,10 @@ impl UvTransform { #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum Channel { - /// All three colour channels (colour inputs). + /// All three colour channels; number inputs read their ACEScg luminance (equal to the value on grey maps). + #[default] Rgb, /// Red. - #[default] R, /// Green. G, @@ -358,7 +358,7 @@ impl Default for TextureSlot { wrap: Wrap::Repeat, filter: Filter::Trilinear, colour_space: None, - channel: Channel::R, + channel: Channel::Rgb, range: [0.0, 1.0], invert: false, multiply: false, From 206fdd10c5823ec080d88b3b7568ea3b48c5aa23 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:44:42 -0500 Subject: [PATCH 189/494] fix(materials): read uv set 0 when a mesh lacks the requested set A slot or graph asking for a uv set the hit does not carry now reads set 0 instead of zero coordinates, so a missing second uv set still shows the texture. Ran cargo clippy with -D warnings on fsh-materials, fsh-scene and fsh-commands and the mat-core check program (0 failures). --- native/crates/fsh-materials/src/interp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/native/crates/fsh-materials/src/interp.rs b/native/crates/fsh-materials/src/interp.rs index 97e69edc..7016ac78 100644 --- a/native/crates/fsh-materials/src/interp.rs +++ b/native/crates/fsh-materials/src/interp.rs @@ -223,6 +223,7 @@ fn read_input(ctx: &HitContext, which: u8, offset: u8, set: u32) -> V4 { input::GEOMETRIC_NORMAL => v4(ctx.ng, 0.0), input::NORMAL_OBJECT => v4(ctx.n_object, 0.0), input::UV => { + let set = if set >= ctx.uv_count { 0 } else { set }; let uv = ctx.uv.get(set as usize).copied().unwrap_or(Vec2::ZERO); [uv.x + su, uv.y + sv, uv_footprint(ctx), 0.0] } From cd0ebd893010184207b0250fd42a89585c3e2986 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:44:57 -0500 Subject: [PATCH 190/494] feat(materials): add the shared sRGB 8-bit decode table srgb8_table gives the exact decode of every byte so the CPU sampler and the GPU upload filter identical linear values. Ran cargo clippy -p fsh-materials with -D warnings. --- native/crates/fsh-materials/src/lib.rs | 2 +- native/crates/fsh-materials/src/texture.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-materials/src/lib.rs b/native/crates/fsh-materials/src/lib.rs index a9679c14..035e4f5c 100644 --- a/native/crates/fsh-materials/src/lib.rs +++ b/native/crates/fsh-materials/src/lib.rs @@ -15,6 +15,6 @@ pub use bsdf::{Bsdf, BsdfSample, LobeFlags, ShadingFrame}; pub use inputs::SurfaceInputs; pub use interp::{fold, HitContext, Shaded}; pub use procedural::{procedural, ProcKind, ProcOutput}; -pub use texture::{ColourSpace, NoTextures, TextureImage, TextureLevel, TextureSampler, TextureSet, Texels}; +pub use texture::{srgb8_table, ColourSpace, NoTextures, TextureImage, TextureLevel, TextureSampler, TextureSet, Texels}; pub use program::{DecodeError, Field, Filter, Instr, Op, Output, Program, Wrap, MAX_UV_SETS, REGISTERS}; pub use tables::{energy_tables, warm_up, EnergyTables}; diff --git a/native/crates/fsh-materials/src/texture.rs b/native/crates/fsh-materials/src/texture.rs index 39245915..de14e709 100644 --- a/native/crates/fsh-materials/src/texture.rs +++ b/native/crates/fsh-materials/src/texture.rs @@ -35,6 +35,12 @@ impl ColourSpace { } } +/// The exact sRGB decode of every 8-bit code (`srgb_decode(i / 255)`); both engines decode through this table. +pub fn srgb8_table() -> &'static [f32; 256] { + static TABLE: std::sync::OnceLock<[f32; 256]> = std::sync::OnceLock::new(); + TABLE.get_or_init(|| core::array::from_fn(|i| fsh_core::srgb_decode(i as f32 / 255.0))) +} + /// Texel storage of one mip level, row-major, row 0 at v = 1 (the top of the image). #[derive(Clone, Debug, PartialEq)] pub enum Texels { From 9e938c719b3c97516c5c36b9aed9ca254fac2b17 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:45:08 -0500 Subject: [PATCH 191/494] feat(materials): define the colour-space conversion after filtering ColourSpace::to_shading turns a filtered texel into ACEScg for srgb and linear images and leaves acescg and data values alone, the one rule both texture samplers follow. Ran cargo clippy with -D warnings on fsh-materials, fsh-scene and fsh-commands. --- native/crates/fsh-materials/src/texture.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/native/crates/fsh-materials/src/texture.rs b/native/crates/fsh-materials/src/texture.rs index de14e709..e7e978a4 100644 --- a/native/crates/fsh-materials/src/texture.rs +++ b/native/crates/fsh-materials/src/texture.rs @@ -23,6 +23,18 @@ impl ColourSpace { self as u32 } + /// Converts a filtered, already decoded RGBA value to shading space: sRGB primaries to ACEScg for `srgb` and + /// `linear`, unchanged for `acescg` and `data`; alpha is never changed. + pub fn to_shading(self, v: [f32; 4]) -> [f32; 4] { + match self { + ColourSpace::Srgb | ColourSpace::Linear => { + let c = fsh_core::Rgb::from_linear_srgb([v[0], v[1], v[2]]); + [c.r, c.g, c.b, v[3]] + } + ColourSpace::Acescg | ColourSpace::Data => v, + } + } + /// Parses "srgb", "linear", "acescg" or "data" (also "raw" and "non_color" for data). pub fn parse(s: &str) -> Option { match s.trim().to_ascii_lowercase().as_str() { From 856fd0a748d47395b4c8bae58dce2fa3cfc01df6 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:48:12 -0500 Subject: [PATCH 192/494] fix(format): keep material slots and graphs when a project loads The reader learned a material's known fields from the default material, which leaves empty slots and graphs out of its JSON, so saved slots and graphs reloaded as unknown fields. It now uses the scene's list of material fields. Ran cargo clippy on the workspace with -D warnings. --- native/crates/fsh-format/src/project.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/crates/fsh-format/src/project.rs b/native/crates/fsh-format/src/project.rs index d871ad20..96a7b0f8 100644 --- a/native/crates/fsh-format/src/project.rs +++ b/native/crates/fsh-format/src/project.rs @@ -548,7 +548,7 @@ pub(crate) fn decode(bytes: &[u8], strict: bool) -> Result<(Project, LoadReport) scene_known_obj.insert("format_version".into(), Value::from(fsh_scene::FORMAT_VERSION)); let mut data: DocumentData = serde_json::from_value(Value::Object(scene_known_obj)) .map_err(|e| FormatError::member(SCENE_MEMBER, format!("does not match the document layout ({e})")))?; - let mat_known = keys_of(&Material::default()); + let mat_known: BTreeSet = fsh_scene::MATERIAL_FIELDS.iter().map(|f| f.to_string()).collect(); for (k, v) in materials_v { let name = material_member(MaterialKey(k)); let mut known_obj = Map::new(); From bcd11a6b371d39a0460f094197b0393a9099cb47 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:50:58 -0500 Subject: [PATCH 193/494] feat(frontend): reserve the label section and the node graph editor The material page mounts the label section and opens the graph editor through these two entry points, so the page and both parts can be written side by side. Ran npx tsc --noEmit. --- frontend/src/ui/graph/index.ts | 3 +++ frontend/src/ui/labels/index.ts | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 frontend/src/ui/graph/index.ts create mode 100644 frontend/src/ui/labels/index.ts diff --git a/frontend/src/ui/graph/index.ts b/frontend/src/ui/graph/index.ts new file mode 100644 index 00000000..2bc85318 --- /dev/null +++ b/frontend/src/ui/graph/index.ts @@ -0,0 +1,3 @@ +import type { Workspace } from '../context'; + +export function openGraphEditor(_ws: Workspace, _material: string): void {} diff --git a/frontend/src/ui/labels/index.ts b/frontend/src/ui/labels/index.ts new file mode 100644 index 00000000..70dfd03b --- /dev/null +++ b/frontend/src/ui/labels/index.ts @@ -0,0 +1,9 @@ +import type { Workspace } from '../context'; + +export interface LabelsSection { + show(material: string | null): void; +} + +export function mountLabels(_host: HTMLElement, _ws: Workspace): LabelsSection { + return { show: () => undefined }; +} From f8124bc8fe1155edd4239d98e8b0ec383ad79771 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:50:58 -0500 Subject: [PATCH 194/494] feat(backend): reserve a router for material texture uploads The window cannot hand the engine a local image path in the browser build, so texture uploads get their own router next to the import uploads. Ran the service import. --- backend/app/main.py | 3 ++- backend/app/routers/textures.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 backend/app/routers/textures.py diff --git a/backend/app/main.py b/backend/app/main.py index ccf38b61..1b1427c7 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -14,7 +14,7 @@ from app.agent import router as agent_router from app.engine import EngineError, EngineUnavailable, engine from app.local_guard import LocalGuard -from app.routers import cad, handoff, imports, library, mcp +from app.routers import cad, handoff, imports, library, mcp, textures mimetypes.add_type("text/javascript", ".js") mimetypes.add_type("text/javascript", ".mjs") @@ -49,6 +49,7 @@ async def lifespan(app): app.include_router(cad.router) app.include_router(handoff.router) app.include_router(library.router) +app.include_router(textures.router) @app.middleware("http") diff --git a/backend/app/routers/textures.py b/backend/app/routers/textures.py new file mode 100644 index 00000000..d1f926ed --- /dev/null +++ b/backend/app/routers/textures.py @@ -0,0 +1,5 @@ +"""Texture images a material uses: uploads from the window, kept beside the project (0.6.0).""" + +from fastapi import APIRouter + +router = APIRouter() From 8e4534b0e97ef633483818416db860a2a1bfd2f9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 13:50:58 -0500 Subject: [PATCH 195/494] feat(gpu): reserve the procedural texture shader module The material program interpreter calls procedural() for procedural nodes; this neutral body lets the interpreter and the procedural maths be written side by side. Not run: nothing includes it yet. --- native/crates/fsh-render-gpu/src/shaders/procedural.wgsl | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 native/crates/fsh-render-gpu/src/shaders/procedural.wgsl diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl new file mode 100644 index 00000000..0c5ba913 --- /dev/null +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -0,0 +1,3 @@ +fn procedural(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { + return vec4(0.5, 0.5, 0.5, 1.0); +} From 9c58a046897e72e88eb891827ae309f39b705ef4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:00:28 -0500 Subject: [PATCH 196/494] feat(graph): add the material graph model and node kind catalogue Parses material.node_kinds and the engine's graph JSON into a local model with stable serialisation, socket type conversion rules, cycle checks and node defaults. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/model.ts | 237 +++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 frontend/src/ui/graph/model.ts diff --git a/frontend/src/ui/graph/model.ts b/frontend/src/ui/graph/model.ts new file mode 100644 index 00000000..b0bb7c85 --- /dev/null +++ b/frontend/src/ui/graph/model.ts @@ -0,0 +1,237 @@ +export type SocketType = 'float' | 'colour' | 'vector' | 'normal'; +export type Rgb = [number, number, number]; +export type SocketValue = number | Rgb; +export type SocketRef = [number, string]; + +export interface SocketSpec { name: string; ty: SocketType; default: Rgb } +export interface SettingSpec { name: string; kind: string; values: string[] } +export interface KindSpec { + id: string; + label: string; + inputs: SocketSpec[]; + outputs: SocketSpec[]; + settings: SettingSpec[]; + procedural: boolean; +} +export interface MaterialInputSpec { name: string; colour: boolean; graph: boolean } + +export interface Catalogue { + kinds: KindSpec[]; + byId: Map; + inputs: MaterialInputSpec[]; +} + +export interface GNode { + id: number; + kind: string; + settings: Record; + inputs: Record; + position: [number, number]; + label: string; +} + +export interface GLink { from: SocketRef; to: SocketRef } + +export interface Graph { + nodes: Map; + links: GLink[]; + outputs: Map; +} + +export const OUTPUT_NODE = 0; +export const MAX_NODES = 256; +export const MAX_STOPS = 16; + +const TYPES: readonly SocketType[] = ['float', 'colour', 'vector', 'normal']; +const RESERVED = new Set(['kind', 'inputs', 'position', 'label']); + +const obj = (v: unknown): Record | null => (v && typeof v === 'object' && !Array.isArray(v) ? v as Record : null); +const num = (v: unknown, d = 0): number => (typeof v === 'number' && Number.isFinite(v) ? v : d); + +function rgbOf(v: unknown, d: Rgb = [0, 0, 0]): Rgb { + return Array.isArray(v) && v.length >= 3 ? [num(v[0], d[0]), num(v[1], d[1]), num(v[2], d[2])] : [...d]; +} + +function socketSpec(v: unknown): SocketSpec | null { + const o = obj(v); + if (!o || typeof o.name !== 'string') return null; + const ty = TYPES.includes(o.ty as SocketType) ? o.ty as SocketType : 'float'; + return { name: o.name, ty, default: rgbOf(o.default) }; +} + +export function parseCatalogue(raw: unknown): Catalogue { + const o = obj(raw) ?? {}; + const kinds: KindSpec[] = []; + for (const k of Array.isArray(o.kinds) ? o.kinds : []) { + const ko = obj(k); + if (!ko || typeof ko.id !== 'string') continue; + const list = (v: unknown): SocketSpec[] => (Array.isArray(v) ? v.map(socketSpec).filter((s): s is SocketSpec => s !== null) : []); + const settings: SettingSpec[] = []; + for (const s of Array.isArray(ko.settings) ? ko.settings : []) { + const so = obj(s); + if (!so || typeof so.name !== 'string') continue; + settings.push({ name: so.name, kind: typeof so.kind === 'string' ? so.kind : 'enum', values: Array.isArray(so.values) ? so.values.map(String) : [] }); + } + kinds.push({ id: ko.id, label: typeof ko.label === 'string' ? ko.label : ko.id, inputs: list(ko.inputs), outputs: list(ko.outputs), settings, procedural: ko.procedural === true }); + } + const inputs: MaterialInputSpec[] = []; + for (const i of Array.isArray(o.inputs) ? o.inputs : []) { + const io = obj(i); + if (io && typeof io.name === 'string') inputs.push({ name: io.name, colour: io.colour === true, graph: io.graph !== false }); + } + return { kinds, byId: new Map(kinds.map((k) => [k.id, k])), inputs }; +} + +export function emptyGraph(): Graph { + return { nodes: new Map(), links: [], outputs: new Map() }; +} + +function refOf(v: unknown): SocketRef | null { + return Array.isArray(v) && v.length === 2 && typeof v[1] === 'string' && Number.isFinite(Number(v[0])) ? [Number(v[0]), v[1]] : null; +} + +export function parseGraph(raw: unknown): Graph { + const g = emptyGraph(); + const o = obj(raw); + if (!o) return g; + for (const [key, value] of Object.entries(obj(o.nodes) ?? {})) { + const n = obj(value); + const id = Number(key); + if (!n || !Number.isInteger(id) || id <= 0 || typeof n.kind !== 'string') continue; + const settings: Record = {}; + for (const [k, v] of Object.entries(n)) if (!RESERVED.has(k)) settings[k] = v; + const inputs: Record = {}; + for (const [k, v] of Object.entries(obj(n.inputs) ?? {})) { + if (typeof v === 'number') inputs[k] = v; + else if (Array.isArray(v)) inputs[k] = rgbOf(v); + } + const p = Array.isArray(n.position) ? n.position : []; + g.nodes.set(id, { id, kind: n.kind, settings, inputs, position: [num(p[0]), num(p[1])], label: typeof n.label === 'string' ? n.label : '' }); + } + for (const l of Array.isArray(o.links) ? o.links : []) { + const lo = obj(l); + const from = refOf(lo?.from), to = refOf(lo?.to); + if (from && to) g.links.push({ from, to }); + } + for (const [k, v] of Object.entries(obj(o.outputs) ?? {})) { + const r = refOf(v); + if (r) g.outputs.set(k, r); + } + return g; +} + +export function nodeJson(n: GNode): Record { + return { ...n.settings, kind: n.kind, inputs: { ...n.inputs }, position: [Math.round(n.position[0]), Math.round(n.position[1])], label: n.label }; +} + +export function graphJson(g: Graph): Record { + const nodes: Record = {}; + for (const id of [...g.nodes.keys()].sort((a, b) => a - b)) nodes[String(id)] = nodeJson(g.nodes.get(id) as GNode); + const links = [...g.links].sort((a, b) => cmpRef(a.to, b.to) || cmpRef(a.from, b.from)).map((l) => ({ from: [...l.from], to: [...l.to] })); + const outputs: Record = {}; + for (const k of [...g.outputs.keys()].sort()) outputs[k] = [...(g.outputs.get(k) as SocketRef)]; + return { nodes, links, outputs }; +} + +function cmpRef(a: SocketRef, b: SocketRef): number { + return a[0] - b[0] || (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0); +} + +export function stable(v: unknown): string { + if (Array.isArray(v)) return '[' + v.map(stable).join(',') + ']'; + const o = obj(v); + if (o) return '{' + Object.keys(o).sort().map((k) => JSON.stringify(k) + ':' + stable(o[k])).join(',') + '}'; + if (typeof v === 'number') return String(Math.fround(v)); + return JSON.stringify(v ?? null); +} + +export const nodeSig = (n: GNode): string => stable(nodeJson(n)); +export const graphSig = (g: Graph): string => stable(graphJson(g)); + +export function cloneGraph(g: Graph): Graph { + return parseGraph(JSON.parse(JSON.stringify(graphJson(g)))); +} + +export function cloneNode(n: GNode, id = n.id): GNode { + return { id, kind: n.kind, settings: JSON.parse(JSON.stringify(n.settings)) as Record, inputs: JSON.parse(JSON.stringify(n.inputs)) as Record, position: [n.position[0], n.position[1]], label: n.label }; +} + +export const linkKey = (l: GLink): string => `${l.from[0]}:${l.from[1]}>${l.to[0]}:${l.to[1]}`; +export const outputKey = (input: string, r: SocketRef): string => `${r[0]}:${r[1]}>out:${input}`; + +export function nextId(g: Graph): number { + let max = 0; + for (const id of g.nodes.keys()) max = Math.max(max, id); + return max + 1; +} + +export function converts(from: SocketType, to: SocketType): boolean { + if (from === to) return true; + if ((from === 'normal' && to === 'vector') || (from === 'vector' && to === 'normal')) return true; + return from !== 'normal' && to !== 'normal'; +} + +export function outputType(cat: Catalogue, n: GNode, socket: string): SocketType | null { + if (n.kind === 'constant' && socket === 'value') return Array.isArray(n.settings.value) ? 'colour' : 'float'; + return cat.byId.get(n.kind)?.outputs.find((s) => s.name === socket)?.ty ?? null; +} + +export function inputSpec(cat: Catalogue, n: GNode, socket: string): SocketSpec | null { + return cat.byId.get(n.kind)?.inputs.find((s) => s.name === socket) ?? null; +} + +export function materialInputType(cat: Catalogue, input: string): SocketType { + if (input === 'normal') return 'normal'; + return cat.inputs.find((i) => i.name === input)?.colour ? 'colour' : 'float'; +} + +export function linkInto(g: Graph, node: number, socket: string): GLink | undefined { + return g.links.find((l) => l.to[0] === node && l.to[1] === socket); +} + +export function reaches(g: Graph, from: number, target: number): boolean { + const seen = new Set(); + const stack = [from]; + while (stack.length) { + const id = stack.pop() as number; + if (id === target) return true; + if (seen.has(id)) continue; + seen.add(id); + for (const l of g.links) if (l.from[0] === id) stack.push(l.to[0]); + } + return false; +} + +export function defaultSetting(s: SettingSpec): unknown { + switch (s.kind) { + case 'enum': return s.values[0] ?? ''; + case 'u32': return 0; + case 'bool': return false; + case 'texture': return null; + case 'projection': return { kind: 'uv', set: 0 }; + case 'transform': return { offset: [0, 0], scale: [1, 1], rotation: 0, space: 'object' }; + case 'colour_space': return null; + case 'rgba': return [0.5, 0.5, 0.5, 1]; + case 'stops': return [{ position: 0, colour: [0, 0, 0, 1] }, { position: 1, colour: [1, 1, 1, 1] }]; + case 'value': return 0; + default: return null; + } +} + +export function newNode(spec: KindSpec, id: number, position: [number, number]): GNode { + const settings: Record = {}; + for (const s of spec.settings) settings[s.name] = defaultSetting(s); + return { id, kind: spec.id, settings, inputs: {}, position, label: '' }; +} + +export function inputValue(spec: SocketSpec, n: GNode): SocketValue { + const v = n.inputs[spec.name]; + if (v !== undefined) return v; + return spec.ty === 'colour' ? [...spec.default] : spec.default[0]; +} + +export function removeNodes(g: Graph, ids: ReadonlySet): void { + for (const id of ids) g.nodes.delete(id); + g.links = g.links.filter((l) => !ids.has(l.from[0]) && !ids.has(l.to[0])); + for (const [k, r] of [...g.outputs]) if (ids.has(r[0])) g.outputs.delete(k); +} From 650e3c15fe36bf05f9992c6fa3aee7f7c8217469 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:01:07 -0500 Subject: [PATCH 197/494] feat(graph): read a material's graph, textures and preview swatch The engine has no command that returns one material, so the editor uses material.get when the catalogue lists it and otherwise reads scene.json and the material member from the stored project snapshot. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/source.ts | 86 +++++++++++++++++++++++++++++++++ frontend/src/ui/graph/zip.ts | 38 +++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 frontend/src/ui/graph/source.ts create mode 100644 frontend/src/ui/graph/zip.ts diff --git a/frontend/src/ui/graph/source.ts b/frontend/src/ui/graph/source.ts new file mode 100644 index 00000000..3e31eac7 --- /dev/null +++ b/frontend/src/ui/graph/source.ts @@ -0,0 +1,86 @@ +import { api } from '../../shell/api'; +import type { Workspace } from '../context'; +import { emptyGraph, parseCatalogue, parseGraph, type Catalogue, type Graph } from './model'; +import { memberJson, zipMembers } from './zip'; + +export interface TextureInfo { key: string; path: string; name: string } +export interface MaterialData { graph: Graph; textures: TextureInfo[]; name: string } + +const READ_COMMAND = 'material.get'; +const SNAPSHOT_ROUTE = '/api/engine/snapshot'; +const SNAPSHOT_COMMAND = 'file.snapshot'; + +const obj = (v: unknown): Record | null => (v && typeof v === 'object' && !Array.isArray(v) ? v as Record : null); + +function base64Bytes(s: string): Uint8Array { + const bin = atob(s); + const out = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i); + return out; +} + +export function baseName(path: string): string { + const clean = path.replace(/^fshot:/, ''); + const i = Math.max(clean.lastIndexOf('/'), clean.lastIndexOf('\\')); + return i >= 0 ? clean.slice(i + 1) : clean; +} + +function texturesOf(raw: unknown): TextureInfo[] { + const out: TextureInfo[] = []; + const add = (key: unknown, t: unknown): void => { + const o = obj(t); + const k = key ?? o?.key; + if (!o || k === undefined || k === null || typeof o.path !== 'string') return; + out.push({ key: String(k), path: o.path, name: baseName(o.path) }); + }; + if (Array.isArray(raw)) for (const t of raw) add(obj(t)?.key, t); + else for (const [k, t] of Object.entries(obj(raw) ?? {})) add(k, t); + return out.sort((a, b) => Number(a.key) - Number(b.key)); +} + +export class GraphSource { + private kinds: Promise | null = null; + private snapshotRoute = true; + + constructor(private readonly ws: Workspace) {} + + catalogue(): Promise { + if (!this.kinds) { + this.kinds = this.ws.client.dispatch('material.node_kinds', {}).then(parseCatalogue); + this.kinds.catch(() => { this.kinds = null; }); + } + return this.kinds; + } + + async read(material: string): Promise { + if (this.ws.client.has(READ_COMMAND)) { + const o = obj(await this.ws.client.dispatch(READ_COMMAND, { key: material })) ?? {}; + const m = obj(o.material) ?? o; + return { graph: m.graph ? parseGraph(m.graph) : emptyGraph(), textures: texturesOf(o.textures), name: typeof m.name === 'string' ? m.name : '' }; + } + const members = zipMembers(await this.snapshot(), (n) => n === 'scene.json' || n === `materials/${material}.json`); + const scene = obj(memberJson(members, 'scene.json')) ?? {}; + const m = obj(memberJson(members, `materials/${material}.json`)); + if (!m) throw new Error('missing material'); + return { graph: m.graph ? parseGraph(m.graph) : emptyGraph(), textures: texturesOf(scene.textures), name: typeof m.name === 'string' ? m.name : '' }; + } + + async preview(material: string, size: number): Promise { + if (!this.ws.client.has('material.preview_maps')) return null; + const o = obj(await this.ws.client.dispatch('material.preview_maps', { key: material, size })); + const png = obj(o?.maps)?.base_color; + return typeof png === 'string' ? `data:image/png;base64,${png}` : null; + } + + private async snapshot(): Promise { + if (this.snapshotRoute) { + const res = await fetch(api.url(SNAPSHOT_ROUTE), { cache: 'no-store' }); + if (res.ok) return new Uint8Array(await res.arrayBuffer()); + if (res.status === 404 || res.status === 405) this.snapshotRoute = false; + else throw new Error(res.statusText || String(res.status)); + } + const o = obj(await this.ws.client.dispatch(SNAPSHOT_COMMAND, {})) ?? {}; + if (typeof o.fshot_b64 !== 'string') throw new Error('no snapshot'); + return base64Bytes(o.fshot_b64); + } +} diff --git a/frontend/src/ui/graph/zip.ts b/frontend/src/ui/graph/zip.ts new file mode 100644 index 00000000..3228e550 --- /dev/null +++ b/frontend/src/ui/graph/zip.ts @@ -0,0 +1,38 @@ +const EOCD = 0x06054b50; +const CENTRAL = 0x02014b50; +const LOCAL = 0x04034b50; + +export function zipMembers(bytes: Uint8Array, want: (name: string) => boolean): Map { + const out = new Map(); + const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); + let end = -1; + for (let i = bytes.byteLength - 22; i >= Math.max(0, bytes.byteLength - 22 - 65535); i--) { + if (dv.getUint32(i, true) === EOCD) { end = i; break; } + } + if (end < 0) throw new Error('not a project file'); + const total = dv.getUint16(end + 10, true); + let at = dv.getUint32(end + 16, true); + const decoder = new TextDecoder(); + for (let i = 0; i < total; i++) { + if (at + 46 > bytes.byteLength || dv.getUint32(at, true) !== CENTRAL) throw new Error('damaged project file'); + const method = dv.getUint16(at + 10, true); + const size = dv.getUint32(at + 20, true); + const nlen = dv.getUint16(at + 28, true); + const elen = dv.getUint16(at + 30, true); + const clen = dv.getUint16(at + 32, true); + const local = dv.getUint32(at + 42, true); + const name = decoder.decode(bytes.subarray(at + 46, at + 46 + nlen)); + at += 46 + nlen + elen + clen; + if (method !== 0 || !want(name)) continue; + if (dv.getUint32(local, true) !== LOCAL) continue; + const start = local + 30 + dv.getUint16(local + 26, true) + dv.getUint16(local + 28, true); + out.set(name, bytes.subarray(start, start + size)); + } + return out; +} + +export function memberJson(members: Map, name: string): unknown { + const b = members.get(name); + if (!b) return null; + try { return JSON.parse(new TextDecoder().decode(b)) as unknown; } catch { return null; } +} From 58fafb9105576d388782ad5117b96d349dde31f5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:02:32 -0500 Subject: [PATCH 198/494] feat(graph): open the node editor in a movable, resizable window openGraphEditor now opens one editor window in the overlay root at the popover layer, loading the catalogue and graph before it shows, so it appears at its final size. The window moves by its header, resizes from every edge, remembers its box for the session and closes with Escape or its trailing close button. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/editor.ts | 52 +++++++++++ frontend/src/ui/graph/graph.css | 22 +++++ frontend/src/ui/graph/index.ts | 9 +- frontend/src/ui/graph/window.ts | 155 ++++++++++++++++++++++++++++++++ 4 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/graph/editor.ts create mode 100644 frontend/src/ui/graph/graph.css create mode 100644 frontend/src/ui/graph/window.ts diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts new file mode 100644 index 00000000..960444cf --- /dev/null +++ b/frontend/src/ui/graph/editor.ts @@ -0,0 +1,52 @@ +import { setText } from '../../shell/dom'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import type { Catalogue, Graph } from './model'; +import { GraphSource, type TextureInfo } from './source'; +import { EditorWindow } from './window'; + +export class GraphEditor { + readonly win: EditorWindow; + readonly source: GraphSource; + material: string | null = null; + cat: Catalogue | null = null; + graph: Graph | null = null; + textures: TextureInfo[] = []; + private opening = 0; + + constructor(readonly ws: Workspace) { + this.win = new EditorWindow(ws.ctx.slots.overlayRoot); + this.source = new GraphSource(ws); + this.win.root.addEventListener('keydown', (e) => this.key(e)); + } + + async open(material: string): Promise { + const token = ++this.opening; + if (this.win.open && this.material === material) { this.focus(); return; } + try { + const cat = await this.source.catalogue(); + const data = await this.source.read(material); + if (token !== this.opening) return; + this.cat = cat; + this.material = material; + this.graph = data.graph; + this.textures = data.textures; + this.win.setTitle(data.name ? t('Node editor: {name}', { name: data.name }) : t('Node editor')); + setText(this.win.status, ''); + this.win.show(); + this.focus(); + } catch (err) { + this.ws.ctx.toast(t('The node editor could not open: {reason}', { reason: err instanceof Error ? err.message : String(err) }), 'error'); + } + } + + focus(): void { this.win.body.focus(); } + + private key(e: KeyboardEvent): void { + if (e.key === 'Escape' && !e.defaultPrevented) { + e.preventDefault(); + e.stopPropagation(); + this.win.close(); + } + } +} diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css new file mode 100644 index 00000000..0128eded --- /dev/null +++ b/frontend/src/ui/graph/graph.css @@ -0,0 +1,22 @@ +.fsh-graph-win { position: fixed; left: 0; top: 0; z-index: var(--z-popover); display: grid; grid-template-rows: 36px minmax(0, 1fr) 24px; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-window); color: var(--text-primary); font: var(--fs-12) var(--font-ui); contain: layout paint; } +.fsh-graph-win[hidden] { display: none; } +.fsh-graph-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; padding: 0 var(--space-1) 0 var(--space-3); border-bottom: 1px solid var(--line-0); background: linear-gradient(to bottom, var(--bg-node), var(--surface-1)); cursor: grab; touch-action: none; } +.fsh-graph-head:active { cursor: grabbing; } +.fsh-graph-grip { flex: none; width: 8px; height: 14px; background-image: radial-gradient(circle, var(--text-faint) 1px, transparent 1.4px); background-size: 4px 4px; } +.fsh-graph-title { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; font-size: var(--fs-13); font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; } +.fsh-graph-tools { display: flex; flex: none; align-items: center; gap: var(--space-0); } +.fsh-graph-close { flex: none; margin-inline-start: var(--space-1); } +.fsh-graph-body { position: relative; min-width: 0; min-height: 0; overflow: hidden; } +.fsh-graph-status { display: flex; align-items: center; gap: var(--space-3); min-width: 0; padding: 0 var(--space-3); overflow: hidden; border-top: 1px solid var(--line-0); background: var(--bg-secondary); color: var(--text-muted); font-size: var(--fs-11); white-space: nowrap; } +.fsh-graph-edge { position: absolute; z-index: var(--z-raised); touch-action: none; } +.fsh-graph-edge.is-n, .fsh-graph-edge.is-s { left: 8px; right: 8px; height: 6px; cursor: ns-resize; } +.fsh-graph-edge.is-e, .fsh-graph-edge.is-w { top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; } +.fsh-graph-edge.is-n { top: 0; } +.fsh-graph-edge.is-s { bottom: 0; } +.fsh-graph-edge.is-e { right: 0; } +.fsh-graph-edge.is-w { left: 0; } +.fsh-graph-edge.is-ne, .fsh-graph-edge.is-nw, .fsh-graph-edge.is-se, .fsh-graph-edge.is-sw { width: 12px; height: 12px; } +.fsh-graph-edge.is-ne { top: 0; right: 0; cursor: nesw-resize; } +.fsh-graph-edge.is-sw { bottom: 0; left: 0; cursor: nesw-resize; } +.fsh-graph-edge.is-nw { top: 0; left: 0; cursor: nwse-resize; } +.fsh-graph-edge.is-se { bottom: 0; right: 0; cursor: nwse-resize; } diff --git a/frontend/src/ui/graph/index.ts b/frontend/src/ui/graph/index.ts index 2bc85318..e55bad12 100644 --- a/frontend/src/ui/graph/index.ts +++ b/frontend/src/ui/graph/index.ts @@ -1,3 +1,10 @@ +import './graph.css'; import type { Workspace } from '../context'; +import { GraphEditor } from './editor'; -export function openGraphEditor(_ws: Workspace, _material: string): void {} +let editor: GraphEditor | null = null; + +export function openGraphEditor(ws: Workspace, material: string): void { + if (!editor || editor.ws !== ws) editor = new GraphEditor(ws); + void editor.open(String(material)); +} diff --git a/frontend/src/ui/graph/window.ts b/frontend/src/ui/graph/window.ts new file mode 100644 index 00000000..06682479 --- /dev/null +++ b/frontend/src/ui/graph/window.ts @@ -0,0 +1,155 @@ +import { el, q, setText } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; + +export interface Box { x: number; y: number; w: number; h: number } + +const STORE = 'formshot.graph.window'; +const MIN_W = 520; +const MIN_H = 360; +const EDGES = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'] as const; + +function stored(): Box | null { + try { + const v = JSON.parse(sessionStorage.getItem(STORE) ?? 'null') as Partial | null; + if (v && [v.x, v.y, v.w, v.h].every((n) => typeof n === 'number' && Number.isFinite(n))) return v as Box; + } catch { return null; } + return null; +} + +export class EditorWindow { + readonly root: HTMLElement; + readonly body: HTMLElement; + readonly tools: HTMLElement; + readonly status: HTMLElement; + private readonly title: HTMLElement; + private box: Box; + private before: Element | null = null; + onClose: (() => void) | null = null; + + constructor(host: HTMLElement) { + this.root = el(``); + this.title = q(this.root, '.fsh-graph-title'); + this.body = q(this.root, '.fsh-graph-body'); + this.tools = q(this.root, '.fsh-graph-tools'); + this.status = q(this.root, '.fsh-graph-status'); + this.box = this.clamp(stored() ?? this.initial()); + this.place(); + host.appendChild(this.root); + q(this.root, '.fsh-graph-close').addEventListener('click', () => this.close()); + this.listen(); + window.addEventListener('resize', () => { if (!this.root.hidden) { this.box = this.clamp(this.box); this.place(); } }); + } + + get open(): boolean { return !this.root.hidden; } + get rect(): Box { return { ...this.box }; } + + setTitle(text: string): void { setText(this.title, text); } + + show(): void { + if (!this.root.hidden) return; + this.before = document.activeElement; + this.box = this.clamp(this.box); + this.place(); + this.root.hidden = false; + } + + close(): void { + if (this.root.hidden) return; + this.root.hidden = true; + this.onClose?.(); + if (this.before instanceof HTMLElement && this.before.isConnected) this.before.focus(); + } + + private initial(): Box { + const w = Math.max(MIN_W, Math.round(window.innerWidth * 0.72)); + const h = Math.max(MIN_H, Math.round(window.innerHeight * 0.7)); + return { x: Math.round((window.innerWidth - w) / 2), y: Math.round((window.innerHeight - h) / 2), w, h }; + } + + private clamp(b: Box): Box { + const vw = window.innerWidth, vh = window.innerHeight; + const w = Math.min(Math.max(MIN_W, b.w), Math.max(MIN_W, vw)); + const h = Math.min(Math.max(MIN_H, b.h), Math.max(MIN_H, vh)); + const x = Math.min(Math.max(b.x, 40 - w), vw - 40); + const y = Math.min(Math.max(b.y, 0), vh - 36); + return { x: Math.round(x), y: Math.round(y), w: Math.round(w), h: Math.round(h) }; + } + + private place(): void { + const s = this.root.style; + const tr = `translate(${this.box.x}px, ${this.box.y}px)`; + if (s.transform !== tr) s.transform = tr; + if (s.width !== `${this.box.w}px`) s.width = `${this.box.w}px`; + if (s.height !== `${this.box.h}px`) s.height = `${this.box.h}px`; + } + + private save(): void { + try { sessionStorage.setItem(STORE, JSON.stringify(this.box)); } catch { return; } + } + + private listen(): void { + const head = q(this.root, '.fsh-graph-head'); + let mode: string | null = null; + let start = { x: 0, y: 0 }; + let from: Box = this.box; + let pointer = -1; + const down = (e: PointerEvent, m: string, target: HTMLElement): void => { + if (e.button !== 0) return; + mode = m; + pointer = e.pointerId; + start = { x: e.clientX, y: e.clientY }; + from = { ...this.box }; + target.setPointerCapture(e.pointerId); + e.preventDefault(); + }; + head.addEventListener('pointerdown', (e) => { + if ((e.target as HTMLElement).closest('button, input, select')) return; + down(e, 'move', head); + }); + for (const edge of this.root.querySelectorAll('.fsh-graph-edge')) { + edge.addEventListener('pointerdown', (e) => down(e, edge.dataset.edge ?? 'se', edge)); + } + const move = (e: PointerEvent): void => { + if (e.pointerId !== pointer || !mode) return; + const dx = e.clientX - start.x, dy = e.clientY - start.y; + const b = { ...from }; + if (mode === 'move') { b.x += dx; b.y += dy; } + else { + if (mode.includes('e')) b.w = Math.max(MIN_W, from.w + dx); + if (mode.includes('s')) b.h = Math.max(MIN_H, from.h + dy); + if (mode.includes('w')) { b.w = Math.max(MIN_W, from.w - dx); b.x = from.x + from.w - b.w; } + if (mode.includes('n')) { b.h = Math.max(MIN_H, from.h - dy); b.y = from.y + from.h - b.h; } + } + this.box = this.clamp(b); + this.place(); + }; + const up = (e: PointerEvent): void => { + if (e.pointerId !== pointer) return; + pointer = -1; + mode = null; + this.save(); + }; + this.root.addEventListener('pointermove', move); + this.root.addEventListener('pointerup', up); + this.root.addEventListener('pointercancel', up); + head.addEventListener('dblclick', (e) => { + if ((e.target as HTMLElement).closest('button')) return; + const vw = window.innerWidth, vh = window.innerHeight; + const full = this.box.w >= vw - 16 && this.box.h >= vh - 16; + this.box = this.clamp(full ? this.initial() : { x: 8, y: 8, w: vw - 16, h: vh - 16 }); + this.place(); + this.save(); + }); + } +} From 6d0937210733f756853cdb052d292fbd677aef02 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:08:08 -0500 Subject: [PATCH 199/494] feat(graph): add the pannable, zoomable node canvas One moving layer carries nodes and the link SVG by a single transform; the grid is CSS gradients whose size and offset follow the view. Middle drag, space drag, trackpad scroll and touch pan; the mouse wheel, trackpad pinch and touch pinch zoom about the pointer. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/canvas.ts | 152 ++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 frontend/src/ui/graph/canvas.ts diff --git a/frontend/src/ui/graph/canvas.ts b/frontend/src/ui/graph/canvas.ts new file mode 100644 index 00000000..737ec07a --- /dev/null +++ b/frontend/src/ui/graph/canvas.ts @@ -0,0 +1,152 @@ +import { el, q, setStyleVar } from '../../shell/dom'; + +export interface View { x: number; y: number; z: number } +export interface Rect { x: number; y: number; w: number; h: number } + +export const MIN_ZOOM = 0.2; +export const MAX_ZOOM = 2.5; +const GRID = 24; +const SVG_NS = 'http://www.w3.org/2000/svg'; + +const clampZoom = (z: number): number => Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, z)); + +export class GraphCanvas { + readonly host: HTMLElement; + readonly layer: HTMLElement; + readonly nodes: HTMLElement; + readonly links: SVGSVGElement; + readonly band: HTMLElement; + view: View = { x: 0, y: 0, z: 1 }; + spaceHeld = false; + onView: (() => void) | null = null; + private panning = -1; + private panFrom = { x: 0, y: 0, vx: 0, vy: 0 }; + private readonly touches = new Map(); + private pinch: { d: number; cx: number; cy: number } | null = null; + + constructor(parent: HTMLElement, label: string) { + this.host = el(`
      `); + this.host.setAttribute('aria-label', label); + this.layer = q(this.host, '.fsh-graph-layer'); + this.nodes = q(this.host, '.fsh-graph-nodes'); + this.band = q(this.host, '.fsh-graph-band'); + this.links = document.createElementNS(SVG_NS, 'svg'); + this.links.classList.add('fsh-graph-links'); + this.links.setAttribute('aria-hidden', 'true'); + this.layer.insertBefore(this.links, this.nodes); + parent.appendChild(this.host); + this.apply(); + this.listen(); + } + + toCanvas(clientX: number, clientY: number): [number, number] { + const r = this.host.getBoundingClientRect(); + return [(clientX - r.left - this.view.x) / this.view.z, (clientY - r.top - this.view.y) / this.view.z]; + } + + setView(v: View): void { + const z = clampZoom(v.z); + if (v.x === this.view.x && v.y === this.view.y && z === this.view.z) return; + this.view = { x: v.x, y: v.y, z }; + this.apply(); + this.onView?.(); + } + + zoomAt(clientX: number, clientY: number, factor: number): void { + const r = this.host.getBoundingClientRect(); + const px = clientX - r.left, py = clientY - r.top; + const z = clampZoom(this.view.z * factor); + const k = z / this.view.z; + this.setView({ x: px - (px - this.view.x) * k, y: py - (py - this.view.y) * k, z }); + } + + zoomCentre(factor: number): void { + const r = this.host.getBoundingClientRect(); + this.zoomAt(r.left + r.width / 2, r.top + r.height / 2, factor); + } + + frame(box: Rect | null, size?: { w: number; h: number }): void { + const w = size?.w ?? this.host.clientWidth, h = size?.h ?? this.host.clientHeight; + if (!box || w <= 0 || h <= 0) { this.setView({ x: w / 2, y: h / 2, z: 1 }); return; } + const pad = 48; + const z = clampZoom(Math.min(1, (w - pad * 2) / Math.max(1, box.w), (h - pad * 2) / Math.max(1, box.h))); + this.setView({ x: Math.round(w / 2 - (box.x + box.w / 2) * z), y: Math.round(h / 2 - (box.y + box.h / 2) * z), z }); + } + + private apply(): void { + const { x, y, z } = this.view; + const tr = `translate(${x}px, ${y}px) scale(${z})`; + if (this.layer.style.transform !== tr) this.layer.style.transform = tr; + const step = GRID * z; + setStyleVar(this.host, '--fsh-graph-grid', `${step}px`); + setStyleVar(this.host, '--fsh-graph-gx', `${x % (step * 4)}px`); + setStyleVar(this.host, '--fsh-graph-gy', `${y % (step * 4)}px`); + } + + private listen(): void { + const h = this.host; + h.addEventListener('pointerdown', (e) => { + if (e.pointerType === 'touch') { + this.touches.set(e.pointerId, { x: e.clientX, y: e.clientY }); + if (this.touches.size === 2) { this.beginPinch(); e.preventDefault(); e.stopPropagation(); return; } + } + const pan = e.button === 1 || (e.button === 0 && this.spaceHeld); + if (!pan) return; + this.panning = e.pointerId; + this.panFrom = { x: e.clientX, y: e.clientY, vx: this.view.x, vy: this.view.y }; + h.setPointerCapture(e.pointerId); + h.classList.add('is-panning'); + e.preventDefault(); + e.stopPropagation(); + }, true); + h.addEventListener('pointermove', (e) => { + if (this.touches.has(e.pointerId)) { + this.touches.set(e.pointerId, { x: e.clientX, y: e.clientY }); + if (this.pinch) { this.movePinch(); e.stopPropagation(); return; } + } + if (e.pointerId !== this.panning) return; + this.setView({ x: this.panFrom.vx + e.clientX - this.panFrom.x, y: this.panFrom.vy + e.clientY - this.panFrom.y, z: this.view.z }); + e.stopPropagation(); + }, true); + const end = (e: PointerEvent): void => { + this.touches.delete(e.pointerId); + if (this.touches.size < 2) this.pinch = null; + if (e.pointerId !== this.panning) return; + this.panning = -1; + h.classList.remove('is-panning'); + e.stopPropagation(); + }; + h.addEventListener('pointerup', end, true); + h.addEventListener('pointercancel', end, true); + h.addEventListener('auxclick', (e) => { if (e.button === 1) e.preventDefault(); }); + h.addEventListener('wheel', (e) => { + if ((e.target as HTMLElement).closest('.fsh-graph-scroll')) return; + e.preventDefault(); + const legacy = (e as WheelEvent & { wheelDeltaY?: number }).wheelDeltaY; + const mouse = e.deltaMode !== 0 || (e.deltaX === 0 && typeof legacy === 'number' && legacy !== 0 && legacy % 120 === 0); + if (e.ctrlKey || e.metaKey || (mouse && !e.shiftKey)) { + const d = e.deltaMode === 1 ? e.deltaY * 33 : e.deltaY; + this.zoomAt(e.clientX, e.clientY, Math.exp(-d * (e.ctrlKey && !mouse ? 0.01 : 0.0015))); + return; + } + const dx = e.shiftKey && e.deltaX === 0 ? e.deltaY : e.deltaX; + const dy = e.shiftKey && e.deltaX === 0 ? 0 : e.deltaY; + this.setView({ x: this.view.x - dx, y: this.view.y - dy, z: this.view.z }); + }, { passive: false }); + } + + private beginPinch(): void { + const [a, b] = [...this.touches.values()]; + this.pinch = { d: Math.hypot(a.x - b.x, a.y - b.y), cx: (a.x + b.x) / 2, cy: (a.y + b.y) / 2 }; + } + + private movePinch(): void { + const p = this.pinch; + if (!p) return; + const [a, b] = [...this.touches.values()]; + const d = Math.hypot(a.x - b.x, a.y - b.y), cx = (a.x + b.x) / 2, cy = (a.y + b.y) / 2; + this.setView({ x: this.view.x + cx - p.cx, y: this.view.y + cy - p.cy, z: this.view.z }); + if (p.d > 0 && d > 0) this.zoomAt(cx, cy, d / p.d); + this.pinch = { d, cx, cy }; + } +} From 595273853b7336084cbc277a37c988ecadc8cd4b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:08:08 -0500 Subject: [PATCH 200/494] feat(graph): build node views with sockets, value fields and settings Each node is built once from its kind: output sockets, settings (menus, seed, flags, projection, transform, colour space, fallback, texture chooser, constant type), then inputs with inline number and colour fields; update() patches values in place. The colour ramp editor adds, drags, recolours and deletes stops. Colours convert between ACEScg and display sRGB. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/colour.ts | 37 ++++ frontend/src/ui/graph/fields.ts | 62 +++++++ frontend/src/ui/graph/labels.ts | 28 +++ frontend/src/ui/graph/ramp.ts | 218 ++++++++++++++++++++++ frontend/src/ui/graph/views.ts | 309 ++++++++++++++++++++++++++++++++ 5 files changed, 654 insertions(+) create mode 100644 frontend/src/ui/graph/colour.ts create mode 100644 frontend/src/ui/graph/fields.ts create mode 100644 frontend/src/ui/graph/labels.ts create mode 100644 frontend/src/ui/graph/ramp.ts create mode 100644 frontend/src/ui/graph/views.ts diff --git a/frontend/src/ui/graph/colour.ts b/frontend/src/ui/graph/colour.ts new file mode 100644 index 00000000..c6cc2ab6 --- /dev/null +++ b/frontend/src/ui/graph/colour.ts @@ -0,0 +1,37 @@ +import type { Rgb } from './model'; + +const TO_SRGB: readonly number[] = [1.70505, -0.62179, -0.08326, -0.13026, 1.1408, -0.01055, -0.024, -0.12897, 1.15297]; +const TO_ACESCG: readonly number[] = [0.6131, 0.33952, 0.04738, 0.07019, 0.91636, 0.01345, 0.02062, 0.10958, 0.8698]; + +function mul(m: readonly number[], c: Rgb): Rgb { + return [m[0] * c[0] + m[1] * c[1] + m[2] * c[2], m[3] * c[0] + m[4] * c[1] + m[5] * c[2], m[6] * c[0] + m[7] * c[1] + m[8] * c[2]]; +} + +const encode = (v: number): number => (v <= 0.0031308 ? v * 12.92 : 1.055 * Math.pow(v, 1 / 2.4) - 0.055); +const decode = (v: number): number => (v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4)); +const clamp01 = (v: number): number => (Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : 0); + +export function displayRgb(acescg: Rgb): Rgb { + return mul(TO_SRGB, acescg).map((v) => clamp01(encode(clamp01(v)))) as Rgb; +} + +export function hexOf(acescg: Rgb): string { + return '#' + displayRgb(acescg).map((v) => Math.round(v * 255).toString(16).padStart(2, '0')).join(''); +} + +export function cssOf(acescg: Rgb): string { + const [r, g, b] = displayRgb(acescg).map((v) => Math.round(v * 255)); + return `rgb(${r} ${g} ${b})`; +} + +export function fromHex(hex: string): Rgb { + const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim()); + if (!m) return [0, 0, 0]; + const n = parseInt(m[1], 16); + const lin: Rgb = [decode(((n >> 16) & 255) / 255), decode(((n >> 8) & 255) / 255), decode((n & 255) / 255)]; + return mul(TO_ACESCG, lin).map((v) => Math.round(Math.max(0, v) * 1e5) / 1e5) as Rgb; +} + +export function lerpRgba(a: number[], b: number[], f: number): number[] { + return a.map((v, i) => v + ((b[i] ?? v) - v) * f); +} diff --git a/frontend/src/ui/graph/fields.ts b/frontend/src/ui/graph/fields.ts new file mode 100644 index 00000000..c4e7dacb --- /dev/null +++ b/frontend/src/ui/graph/fields.ts @@ -0,0 +1,62 @@ +import { el, escapeHtml, q, setChecked, setValue } from '../../shell/dom'; +import { t } from '../../i18n'; +import { NumberField } from '../number-field'; +import { fromHex, hexOf } from './colour'; +import type { Rgb } from './model'; + +export type Edit = (value: unknown, live: boolean) => void; + +export interface Control { + el: HTMLElement; + set(value: unknown): void; +} + +export interface NumberOptions { step: number; min?: number; max?: number; integer?: boolean } + +export function stepFor(value: number): number { + const a = Math.abs(value); + if (a >= 100) return 1; + if (a >= 10) return 0.1; + if (a > 0 && a < 0.01) return 0.0001; + return 0.01; +} + +export function numberControl(label: string, opts: NumberOptions, edit: Edit): Control { + const field = new NumberField({ + label, step: opts.step, min: opts.min, max: opts.max, integer: opts.integer, + onInput: (v) => edit(v, true), + onCommit: (v) => edit(v, false), + }); + field.root.classList.add('fsh-graph-num'); + return { el: field.root, set: (v) => { if (typeof v === 'number') field.set(v); } }; +} + +export function colourControl(label: string, edit: Edit): Control { + const node = el(``); + const input = q(node, 'input'); + input.addEventListener('input', () => edit(fromHex(input.value), true)); + input.addEventListener('change', () => edit(fromHex(input.value), false)); + return { + el: node, + set: (v) => { + if (!Array.isArray(v)) return; + const hex = hexOf([Number(v[0]), Number(v[1]), Number(v[2])] as Rgb); + if (document.activeElement !== input) setValue(input, hex); + }, + }; +} + +export function selectControl(label: string, options: ReadonlyArray, edit: Edit): Control & { select: HTMLSelectElement } { + const opts = options.map(([v, l]) => ``).join(''); + const node = el(``); + const select = q(node, 'select'); + select.addEventListener('change', () => edit(select.value, false)); + return { el: node, select, set: (v) => setValue(select, v === null || v === undefined ? '' : String(v)) }; +} + +export function boolControl(label: string, edit: Edit): Control { + const node = el(``); + const input = q(node, 'input'); + input.addEventListener('change', () => edit(input.checked, false)); + return { el: node, set: (v) => setChecked(input, v === true) }; +} diff --git a/frontend/src/ui/graph/labels.ts b/frontend/src/ui/graph/labels.ts new file mode 100644 index 00000000..2e21c10f --- /dev/null +++ b/frontend/src/ui/graph/labels.ts @@ -0,0 +1,28 @@ +const NAMES: Readonly> = { + op: 'Operation', + gradient: 'Shape', + wave: 'Shape', + texture: 'Image', + colour_space: 'Colour space', + flip_y: 'Flip green', + f1: 'Nearest point', + f2: 'Second nearest', + edge: 'Cell edge', + acescg: 'ACEScg', + srgb: 'sRGB', + uv: 'UV', +}; + +export function words(name: string): string { + const own = NAMES[name]; + if (own) return own; + const s = name.replace(/_/g, ' ').replace(/([a-z])(\d)/gi, '$1 $2'); + return s.charAt(0).toUpperCase() + s.slice(1); +} + +export const TYPE_WORDS: Readonly> = { + float: 'number', + colour: 'colour', + vector: 'vector', + normal: 'normal', +}; diff --git a/frontend/src/ui/graph/ramp.ts b/frontend/src/ui/graph/ramp.ts new file mode 100644 index 00000000..071c0109 --- /dev/null +++ b/frontend/src/ui/graph/ramp.ts @@ -0,0 +1,218 @@ +import { el, escapeHtml, q, setAttr, setClass, setStyleVar, setValue } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import { cssOf, fromHex, hexOf, lerpRgba } from './colour'; +import type { Control, Edit } from './fields'; +import { MAX_STOPS, type Rgb } from './model'; + +export interface Stop { position: number; colour: number[] } + +function stopsOf(v: unknown): Stop[] { + if (!Array.isArray(v)) return []; + return v.map((s) => { + const o = (s && typeof s === 'object' ? s : {}) as Record; + const c = Array.isArray(o.colour) ? o.colour.map(Number) : [0, 0, 0, 1]; + return { position: Number(o.position) || 0, colour: [c[0] ?? 0, c[1] ?? 0, c[2] ?? 0, c[3] ?? 1] }; + }); +} + +const round = (v: number): number => Math.round(v * 1000) / 1000; +const rgb = (c: number[]): Rgb => [c[0], c[1], c[2]]; + +export function sampleStops(stops: Stop[], at: number): number[] { + if (!stops.length) return [0, 0, 0, 1]; + if (at <= stops[0].position) return [...stops[0].colour]; + for (let i = 1; i < stops.length; i++) { + const a = stops[i - 1], b = stops[i]; + if (at <= b.position) return lerpRgba(a.colour, b.colour, b.position > a.position ? (at - a.position) / (b.position - a.position) : 0); + } + return [...stops[stops.length - 1].colour]; +} + +export class RampControl implements Control { + readonly el: HTMLElement; + private readonly bar: HTMLElement; + private readonly track: HTMLElement; + private readonly colour: HTMLInputElement; + private readonly pos: HTMLInputElement; + private readonly remove: HTMLButtonElement; + private stops: Stop[] = []; + private interpolation = 'linear'; + private active = 0; + private dragging = false; + + constructor(private readonly edit: Edit) { + this.el = el(`
      + +
      +
      + + + +
      +
      `); + this.bar = q(this.el, '.fsh-graph-ramp-bar'); + this.track = q(this.el, '.fsh-graph-ramp-track'); + this.colour = q(this.el, '.fsh-graph-swatch'); + this.pos = q(this.el, '.fsh-graph-ramp-pos'); + this.remove = q(this.el, '.fsh-graph-ramp-del'); + this.bar.title = t('Click to add a stop'); + this.listen(); + } + + setInterpolation(mode: string): void { + if (this.interpolation === mode) return; + this.interpolation = mode; + this.paint(); + } + + set(v: unknown): void { + if (this.dragging) return; + const next = stopsOf(v); + if (!next.length) return; + this.stops = next; + this.active = Math.min(this.active, next.length - 1); + this.paint(); + } + + private send(live: boolean): void { + this.edit(this.stops.map((s) => ({ position: round(s.position), colour: s.colour.map((c) => Math.round(c * 1e5) / 1e5) })), live); + } + + private sortKeep(): void { + const cur = this.stops[this.active]; + this.stops.sort((a, b) => a.position - b.position); + this.active = this.stops.indexOf(cur); + } + + private paint(): void { + const parts: string[] = []; + for (let i = 0; i < this.stops.length; i++) { + const s = this.stops[i], pct = `${(s.position * 100).toFixed(2)}%`, c = cssOf(rgb(s.colour)); + if (this.interpolation === 'constant' && i > 0) parts.push(`${cssOf(rgb(this.stops[i - 1].colour))} ${pct}`); + parts.push(`${c} ${pct}`); + } + const bg = this.stops.length === 1 ? cssOf(rgb(this.stops[0].colour)) : `linear-gradient(to right, ${parts.join(', ')})`; + if (this.bar.style.background !== bg) this.bar.style.background = bg; + const handles = this.track.children; + while (handles.length < this.stops.length) { + const b = el(``); + this.track.appendChild(b); + } + while (handles.length > this.stops.length) (this.track.lastElementChild as Element).remove(); + this.stops.forEach((s, i) => { + const h = handles[i] as HTMLElement; + h.dataset.index = String(i); + setStyleVar(h, '--fsh-graph-at', `${s.position * 100}%`); + setStyleVar(h, '--fsh-graph-stop', cssOf(rgb(s.colour))); + setClass(h, 'is-active', i === this.active); + setAttr(h, 'aria-label', t('Stop {n} at {pos}', { n: i + 1, pos: s.position.toFixed(3) })); + setAttr(h, 'tabindex', i === this.active ? '0' : '-1'); + }); + const a = this.stops[this.active]; + if (a) { + if (document.activeElement !== this.colour) setValue(this.colour, hexOf(rgb(a.colour))); + setValue(this.pos, a.position.toFixed(3)); + } + this.remove.disabled = this.stops.length <= 1; + } + + private at(clientX: number): number { + const r = this.track.getBoundingClientRect(); + return Math.min(1, Math.max(0, (clientX - r.left) / Math.max(1, r.width))); + } + + private add(position: number): void { + if (this.stops.length >= MAX_STOPS) return; + const s = { position: round(position), colour: sampleStops(this.stops, position) }; + this.stops.push(s); + this.active = this.stops.length - 1; + this.sortKeep(); + this.paint(); + this.send(false); + } + + private drop(): void { + if (this.stops.length <= 1) return; + this.stops.splice(this.active, 1); + this.active = Math.max(0, this.active - 1); + this.paint(); + this.send(false); + (this.track.children[this.active] as HTMLElement | undefined)?.focus(); + } + + private listen(): void { + this.bar.addEventListener('pointerdown', (e) => { + if (e.button !== 0) return; + e.stopPropagation(); + this.add(this.at(e.clientX)); + }); + let pointer = -1, moved = false; + this.track.addEventListener('pointerdown', (e) => { + const h = (e.target as HTMLElement).closest('.fsh-graph-ramp-stop'); + e.stopPropagation(); + if (!h || e.button !== 0) { if (!h && e.button === 0) this.add(this.at(e.clientX)); return; } + this.active = Number(h.dataset.index); + pointer = e.pointerId; + moved = false; + this.dragging = true; + h.setPointerCapture(e.pointerId); + h.focus(); + this.paint(); + }); + this.track.addEventListener('pointermove', (e) => { + if (e.pointerId !== pointer) return; + moved = true; + this.stops[this.active].position = round(this.at(e.clientX)); + this.sortKeep(); + this.paint(); + this.send(true); + }); + const end = (e: PointerEvent): void => { + if (e.pointerId !== pointer) return; + pointer = -1; + this.dragging = false; + if (moved) this.send(false); + }; + this.track.addEventListener('pointerup', end); + this.track.addEventListener('pointercancel', end); + this.track.addEventListener('keydown', (e) => { + const h = (e.target as HTMLElement).closest('.fsh-graph-ramp-stop'); + if (!h) return; + const step = e.shiftKey ? 0.1 : 0.01; + if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') { + const s = this.stops[this.active]; + s.position = round(Math.min(1, Math.max(0, s.position + (e.key === 'ArrowLeft' ? -step : step)))); + this.sortKeep(); + this.paint(); + this.send(false); + (this.track.children[this.active] as HTMLElement).focus(); + } else if (e.key === 'Delete' || e.key === 'Backspace') this.drop(); + else if (e.key === 'Insert' || e.key === '+') this.add(Math.min(1, this.stops[this.active].position + 0.1)); + else return; + e.preventDefault(); + e.stopPropagation(); + }); + this.colour.addEventListener('input', () => { this.recolour(); this.send(true); }); + this.colour.addEventListener('change', () => { this.recolour(); this.send(false); }); + const setPos = (): void => { + const v = parseFloat(this.pos.value.replace(',', '.')); + if (!Number.isFinite(v)) { this.paint(); return; } + this.stops[this.active].position = round(Math.min(1, Math.max(0, v))); + this.sortKeep(); + this.paint(); + this.send(false); + }; + this.pos.addEventListener('change', setPos); + this.pos.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); setPos(); } e.stopPropagation(); }); + this.remove.addEventListener('click', () => this.drop()); + } + + private recolour(): void { + const s = this.stops[this.active]; + if (!s) return; + const c = fromHex(this.colour.value); + s.colour = [c[0], c[1], c[2], s.colour[3] ?? 1]; + this.paint(); + } +} diff --git a/frontend/src/ui/graph/views.ts b/frontend/src/ui/graph/views.ts new file mode 100644 index 00000000..f96eae63 --- /dev/null +++ b/frontend/src/ui/graph/views.ts @@ -0,0 +1,309 @@ +import { el, escapeHtml, q, setAttr, setClass, setText, setTitle, swapMedia } from '../../shell/dom'; +import { t } from '../../i18n'; +import { boolControl, colourControl, numberControl, selectControl, stepFor, type Control, type Edit } from './fields'; +import { TYPE_WORDS, words } from './labels'; +import { inputValue, materialInputType, OUTPUT_NODE, type Catalogue, type GNode, type SettingSpec, type SocketType, type SocketValue } from './model'; +import { RampControl } from './ramp'; +import type { TextureInfo } from './source'; + +export type Dir = 'in' | 'out'; + +export interface Sock { + el: HTMLElement; + row: HTMLElement; + dir: Dir; + name: string; + ty: SocketType; + label: string; + dy: number; +} + +export interface NodeHost { + cat: Catalogue; + textures(): TextureInfo[]; + editInput(node: number, socket: string, value: SocketValue, live: boolean): void; + editSetting(node: number, name: string, value: unknown, live: boolean): void; + addImage(node: number): void; +} + +export const NODE_W = 208; +export const OUTPUT_W = 196; +const ADD_IMAGE = '__add'; +const PROJECTIONS = ['uv', 'box', 'planar', 'cylindrical', 'spherical'] as const; +const SPACES = ['', 'srgb', 'linear', 'acescg', 'data'] as const; + +export function shapeOf(n: GNode): string { + return n.kind === 'constant' ? `constant:${Array.isArray(n.settings.value) ? 'colour' : 'float'}` : n.kind; +} + +function sockHtml(dir: Dir, ty: SocketType, name: string): string { + return ``; +} + +abstract class BaseView { + readonly el: HTMLElement; + readonly sockets = new Map(); + x = Number.NaN; + y = Number.NaN; + w = NODE_W; + h = 0; + protected readonly body: HTMLElement; + private readonly head: HTMLElement; + + constructor(readonly id: number, title: string, extra: string) { + this.el = el(`
      `); + this.head = q(this.el, '.fsh-graph-node-head'); + this.body = q(this.el, '.fsh-graph-node-body'); + setText(q(this.el, '.fsh-graph-node-title'), title); + } + + place(x: number, y: number): boolean { + if (x === this.x && y === this.y) return false; + this.x = x; + this.y = y; + this.el.style.transform = `translate(${x}px, ${y}px)`; + return true; + } + + measure(): void { + this.w = this.el.offsetWidth || this.w; + this.h = this.el.offsetHeight; + for (const s of this.sockets.values()) s.dy = s.row.offsetTop + s.row.offsetHeight / 2; + } + + socketAt(dir: Dir, name: string): [number, number] | null { + const s = this.sockets.get(`${dir}:${name}`); + return s ? [this.x + (dir === 'out' ? this.w : 0), this.y + s.dy] : null; + } + + setSelected(on: boolean): void { + setClass(this.el, 'is-selected', on); + setAttr(this.el, 'aria-selected', on ? 'true' : 'false'); + } + + setError(message: string | null): void { + setClass(this.el, 'is-error', message !== null); + const badge = q(this.head, '.fsh-graph-node-badge'); + if (badge.hidden !== (message === null)) badge.hidden = message === null; + setTitle(badge, message ?? ''); + } + + setLinked(name: string, on: boolean, to: string): void { + const s = this.sockets.get(`in:${name}`); + if (!s) return; + setClass(s.row, 'is-linked', on); + setAttr(s.el, 'aria-label', on ? t('{socket} input, linked from {from}', { socket: s.label, from: to }) : t('{socket} input, {type}', { socket: s.label, type: t(TYPE_WORDS[s.ty]) })); + } + + protected addSocketRow(dir: Dir, name: string, ty: SocketType, label: string, control: Control | null): HTMLElement { + const row = el(`
      ${sockHtml(dir, ty, name)}
      `); + setText(q(row, '.fsh-graph-row-label'), label); + if (control) { row.classList.add('has-field'); row.appendChild(control.el); } + const sockEl = q(row, '.fsh-graph-sock'); + sockEl.setAttribute('aria-label', dir === 'out' + ? t('{socket} output, {type}', { socket: label, type: t(TYPE_WORDS[ty]) }) + : t('{socket} input, {type}', { socket: label, type: t(TYPE_WORDS[ty]) })); + this.body.appendChild(row); + this.sockets.set(`${dir}:${name}`, { el: sockEl, row, dir, name, ty, label, dy: 0 }); + return row; + } +} + +export class NodeView extends BaseView { + readonly kind: string; + readonly shape: string; + private readonly inputs = new Map(); + private readonly settings = new Map(); + private readonly rgba = new Map(); + private ramp: RampControl | null = null; + private texture: HTMLSelectElement | null = null; + private texturesSig = ''; + + constructor(private readonly host: NodeHost, node: GNode) { + const spec = host.cat.byId.get(node.kind); + super(node.id, t(spec?.label ?? words(node.kind)), `is-kind-${node.kind}${spec?.procedural ? ' is-pattern' : ''}`); + this.kind = node.kind; + this.shape = shapeOf(node); + this.el.setAttribute('aria-label', t('{kind} node {id}', { kind: t(spec?.label ?? words(node.kind)), id: node.id })); + const outputs = node.kind === 'constant' ? [{ name: 'value', ty: (Array.isArray(node.settings.value) ? 'colour' : 'float') as SocketType }] : (spec?.outputs ?? []); + for (const o of outputs) this.addSocketRow('out', o.name, o.ty, t(words(o.name)), null); + for (const s of spec?.settings ?? []) this.addSetting(node, s); + for (const i of spec?.inputs ?? []) { + const id = node.id, name = i.name; + const edit: Edit = (v, live) => host.editInput(id, name, v as SocketValue, live); + let control: Control | null = null; + if (i.ty === 'float') control = numberControl(words(name), { step: stepFor(i.default[0]) }, edit); + else if (i.ty === 'colour') control = colourControl(words(name), edit); + this.addSocketRow('in', name, i.ty, t(words(name)), control); + if (control) this.inputs.set(name, control); + } + this.update(node); + } + + update(node: GNode): void { + const spec = this.host.cat.byId.get(node.kind); + for (const i of spec?.inputs ?? []) this.inputs.get(i.name)?.set(inputValue(i, node)); + for (const [name, c] of this.settings) c.set(node.settings[name]); + if (this.ramp) this.ramp.setInterpolation(String(node.settings.interpolation ?? 'linear')); + this.refreshTextures(); + const tex = this.texture; + if (tex) { + const v = node.settings.texture; + const want = v === null || v === undefined ? '' : String(v); + if (tex.value !== want && document.activeElement !== tex) tex.value = want; + } + } + + refreshTextures(): void { + const tex = this.texture; + if (!tex) return; + const list = this.host.textures(); + const sig = list.map((x) => `${x.key}=${x.name}`).join('|'); + if (sig === this.texturesSig) return; + this.texturesSig = sig; + const keep = tex.value; + const want: Array<[string, string]> = [['', t('None')], ...list.map((x): [string, string] => [x.key, x.name]), [ADD_IMAGE, t('Add image...')]]; + const have = new Map(); + for (const o of Array.from(tex.options)) have.set(o.value, o); + want.forEach(([value, label], i) => { + let o = have.get(value); + if (!o) { o = document.createElement('option'); o.value = value; } + if (o.textContent !== label) o.textContent = label; + if (value !== '' && value !== ADD_IMAGE) o.setAttribute('data-no-i18n', ''); + if (tex.options[i] !== o) tex.insertBefore(o, tex.options[i] ?? null); + have.delete(value); + }); + for (const o of have.values()) o.remove(); + tex.value = keep; + } + + private addRow(control: Control): void { + const row = el('
      '); + row.appendChild(control.el); + this.body.appendChild(row); + } + + private addSetting(node: GNode, s: SettingSpec): void { + const id = node.id, name = s.name; + const edit: Edit = (v, live) => this.host.editSetting(id, name, v, live); + let c: Control | null = null; + switch (s.kind) { + case 'enum': c = selectControl(words(name), s.values.map((v) => [v, words(v)] as const), edit); break; + case 'u32': c = numberControl(words(name), { step: 1, min: 0, integer: true }, edit); break; + case 'bool': c = boolControl(words(name), edit); break; + case 'colour_space': { + const sel = selectControl(words(name), SPACES.map((v) => [v, v ? words(v) : 'Automatic'] as const), (v, live) => edit(v === '' ? null : v, live)); + c = sel; + break; + } + case 'rgba': { + const col = colourControl(words(name), (v, live) => { + const cur = this.currentRgba(name); + const rgb = v as number[]; + edit([rgb[0], rgb[1], rgb[2], cur[3] ?? 1], live); + }); + c = { el: col.el, set: (v) => { if (Array.isArray(v)) { this.rgba.set(name, v.map(Number)); col.set(v); } } }; + break; + } + case 'projection': { + const sel = selectControl(words(name), PROJECTIONS.map((v) => [v, words(v)] as const), (v, live) => edit(v === 'box' ? { kind: 'box', blend: 0.5 } : v === 'uv' ? { kind: 'uv', set: 0 } : { kind: v }, live)); + c = { el: sel.el, set: (v) => sel.set((v && typeof v === 'object' ? (v as Record).kind : 'uv') ?? 'uv') }; + break; + } + case 'transform': this.addTransform(id, name); return; + case 'texture': this.addTexture(id); return; + case 'stops': { + this.ramp = new RampControl(edit); + const row = el('
      '); + row.appendChild(this.ramp.el); + this.body.appendChild(row); + this.settings.set(name, this.ramp); + return; + } + case 'value': this.addConstant(node); return; + default: return; + } + if (c) { this.addRow(c); this.settings.set(name, c); } + } + + private currentRgba(name: string): number[] { return this.rgba.get(name) ?? [0.5, 0.5, 0.5, 1]; } + + private addTransform(id: number, name: string): void { + let cur: Record = {}; + const pair = (v: unknown, i: number, d: number): number => (Array.isArray(v) && typeof v[i] === 'number' ? v[i] as number : d); + const send = (patch: Record, live: boolean): void => { cur = { ...cur, ...patch }; this.host.editSetting(id, name, cur, live); }; + const parts: Array<[string, (v: number) => Record, (o: Record) => number, number]> = [ + ['Scale X', (v) => ({ scale: [v, pair(cur.scale, 1, 1)] }), (o) => pair(o.scale, 0, 1), 0.01], + ['Scale Y', (v) => ({ scale: [pair(cur.scale, 0, 1), v] }), (o) => pair(o.scale, 1, 1), 0.01], + ['Rotation', (v) => ({ rotation: (v * Math.PI) / 180 }), (o) => Math.round(((Number(o.rotation) || 0) * 180) / Math.PI * 100) / 100, 1], + ['Offset X', (v) => ({ offset: [v, pair(cur.offset, 1, 0)] }), (o) => pair(o.offset, 0, 0), 0.01], + ['Offset Y', (v) => ({ offset: [pair(cur.offset, 0, 0), v] }), (o) => pair(o.offset, 1, 0), 0.01], + ]; + const controls = parts.map(([label, patch, , step]) => { + const c = numberControl(label, { step }, (v, live) => send(patch(v as number), live)); + this.addRow(c); + return c; + }); + this.settings.set(name, { + el: this.body, + set: (v) => { + cur = v && typeof v === 'object' ? { ...(v as Record) } : {}; + parts.forEach(([, , read], i) => controls[i].set(read(cur))); + }, + }); + } + + private addTexture(id: number): void { + const row = el(`
      `); + const sel = q(row, 'select'); + this.texture = sel; + let last = ''; + sel.addEventListener('focus', () => { last = sel.value; }); + sel.addEventListener('change', () => { + if (sel.value === ADD_IMAGE) { sel.value = last; this.host.addImage(id); return; } + last = sel.value; + this.host.editSetting(id, 'texture', sel.value === '' ? null : Number(sel.value), false); + }); + this.body.appendChild(row); + this.refreshTextures(); + } + + private addConstant(node: GNode): void { + const id = node.id; + const colour = Array.isArray(node.settings.value); + const type = selectControl('Type', [['float', 'Number'], ['colour', 'Colour']], (v) => { + this.host.editSetting(id, 'value', v === 'colour' ? [0.5, 0.5, 0.5] : 0.5, false); + }); + type.set(colour ? 'colour' : 'float'); + this.addRow(type); + const edit: Edit = (v, live) => this.host.editSetting(id, 'value', v, live); + const c = colour ? colourControl(words('value'), edit) : numberControl(words('value'), { step: 0.01 }, edit); + this.addRow(c); + this.settings.set('value', c); + } +} + +export class OutputView extends BaseView { + private readonly swatch: HTMLImageElement; + private readonly box: HTMLElement; + + constructor(cat: Catalogue) { + super(OUTPUT_NODE, t('Material output'), 'is-output'); + this.w = OUTPUT_W; + this.el.setAttribute('aria-label', t('Material output')); + this.box = el(`
      `); + this.swatch = q(this.box, 'img'); + this.swatch.alt = t('Material preview'); + this.body.appendChild(this.box); + for (const i of cat.inputs) { + if (!i.graph) continue; + this.addSocketRow('in', i.name, materialInputType(cat, i.name), t(words(i.name)), null); + } + } + + async setPreview(src: string | null): Promise { + if (!src) return; + try { await swapMedia(this.swatch, src); } catch { return; } + setClass(this.box, 'is-empty', false); + } +} From 2deae9d2b4b6d867f3fb5b9021ed4ce12dc8c143 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:08:08 -0500 Subject: [PATCH 201/494] feat(graph): draw the graph with links and a material output node The editor applies a graph by diffing node views (unchanged shapes are patched, never rebuilt), draws each link as one cubic path keyed by its sockets, places the material output node on the right and remembers the view and output position per material for the session. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/editor.ts | 180 ++++++++++++++++++++++++++++++-- frontend/src/ui/graph/graph.css | 64 ++++++++++++ frontend/src/ui/graph/links.ts | 68 ++++++++++++ 3 files changed, 301 insertions(+), 11 deletions(-) create mode 100644 frontend/src/ui/graph/links.ts diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index 960444cf..21302300 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -1,25 +1,39 @@ -import { setText } from '../../shell/dom'; import { t } from '../../i18n'; import type { Workspace } from '../context'; -import type { Catalogue, Graph } from './model'; +import { GraphCanvas, type Rect, type View } from './canvas'; +import { LinkLayer, type Point } from './links'; +import { linkKey, materialInputType, OUTPUT_NODE, outputKey, outputType, emptyGraph, type Catalogue, type GLink, type GNode, type Graph, type SocketValue } from './model'; import { GraphSource, type TextureInfo } from './source'; +import { NodeView, OutputView, shapeOf, type NodeHost } from './views'; import { EditorWindow } from './window'; -export class GraphEditor { +interface Session { view: View; out: Point } + +export class GraphEditor implements NodeHost { readonly win: EditorWindow; readonly source: GraphSource; material: string | null = null; - cat: Catalogue | null = null; - graph: Graph | null = null; - textures: TextureInfo[] = []; + cat: Catalogue = { kinds: [], byId: new Map(), inputs: [] }; + graph: Graph = emptyGraph(); + canvas: GraphCanvas | null = null; + links: LinkLayer | null = null; + out: OutputView | null = null; + readonly views = new Map(); + readonly selection = new Set(); + private textureList: TextureInfo[] = []; + private outPos: Point = [0, 0]; + private readonly sessions = new Map(); private opening = 0; constructor(readonly ws: Workspace) { this.win = new EditorWindow(ws.ctx.slots.overlayRoot); this.source = new GraphSource(ws); this.win.root.addEventListener('keydown', (e) => this.key(e)); + this.win.onClose = () => this.remember(); } + textures(): TextureInfo[] { return this.textureList; } + async open(material: string): Promise { const token = ++this.opening; if (this.win.open && this.material === material) { this.focus(); return; } @@ -27,20 +41,164 @@ export class GraphEditor { const cat = await this.source.catalogue(); const data = await this.source.read(material); if (token !== this.opening) return; + this.remember(); + const fresh = this.material !== material || !this.canvas; this.cat = cat; - this.material = material; - this.graph = data.graph; - this.textures = data.textures; this.win.setTitle(data.name ? t('Node editor: {name}', { name: data.name }) : t('Node editor')); - setText(this.win.status, ''); this.win.show(); + this.ensureCanvas(); + if (fresh) this.reset(); + this.material = material; + this.textureList = data.textures; + this.apply(data.graph); + if (fresh) this.restore(material); this.focus(); } catch (err) { this.ws.ctx.toast(t('The node editor could not open: {reason}', { reason: err instanceof Error ? err.message : String(err) }), 'error'); } } - focus(): void { this.win.body.focus(); } + focus(): void { this.canvas?.host.focus({ preventScroll: true }); } + + private ensureCanvas(): void { + if (this.canvas) return; + this.canvas = new GraphCanvas(this.win.body, t('Node canvas')); + this.links = new LinkLayer(this.canvas.links); + this.out = new OutputView(this.cat); + this.canvas.nodes.appendChild(this.out.el); + this.out.measure(); + } + + private reset(): void { + for (const v of this.views.values()) v.el.remove(); + this.views.clear(); + for (const k of this.links?.keys() ?? []) this.links?.remove(k); + this.selection.clear(); + this.graph = emptyGraph(); + } + + private remember(): void { + if (this.material && this.canvas) this.sessions.set(this.material, { view: { ...this.canvas.view }, out: [...this.outPos] }); + } + + private restore(material: string): void { + const s = this.sessions.get(material); + if (s) { + this.outPos = [...s.out]; + this.placeOutput(); + this.canvas?.setView(s.view); + return; + } + const b = this.bounds(false); + this.outPos = b ? [Math.round(b.x + b.w + 96), Math.round(b.y)] : [240, -120]; + this.placeOutput(); + this.frameAll(); + } + + apply(next: Graph): void { + const g = next; + for (const [id, v] of [...this.views]) { + const n = g.nodes.get(id); + if (!n || v.shape !== shapeOf(n)) { v.el.remove(); this.views.delete(id); this.selection.delete(id); } + } + for (const n of g.nodes.values()) { + let v = this.views.get(n.id); + if (!v) { + v = new NodeView(this, n); + this.canvas?.nodes.insertBefore(v.el, this.out?.el ?? null); + v.place(n.position[0], n.position[1]); + v.measure(); + this.views.set(n.id, v); + } else { + v.update(n); + v.place(n.position[0], n.position[1]); + } + v.setSelected(this.selection.has(n.id)); + } + this.graph = g; + this.relinkAll(); + } + + private placeOutput(): void { + if (this.out?.place(this.outPos[0], this.outPos[1])) this.relinkAll(); + } + + socketPos(node: number, dir: 'in' | 'out', name: string): Point | null { + const v = node === OUTPUT_NODE ? this.out : this.views.get(node); + return v?.socketAt(dir, name) ?? null; + } + + private nodeName(id: number): string { + const n = this.graph.nodes.get(id); + return n ? t(this.cat.byId.get(n.kind)?.label ?? n.kind) : ''; + } + + private drawLink(l: GLink): void { + const a = this.socketPos(l.from[0], 'out', l.from[1]); + const b = this.socketPos(l.to[0], 'in', l.to[1]); + const from = this.graph.nodes.get(l.from[0]); + if (!a || !b || !from) { this.links?.remove(linkKey(l)); return; } + this.links?.set(linkKey(l), a, b, outputType(this.cat, from, l.from[1]) ?? 'float'); + } + + private drawOutput(input: string, r: [number, string]): void { + const key = outputKey(input, r); + const a = this.socketPos(r[0], 'out', r[1]); + const b = this.socketPos(OUTPUT_NODE, 'in', input); + if (!a || !b) { this.links?.remove(key); return; } + this.links?.set(key, a, b, materialInputType(this.cat, input)); + } + + relinkAll(): void { + const want = new Set(); + for (const l of this.graph.links) { want.add(linkKey(l)); this.drawLink(l); } + for (const [input, r] of this.graph.outputs) { want.add(outputKey(input, r)); this.drawOutput(input, r); } + for (const k of this.links?.keys() ?? []) if (!want.has(k)) this.links?.remove(k); + this.markLinked(); + } + + relinkNodes(ids: ReadonlySet): void { + for (const l of this.graph.links) if (ids.has(l.from[0]) || ids.has(l.to[0])) this.drawLink(l); + for (const [input, r] of this.graph.outputs) if (ids.has(r[0]) || ids.has(OUTPUT_NODE)) this.drawOutput(input, r); + } + + private markLinked(): void { + const fed = new Map(); + for (const l of this.graph.links) fed.set(`${l.to[0]}:${l.to[1]}`, this.nodeName(l.from[0])); + for (const [id, v] of this.views) { + for (const s of v.sockets.values()) if (s.dir === 'in') v.setLinked(s.name, fed.has(`${id}:${s.name}`), fed.get(`${id}:${s.name}`) ?? ''); + } + for (const i of this.cat.inputs) { + const r = this.graph.outputs.get(i.name); + this.out?.setLinked(i.name, r !== undefined, r ? this.nodeName(r[0]) : ''); + } + } + + bounds(withOutput = true): Rect | null { + let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity; + const add = (x: number, y: number, w: number, h: number): void => { x0 = Math.min(x0, x); y0 = Math.min(y0, y); x1 = Math.max(x1, x + w); y1 = Math.max(y1, y + h); }; + for (const v of this.views.values()) add(v.x, v.y, v.w, v.h); + if (withOutput && this.out) add(this.out.x, this.out.y, this.out.w, this.out.h); + return Number.isFinite(x0) ? { x: x0, y: y0, w: x1 - x0, h: y1 - y0 } : null; + } + + frameAll(): void { this.canvas?.frame(this.bounds(true)); } + + editInput(node: number, socket: string, value: SocketValue, live: boolean): void { + const n = this.graph.nodes.get(node); + if (!n) return; + n.inputs[socket] = value; + void live; + } + + editSetting(node: number, name: string, value: unknown, live: boolean): void { + const n: GNode | undefined = this.graph.nodes.get(node); + if (!n) return; + n.settings[name] = value; + void live; + } + + addImage(node: number): void { void node; } private key(e: KeyboardEvent): void { if (e.key === 'Escape' && !e.defaultPrevented) { diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css index 0128eded..ba00b849 100644 --- a/frontend/src/ui/graph/graph.css +++ b/frontend/src/ui/graph/graph.css @@ -20,3 +20,67 @@ .fsh-graph-edge.is-sw { bottom: 0; left: 0; cursor: nesw-resize; } .fsh-graph-edge.is-nw { top: 0; left: 0; cursor: nwse-resize; } .fsh-graph-edge.is-se { bottom: 0; right: 0; cursor: nwse-resize; } + +.fsh-graph-canvas { --fsh-graph-minor: color-mix(in srgb, var(--text) 4%, transparent); --fsh-graph-major: color-mix(in srgb, var(--text) 8%, transparent); --fsh-graph-grid: 24px; --fsh-graph-gx: 0px; --fsh-graph-gy: 0px; position: absolute; inset: 0; overflow: hidden; outline: none; background-color: var(--canvas-bg); background-image: linear-gradient(to right, var(--fsh-graph-major) 1px, transparent 1px), linear-gradient(to bottom, var(--fsh-graph-major) 1px, transparent 1px), linear-gradient(to right, var(--fsh-graph-minor) 1px, transparent 1px), linear-gradient(to bottom, var(--fsh-graph-minor) 1px, transparent 1px); background-size: calc(var(--fsh-graph-grid) * 4) calc(var(--fsh-graph-grid) * 4), calc(var(--fsh-graph-grid) * 4) calc(var(--fsh-graph-grid) * 4), var(--fsh-graph-grid) var(--fsh-graph-grid), var(--fsh-graph-grid) var(--fsh-graph-grid); background-position: var(--fsh-graph-gx) var(--fsh-graph-gy); touch-action: none; cursor: default; } +.fsh-graph-canvas:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-line); } +.fsh-graph-canvas.is-panning, .fsh-graph-canvas.is-space { cursor: grab; } +.fsh-graph-canvas.is-panning { cursor: grabbing; } +.fsh-graph-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; } +.fsh-graph-nodes { position: absolute; left: 0; top: 0; } +.fsh-graph-links { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; } +.fsh-graph-link { fill: none; stroke: var(--fsh-graph-wire, var(--text-muted)); stroke-width: 2px; vector-effect: non-scaling-stroke; } +.fsh-graph-link.is-float { --fsh-graph-wire: var(--text-muted); } +.fsh-graph-link.is-colour { --fsh-graph-wire: var(--warn); } +.fsh-graph-link.is-vector { --fsh-graph-wire: var(--accent-color); } +.fsh-graph-link.is-normal { --fsh-graph-wire: var(--ok); } +.fsh-graph-link.is-temp { stroke-dasharray: 6 4; } +.fsh-graph-link.is-refused { --fsh-graph-wire: var(--danger); } +.fsh-graph-link.is-error { --fsh-graph-wire: var(--danger); stroke-dasharray: 3 3; } +.fsh-graph-link.is-picked { opacity: 0.25; } +.fsh-graph-band { position: absolute; left: 0; top: 0; border: 1px solid var(--accent-line); background: var(--accent-wash); pointer-events: none; } + +.fsh-graph-node { position: absolute; left: 0; top: 0; width: 208px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-sm); color: var(--text-primary); font-size: var(--fs-11); outline: none; } +.fsh-graph-node.is-output { width: 196px; } +.fsh-graph-node.is-selected { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color), var(--shadow-md); } +.fsh-graph-node:focus-visible { box-shadow: 0 0 0 2px var(--accent-color), var(--shadow-md); } +.fsh-graph-node.is-error { border-color: var(--danger); } +.fsh-graph-node-head { display: flex; align-items: center; gap: var(--space-1); height: 26px; padding: 0 var(--space-2); border-bottom: 1px solid var(--line-1); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--bg-node); cursor: grab; } +.fsh-graph-node.is-pattern .fsh-graph-node-head { background: color-mix(in srgb, var(--accent) 12%, var(--bg-node)); } +.fsh-graph-node.is-output .fsh-graph-node-head { background: color-mix(in srgb, var(--ok) 14%, var(--bg-node)); } +.fsh-graph-node-title { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: var(--fs-12); font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; } +.fsh-graph-node-badge { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: var(--radius-pill); background: var(--danger); color: var(--text-on-accent); font-size: var(--fs-10); font-weight: var(--fw-semibold); cursor: help; } +.fsh-graph-node-badge[hidden] { display: none; } +.fsh-graph-node-body { padding: var(--space-1) 0; } +.fsh-graph-row { position: relative; display: flex; align-items: center; gap: var(--space-1); height: 26px; padding: 0 var(--space-3); } +.fsh-graph-row.is-out { justify-content: flex-end; } +.fsh-graph-row-label { min-width: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-graph-row.has-field:not(.is-linked) > .fsh-graph-row-label { display: none; } +.fsh-graph-row.is-linked > .fsh-graph-num, .fsh-graph-row.is-linked > .fsh-graph-field { display: none; } +.fsh-graph-row.is-ramp { height: 76px; align-items: stretch; padding-top: var(--space-1); padding-bottom: var(--space-1); } +.fsh-graph-sock { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0; padding: 0; border: 2px solid var(--surface-raised); border-radius: var(--radius-pill); background: var(--fsh-graph-wire, var(--text-muted)); cursor: crosshair; } +.fsh-graph-sock.is-in { left: -7px; } +.fsh-graph-sock.is-out { right: -7px; } +.fsh-graph-sock.is-float { --fsh-graph-wire: var(--text-muted); } +.fsh-graph-sock.is-colour { --fsh-graph-wire: var(--warn); } +.fsh-graph-sock.is-vector { --fsh-graph-wire: var(--accent-color); } +.fsh-graph-sock.is-normal { --fsh-graph-wire: var(--ok); border-radius: var(--radius-xs); } +.fsh-graph-sock:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; } +.fsh-graph-num { flex: 1 1 auto; min-width: 0; height: 22px; } +.fsh-graph-field { display: flex; flex: 1 1 auto; align-items: center; gap: var(--space-2); min-width: 0; height: 22px; } +.fsh-graph-field-label { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } +.fsh-graph-select { flex: 0 1 112px; min-width: 0; height: 22px; padding: 0 var(--space-1); font-size: var(--fs-11); } +.fsh-graph-swatch { flex: none; width: 40px; height: 18px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: none; cursor: pointer; } +.fsh-graph-swatch::-webkit-color-swatch-wrapper { padding: 0; } +.fsh-graph-swatch::-webkit-color-swatch { border: 0; border-radius: var(--radius-xs); } +.fsh-graph-field.is-bool { justify-content: flex-start; } +.fsh-graph-preview { height: 88px; margin: 0 var(--space-3) var(--space-1); overflow: hidden; border: 1px solid var(--line-1); border-radius: var(--radius); background: var(--bg-input); } +.fsh-graph-preview img { display: block; width: 100%; height: 100%; object-fit: cover; } +.fsh-graph-preview.is-empty img { visibility: hidden; } +.fsh-graph-ramp { display: grid; grid-template-rows: 16px 10px 24px; gap: var(--space-0); flex: 1 1 auto; min-width: 0; } +.fsh-graph-ramp-bar { border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: copy; } +.fsh-graph-ramp-track { position: relative; margin: 0 1px; cursor: copy; } +.fsh-graph-ramp-stop { position: absolute; top: 0; left: var(--fsh-graph-at, 0%); width: 10px; height: 10px; margin-left: -5px; padding: 0; border: 1px solid var(--text-muted); border-radius: var(--radius-xs); background: var(--fsh-graph-stop, var(--text)); cursor: ew-resize; } +.fsh-graph-ramp-stop.is-active { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color); } +.fsh-graph-ramp-row { display: flex; align-items: center; gap: var(--space-1); } +.fsh-graph-ramp-pos { flex: 1 1 auto; min-width: 0; height: 22px; padding: 0 var(--space-1); font: var(--fs-11) var(--mono); } +.fsh-graph-ramp-del { width: 22px; height: 22px; } diff --git a/frontend/src/ui/graph/links.ts b/frontend/src/ui/graph/links.ts new file mode 100644 index 00000000..fdd8f200 --- /dev/null +++ b/frontend/src/ui/graph/links.ts @@ -0,0 +1,68 @@ +import type { SocketType } from './model'; + +const SVG_NS = 'http://www.w3.org/2000/svg'; + +export type Point = [number, number]; + +export function curve(a: Point, b: Point): string { + const dx = Math.max(36, Math.abs(b[0] - a[0]) * 0.5); + const r = (v: number): number => Math.round(v * 10) / 10; + return `M${r(a[0])} ${r(a[1])}C${r(a[0] + dx)} ${r(a[1])} ${r(b[0] - dx)} ${r(b[1])} ${r(b[0])} ${r(b[1])}`; +} + +interface Path { el: SVGPathElement; d: string; ty: string } + +export class LinkLayer { + private readonly paths = new Map(); + private readonly temp: SVGPathElement; + private tempD = ''; + + constructor(private readonly svg: SVGSVGElement) { + this.temp = document.createElementNS(SVG_NS, 'path'); + this.temp.setAttribute('class', 'fsh-graph-link is-temp'); + this.temp.style.visibility = 'hidden'; + svg.appendChild(this.temp); + } + + has(key: string): boolean { return this.paths.has(key); } + keys(): string[] { return [...this.paths.keys()]; } + + set(key: string, a: Point, b: Point, ty: SocketType): void { + const d = curve(a, b); + let p = this.paths.get(key); + if (!p) { + const node = document.createElementNS(SVG_NS, 'path'); + node.setAttribute('class', `fsh-graph-link is-${ty}`); + node.dataset.key = key; + this.svg.insertBefore(node, this.temp); + p = { el: node, d: '', ty }; + this.paths.set(key, p); + } + if (p.ty !== ty) { p.el.classList.replace(`is-${p.ty}`, `is-${ty}`); p.ty = ty; } + if (p.d !== d) { p.d = d; p.el.setAttribute('d', d); } + } + + remove(key: string): void { + const p = this.paths.get(key); + if (!p) return; + p.el.remove(); + this.paths.delete(key); + } + + setClass(key: string, cls: string, on: boolean): void { + const p = this.paths.get(key); + if (p && p.el.classList.contains(cls) !== on) p.el.classList.toggle(cls, on); + } + + showTemp(a: Point, b: Point, ty: SocketType, refused: boolean): void { + const d = curve(a, b); + if (d !== this.tempD) { this.tempD = d; this.temp.setAttribute('d', d); } + const cls = `fsh-graph-link is-temp is-${ty}${refused ? ' is-refused' : ''}`; + if (this.temp.getAttribute('class') !== cls) this.temp.setAttribute('class', cls); + if (this.temp.style.visibility) this.temp.style.visibility = ''; + } + + hideTemp(): void { + if (!this.temp.style.visibility) this.temp.style.visibility = 'hidden'; + } +} From bb7377c6d9aee524249d8f56964e0043c78abe06 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:09:49 -0500 Subject: [PATCH 202/494] feat(graph): commit each finished edit with material.set_graph The editor keeps a local graph and sends it whole after each finished gesture, skipping sends that change nothing; while a value is dragged the sends are wrapped in a history group so the drag undoes as one step. Engine refusals are placed on the named nodes and links, the status line says the material keeps its last working graph and Revert restores it. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/commit.ts | 87 ++++++++++++++++++++++++++++++ frontend/src/ui/graph/editor.ts | 94 +++++++++++++++++++++++++++++++-- frontend/src/ui/graph/status.ts | 46 ++++++++++++++++ 3 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 frontend/src/ui/graph/commit.ts create mode 100644 frontend/src/ui/graph/status.ts diff --git a/frontend/src/ui/graph/commit.ts b/frontend/src/ui/graph/commit.ts new file mode 100644 index 00000000..49a35d84 --- /dev/null +++ b/frontend/src/ui/graph/commit.ts @@ -0,0 +1,87 @@ +import type { Workspace } from '../context'; +import { frameLater } from '../context'; + +export interface CommitResult { ok: boolean; error: string; graph: string } + +const SET = 'material.set_graph'; +const BEGIN = 'history.begin_group'; +const END = 'history.end_group'; + +export class Committer { + private chain: Promise = Promise.resolve(); + private grouping = false; + private pendingLive: Record | null = null; + private queued = 0; + private sent = 0; + readonly own = new WeakSet(); + onResult: ((r: CommitResult, live: boolean) => void) | null = null; + private readonly flushLive = frameLater(() => { + const g = this.pendingLive; + if (!g || this.queued > 0) { if (g) this.flushLive(); return; } + this.pendingLive = null; + this.send(g, true); + }); + + constructor(private readonly ws: Workspace, private readonly material: () => string | null) {} + + get busy(): boolean { return this.queued > 0 || this.pendingLive !== null || this.grouping; } + get count(): number { return this.sent; } + + live(graph: Record, label: string): void { + if (!this.ws.client.has(BEGIN)) return; + if (!this.grouping) { + this.grouping = true; + this.enqueue(BEGIN, { label }); + } + this.pendingLive = graph; + this.flushLive(); + } + + commit(graph: Record): void { + this.pendingLive = null; + this.send(graph, false); + if (this.grouping) { + this.grouping = false; + this.enqueue(END, {}); + } + } + + private send(graph: Record, live: boolean): void { + const key = this.material(); + if (!key) return; + const text = JSON.stringify(graph); + this.sent++; + this.enqueue(SET, { key, graph }, (ok, error) => this.onResult?.({ ok, error, graph: text }, live)); + } + + private enqueue(name: string, args: Record, done?: (ok: boolean, error: string) => void): void { + this.queued++; + this.own.add(args); + this.chain = this.chain.then(async () => { + try { + await this.ws.client.dispatch(name, args); + done?.(true, ''); + } catch (err) { + done?.(false, err instanceof Error ? err.message : String(err)); + } finally { + this.queued--; + } + }); + } + + idle(): Promise { return this.chain; } +} + +export interface ErrorPlace { nodes: Set; links: Array<[number, string, number, string]>; inputs: Array<[number, string]> } + +export function placeError(message: string): ErrorPlace { + const place: ErrorPlace = { nodes: new Set(), links: [], inputs: [] }; + const link = /(\d+) (\w+) -> (\d+) (\w+)/.exec(message) ?? /output (\d+) (\w+) cannot feed \w+ input (\d+) (\w+)/.exec(message); + if (link) place.links.push([Number(link[1]), link[2], Number(link[3]), link[4]]); + const fed = /input (\d+) (\w+) has more than one link/.exec(message); + if (fed) place.inputs.push([Number(fed[1]), fed[2]]); + for (const m of message.matchAll(/(?:node|nodes\.|cycle through node) ?(\d+)/g)) place.nodes.add(Number(m[1])); + const out = /output (\d+) \w+ cannot drive/.exec(message); + if (out) place.nodes.add(Number(out[1])); + return place; +} diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index 21302300..362e20fc 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -1,14 +1,21 @@ import { t } from '../../i18n'; import type { Workspace } from '../context'; import { GraphCanvas, type Rect, type View } from './canvas'; +import { Committer, placeError, type CommitResult } from './commit'; import { LinkLayer, type Point } from './links'; -import { linkKey, materialInputType, OUTPUT_NODE, outputKey, outputType, emptyGraph, type Catalogue, type GLink, type GNode, type Graph, type SocketValue } from './model'; +import { + converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, OUTPUT_NODE, outputKey, outputType, parseGraph, + type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, +} from './model'; import { GraphSource, type TextureInfo } from './source'; +import { StatusLine } from './status'; import { NodeView, OutputView, shapeOf, type NodeHost } from './views'; import { EditorWindow } from './window'; interface Session { view: View; out: Point } +const PREVIEW_SIZE = 96; + export class GraphEditor implements NodeHost { readonly win: EditorWindow; readonly source: GraphSource; @@ -24,10 +31,19 @@ export class GraphEditor implements NodeHost { private outPos: Point = [0, 0]; private readonly sessions = new Map(); private opening = 0; + readonly committer: Committer; + readonly status: StatusLine; + private good = ''; + private goodSig = ''; + private failed = false; + private previewToken = 0; constructor(readonly ws: Workspace) { this.win = new EditorWindow(ws.ctx.slots.overlayRoot); this.source = new GraphSource(ws); + this.status = new StatusLine(this.win.status, () => this.revert()); + this.committer = new Committer(ws, () => this.material); + this.committer.onResult = (r, live) => this.result(r, live); this.win.root.addEventListener('keydown', (e) => this.key(e)); this.win.onClose = () => this.remember(); } @@ -50,8 +66,9 @@ export class GraphEditor implements NodeHost { if (fresh) this.reset(); this.material = material; this.textureList = data.textures; - this.apply(data.graph); + this.adopt(data.graph); if (fresh) this.restore(material); + this.refreshPreview(); this.focus(); } catch (err) { this.ws.ctx.toast(t('The node editor could not open: {reason}', { reason: err instanceof Error ? err.message : String(err) }), 'error'); @@ -95,6 +112,13 @@ export class GraphEditor implements NodeHost { this.frameAll(); } + private adopt(g: Graph): void { + this.good = JSON.stringify(graphJson(g)); + this.goodSig = graphSig(g); + this.apply(g); + this.showError(null); + } + apply(next: Graph): void { const g = next; for (const [id, v] of [...this.views]) { @@ -188,18 +212,80 @@ export class GraphEditor implements NodeHost { const n = this.graph.nodes.get(node); if (!n) return; n.inputs[socket] = value; - void live; + this.changed(live, t('Change a node value')); } editSetting(node: number, name: string, value: unknown, live: boolean): void { const n: GNode | undefined = this.graph.nodes.get(node); if (!n) return; + const shape = shapeOf(n); n.settings[name] = value; - void live; + if (name === 'stops' && Array.isArray(value)) value.sort((a, b) => Number((a as { position: number }).position) - Number((b as { position: number }).position)); + if (shapeOf(n) !== shape) { + const ty = outputType(this.cat, n, 'value'); + this.graph.links = this.graph.links.filter((l) => l.from[0] !== node || !ty || converts(ty, this.inputType(l.to[0], l.to[1]))); + for (const [k, r] of [...this.graph.outputs]) if (r[0] === node && ty && !converts(ty, materialInputType(this.cat, k))) this.graph.outputs.delete(k); + this.apply(this.graph); + } else if (name === 'interpolation') this.views.get(node)?.update(n); + this.changed(live, t('Change a node setting')); + } + + inputType(node: number, socket: string): SocketType { + if (node === OUTPUT_NODE) return materialInputType(this.cat, socket); + const n = this.graph.nodes.get(node); + return (n && inputSpec(this.cat, n, socket)?.ty) ?? 'float'; } addImage(node: number): void { void node; } + changed(live: boolean, label: string): void { + if (live) { this.committer.live(graphJson(this.graph), label); return; } + this.finish(); + } + + finish(): void { + if (!this.material) return; + if (graphSig(this.graph) === this.goodSig && !this.failed) return; + this.committer.commit(graphJson(this.graph)); + } + + private result(r: CommitResult, live: boolean): void { + if (r.ok) { + if (live) return; + this.good = r.graph; + this.goodSig = graphSig(parseGraph(JSON.parse(r.graph))); + this.showError(null); + this.refreshPreview(); + return; + } + this.showError(r.error); + } + + private showError(message: string | null): void { + const place = message ? placeError(message) : { nodes: new Set(), links: [], inputs: [] }; + this.failed = message !== null; + for (const [id, v] of this.views) v.setError(place.nodes.has(id) ? message : null); + for (const k of this.links?.keys() ?? []) this.links?.setClass(k, 'is-error', false); + for (const [a, as, b, bs] of place.links) this.links?.setClass(linkKey({ from: [a, as], to: [b, bs] }), 'is-error', true); + for (const [b, bs] of place.inputs) for (const l of this.graph.links) if (l.to[0] === b && l.to[1] === bs) this.links?.setClass(linkKey(l), 'is-error', true); + this.status.error(message ? t('Not applied: {reason}. The material keeps its last working graph.', { reason: message }) : ''); + } + + revert(): void { + if (!this.good) return; + this.apply(parseGraph(JSON.parse(this.good))); + this.showError(null); + } + + refreshPreview(): void { + const material = this.material; + if (!material || !this.out) return; + const token = ++this.previewToken; + void this.source.preview(material, PREVIEW_SIZE).then((src) => { + if (token === this.previewToken && this.material === material) void this.out?.setPreview(src); + }).catch(() => undefined); + } + private key(e: KeyboardEvent): void { if (e.key === 'Escape' && !e.defaultPrevented) { e.preventDefault(); diff --git a/frontend/src/ui/graph/status.ts b/frontend/src/ui/graph/status.ts new file mode 100644 index 00000000..758c3bd8 --- /dev/null +++ b/frontend/src/ui/graph/status.ts @@ -0,0 +1,46 @@ +import { el, q, setClass, setText, setTitle } from '../../shell/dom'; +import { t } from '../../i18n'; + +export class StatusLine { + private readonly message: HTMLElement; + private readonly revert: HTMLButtonElement; + private readonly zoom: HTMLElement; + private readonly count: HTMLElement; + private hint = ''; + private err = ''; + + constructor(host: HTMLElement, onRevert: () => void) { + host.appendChild(el(``)); + host.appendChild(el(``)); + host.appendChild(el(``)); + host.appendChild(el(``)); + this.message = q(host, '.fsh-graph-msg'); + this.revert = q(host, '.fsh-graph-revert'); + this.zoom = q(host, '.fsh-graph-zoom'); + this.count = q(host, '.fsh-graph-count'); + setText(this.revert, t('Revert')); + setTitle(this.revert, t('Go back to the last graph the engine accepted')); + this.revert.addEventListener('click', onRevert); + } + + note(text: string): void { + this.hint = text; + this.paint(); + } + + error(text: string): void { + this.err = text; + this.paint(); + } + + setZoom(z: number): void { setText(this.zoom, `${Math.round(z * 100)}%`); } + setCount(nodes: number, links: number): void { setText(this.count, t('{nodes} nodes, {links} links', { nodes, links })); } + + private paint(): void { + const text = this.err || this.hint; + setText(this.message, text); + setTitle(this.message, text); + setClass(this.message, 'is-error', this.err !== ''); + if (this.revert.hidden !== !this.err) this.revert.hidden = !this.err; + } +} From 2ccd44b2e89010044bb1af1f6a660301b02b1223 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:12:15 -0500 Subject: [PATCH 203/494] feat(graph): add a searchable pick menu grouped like the node kinds A glass popover in the overlay root with a search field, keyboard selection and rows patched by key; node kinds group as inputs, colour and maths, surface and patterns in catalogue order. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/labels.ts | 7 ++ frontend/src/ui/graph/menu.ts | 119 ++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 frontend/src/ui/graph/menu.ts diff --git a/frontend/src/ui/graph/labels.ts b/frontend/src/ui/graph/labels.ts index 2e21c10f..50ade66d 100644 --- a/frontend/src/ui/graph/labels.ts +++ b/frontend/src/ui/graph/labels.ts @@ -20,6 +20,13 @@ export function words(name: string): string { return s.charAt(0).toUpperCase() + s.slice(1); } +export function groupOf(k: { id: string; procedural: boolean }): string { + if (k.procedural) return 'Patterns'; + if (k.id === 'constant' || k.id === 'texture' || k.id === 'mapping') return 'Inputs'; + if (k.id === 'normal_map' || k.id === 'bump') return 'Surface'; + return 'Colour and maths'; +} + export const TYPE_WORDS: Readonly> = { float: 'number', colour: 'colour', diff --git a/frontend/src/ui/graph/menu.ts b/frontend/src/ui/graph/menu.ts new file mode 100644 index 00000000..d0e39269 --- /dev/null +++ b/frontend/src/ui/graph/menu.ts @@ -0,0 +1,119 @@ +import { el, escapeHtml, patchList, q, setAttr, setClass, setHidden, setStyleVar } from '../../shell/dom'; +import { t } from '../../i18n'; + +export interface PickItem { id: string; label: string; group: string; hint?: string } + +export class PickMenu { + readonly root: HTMLElement; + private readonly input: HTMLInputElement; + private readonly list: HTMLElement; + private readonly empty: HTMLElement; + private items: PickItem[] = []; + private shown: PickItem[] = []; + private active = 0; + private pick: ((item: PickItem) => void) | null = null; + private before: HTMLElement | null = null; + + constructor(host: HTMLElement) { + this.root = el(``); + this.input = q(this.root, 'input'); + this.list = q(this.root, '.fsh-graph-menu-list'); + this.empty = q(this.root, '.fsh-graph-menu-empty'); + host.appendChild(this.root); + this.input.addEventListener('input', () => { this.active = 0; this.filter(); }); + this.input.addEventListener('keydown', (e) => this.key(e)); + this.list.addEventListener('pointerdown', (e) => e.preventDefault()); + this.list.addEventListener('click', (e) => { + const row = (e.target as HTMLElement).closest('[data-index]'); + if (row) this.choose(Number(row.dataset.index)); + }); + this.list.addEventListener('pointermove', (e) => { + const row = (e.target as HTMLElement).closest('[data-index]'); + if (row && Number(row.dataset.index) !== this.active) { this.active = Number(row.dataset.index); this.mark(); } + }); + this.input.addEventListener('blur', () => { if (!this.root.hidden) window.setTimeout(() => { if (!this.root.contains(document.activeElement)) this.close(false); }, 0); }); + } + + get open(): boolean { return !this.root.hidden; } + + show(title: string, items: PickItem[], x: number, y: number, pick: (item: PickItem) => void): void { + this.before = document.activeElement instanceof HTMLElement ? document.activeElement : null; + this.items = items; + this.pick = pick; + this.active = 0; + this.input.value = ''; + setAttr(this.input, 'placeholder', title); + setAttr(this.input, 'aria-label', title); + this.filter(); + const w = 260, h = 340; + setStyleVar(this.root, '--fsh-graph-mx', `${Math.round(Math.min(Math.max(4, x), window.innerWidth - w - 4))}px`); + setStyleVar(this.root, '--fsh-graph-my', `${Math.round(Math.min(Math.max(4, y), window.innerHeight - h - 4))}px`); + setHidden(this.root, false); + this.input.focus(); + } + + close(refocus = true): void { + if (this.root.hidden) return; + setHidden(this.root, true); + this.pick = null; + if (refocus && this.before?.isConnected) this.before.focus({ preventScroll: true }); + } + + private filter(): void { + const words = this.input.value.trim().toLowerCase().split(/\s+/).filter(Boolean); + this.shown = this.items.filter((i) => words.every((w) => `${i.label} ${i.group} ${i.hint ?? ''}`.toLowerCase().includes(w))); + const rows: Array<{ key: string; group?: string; item?: PickItem; n: number }> = []; + let group = ''; + this.shown.forEach((i, n) => { + if (i.group !== group) { group = i.group; rows.push({ key: `g:${group}`, group, n: -1 }); } + rows.push({ key: `i:${i.id}`, item: i, n }); + }); + patchList(this.list, rows, { + key: (r) => r.key, + create: (r) => (r.item + ? el(`
      ${escapeHtml(r.item.label)}${r.item.hint ? `${escapeHtml(r.item.hint)}` : ''}
      `) + : el(``)), + update: () => undefined, + }); + for (const row of this.list.children) { + const r = rows.find((x) => x.key === (row as HTMLElement).dataset.key); + if (r?.item) { (row as HTMLElement).dataset.index = String(r.n); row.id = `fsh-graph-opt-${r.n}`; } + } + setHidden(this.empty, this.shown.length > 0); + this.mark(); + } + + private mark(): void { + for (const row of this.list.querySelectorAll('[data-index]')) { + const on = Number(row.dataset.index) === this.active; + setClass(row, 'is-active', on); + setAttr(row, 'aria-selected', on ? 'true' : 'false'); + if (on) row.scrollIntoView({ block: 'nearest' }); + } + setAttr(this.input, 'aria-activedescendant', this.shown.length ? `fsh-graph-opt-${this.active}` : null); + } + + private choose(i: number): void { + const item = this.shown[i]; + const fn = this.pick; + if (!item || !fn) return; + this.close(); + fn(item); + } + + private key(e: KeyboardEvent): void { + if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { + if (this.shown.length) this.active = (this.active + (e.key === 'ArrowDown' ? 1 : this.shown.length - 1)) % this.shown.length; + this.mark(); + } else if (e.key === 'Enter') this.choose(this.active); + else if (e.key === 'Escape') this.close(); + else if (e.key === 'Tab') { e.preventDefault(); this.close(); } + else { e.stopPropagation(); return; } + e.preventDefault(); + e.stopPropagation(); + } +} From bfaab4e439c9b6e86e58315ac82633d303073d59 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:12:15 -0500 Subject: [PATCH 204/494] feat(graph): add, select, drag and connect nodes with the pointer Right click adds a node at the pointer; click and Shift select, empty-canvas drags box-select, and dragging nodes writes one transform per node and rewrites only the touching link paths, committing once on release. Dragging from a socket highlights type-compatible sockets, refuses others with the reason, and dragging an input end away reconnects or disconnects. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/editor.ts | 82 ++++++++++- frontend/src/ui/graph/graph.css | 19 +++ frontend/src/ui/graph/interact.ts | 220 ++++++++++++++++++++++++++++++ 3 files changed, 319 insertions(+), 2 deletions(-) create mode 100644 frontend/src/ui/graph/interact.ts diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index 362e20fc..7507f931 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -2,10 +2,13 @@ import { t } from '../../i18n'; import type { Workspace } from '../context'; import { GraphCanvas, type Rect, type View } from './canvas'; import { Committer, placeError, type CommitResult } from './commit'; +import { Interaction } from './interact'; +import { groupOf } from './labels'; import { LinkLayer, type Point } from './links'; +import { PickMenu, type PickItem } from './menu'; import { - converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, OUTPUT_NODE, outputKey, outputType, parseGraph, - type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, + converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, MAX_NODES, newNode, nextId, OUTPUT_NODE, outputKey, + outputType, parseGraph, type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, } from './model'; import { GraphSource, type TextureInfo } from './source'; import { StatusLine } from './status'; @@ -33,6 +36,8 @@ export class GraphEditor implements NodeHost { private opening = 0; readonly committer: Committer; readonly status: StatusLine; + readonly menu: PickMenu; + interaction: Interaction | null = null; private good = ''; private goodSig = ''; private failed = false; @@ -44,6 +49,7 @@ export class GraphEditor implements NodeHost { this.status = new StatusLine(this.win.status, () => this.revert()); this.committer = new Committer(ws, () => this.material); this.committer.onResult = (r, live) => this.result(r, live); + this.menu = new PickMenu(ws.ctx.slots.overlayRoot); this.win.root.addEventListener('keydown', (e) => this.key(e)); this.win.onClose = () => this.remember(); } @@ -84,6 +90,9 @@ export class GraphEditor implements NodeHost { this.out = new OutputView(this.cat); this.canvas.nodes.appendChild(this.out.el); this.out.measure(); + this.interaction = new Interaction(this); + this.canvas.onView = () => this.status.setZoom(this.canvas?.view.z ?? 1); + this.status.setZoom(1); } private reset(): void { @@ -238,6 +247,75 @@ export class GraphEditor implements NodeHost { addImage(node: number): void { void node; } + select(ids: ReadonlySet): void { + for (const [id, v] of this.views) v.setSelected(ids.has(id)); + this.out?.setSelected(ids.has(OUTPUT_NODE)); + this.selection.clear(); + for (const id of ids) this.selection.add(id); + } + + position(id: number): Point | null { + if (id === OUTPUT_NODE) return [...this.outPos]; + const n = this.graph.nodes.get(id); + return n ? [n.position[0], n.position[1]] : null; + } + + moveTo(id: number, p: Point): void { + if (id === OUTPUT_NODE) { this.outPos = [p[0], p[1]]; this.out?.place(p[0], p[1]); return; } + const n = this.graph.nodes.get(id); + if (!n) return; + n.position = [p[0], p[1]]; + this.views.get(id)?.place(p[0], p[1]); + } + + finishMove(ids: number[]): void { + this.relinkNodes(new Set(ids)); + if (ids.some((id) => id !== OUTPUT_NODE)) this.finish(); + } + + connect(from: [number, string], toNode: number, toName: string, picked: string | null): void { + if (picked) this.dropLink(picked); + if (toNode === OUTPUT_NODE) this.graph.outputs.set(toName, [from[0], from[1]]); + else { + this.graph.links = this.graph.links.filter((l) => !(l.to[0] === toNode && l.to[1] === toName)); + this.graph.links.push({ from: [from[0], from[1]], to: [toNode, toName] }); + } + this.relinkAll(); + this.finish(); + } + + disconnect(key: string): void { + this.dropLink(key); + this.relinkAll(); + this.finish(); + } + + private dropLink(key: string): void { + this.graph.links = this.graph.links.filter((l) => linkKey(l) !== key); + for (const [k, r] of [...this.graph.outputs]) if (outputKey(k, r) === key) this.graph.outputs.delete(k); + } + + addNode(kind: string, at: Point): number | null { + const spec = this.cat.byId.get(kind); + if (!spec) return null; + if (this.graph.nodes.size >= MAX_NODES) { this.ws.ctx.toast(t('A graph holds at most {n} nodes.', { n: MAX_NODES }), 'error'); return null; } + const id = nextId(this.graph); + this.graph.nodes.set(id, newNode(spec, id, [Math.round(at[0]), Math.round(at[1])])); + this.apply(this.graph); + this.select(new Set([id])); + this.views.get(id)?.el.focus({ preventScroll: true }); + this.finish(); + return id; + } + + openAddMenu(clientX: number, clientY: number): void { + const canvas = this.canvas; + if (!canvas) return; + const at = canvas.toCanvas(clientX, clientY); + const items: PickItem[] = this.cat.kinds.map((k) => ({ id: k.id, label: t(k.label), group: t(groupOf(k)) })); + this.menu.show(t('Add a node'), items, clientX, clientY, (item) => { this.addNode(item.id, at); }); + } + changed(live: boolean, label: string): void { if (live) { this.committer.live(graphJson(this.graph), label); return; } this.finish(); diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css index ba00b849..f02078ff 100644 --- a/frontend/src/ui/graph/graph.css +++ b/frontend/src/ui/graph/graph.css @@ -65,6 +65,25 @@ .fsh-graph-sock.is-vector { --fsh-graph-wire: var(--accent-color); } .fsh-graph-sock.is-normal { --fsh-graph-wire: var(--ok); border-radius: var(--radius-xs); } .fsh-graph-sock:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; } +.fsh-graph-sock::before { content: ""; position: absolute; inset: -7px; } +.fsh-graph-canvas.is-linking .fsh-graph-sock { opacity: 0.3; } +.fsh-graph-canvas.is-linking .fsh-graph-sock.is-ok { opacity: 1; box-shadow: 0 0 0 3px var(--accent-wash), 0 0 0 1px var(--accent-color); } +.fsh-graph-msg { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; } +.fsh-graph-msg.is-error { color: var(--danger-text); } +.fsh-graph-revert { flex: none; height: 18px; padding: 0 var(--space-2); font-size: var(--fs-11); } +.fsh-graph-revert[hidden] { display: none; } +.fsh-graph-count { flex: none; min-width: 16ch; text-align: end; } +.fsh-graph-zoom { flex: none; min-width: 5ch; text-align: end; } +.fsh-graph-menu { position: fixed; left: var(--fsh-graph-mx, 0px); top: var(--fsh-graph-my, 0px); z-index: var(--z-menu); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 260px; max-height: 340px; padding: var(--space-1); background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-12); } +.fsh-graph-menu[hidden] { display: none; } +.fsh-graph-menu-search { height: var(--ctl-md); margin-bottom: var(--space-1); } +.fsh-graph-menu-list { min-height: 0; overflow-y: auto; } +.fsh-graph-menu-group { padding: var(--space-2) var(--space-2) var(--space-0); color: var(--text-faint); font-size: var(--fs-10); font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase; } +.fsh-graph-menu-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: 26px; padding: 0 var(--space-2); border-radius: var(--radius); cursor: default; } +.fsh-graph-menu-item.is-active { background: var(--accent-soft); } +.fsh-graph-menu-hint { color: var(--text-faint); font-size: var(--fs-11); } +.fsh-graph-menu-empty { margin: var(--space-2); color: var(--text-muted); } +.fsh-graph-menu-empty[hidden] { display: none; } .fsh-graph-num { flex: 1 1 auto; min-width: 0; height: 22px; } .fsh-graph-field { display: flex; flex: 1 1 auto; align-items: center; gap: var(--space-2); min-width: 0; height: 22px; } .fsh-graph-field-label { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } diff --git a/frontend/src/ui/graph/interact.ts b/frontend/src/ui/graph/interact.ts new file mode 100644 index 00000000..072cebbb --- /dev/null +++ b/frontend/src/ui/graph/interact.ts @@ -0,0 +1,220 @@ +import { setClass } from '../../shell/dom'; +import { t } from '../../i18n'; +import type { GraphEditor } from './editor'; +import { TYPE_WORDS } from './labels'; +import type { Point } from './links'; +import { converts, linkInto, linkKey, OUTPUT_NODE, outputKey, outputType, reaches, type SocketRef, type SocketType } from './model'; + +const DRAG_SLOP = 4; + +interface End { node: number; dir: 'in' | 'out'; name: string; ty: SocketType } + +interface LinkDrag { + kind: 'link'; + pointer: number; + fixed: End; + picked: string | null; + over: End | null; + reason: string; +} + +interface NodeDrag { + kind: 'nodes'; + pointer: number; + start: Point; + ids: number[]; + from: Map; + moved: boolean; + clickSelect: number | null; +} + +interface BoxDrag { kind: 'box'; pointer: number; start: Point; add: boolean; base: Set; moved: boolean } + +type Gesture = LinkDrag | NodeDrag | BoxDrag; + +function endOf(sock: HTMLElement): End | null { + const node = sock.closest('.fsh-graph-node'); + if (!node) return null; + return { node: Number(node.dataset.node), dir: sock.dataset.dir === 'out' ? 'out' : 'in', name: sock.dataset.sock ?? '', ty: (sock.dataset.ty ?? 'float') as SocketType }; +} + +export class Interaction { + private g: Gesture | null = null; + pointer: Point | null = null; + + constructor(private readonly ed: GraphEditor) { + const host = ed.canvas?.host; + if (!host) return; + host.addEventListener('pointerdown', (e) => this.down(e)); + host.addEventListener('pointermove', (e) => this.move(e)); + host.addEventListener('pointerup', (e) => this.up(e, false)); + host.addEventListener('pointercancel', (e) => this.up(e, true)); + host.addEventListener('pointerleave', () => { if (!this.g) this.pointer = null; }); + host.addEventListener('contextmenu', (e) => { + e.preventDefault(); + if ((e.target as HTMLElement).closest('input, select, textarea')) return; + this.ed.openAddMenu(e.clientX, e.clientY); + }); + } + + get active(): boolean { return this.g !== null; } + + private down(e: PointerEvent): void { + const ed = this.ed, canvas = ed.canvas; + if (!canvas || e.button !== 0 || this.g) return; + const target = e.target as HTMLElement; + const sock = target.closest('.fsh-graph-sock'); + if (sock) { this.beginLink(e, sock); return; } + if (target.closest('input, select, textarea, button, .fsh-graph-num, .fsh-graph-ramp, label')) return; + const nodeEl = target.closest('.fsh-graph-node'); + const at = canvas.toCanvas(e.clientX, e.clientY); + if (nodeEl) { + const id = Number(nodeEl.dataset.node); + let clickSelect: number | null = null; + if (e.shiftKey || e.ctrlKey || e.metaKey) { + const next = new Set(ed.selection); + if (next.has(id)) next.delete(id); else next.add(id); + ed.select(next); + } else if (!ed.selection.has(id)) ed.select(new Set([id])); + else clickSelect = id; + const ids = [...ed.selection]; + const from = new Map(); + for (const i of ids) { const p = ed.position(i); if (p) from.set(i, p); } + this.g = { kind: 'nodes', pointer: e.pointerId, start: at, ids, from, moved: false, clickSelect }; + nodeEl.focus({ preventScroll: true }); + } else { + this.g = { kind: 'box', pointer: e.pointerId, start: at, add: e.shiftKey || e.ctrlKey || e.metaKey, base: new Set(ed.selection), moved: false }; + canvas.host.focus({ preventScroll: true }); + } + canvas.host.setPointerCapture(e.pointerId); + e.preventDefault(); + } + + private beginLink(e: PointerEvent, sock: HTMLElement): void { + const ed = this.ed; + const end = endOf(sock); + if (!end || !ed.canvas) return; + let fixed = end, picked: string | null = null; + if (end.dir === 'in') { + const existing = end.node === OUTPUT_NODE ? ed.graph.outputs.get(end.name) : linkInto(ed.graph, end.node, end.name)?.from; + if (existing) { + const from = ed.graph.nodes.get(existing[0]); + fixed = { node: existing[0], dir: 'out', name: existing[1], ty: (from && outputType(ed.cat, from, existing[1])) ?? 'float' }; + picked = end.node === OUTPUT_NODE ? outputKey(end.name, existing) : linkKey({ from: existing, to: [end.node, end.name] }); + ed.links?.setClass(picked, 'is-picked', true); + } + } + this.g = { kind: 'link', pointer: e.pointerId, fixed, picked, over: null, reason: '' }; + this.mark(fixed, picked); + ed.canvas.host.setPointerCapture(e.pointerId); + e.preventDefault(); + e.stopPropagation(); + this.move(e); + } + + refusal(a: End, b: End, picked: string | null): string { + if (a.dir === b.dir) return a.dir === 'out' ? t('Connect an output to an input.') : t('Connect an input to an output.'); + const out = a.dir === 'out' ? a : b, inp = a.dir === 'out' ? b : a; + if (out.node === inp.node) return t('A node cannot feed itself.'); + if (!converts(out.ty, inp.ty)) return t('A {from} output cannot feed a {to} input.', { from: t(TYPE_WORDS[out.ty]), to: t(TYPE_WORDS[inp.ty]) }); + if (inp.node !== OUTPUT_NODE) { + const g = this.ed.graph; + const links = picked ? g.links.filter((l) => linkKey(l) !== picked) : g.links; + if (reaches({ ...g, links }, inp.node, out.node)) return t('That link would make a loop.'); + } + return ''; + } + + private mark(fixed: End, picked: string | null): void { + const ed = this.ed; + setClass(ed.canvas?.host ?? null, 'is-linking', true); + const all = [...ed.views.values(), ...(ed.out ? [ed.out] : [])]; + for (const v of all) { + for (const s of v.sockets.values()) { + const ok = this.refusal(fixed, { node: v.id, dir: s.dir, name: s.name, ty: s.ty }, picked) === ''; + setClass(s.el, 'is-ok', ok); + } + } + } + + private unmark(): void { + const ed = this.ed; + setClass(ed.canvas?.host ?? null, 'is-linking', false); + for (const v of [...ed.views.values(), ...(ed.out ? [ed.out] : [])]) for (const s of v.sockets.values()) setClass(s.el, 'is-ok', false); + } + + private move(e: PointerEvent): void { + const ed = this.ed, canvas = ed.canvas; + if (!canvas) return; + const at = canvas.toCanvas(e.clientX, e.clientY); + this.pointer = [e.clientX, e.clientY]; + const g = this.g; + if (!g || e.pointerId !== g.pointer) return; + if (g.kind === 'link') { + const hit = document.elementFromPoint(e.clientX, e.clientY)?.closest('.fsh-graph-sock') ?? null; + const over = hit ? endOf(hit) : null; + g.over = over; + g.reason = over ? this.refusal(g.fixed, over, g.picked) : ''; + const fixedPos = ed.socketPos(g.fixed.node, g.fixed.dir, g.fixed.name) ?? at; + const overPos = over && !g.reason ? ed.socketPos(over.node, over.dir, over.name) ?? at : at; + if (g.fixed.dir === 'out') ed.links?.showTemp(fixedPos, overPos, g.fixed.ty, g.reason !== ''); + else ed.links?.showTemp(overPos, fixedPos, g.fixed.ty, g.reason !== ''); + ed.status.note(g.reason); + return; + } + if (g.kind === 'nodes') { + const dx = at[0] - g.start[0], dy = at[1] - g.start[1]; + if (!g.moved && Math.hypot(dx, dy) * canvas.view.z < DRAG_SLOP) return; + g.moved = true; + for (const id of g.ids) { + const p = g.from.get(id); + if (p) ed.moveTo(id, [Math.round(p[0] + dx), Math.round(p[1] + dy)]); + } + ed.relinkNodes(new Set(g.ids)); + return; + } + const x0 = Math.min(g.start[0], at[0]), y0 = Math.min(g.start[1], at[1]); + const x1 = Math.max(g.start[0], at[0]), y1 = Math.max(g.start[1], at[1]); + if (!g.moved && (x1 - x0) * canvas.view.z < DRAG_SLOP && (y1 - y0) * canvas.view.z < DRAG_SLOP) return; + g.moved = true; + const z = canvas.view.z, v = canvas.view; + const band = canvas.band; + band.hidden = false; + band.style.transform = `translate(${x0 * z + v.x}px, ${y0 * z + v.y}px)`; + band.style.width = `${(x1 - x0) * z}px`; + band.style.height = `${(y1 - y0) * z}px`; + const next = new Set(g.add ? g.base : []); + for (const [id, view] of ed.views) { + if (view.x < x1 && view.x + view.w > x0 && view.y < y1 && view.y + view.h > y0) next.add(id); + } + ed.select(next); + } + + private up(e: PointerEvent, cancel: boolean): void { + const g = this.g, ed = this.ed; + if (!g || e.pointerId !== g.pointer) return; + this.g = null; + if (g.kind === 'link') { + ed.links?.hideTemp(); + if (g.picked) ed.links?.setClass(g.picked, 'is-picked', false); + this.unmark(); + ed.status.note(''); + if (cancel) return; + if (g.over && g.reason) { ed.ws.ctx.toast(g.reason, 'error'); return; } + if (g.over) { + const out = g.fixed.dir === 'out' ? g.fixed : g.over, inp = g.fixed.dir === 'out' ? g.over : g.fixed; + ed.connect([out.node, out.name] as SocketRef, inp.node, inp.name, g.picked); + } else if (g.picked) ed.disconnect(g.picked); + return; + } + if (g.kind === 'nodes') { + if (g.moved && !cancel) ed.finishMove(g.ids); + else if (g.moved) for (const id of g.ids) { const p = g.from.get(id); if (p) ed.moveTo(id, p); } + else if (g.clickSelect !== null) ed.select(new Set([g.clickSelect])); + if (cancel) ed.relinkNodes(new Set(g.ids)); + return; + } + if (ed.canvas) ed.canvas.band.hidden = true; + if (!g.moved && !g.add) ed.select(new Set()); + } +} From 73f2fe20f657097d7beaed9477f0da14e25e8b90 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:13:59 -0500 Subject: [PATCH 205/494] feat(graph): list every editor key in a help popover One key table drives both the handler and the popover, which opens from the header or with ? and closes with Escape or when focus leaves it. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/graph.css | 8 ++++++ frontend/src/ui/graph/help.ts | 43 +++++++++++++++++++++++++++++++++ frontend/src/ui/graph/keys.ts | 31 ++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 frontend/src/ui/graph/help.ts create mode 100644 frontend/src/ui/graph/keys.ts diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css index f02078ff..c0f47814 100644 --- a/frontend/src/ui/graph/graph.css +++ b/frontend/src/ui/graph/graph.css @@ -84,6 +84,14 @@ .fsh-graph-menu-hint { color: var(--text-faint); font-size: var(--fs-11); } .fsh-graph-menu-empty { margin: var(--space-2); color: var(--text-muted); } .fsh-graph-menu-empty[hidden] { display: none; } +.fsh-graph-help { position: absolute; top: 40px; right: var(--space-2); z-index: var(--z-raised); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 360px; max-height: calc(100% - 72px); padding: var(--space-3); background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); outline: none; } +.fsh-graph-help[hidden] { display: none; } +.fsh-graph-help-title { margin: 0 0 var(--space-2); font-size: var(--fs-13); font-weight: var(--fw-semibold); } +.fsh-graph-help-list { min-height: 0; overflow-y: auto; } +.fsh-graph-help-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: baseline; gap: var(--space-2); padding: var(--space-1) 0; border-top: 1px solid var(--line-1); color: var(--text-secondary); } +.fsh-graph-help-keys { display: flex; flex-wrap: wrap; gap: var(--space-0); } +.fsh-graph-help kbd { padding: 0 var(--space-1); border: 1px solid var(--line-2); border-radius: var(--radius-xs); background: var(--bg-input); color: var(--text-primary); font: var(--fs-11) var(--mono); } +.fsh-graph-help-note { margin: var(--space-2) 0 0; color: var(--text-faint); font-size: var(--fs-11); } .fsh-graph-num { flex: 1 1 auto; min-width: 0; height: 22px; } .fsh-graph-field { display: flex; flex: 1 1 auto; align-items: center; gap: var(--space-2); min-width: 0; height: 22px; } .fsh-graph-field-label { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; } diff --git a/frontend/src/ui/graph/help.ts b/frontend/src/ui/graph/help.ts new file mode 100644 index 00000000..766ddbf0 --- /dev/null +++ b/frontend/src/ui/graph/help.ts @@ -0,0 +1,43 @@ +import { el, escapeHtml, setHidden } from '../../shell/dom'; +import { formatKeys } from '../../shell/registry'; +import { t } from '../../i18n'; +import { KEY_ACTIONS } from './keys'; + +export class HelpPopover { + readonly root: HTMLElement; + private before: HTMLElement | null = null; + + constructor(host: HTMLElement) { + const rows = KEY_ACTIONS.map((a) => { + const keys = a.shown.map((k) => `${escapeHtml(k === 'Space' ? t('Space') : formatKeys(k))}`).join(' '); + return `
      ${keys}${escapeHtml(t(a.label))}
      `; + }).join(''); + this.root = el(``); + host.appendChild(this.root); + this.root.addEventListener('keydown', (e) => { + if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); this.close(); } + }); + this.root.addEventListener('focusout', (e) => { + if (!this.root.contains(e.relatedTarget as Node | null)) this.close(false); + }); + } + + get open(): boolean { return !this.root.hidden; } + + toggle(): void { + if (this.open) { this.close(); return; } + this.before = document.activeElement instanceof HTMLElement ? document.activeElement : null; + setHidden(this.root, false); + this.root.focus({ preventScroll: true }); + } + + close(refocus = true): void { + if (this.root.hidden) return; + setHidden(this.root, true); + if (refocus && this.before?.isConnected) this.before.focus({ preventScroll: true }); + } +} diff --git a/frontend/src/ui/graph/keys.ts b/frontend/src/ui/graph/keys.ts new file mode 100644 index 00000000..24bacd83 --- /dev/null +++ b/frontend/src/ui/graph/keys.ts @@ -0,0 +1,31 @@ +export type ActionId = + | 'add' | 'links' | 'delete' | 'duplicate' | 'copy' | 'cut' | 'paste' | 'selectAll' | 'frame' | 'zoomIn' | 'zoomOut' | 'zoomReset' + | 'next' | 'enter' | 'nudge' | 'pan' | 'help' | 'close'; + +export interface KeyAction { id: ActionId; keys: string[]; shown: string[]; label: string } + +export const KEY_ACTIONS: readonly KeyAction[] = [ + { id: 'add', keys: ['Tab', 'Shift+A'], shown: ['Tab', 'Shift+A'], label: 'Add a node at the pointer' }, + { id: 'links', keys: ['L'], shown: ['L'], label: 'Connect or disconnect the focused node' }, + { id: 'delete', keys: ['Delete', 'Backspace', 'X'], shown: ['Delete', 'X'], label: 'Delete the selected nodes' }, + { id: 'duplicate', keys: ['Mod+D', 'Shift+D'], shown: ['Mod+D'], label: 'Duplicate the selected nodes' }, + { id: 'copy', keys: ['Mod+C'], shown: ['Mod+C'], label: 'Copy the selected nodes' }, + { id: 'cut', keys: ['Mod+X'], shown: ['Mod+X'], label: 'Cut the selected nodes' }, + { id: 'paste', keys: ['Mod+V'], shown: ['Mod+V'], label: 'Paste nodes, also into another material' }, + { id: 'selectAll', keys: ['Mod+A'], shown: ['Mod+A'], label: 'Select every node' }, + { id: 'frame', keys: ['F', 'Home'], shown: ['F'], label: 'Frame all nodes' }, + { id: 'zoomIn', keys: ['Mod+=', 'Shift+Mod+=', '='], shown: ['Mod++'], label: 'Zoom in' }, + { id: 'zoomOut', keys: ['Mod+-', '-'], shown: ['Mod+-'], label: 'Zoom out' }, + { id: 'zoomReset', keys: ['Mod+0'], shown: ['Mod+0'], label: 'Zoom to 100%' }, + { id: 'next', keys: ['Up', 'Down', 'Left', 'Right'], shown: ['Up', 'Down', 'Left', 'Right'], label: 'Move focus to the nearest node' }, + { id: 'nudge', keys: ['Shift+Up', 'Shift+Down', 'Shift+Left', 'Shift+Right'], shown: ['Shift+Up'], label: 'Move the selected nodes' }, + { id: 'enter', keys: ['Enter'], shown: ['Enter'], label: 'Edit the focused node; Escape returns' }, + { id: 'pan', keys: [], shown: ['Space'], label: 'Hold and drag to pan; middle drag and two-finger scroll pan too' }, + { id: 'help', keys: ['Shift+/', 'H', 'F1'], shown: ['?'], label: 'Show these keys' }, + { id: 'close', keys: ['Escape'], shown: ['Escape'], label: 'Close the node editor' }, +]; + +const BY_COMBO = new Map(); +for (const a of KEY_ACTIONS) for (const k of a.keys) BY_COMBO.set(k, a.id); + +export const actionFor = (combo: string): ActionId | undefined => BY_COMBO.get(combo); From 3641f275589e1df203bbb357fab487d19d3e4f02 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:13:59 -0500 Subject: [PATCH 206/494] feat(graph): delete, duplicate, copy and paste nodes from the keyboard Keys act only on the canvas or a focused node, so fields keep their own keys and the app shortcuts (undo, redo) still reach the shell. Copy and paste go through a module clipboard, so nodes paste into another material too; arrows move focus between nodes, Shift with arrows nudges, L lists connect and disconnect choices for the focused node, and space held pans. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/editor.ts | 234 +++++++++++++++++++++++++++++++- 1 file changed, 228 insertions(+), 6 deletions(-) diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index 7507f931..ad3bf257 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -1,14 +1,19 @@ import { t } from '../../i18n'; import type { Workspace } from '../context'; import { GraphCanvas, type Rect, type View } from './canvas'; +import { el } from '../../shell/dom'; +import { icon, type IconName } from '../../shell/icons'; +import { comboOf } from '../../shell/registry'; import { Committer, placeError, type CommitResult } from './commit'; +import { HelpPopover } from './help'; import { Interaction } from './interact'; -import { groupOf } from './labels'; +import { actionFor, type ActionId } from './keys'; +import { groupOf, words } from './labels'; import { LinkLayer, type Point } from './links'; import { PickMenu, type PickItem } from './menu'; import { - converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, MAX_NODES, newNode, nextId, OUTPUT_NODE, outputKey, - outputType, parseGraph, type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, + cloneNode, converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, MAX_NODES, newNode, nextId, OUTPUT_NODE, outputKey, + outputType, parseGraph, removeNodes, type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, } from './model'; import { GraphSource, type TextureInfo } from './source'; import { StatusLine } from './status'; @@ -37,6 +42,7 @@ export class GraphEditor implements NodeHost { readonly committer: Committer; readonly status: StatusLine; readonly menu: PickMenu; + readonly help: HelpPopover; interaction: Interaction | null = null; private good = ''; private goodSig = ''; @@ -50,8 +56,34 @@ export class GraphEditor implements NodeHost { this.committer = new Committer(ws, () => this.material); this.committer.onResult = (r, live) => this.result(r, live); this.menu = new PickMenu(ws.ctx.slots.overlayRoot); + this.help = new HelpPopover(this.win.root); + this.tools(); this.win.root.addEventListener('keydown', (e) => this.key(e)); - this.win.onClose = () => this.remember(); + this.win.root.addEventListener('keyup', (e) => { if (e.key === ' ') this.space(false); }); + window.addEventListener('blur', () => this.space(false)); + this.win.onClose = () => { this.space(false); this.menu.close(false); this.help.close(false); this.remember(); }; + } + + private tools(): void { + const button = (name: IconName, label: string, keys: string, run: () => void): void => { + const b = el(``); + b.setAttribute('aria-label', t(label)); + b.title = `${t(label)} (${keys})`; + b.addEventListener('click', run); + this.win.tools.appendChild(b); + }; + button('plus', 'Add a node', 'Tab', () => { + const r = this.canvas?.host.getBoundingClientRect(); + if (r) this.openAddMenu(r.left + r.width / 2 - 130, r.top + 24); + }); + button('fit', 'Frame all nodes', 'F', () => this.frameAll()); + button('help', 'Show these keys', '?', () => this.help.toggle()); + } + + private space(on: boolean): void { + if (!this.canvas || this.canvas.spaceHeld === on) return; + this.canvas.spaceHeld = on; + this.canvas.host.classList.toggle('is-space', on); } textures(): TextureInfo[] { return this.textureList; } @@ -365,10 +397,200 @@ export class GraphEditor implements NodeHost { } private key(e: KeyboardEvent): void { - if (e.key === 'Escape' && !e.defaultPrevented) { + if (e.defaultPrevented || e.isComposing) return; + const target = e.target as HTMLElement; + const node = target.closest('.fsh-graph-node'); + const onSurface = target === this.canvas?.host || target === node; + if (e.key === 'Escape') { + if (node && target !== node) node.focus({ preventScroll: true }); + else if (node) this.focus(); + else if (this.selection.size && target === this.canvas?.host) this.select(new Set()); + else this.win.close(); e.preventDefault(); e.stopPropagation(); - this.win.close(); + return; } + if (e.key === ' ' && onSurface) { this.space(true); e.preventDefault(); e.stopPropagation(); return; } + if (!onSurface) return; + const combo = comboOf(e); + const action = actionFor(combo); + if (!action || !this.run(action, combo, node)) return; + e.preventDefault(); + e.stopPropagation(); + } + + private run(action: ActionId, combo: string, node: HTMLElement | null): boolean { + const focused = node ? Number(node.dataset.node) : null; + switch (action) { + case 'add': { + const p = this.interaction?.pointer; + const r = this.canvas?.host.getBoundingClientRect(); + if (p) this.openAddMenu(p[0], p[1]); + else if (r) this.openAddMenu(r.left + r.width / 2, r.top + r.height / 2); + return true; + } + case 'links': if (focused !== null) this.openLinksMenu(focused); return focused !== null; + case 'delete': this.deleteSelection(); return true; + case 'duplicate': this.duplicate(); return true; + case 'copy': this.copy(); return true; + case 'cut': this.copy(); this.deleteSelection(); return true; + case 'paste': this.paste(); return true; + case 'selectAll': this.select(new Set(this.views.keys())); return true; + case 'frame': this.frameAll(); return true; + case 'zoomIn': this.canvas?.zoomCentre(1.25); return true; + case 'zoomOut': this.canvas?.zoomCentre(0.8); return true; + case 'zoomReset': { const v = this.canvas?.view; if (v) this.canvas?.zoomCentre(1 / v.z); return true; } + case 'next': this.focusNext(focused, combo); return true; + case 'nudge': this.nudge(combo); return true; + case 'enter': { + const first = node?.querySelector('select, input, .fsh-ws-num[tabindex="0"], .fsh-graph-ramp-stop[tabindex="0"], button:not(.fsh-graph-sock)'); + first?.focus(); + return first !== null && first !== undefined; + } + case 'help': this.help.toggle(); return true; + default: return false; + } + } + + private focusNext(from: number | null, combo: string): void { + const all: Array<[number, number, number]> = [...this.views.values()].map((v) => [v.id, v.x + v.w / 2, v.y + v.h / 2]); + if (this.out) all.push([OUTPUT_NODE, this.out.x + this.out.w / 2, this.out.y + this.out.h / 2]); + if (!all.length) return; + const cur = all.find((a) => a[0] === from); + let pick: [number, number, number] | undefined; + if (!cur) pick = all.sort((a, b) => a[1] - b[1] || a[2] - b[2])[0]; + else { + const dir = combo === 'Left' ? [-1, 0] : combo === 'Right' ? [1, 0] : combo === 'Up' ? [0, -1] : [0, 1]; + let best = Infinity; + for (const a of all) { + if (a[0] === cur[0]) continue; + const dx = a[1] - cur[1], dy = a[2] - cur[2]; + const along = dx * dir[0] + dy * dir[1]; + if (along <= 0) continue; + const score = along + Math.abs(dx * dir[1] - dy * dir[0]) * 2; + if (score < best) { best = score; pick = a; } + } + } + if (!pick) return; + this.select(new Set([pick[0]])); + const v = pick[0] === OUTPUT_NODE ? this.out : this.views.get(pick[0]); + v?.el.focus({ preventScroll: true }); + this.reveal(pick[0]); + } + + private reveal(id: number): void { + const c = this.canvas, v = id === OUTPUT_NODE ? this.out : this.views.get(id); + if (!c || !v) return; + const { x, y, z } = c.view, w = c.host.clientWidth, h = c.host.clientHeight; + const sx = v.x * z + x, sy = v.y * z + y; + let nx = x, ny = y; + if (sx < 16) nx += 16 - sx; else if (sx + v.w * z > w - 16) nx -= sx + v.w * z - (w - 16); + if (sy < 16) ny += 16 - sy; else if (sy + v.h * z > h - 16) ny -= sy + v.h * z - (h - 16); + c.setView({ x: nx, y: ny, z }); + } + + private nudge(combo: string): void { + const step = 24; + const d: Point = combo.endsWith('Left') ? [-step, 0] : combo.endsWith('Right') ? [step, 0] : combo.endsWith('Up') ? [0, -step] : [0, step]; + const ids = [...this.selection]; + if (!ids.length) return; + for (const id of ids) { const p = this.position(id); if (p) this.moveTo(id, [p[0] + d[0], p[1] + d[1]]); } + this.finishMove(ids); + } + + deleteSelection(): void { + const ids = new Set([...this.selection].filter((id) => id !== OUTPUT_NODE && this.graph.nodes.has(id))); + if (!ids.size) return; + removeNodes(this.graph, ids); + this.apply(this.graph); + this.select(new Set()); + this.focus(); + this.finish(); + } + + private grab(): Clip | null { + const ids = [...this.selection].filter((id) => this.graph.nodes.has(id)); + if (!ids.length) return null; + const set = new Set(ids); + return { + nodes: ids.map((id) => cloneNode(this.graph.nodes.get(id) as GNode)), + links: this.graph.links.filter((l) => set.has(l.from[0]) && set.has(l.to[0])).map((l) => ({ from: [...l.from] as [number, string], to: [...l.to] as [number, string] })), + }; + } + + copy(): void { + const c = this.grab(); + if (c) { clipboard = c; this.status.note(t('Copied {n} nodes.', { n: c.nodes.length })); } + } + + paste(): void { + if (clipboard) this.place(clipboard, null); + } + + duplicate(): void { + const c = this.grab(); + if (c) this.place(c, [24, 24]); + } + + private place(clip: Clip, offset: Point | null): void { + if (this.graph.nodes.size + clip.nodes.length > MAX_NODES) { this.ws.ctx.toast(t('A graph holds at most {n} nodes.', { n: MAX_NODES }), 'error'); return; } + let d: Point = offset ?? [24, 24]; + const p = this.interaction?.pointer; + if (!offset && p && this.canvas) { + const at = this.canvas.toCanvas(p[0], p[1]); + const x0 = Math.min(...clip.nodes.map((n) => n.position[0])), y0 = Math.min(...clip.nodes.map((n) => n.position[1])); + d = [at[0] - x0, at[1] - y0]; + } + const ids = new Map(); + let next = nextId(this.graph); + for (const n of clip.nodes) { + const id = next++; + ids.set(n.id, id); + const copy = cloneNode(n, id); + copy.position = [Math.round(n.position[0] + d[0]), Math.round(n.position[1] + d[1])]; + if (copy.kind === 'texture' && copy.settings.texture !== null && !this.textureList.some((x) => x.key === String(copy.settings.texture))) copy.settings.texture = null; + this.graph.nodes.set(id, copy); + } + for (const l of clip.links) this.graph.links.push({ from: [ids.get(l.from[0]) as number, l.from[1]], to: [ids.get(l.to[0]) as number, l.to[1]] }); + this.apply(this.graph); + this.select(new Set(ids.values())); + this.finish(); + } + + private openLinksMenu(id: number): void { + const items: PickItem[] = []; + const ends: Array<{ node: number; dir: 'in' | 'out'; name: string; ty: SocketType; label: string }> = []; + const all = [...this.views.values(), ...(this.out ? [this.out] : [])]; + for (const v of all) for (const s of v.sockets.values()) ends.push({ node: v.id, dir: s.dir, name: s.name, ty: s.ty, label: `${v.id === OUTPUT_NODE ? t('Material output') : this.nodeName(v.id)} ${v.id === OUTPUT_NODE ? '' : v.id}: ${s.label}` }); + const mine = ends.filter((e) => e.node === id); + const actions = new Map void>(); + for (const a of mine) { + for (const b of ends) { + if (b.node === id || b.dir === a.dir || this.interaction?.refusal(a, b, null)) continue; + const out = a.dir === 'out' ? a : b, inp = a.dir === 'out' ? b : a; + const key = `c:${out.node}:${out.name}>${inp.node}:${inp.name}`; + items.push({ id: key, label: `${out.label} > ${inp.label}`, group: t('Connect') }); + actions.set(key, () => this.connect([out.node, out.name], inp.node, inp.name, null)); + } + } + for (const l of this.graph.links) { + if (l.from[0] !== id && l.to[0] !== id) continue; + const key = `d:${linkKey(l)}`; + items.push({ id: key, label: `${this.nodeName(l.from[0])} ${l.from[0]}: ${t(words(l.from[1]))} > ${this.nodeName(l.to[0])} ${l.to[0]}: ${t(words(l.to[1]))}`, group: t('Disconnect') }); + actions.set(key, () => this.disconnect(linkKey(l))); + } + for (const [input, r] of this.graph.outputs) { + if (r[0] !== id && id !== OUTPUT_NODE) continue; + const key = `d:${outputKey(input, r)}`; + items.push({ id: key, label: `${this.nodeName(r[0])} ${r[0]}: ${t(words(r[1]))} > ${t('Material output')}: ${t(words(input))}`, group: t('Disconnect') }); + actions.set(key, () => this.disconnect(outputKey(input, r))); + } + const v = id === OUTPUT_NODE ? this.out : this.views.get(id); + const r = v?.el.getBoundingClientRect(); + this.menu.show(t('Connect or disconnect'), items, r ? r.right + 8 : 100, r ? r.top : 100, (item) => actions.get(item.id)?.()); } } + +interface Clip { nodes: GNode[]; links: GLink[] } + +let clipboard: Clip | null = null; From 519b94a8948c919f9eefa5cf2b4cdf6c68692229 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:15:13 -0500 Subject: [PATCH 207/494] feat(graph): pick an image through the upload route or the desktop dialog Uses POST /api/textures when the service answers on it, otherwise the Tauri file dialog for a real path, otherwise says why it cannot; the committer can now run other commands in its order. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/commit.ts | 10 ++++++ frontend/src/ui/graph/images.ts | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 frontend/src/ui/graph/images.ts diff --git a/frontend/src/ui/graph/commit.ts b/frontend/src/ui/graph/commit.ts index 49a35d84..da71cbb5 100644 --- a/frontend/src/ui/graph/commit.ts +++ b/frontend/src/ui/graph/commit.ts @@ -69,6 +69,16 @@ export class Committer { }); } + run(name: string, args: Record): Promise { + return new Promise((resolve, reject) => { + this.queued++; + this.own.add(args); + this.chain = this.chain.then(async () => { + try { resolve(await this.ws.client.dispatch(name, args)); } catch (err) { reject(err); } finally { this.queued--; } + }); + }); + } + idle(): Promise { return this.chain; } } diff --git a/frontend/src/ui/graph/images.ts b/frontend/src/ui/graph/images.ts new file mode 100644 index 00000000..1d7c44f0 --- /dev/null +++ b/frontend/src/ui/graph/images.ts @@ -0,0 +1,57 @@ +import { api } from '../../shell/api'; +import { inTauri } from '../../shell/dom'; +import { t } from '../../i18n'; + +const ROUTE = '/api/textures'; +const EXTS = ['png', 'jpg', 'jpeg', 'hdr', 'exr']; + +let route: Promise | null = null; + +function hasRoute(): Promise { + if (!route) { + route = fetch(api.url(ROUTE), { method: 'GET', cache: 'no-store' }).then((r) => r.status !== 404).catch(() => false); + route.then((ok) => { if (!ok) route = null; }).catch(() => undefined); + } + return route; +} + +function chooseFile(): Promise { + return new Promise((resolve) => { + const input = document.createElement('input'); + input.type = 'file'; + input.accept = EXTS.map((e) => `.${e}`).join(','); + input.hidden = true; + let done = false; + const finish = (f: File | null): void => { if (done) return; done = true; input.remove(); resolve(f); }; + input.addEventListener('change', () => finish(input.files?.[0] ?? null)); + input.addEventListener('cancel', () => finish(null)); + document.body.appendChild(input); + input.click(); + }); +} + +async function upload(file: File): Promise { + const form = new FormData(); + form.append('file', file, file.name); + const res = await fetch(api.url(ROUTE), { method: 'POST', body: form }); + const body = await res.json().catch(() => ({})) as { path?: unknown; detail?: unknown }; + if (!res.ok || typeof body.path !== 'string') throw new Error(typeof body.detail === 'string' ? body.detail : t('The image could not be stored ({status})', { status: res.status })); + return body.path; +} + +async function desktopPath(): Promise { + const { invoke } = await import('@tauri-apps/api/core'); + const picked = await invoke('plugin:dialog|open', { + options: { multiple: false, directory: false, title: t('Add image'), filters: [{ name: t('Images'), extensions: EXTS }] }, + }); + return Array.isArray(picked) ? picked[0] ?? null : picked; +} + +export async function pickImage(): Promise { + if (await hasRoute()) { + const file = await chooseFile(); + return file ? upload(file) : null; + } + if (inTauri()) return desktopPath(); + throw new Error(t('Adding images needs the desktop app or a service that stores uploads.')); +} From bbb0dc9db7715df0d9fb57ca345968806267cba5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:15:13 -0500 Subject: [PATCH 208/494] feat(graph): add images to texture nodes and follow outside changes Add image stores the picture, adds the texture and points the node at it in one history group. Undo, redo, other views and agents mark the editor stale; it re-reads the material when no gesture or commit is in flight and applies only what differs, keeping pending invalid edits when the engine still holds the last good graph. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/editor.ts | 75 ++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index ad3bf257..98f9af77 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -15,7 +15,8 @@ import { cloneNode, converts, emptyGraph, graphJson, graphSig, inputSpec, linkKey, materialInputType, MAX_NODES, newNode, nextId, OUTPUT_NODE, outputKey, outputType, parseGraph, removeNodes, type Catalogue, type GLink, type GNode, type Graph, type SocketType, type SocketValue, } from './model'; -import { GraphSource, type TextureInfo } from './source'; +import { pickImage } from './images'; +import { baseName, GraphSource, type MaterialData, type TextureInfo } from './source'; import { StatusLine } from './status'; import { NodeView, OutputView, shapeOf, type NodeHost } from './views'; import { EditorWindow } from './window'; @@ -23,6 +24,9 @@ import { EditorWindow } from './window'; interface Session { view: View; out: Point } const PREVIEW_SIZE = 96; +const FOLLOW_DELAY_MS = 120; +const QUIET = /^(scene\.(summary|meshes|mesh_data)|material\.(preview_maps|node_kinds|types|program)|render\.|view\.|camera\.|selection\.|app\.|file\.snapshot|history\.(barrier|begin_group|end_group))/; +const OUTSIDE_EVENTS = ['agent.activity', 'scene.changed', 'document.changed', 'history.changed', 'resync', 'hello']; export class GraphEditor implements NodeHost { readonly win: EditorWindow; @@ -48,6 +52,8 @@ export class GraphEditor implements NodeHost { private goodSig = ''; private failed = false; private previewToken = 0; + private readTimer: number | undefined; + private reading = false; constructor(readonly ws: Workspace) { this.win = new EditorWindow(ws.ctx.slots.overlayRoot); @@ -62,6 +68,8 @@ export class GraphEditor implements NodeHost { this.win.root.addEventListener('keyup', (e) => { if (e.key === ' ') this.space(false); }); window.addEventListener('blur', () => this.space(false)); this.win.onClose = () => { this.space(false); this.menu.close(false); this.help.close(false); this.remember(); }; + ws.client.onDispatch((n) => { if (!this.committer.own.has(n.args) && !QUIET.test(n.name)) this.dirty(); }); + for (const type of OUTSIDE_EVENTS) ws.ctx.events.on(type, () => this.dirty()); } private tools(): void { @@ -277,7 +285,70 @@ export class GraphEditor implements NodeHost { return (n && inputSpec(this.cat, n, socket)?.ty) ?? 'float'; } - addImage(node: number): void { void node; } + addImage(node: number): void { void this.addImageTo(node); } + + private async addImageTo(node: number): Promise { + let path: string | null; + try { path = await pickImage(); } catch (err) { this.ws.ctx.toast(err instanceof Error ? err.message : String(err), 'error'); return; } + if (!path || !this.graph.nodes.has(node)) return; + const label = t('Add an image to a node'); + try { + if (this.ws.client.has('history.begin_group')) void this.committer.run('history.begin_group', { label }).catch(() => undefined); + const reply = await this.committer.run('texture.add', { texture: { path, role: 'other', uv_set: 0, colour_space: null } }) as { created?: unknown[] } | null; + const key = Array.isArray(reply?.created) ? reply?.created[0] : undefined; + const n = this.graph.nodes.get(node); + if (key === undefined || !n) throw new Error(t('The engine did not add the image.')); + this.textureList = [...this.textureList.filter((x) => x.key !== String(key)), { key: String(key), path, name: baseName(path) }].sort((a, b) => Number(a.key) - Number(b.key)); + for (const v of this.views.values()) v.refreshTextures(); + n.settings.texture = Number(key); + this.views.get(node)?.update(n); + this.finish(); + } catch (err) { + this.ws.ctx.toast(err instanceof Error ? err.message : String(err), 'error'); + } finally { + if (this.ws.client.has('history.end_group')) void this.committer.run('history.end_group', {}).catch(() => undefined); + } + } + + private dirty(): void { + if (!this.win.open || !this.material) return; + window.clearTimeout(this.readTimer); + this.readTimer = window.setTimeout(() => { void this.follow(); }, FOLLOW_DELAY_MS); + } + + private async follow(): Promise { + const material = this.material; + if (!material || !this.win.open) return; + if (this.reading || this.committer.busy || this.interaction?.active) { this.dirty(); return; } + this.reading = true; + const before = this.committer.count; + let data: MaterialData; + try { + data = await this.source.read(material); + } catch (err) { + this.reading = false; + if (this.material !== material) return; + const gone = !(this.ws.client.summary?.materials ?? []).some((m) => String(m.key) === material); + if (gone) { this.win.close(); this.ws.ctx.toast(t('The material was removed, so the node editor closed.')); } + else this.ws.client.message(err instanceof Error ? err.message : String(err), 'error'); + return; + } + this.reading = false; + if (this.material !== material) return; + if (this.committer.count !== before || this.committer.busy || this.interaction?.active) { this.dirty(); return; } + if (data.name) this.win.setTitle(t('Node editor: {name}', { name: data.name })); + const texSig = (l: TextureInfo[]): string => l.map((x) => `${x.key}=${x.path}`).join('|'); + if (texSig(data.textures) !== texSig(this.textureList)) { + this.textureList = data.textures; + for (const v of this.views.values()) v.refreshTextures(); + } + const sig = graphSig(data.graph); + if (sig === this.goodSig) return; + const keep = new Set([...this.selection].filter((id) => id === OUTPUT_NODE || data.graph.nodes.has(id))); + this.adopt(data.graph); + this.select(keep); + this.refreshPreview(); + } select(ids: ReadonlySet): void { for (const [id, v] of this.views) v.setSelected(ids.has(id)); From db26833aa8542ca7b36235a02bd24977ba3733dc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:17:18 -0500 Subject: [PATCH 209/494] fix(graph): close an open value group when a drag never finishes A colour picker dismissed without a change event left the history group open, so later commands would have joined it. The group now closes after two quiet seconds, on any finished edit and when the editor closes. Verified with npx tsc --noEmit. --- frontend/src/ui/graph/commit.ts | 7 +++++++ frontend/src/ui/graph/editor.ts | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/graph/commit.ts b/frontend/src/ui/graph/commit.ts index da71cbb5..490452a8 100644 --- a/frontend/src/ui/graph/commit.ts +++ b/frontend/src/ui/graph/commit.ts @@ -6,6 +6,7 @@ export interface CommitResult { ok: boolean; error: string; graph: string } const SET = 'material.set_graph'; const BEGIN = 'history.begin_group'; const END = 'history.end_group'; +const IDLE_MS = 2000; export class Committer { private chain: Promise = Promise.resolve(); @@ -15,6 +16,8 @@ export class Committer { private sent = 0; readonly own = new WeakSet(); onResult: ((r: CommitResult, live: boolean) => void) | null = null; + onIdle: (() => void) | null = null; + private idleTimer: number | undefined; private readonly flushLive = frameLater(() => { const g = this.pendingLive; if (!g || this.queued > 0) { if (g) this.flushLive(); return; } @@ -25,6 +28,7 @@ export class Committer { constructor(private readonly ws: Workspace, private readonly material: () => string | null) {} get busy(): boolean { return this.queued > 0 || this.pendingLive !== null || this.grouping; } + get open(): boolean { return this.grouping; } get count(): number { return this.sent; } live(graph: Record, label: string): void { @@ -35,9 +39,12 @@ export class Committer { } this.pendingLive = graph; this.flushLive(); + window.clearTimeout(this.idleTimer); + this.idleTimer = window.setTimeout(() => { if (this.grouping) this.onIdle?.(); }, IDLE_MS); } commit(graph: Record): void { + window.clearTimeout(this.idleTimer); this.pendingLive = null; this.send(graph, false); if (this.grouping) { diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index 98f9af77..dcb2d82a 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -61,13 +61,20 @@ export class GraphEditor implements NodeHost { this.status = new StatusLine(this.win.status, () => this.revert()); this.committer = new Committer(ws, () => this.material); this.committer.onResult = (r, live) => this.result(r, live); + this.committer.onIdle = () => this.finish(); this.menu = new PickMenu(ws.ctx.slots.overlayRoot); this.help = new HelpPopover(this.win.root); this.tools(); this.win.root.addEventListener('keydown', (e) => this.key(e)); this.win.root.addEventListener('keyup', (e) => { if (e.key === ' ') this.space(false); }); window.addEventListener('blur', () => this.space(false)); - this.win.onClose = () => { this.space(false); this.menu.close(false); this.help.close(false); this.remember(); }; + this.win.onClose = () => { + this.space(false); + this.menu.close(false); + this.help.close(false); + if (this.committer.open) this.finish(); + this.remember(); + }; ws.client.onDispatch((n) => { if (!this.committer.own.has(n.args) && !QUIET.test(n.name)) this.dirty(); }); for (const type of OUTSIDE_EVENTS) ws.ctx.events.on(type, () => this.dirty()); } @@ -426,7 +433,7 @@ export class GraphEditor implements NodeHost { finish(): void { if (!this.material) return; - if (graphSig(this.graph) === this.goodSig && !this.failed) return; + if (graphSig(this.graph) === this.goodSig && !this.failed && !this.committer.open) return; this.committer.commit(graphJson(this.graph)); } From 0da4d5ec6b3c5c5737d38b6358ffb824f25a4798 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:48:49 -0500 Subject: [PATCH 210/494] fix(graph): fit the ramp in its node and mark both ends of a bad link Found in headless Chrome against the service: the ramp's position field pushed the ramp past the node edge, links into the output node took the input's colour instead of the source's, a fresh session drew NaN paths before the output node was placed, texture nodes started with nearest filtering instead of the engine's trilinear default, and undo or redo of a material with no parts left the shell's undo state stale. Verified with npx tsc --noEmit and the browser run. --- frontend/src/ui/graph/editor.ts | 15 ++++++++++++--- frontend/src/ui/graph/graph.css | 4 ++-- frontend/src/ui/graph/model.ts | 3 ++- frontend/src/ui/graph/ramp.ts | 6 +++--- frontend/src/ui/graph/views.ts | 4 ++-- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index dcb2d82a..ad7f5cd4 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -75,7 +75,11 @@ export class GraphEditor implements NodeHost { if (this.committer.open) this.finish(); this.remember(); }; - ws.client.onDispatch((n) => { if (!this.committer.own.has(n.args) && !QUIET.test(n.name)) this.dirty(); }); + ws.client.onDispatch((n) => { + if (this.committer.own.has(n.args) || QUIET.test(n.name)) return; + if (n.change === 'none' && /^history\.(undo|redo)$/.test(n.name)) ws.client.scheduleRefresh(); + this.dirty(); + }); for (const type of OUTSIDE_EVENTS) ws.ctx.events.on(type, () => this.dirty()); } @@ -225,8 +229,9 @@ export class GraphEditor implements NodeHost { const key = outputKey(input, r); const a = this.socketPos(r[0], 'out', r[1]); const b = this.socketPos(OUTPUT_NODE, 'in', input); - if (!a || !b) { this.links?.remove(key); return; } - this.links?.set(key, a, b, materialInputType(this.cat, input)); + const from = this.graph.nodes.get(r[0]); + if (!a || !b || !from) { this.links?.remove(key); return; } + this.links?.set(key, a, b, outputType(this.cat, from, r[1]) ?? materialInputType(this.cat, input)); } relinkAll(): void { @@ -235,6 +240,7 @@ export class GraphEditor implements NodeHost { for (const [input, r] of this.graph.outputs) { want.add(outputKey(input, r)); this.drawOutput(input, r); } for (const k of this.links?.keys() ?? []) if (!want.has(k)) this.links?.remove(k); this.markLinked(); + this.status.setCount(this.graph.nodes.size, want.size); } relinkNodes(ids: ReadonlySet): void { @@ -444,6 +450,7 @@ export class GraphEditor implements NodeHost { this.goodSig = graphSig(parseGraph(JSON.parse(r.graph))); this.showError(null); this.refreshPreview(); + this.ws.client.scheduleRefresh(); return; } this.showError(r.error); @@ -452,6 +459,8 @@ export class GraphEditor implements NodeHost { private showError(message: string | null): void { const place = message ? placeError(message) : { nodes: new Set(), links: [], inputs: [] }; this.failed = message !== null; + for (const [a, , b] of place.links) { place.nodes.add(a); place.nodes.add(b); } + for (const [b] of place.inputs) place.nodes.add(b); for (const [id, v] of this.views) v.setError(place.nodes.has(id) ? message : null); for (const k of this.links?.keys() ?? []) this.links?.setClass(k, 'is-error', false); for (const [a, as, b, bs] of place.links) this.links?.setClass(linkKey({ from: [a, as], to: [b, bs] }), 'is-error', true); diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css index c0f47814..81917c00 100644 --- a/frontend/src/ui/graph/graph.css +++ b/frontend/src/ui/graph/graph.css @@ -103,11 +103,11 @@ .fsh-graph-preview { height: 88px; margin: 0 var(--space-3) var(--space-1); overflow: hidden; border: 1px solid var(--line-1); border-radius: var(--radius); background: var(--bg-input); } .fsh-graph-preview img { display: block; width: 100%; height: 100%; object-fit: cover; } .fsh-graph-preview.is-empty img { visibility: hidden; } -.fsh-graph-ramp { display: grid; grid-template-rows: 16px 10px 24px; gap: var(--space-0); flex: 1 1 auto; min-width: 0; } +.fsh-graph-ramp { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 16px 10px 24px; gap: var(--space-0); flex: 1 1 0; min-width: 0; } .fsh-graph-ramp-bar { border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: copy; } .fsh-graph-ramp-track { position: relative; margin: 0 1px; cursor: copy; } .fsh-graph-ramp-stop { position: absolute; top: 0; left: var(--fsh-graph-at, 0%); width: 10px; height: 10px; margin-left: -5px; padding: 0; border: 1px solid var(--text-muted); border-radius: var(--radius-xs); background: var(--fsh-graph-stop, var(--text)); cursor: ew-resize; } .fsh-graph-ramp-stop.is-active { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color); } .fsh-graph-ramp-row { display: flex; align-items: center; gap: var(--space-1); } -.fsh-graph-ramp-pos { flex: 1 1 auto; min-width: 0; height: 22px; padding: 0 var(--space-1); font: var(--fs-11) var(--mono); } +.fsh-graph-ramp-pos { flex: 1 1 0; width: 0; min-width: 0; height: 22px; padding: 0 var(--space-1); font: var(--fs-11) var(--mono); } .fsh-graph-ramp-del { width: 22px; height: 22px; } diff --git a/frontend/src/ui/graph/model.ts b/frontend/src/ui/graph/model.ts index b0bb7c85..c83f07f3 100644 --- a/frontend/src/ui/graph/model.ts +++ b/frontend/src/ui/graph/model.ts @@ -42,6 +42,7 @@ export const OUTPUT_NODE = 0; export const MAX_NODES = 256; export const MAX_STOPS = 16; +const ENUM_DEFAULTS: Readonly> = { filter: 'trilinear' }; const TYPES: readonly SocketType[] = ['float', 'colour', 'vector', 'normal']; const RESERVED = new Set(['kind', 'inputs', 'position', 'label']); @@ -204,7 +205,7 @@ export function reaches(g: Graph, from: number, target: number): boolean { export function defaultSetting(s: SettingSpec): unknown { switch (s.kind) { - case 'enum': return s.values[0] ?? ''; + case 'enum': return ENUM_DEFAULTS[s.name] && s.values.includes(ENUM_DEFAULTS[s.name]) ? ENUM_DEFAULTS[s.name] : s.values[0] ?? ''; case 'u32': return 0; case 'bool': return false; case 'texture': return null; diff --git a/frontend/src/ui/graph/ramp.ts b/frontend/src/ui/graph/ramp.ts index 071c0109..753decec 100644 --- a/frontend/src/ui/graph/ramp.ts +++ b/frontend/src/ui/graph/ramp.ts @@ -102,7 +102,7 @@ export class RampControl implements Control { while (handles.length > this.stops.length) (this.track.lastElementChild as Element).remove(); this.stops.forEach((s, i) => { const h = handles[i] as HTMLElement; - h.dataset.index = String(i); + if (h.dataset.index !== String(i)) h.dataset.index = String(i); setStyleVar(h, '--fsh-graph-at', `${s.position * 100}%`); setStyleVar(h, '--fsh-graph-stop', cssOf(rgb(s.colour))); setClass(h, 'is-active', i === this.active); @@ -155,10 +155,10 @@ export class RampControl implements Control { this.active = Number(h.dataset.index); pointer = e.pointerId; moved = false; - this.dragging = true; - h.setPointerCapture(e.pointerId); h.focus(); this.paint(); + try { this.track.setPointerCapture(e.pointerId); } catch { pointer = -1; return; } + this.dragging = true; }); this.track.addEventListener('pointermove', (e) => { if (e.pointerId !== pointer) return; diff --git a/frontend/src/ui/graph/views.ts b/frontend/src/ui/graph/views.ts index f96eae63..41d5db2f 100644 --- a/frontend/src/ui/graph/views.ts +++ b/frontend/src/ui/graph/views.ts @@ -51,7 +51,7 @@ abstract class BaseView { private readonly head: HTMLElement; constructor(readonly id: number, title: string, extra: string) { - this.el = el(`
      `); + this.el = el(`
      `); this.head = q(this.el, '.fsh-graph-node-head'); this.body = q(this.el, '.fsh-graph-node-body'); setText(q(this.el, '.fsh-graph-node-title'), title); @@ -73,7 +73,7 @@ abstract class BaseView { socketAt(dir: Dir, name: string): [number, number] | null { const s = this.sockets.get(`${dir}:${name}`); - return s ? [this.x + (dir === 'out' ? this.w : 0), this.y + s.dy] : null; + return s && Number.isFinite(this.x) ? [this.x + (dir === 'out' ? this.w : 0), this.y + s.dy] : null; } setSelected(on: boolean): void { From ff04e9723c8cb17f0a7a08383f434a40ff57f0ed Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:53:08 -0500 Subject: [PATCH 211/494] fix(graph): open help with ? on any layout and widen the window corners Found in headless Chrome: the rounded window clipped the 12 px corner grips so the corner resize missed, ? only matched Shift with slash, long link choices overflowed their fixed-height rows and the copied note never cleared. Verified with npx tsc --noEmit and the browser run. --- frontend/src/ui/graph/editor.ts | 6 +++--- frontend/src/ui/graph/graph.css | 4 ++-- frontend/src/ui/graph/status.ts | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/src/ui/graph/editor.ts b/frontend/src/ui/graph/editor.ts index ad7f5cd4..fc16c7e6 100644 --- a/frontend/src/ui/graph/editor.ts +++ b/frontend/src/ui/graph/editor.ts @@ -500,7 +500,7 @@ export class GraphEditor implements NodeHost { if (e.key === ' ' && onSurface) { this.space(true); e.preventDefault(); e.stopPropagation(); return; } if (!onSurface) return; const combo = comboOf(e); - const action = actionFor(combo); + const action = e.key === '?' ? 'help' : actionFor(combo); if (!action || !this.run(action, combo, node)) return; e.preventDefault(); e.stopPropagation(); @@ -607,7 +607,7 @@ export class GraphEditor implements NodeHost { copy(): void { const c = this.grab(); - if (c) { clipboard = c; this.status.note(t('Copied {n} nodes.', { n: c.nodes.length })); } + if (c) { clipboard = c; this.status.note(t('Copied {n} nodes.', { n: c.nodes.length }), true); } } paste(): void { @@ -648,7 +648,7 @@ export class GraphEditor implements NodeHost { const items: PickItem[] = []; const ends: Array<{ node: number; dir: 'in' | 'out'; name: string; ty: SocketType; label: string }> = []; const all = [...this.views.values(), ...(this.out ? [this.out] : [])]; - for (const v of all) for (const s of v.sockets.values()) ends.push({ node: v.id, dir: s.dir, name: s.name, ty: s.ty, label: `${v.id === OUTPUT_NODE ? t('Material output') : this.nodeName(v.id)} ${v.id === OUTPUT_NODE ? '' : v.id}: ${s.label}` }); + for (const v of all) for (const s of v.sockets.values()) ends.push({ node: v.id, dir: s.dir, name: s.name, ty: s.ty, label: `${v.id === OUTPUT_NODE ? t('Material output') : `${this.nodeName(v.id)} ${v.id}`}: ${s.label}` }); const mine = ends.filter((e) => e.node === id); const actions = new Map void>(); for (const a of mine) { diff --git a/frontend/src/ui/graph/graph.css b/frontend/src/ui/graph/graph.css index 81917c00..58fa7497 100644 --- a/frontend/src/ui/graph/graph.css +++ b/frontend/src/ui/graph/graph.css @@ -15,7 +15,7 @@ .fsh-graph-edge.is-s { bottom: 0; } .fsh-graph-edge.is-e { right: 0; } .fsh-graph-edge.is-w { left: 0; } -.fsh-graph-edge.is-ne, .fsh-graph-edge.is-nw, .fsh-graph-edge.is-se, .fsh-graph-edge.is-sw { width: 12px; height: 12px; } +.fsh-graph-edge.is-ne, .fsh-graph-edge.is-nw, .fsh-graph-edge.is-se, .fsh-graph-edge.is-sw { width: 18px; height: 18px; } .fsh-graph-edge.is-ne { top: 0; right: 0; cursor: nesw-resize; } .fsh-graph-edge.is-sw { bottom: 0; left: 0; cursor: nesw-resize; } .fsh-graph-edge.is-nw { top: 0; left: 0; cursor: nwse-resize; } @@ -79,7 +79,7 @@ .fsh-graph-menu-search { height: var(--ctl-md); margin-bottom: var(--space-1); } .fsh-graph-menu-list { min-height: 0; overflow-y: auto; } .fsh-graph-menu-group { padding: var(--space-2) var(--space-2) var(--space-0); color: var(--text-faint); font-size: var(--fs-10); font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase; } -.fsh-graph-menu-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: 26px; padding: 0 var(--space-2); border-radius: var(--radius); cursor: default; } +.fsh-graph-menu-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 26px; padding: var(--space-1) var(--space-2); border-radius: var(--radius); cursor: default; } .fsh-graph-menu-item.is-active { background: var(--accent-soft); } .fsh-graph-menu-hint { color: var(--text-faint); font-size: var(--fs-11); } .fsh-graph-menu-empty { margin: var(--space-2); color: var(--text-muted); } diff --git a/frontend/src/ui/graph/status.ts b/frontend/src/ui/graph/status.ts index 758c3bd8..7f50d02d 100644 --- a/frontend/src/ui/graph/status.ts +++ b/frontend/src/ui/graph/status.ts @@ -1,6 +1,8 @@ import { el, q, setClass, setText, setTitle } from '../../shell/dom'; import { t } from '../../i18n'; +const NOTE_MS = 4000; + export class StatusLine { private readonly message: HTMLElement; private readonly revert: HTMLButtonElement; @@ -8,6 +10,7 @@ export class StatusLine { private readonly count: HTMLElement; private hint = ''; private err = ''; + private fade: number | undefined; constructor(host: HTMLElement, onRevert: () => void) { host.appendChild(el(``)); @@ -23,9 +26,11 @@ export class StatusLine { this.revert.addEventListener('click', onRevert); } - note(text: string): void { + note(text: string, fade = false): void { + window.clearTimeout(this.fade); this.hint = text; this.paint(); + if (fade && text) this.fade = window.setTimeout(() => { if (this.hint === text) this.note(''); }, NOTE_MS); } error(text: string): void { From 5ae19ac797daf60c8dc99134caa7655e955a62cf Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:59:53 -0500 Subject: [PATCH 212/494] fix(graph): list texture choices in an empty document and probe uploads by POST With no textures the chooser kept no options because the empty list matched the initial signature; the service answers 404 to GET on a POST-only route, so the upload route is now probed with an empty POST. Checked in headless Chrome against a stand-in upload route outside the repository: the picked file was stored, added as texture 2 and set on the node in one undo step. --- frontend/src/ui/graph/images.ts | 2 +- frontend/src/ui/graph/views.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/ui/graph/images.ts b/frontend/src/ui/graph/images.ts index 1d7c44f0..cd1f6d0c 100644 --- a/frontend/src/ui/graph/images.ts +++ b/frontend/src/ui/graph/images.ts @@ -9,7 +9,7 @@ let route: Promise | null = null; function hasRoute(): Promise { if (!route) { - route = fetch(api.url(ROUTE), { method: 'GET', cache: 'no-store' }).then((r) => r.status !== 404).catch(() => false); + route = fetch(api.url(ROUTE), { method: 'POST', body: new FormData(), cache: 'no-store' }).then((r) => r.status !== 404 && r.status !== 405).catch(() => false); route.then((ok) => { if (!ok) route = null; }).catch(() => undefined); } return route; diff --git a/frontend/src/ui/graph/views.ts b/frontend/src/ui/graph/views.ts index 41d5db2f..90fa72b8 100644 --- a/frontend/src/ui/graph/views.ts +++ b/frontend/src/ui/graph/views.ts @@ -117,7 +117,7 @@ export class NodeView extends BaseView { private readonly rgba = new Map(); private ramp: RampControl | null = null; private texture: HTMLSelectElement | null = null; - private texturesSig = ''; + private texturesSig: string | null = null; constructor(private readonly host: NodeHost, node: GNode) { const spec = host.cat.byId.get(node.kind); @@ -150,7 +150,7 @@ export class NodeView extends BaseView { if (tex) { const v = node.settings.texture; const want = v === null || v === undefined ? '' : String(v); - if (tex.value !== want && document.activeElement !== tex) tex.value = want; + if (tex.value !== want) tex.value = want; } } From 2a18d36aa16362b080b3e16c5e6812bafbfeacba Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:48 -0500 Subject: [PATCH 213/494] feat(graph): add the graph i18n namespace in every language 189 editor strings (node kinds, sockets, settings, menu groups, keys, errors and screen-reader names) with English placeholders in the 23 languages and empty es-MX and fr-CA tables; 14 strings already translated in other tables are left out so this namespace does not hide them. es.json was written by hand and the other placeholder tables are byte copies of it. Verified JSON validity and ./formshot i18n check. --- frontend/src/i18n/modules/graph/cs.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/da.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/de.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/es-MX.json | 1 + frontend/src/i18n/modules/graph/es.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/fi.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/fr-CA.json | 1 + frontend/src/i18n/modules/graph/fr.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/hu.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/id.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/it.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/ja.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/ko.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/nb.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/nl.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/pl.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/pt-BR.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/ru.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/strings.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/sv.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/th.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/tr.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/uk.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/vi.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/zh-CN.json | 191 +++++++++++++++++++ frontend/src/i18n/modules/graph/zh-TW.json | 191 +++++++++++++++++++ 26 files changed, 4586 insertions(+) create mode 100644 frontend/src/i18n/modules/graph/cs.json create mode 100644 frontend/src/i18n/modules/graph/da.json create mode 100644 frontend/src/i18n/modules/graph/de.json create mode 100644 frontend/src/i18n/modules/graph/es-MX.json create mode 100644 frontend/src/i18n/modules/graph/es.json create mode 100644 frontend/src/i18n/modules/graph/fi.json create mode 100644 frontend/src/i18n/modules/graph/fr-CA.json create mode 100644 frontend/src/i18n/modules/graph/fr.json create mode 100644 frontend/src/i18n/modules/graph/hu.json create mode 100644 frontend/src/i18n/modules/graph/id.json create mode 100644 frontend/src/i18n/modules/graph/it.json create mode 100644 frontend/src/i18n/modules/graph/ja.json create mode 100644 frontend/src/i18n/modules/graph/ko.json create mode 100644 frontend/src/i18n/modules/graph/nb.json create mode 100644 frontend/src/i18n/modules/graph/nl.json create mode 100644 frontend/src/i18n/modules/graph/pl.json create mode 100644 frontend/src/i18n/modules/graph/pt-BR.json create mode 100644 frontend/src/i18n/modules/graph/ru.json create mode 100644 frontend/src/i18n/modules/graph/strings.json create mode 100644 frontend/src/i18n/modules/graph/sv.json create mode 100644 frontend/src/i18n/modules/graph/th.json create mode 100644 frontend/src/i18n/modules/graph/tr.json create mode 100644 frontend/src/i18n/modules/graph/uk.json create mode 100644 frontend/src/i18n/modules/graph/vi.json create mode 100644 frontend/src/i18n/modules/graph/zh-CN.json create mode 100644 frontend/src/i18n/modules/graph/zh-TW.json diff --git a/frontend/src/i18n/modules/graph/cs.json b/frontend/src/i18n/modules/graph/cs.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/cs.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/da.json b/frontend/src/i18n/modules/graph/da.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/da.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/de.json b/frontend/src/i18n/modules/graph/de.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/de.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/es-MX.json b/frontend/src/i18n/modules/graph/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/graph/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/graph/es.json b/frontend/src/i18n/modules/graph/es.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/es.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/fi.json b/frontend/src/i18n/modules/graph/fi.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/fi.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/fr-CA.json b/frontend/src/i18n/modules/graph/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/graph/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/graph/fr.json b/frontend/src/i18n/modules/graph/fr.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/fr.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/hu.json b/frontend/src/i18n/modules/graph/hu.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/hu.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/id.json b/frontend/src/i18n/modules/graph/id.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/id.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/it.json b/frontend/src/i18n/modules/graph/it.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/it.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/ja.json b/frontend/src/i18n/modules/graph/ja.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/ja.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/ko.json b/frontend/src/i18n/modules/graph/ko.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/ko.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/nb.json b/frontend/src/i18n/modules/graph/nb.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/nb.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/nl.json b/frontend/src/i18n/modules/graph/nl.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/nl.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/pl.json b/frontend/src/i18n/modules/graph/pl.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/pl.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/pt-BR.json b/frontend/src/i18n/modules/graph/pt-BR.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/pt-BR.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/ru.json b/frontend/src/i18n/modules/graph/ru.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/ru.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/strings.json b/frontend/src/i18n/modules/graph/strings.json new file mode 100644 index 00000000..5f882093 --- /dev/null +++ b/frontend/src/i18n/modules/graph/strings.json @@ -0,0 +1,191 @@ +[ + "A", + "A graph holds at most {n} nodes.", + "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.", + "ACEScg", + "Add", + "Add a node", + "Add a node at the pointer", + "Add an image to a node", + "Add image", + "Add image...", + "Adding images needs the desktop app or a service that stores uploads.", + "Alpha", + "B", + "Bands", + "Base color", + "Base diffuse roughness", + "Base metalness", + "Base weight", + "Bilinear", + "Box", + "Brushed", + "Bump", + "C", + "Cell edge", + "Change a node setting", + "Change a node value", + "Chebyshev", + "Checker", + "Clamp", + "Click to add a stop", + "Close the node editor", + "Coat color", + "Coat ior", + "Coat roughness", + "Coat weight", + "colour", + "Colour 1", + "Colour 2", + "Colour and maths", + "Colour ramp", + "Colour space", + "Connect", + "Connect an input to an output.", + "Connect an output to an input.", + "Connect or disconnect", + "Connect or disconnect the focused node", + "Constant", + "Copied {n} nodes.", + "Copy the selected nodes", + "Cut the selected nodes", + "Cylindrical", + "Data", + "Delete stop", + "Delete the selected nodes", + "Density", + "Detail", + "Disconnect", + "Displacement", + "Distance", + "Distortion", + "Divide", + "Duplicate the selected nodes", + "Edit the focused node; Escape returns", + "Emission color", + "Euclidean", + "Factor", + "Fallback", + "Feature", + "Filter", + "Flakes", + "Flip green", + "Fractal noise", + "Frame all nodes", + "Fuzz color", + "Fuzz roughness", + "Fuzz weight", + "Gain", + "Geometry opacity", + "Go back to the last graph the engine accepted", + "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture", + "Images", + "Inputs", + "Interpolation", + "Invert", + "Lacunarity", + "Length", + "Lerp", + "Linear", + "Manhattan", + "Mapping", + "Marble", + "Mask", + "Material output", + "Math", + "Maximum", + "Metric", + "Minimum", + "Mirror", + "Mix", + "Move focus to the nearest node", + "Move the selected nodes", + "Multiply", + "Nearest", + "Nearest point", + "Node canvas", + "Node editor", + "Node editor keys", + "Node editor: {name}", + "Noise", + "normal", + "Normal map", + "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches", + "Number", + "number", + "Octaves", + "Offset X", + "Offset Y", + "Operation", + "Paste nodes, also into another material", + "Patterns", + "Phase", + "Planar", + "Position", + "Power", + "Profile", + "Projection", + "Quadratic", + "Radial", + "Randomness", + "Repeat", + "Result", + "Revert", + "Rings", + "Saw", + "Scale X", + "Scale Y", + "Second nearest", + "Seed", + "Select every node", + "Shape", + "Show these keys", + "Sine", + "Space", + "Specular color", + "Specular ior", + "Specular roughness", + "Specular roughness anisotropy", + "Specular weight", + "Spherical", + "Spread", + "sRGB", + "Stop colour", + "Stop position", + "Stop {n} at {pos}", + "Stops", + "Strength", + "Subtract", + "Surface", + "That link would make a loop.", + "The engine did not add the image.", + "The image could not be stored ({status})", + "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}", + "Transmission color", + "Transmission weight", + "Triangle", + "Trilinear", + "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV", + "Value", + "Vector", + "vector", + "Veins", + "Voronoi", + "Wave", + "Wrap", + "Zoom in", + "Zoom out", + "Zoom to 100%", + "{kind} node {id}", + "{nodes} nodes, {links} links", + "{socket} input, linked from {from}", + "{socket} input, {type}", + "{socket} output, {type}" +] diff --git a/frontend/src/i18n/modules/graph/sv.json b/frontend/src/i18n/modules/graph/sv.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/sv.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/th.json b/frontend/src/i18n/modules/graph/th.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/th.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/tr.json b/frontend/src/i18n/modules/graph/tr.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/tr.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/uk.json b/frontend/src/i18n/modules/graph/uk.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/uk.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/vi.json b/frontend/src/i18n/modules/graph/vi.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/vi.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/zh-CN.json b/frontend/src/i18n/modules/graph/zh-CN.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/zh-CN.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} diff --git a/frontend/src/i18n/modules/graph/zh-TW.json b/frontend/src/i18n/modules/graph/zh-TW.json new file mode 100644 index 00000000..53279391 --- /dev/null +++ b/frontend/src/i18n/modules/graph/zh-TW.json @@ -0,0 +1,191 @@ +{ + "A": "A", + "A graph holds at most {n} nodes.": "A graph holds at most {n} nodes.", + "A node cannot feed itself.": "A node cannot feed itself.", + "A {from} output cannot feed a {to} input.": "A {from} output cannot feed a {to} input.", + "ACEScg": "ACEScg", + "Add": "Add", + "Add a node": "Add a node", + "Add a node at the pointer": "Add a node at the pointer", + "Add an image to a node": "Add an image to a node", + "Add image": "Add image", + "Add image...": "Add image...", + "Adding images needs the desktop app or a service that stores uploads.": "Adding images needs the desktop app or a service that stores uploads.", + "Alpha": "Alpha", + "B": "B", + "Bands": "Bands", + "Base color": "Base color", + "Base diffuse roughness": "Base diffuse roughness", + "Base metalness": "Base metalness", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Box": "Box", + "Brushed": "Brushed", + "Bump": "Bump", + "C": "C", + "Cell edge": "Cell edge", + "Change a node setting": "Change a node setting", + "Change a node value": "Change a node value", + "Chebyshev": "Chebyshev", + "Checker": "Checker", + "Clamp": "Clamp", + "Click to add a stop": "Click to add a stop", + "Close the node editor": "Close the node editor", + "Coat color": "Coat color", + "Coat ior": "Coat ior", + "Coat roughness": "Coat roughness", + "Coat weight": "Coat weight", + "colour": "colour", + "Colour 1": "Colour 1", + "Colour 2": "Colour 2", + "Colour and maths": "Colour and maths", + "Colour ramp": "Colour ramp", + "Colour space": "Colour space", + "Connect": "Connect", + "Connect an input to an output.": "Connect an input to an output.", + "Connect an output to an input.": "Connect an output to an input.", + "Connect or disconnect": "Connect or disconnect", + "Connect or disconnect the focused node": "Connect or disconnect the focused node", + "Constant": "Constant", + "Copied {n} nodes.": "Copied {n} nodes.", + "Copy the selected nodes": "Copy the selected nodes", + "Cut the selected nodes": "Cut the selected nodes", + "Cylindrical": "Cylindrical", + "Data": "Data", + "Delete stop": "Delete stop", + "Delete the selected nodes": "Delete the selected nodes", + "Density": "Density", + "Detail": "Detail", + "Disconnect": "Disconnect", + "Displacement": "Displacement", + "Distance": "Distance", + "Distortion": "Distortion", + "Divide": "Divide", + "Duplicate the selected nodes": "Duplicate the selected nodes", + "Edit the focused node; Escape returns": "Edit the focused node; Escape returns", + "Emission color": "Emission color", + "Euclidean": "Euclidean", + "Factor": "Factor", + "Fallback": "Fallback", + "Feature": "Feature", + "Filter": "Filter", + "Flakes": "Flakes", + "Flip green": "Flip green", + "Fractal noise": "Fractal noise", + "Frame all nodes": "Frame all nodes", + "Fuzz color": "Fuzz color", + "Fuzz roughness": "Fuzz roughness", + "Fuzz weight": "Fuzz weight", + "Gain": "Gain", + "Geometry opacity": "Geometry opacity", + "Go back to the last graph the engine accepted": "Go back to the last graph the engine accepted", + "Gradient": "Gradient", + "Hold and drag to pan; middle drag and two-finger scroll pan too": "Hold and drag to pan; middle drag and two-finger scroll pan too", + "Image texture": "Image texture", + "Images": "Images", + "Inputs": "Inputs", + "Interpolation": "Interpolation", + "Invert": "Invert", + "Lacunarity": "Lacunarity", + "Length": "Length", + "Lerp": "Lerp", + "Linear": "Linear", + "Manhattan": "Manhattan", + "Mapping": "Mapping", + "Marble": "Marble", + "Mask": "Mask", + "Material output": "Material output", + "Math": "Math", + "Maximum": "Maximum", + "Metric": "Metric", + "Minimum": "Minimum", + "Mirror": "Mirror", + "Mix": "Mix", + "Move focus to the nearest node": "Move focus to the nearest node", + "Move the selected nodes": "Move the selected nodes", + "Multiply": "Multiply", + "Nearest": "Nearest", + "Nearest point": "Nearest point", + "Node canvas": "Node canvas", + "Node editor": "Node editor", + "Node editor keys": "Node editor keys", + "Node editor: {name}": "Node editor: {name}", + "Noise": "Noise", + "normal": "normal", + "Normal map": "Normal map", + "Not applied: {reason}. The material keeps its last working graph.": "Not applied: {reason}. The material keeps its last working graph.", + "Nothing matches": "Nothing matches", + "Number": "Number", + "number": "number", + "Octaves": "Octaves", + "Offset X": "Offset X", + "Offset Y": "Offset Y", + "Operation": "Operation", + "Paste nodes, also into another material": "Paste nodes, also into another material", + "Patterns": "Patterns", + "Phase": "Phase", + "Planar": "Planar", + "Position": "Position", + "Power": "Power", + "Profile": "Profile", + "Projection": "Projection", + "Quadratic": "Quadratic", + "Radial": "Radial", + "Randomness": "Randomness", + "Repeat": "Repeat", + "Result": "Result", + "Revert": "Revert", + "Rings": "Rings", + "Saw": "Saw", + "Scale X": "Scale X", + "Scale Y": "Scale Y", + "Second nearest": "Second nearest", + "Seed": "Seed", + "Select every node": "Select every node", + "Shape": "Shape", + "Show these keys": "Show these keys", + "Sine": "Sine", + "Space": "Space", + "Specular color": "Specular color", + "Specular ior": "Specular ior", + "Specular roughness": "Specular roughness", + "Specular roughness anisotropy": "Specular roughness anisotropy", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Spread": "Spread", + "sRGB": "sRGB", + "Stop colour": "Stop colour", + "Stop position": "Stop position", + "Stop {n} at {pos}": "Stop {n} at {pos}", + "Stops": "Stops", + "Strength": "Strength", + "Subtract": "Subtract", + "Surface": "Surface", + "That link would make a loop.": "That link would make a loop.", + "The engine did not add the image.": "The engine did not add the image.", + "The image could not be stored ({status})": "The image could not be stored ({status})", + "The material was removed, so the node editor closed.": "The material was removed, so the node editor closed.", + "The node editor could not open: {reason}": "The node editor could not open: {reason}", + "Transmission color": "Transmission color", + "Transmission weight": "Transmission weight", + "Triangle": "Triangle", + "Trilinear": "Trilinear", + "Type": "Type", + "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.": "Undo and redo use the app keys, Mod+Z and Shift+Mod+Z.", + "UV": "UV", + "Value": "Value", + "Vector": "Vector", + "vector": "vector", + "Veins": "Veins", + "Voronoi": "Voronoi", + "Wave": "Wave", + "Wrap": "Wrap", + "Zoom in": "Zoom in", + "Zoom out": "Zoom out", + "Zoom to 100%": "Zoom to 100%", + "{kind} node {id}": "{kind} node {id}", + "{nodes} nodes, {links} links": "{nodes} nodes, {links} links", + "{socket} input, linked from {from}": "{socket} input, linked from {from}", + "{socket} input, {type}": "{socket} input, {type}", + "{socket} output, {type}": "{socket} output, {type}" +} From 9b4f85947282656d0bae5bbb5d232da8cfdb3b8f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:12 -0500 Subject: [PATCH 214/494] feat(materials): add pcg3d hashing and improved gradient noise Procedural noise and fbm now evaluate Perlin 2002 improved noise on integer pcg3d hashes with octaves, roughness, distortion and per-octave frequency clamping. Ran a throwaway program that writes noise and fbm panels at four scales and footprints and looked at them. --- native/crates/fsh-materials/src/procedural.rs | 17 ++- .../fsh-materials/src/procedural/common.rs | 108 +++++++++++++++++ .../fsh-materials/src/procedural/noise.rs | 114 ++++++++++++++++++ 3 files changed, 234 insertions(+), 5 deletions(-) create mode 100644 native/crates/fsh-materials/src/procedural/common.rs create mode 100644 native/crates/fsh-materials/src/procedural/noise.rs diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index 4fe33a61..5a67a3af 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -1,3 +1,6 @@ +mod common; +mod noise; + /// Procedural pattern kinds; the numbers are the `Op::Proc` flags. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(u8)] @@ -89,10 +92,14 @@ impl ProcKind { /// Evaluates output `output` of a procedural. `args[0]` is the coordinate (xyz, footprint in w), then the kind's /// inputs in catalogue order (floats in x, colours in xyz), then the settings vector (seed, mode 1, mode 2, 0). pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { - match kind.outputs().get(output as usize) { - Some(ProcOutput::Value) => [0.5, 0.5, 0.5, 1.0], - Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], - Some(ProcOutput::Vector) => args.first().copied().unwrap_or([0.0; 4]), - Some(ProcOutput::Normal) | None => [0.0; 4], + let at = |i: usize| args.get(i).copied().unwrap_or([0.0; 4]); + match kind { + ProcKind::Noise => noise::noise(output, at), + ProcKind::Fbm => noise::fbm(output, at), + _ => match kind.outputs().get(output as usize) { + Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], + Some(ProcOutput::Vector) => at(0), + Some(ProcOutput::Normal) | None => [0.0; 4], + }, } } diff --git a/native/crates/fsh-materials/src/procedural/common.rs b/native/crates/fsh-materials/src/procedural/common.rs new file mode 100644 index 00000000..13a72d91 --- /dev/null +++ b/native/crates/fsh-materials/src/procedural/common.rs @@ -0,0 +1,108 @@ +pub(super) type V4 = [f32; 4]; + +const SEED_MIX: [u32; 3] = [0x9E37_79B9, 0x85EB_CA6B, 0xC2B2_AE35]; +const OCTAVE_MIX: u32 = 0x632B_E5AB; +const CHANNEL_MIX: u32 = 0x2545_F491; +const COORD_LIMIT: f32 = 1.0e9; +const SEED_LIMIT: f32 = 4_294_967_040.0; + +pub(super) fn pcg3d(v: [u32; 3]) -> [u32; 3] { + let mut x = v[0].wrapping_mul(1_664_525).wrapping_add(1_013_904_223); + let mut y = v[1].wrapping_mul(1_664_525).wrapping_add(1_013_904_223); + let mut z = v[2].wrapping_mul(1_664_525).wrapping_add(1_013_904_223); + x = x.wrapping_add(y.wrapping_mul(z)); + y = y.wrapping_add(z.wrapping_mul(x)); + z = z.wrapping_add(x.wrapping_mul(y)); + x ^= x >> 16; + y ^= y >> 16; + z ^= z >> 16; + x = x.wrapping_add(y.wrapping_mul(z)); + y = y.wrapping_add(z.wrapping_mul(x)); + z = z.wrapping_add(x.wrapping_mul(y)); + [x, y, z] +} + +pub(super) fn hash(c: [i32; 3], seed: u32) -> [u32; 3] { + pcg3d([ + (c[0] as u32).wrapping_add(seed.wrapping_mul(SEED_MIX[0])), + (c[1] as u32).wrapping_add(seed.wrapping_mul(SEED_MIX[1])), + (c[2] as u32).wrapping_add(seed.wrapping_mul(SEED_MIX[2])), + ]) +} + +pub(super) fn unit(h: u32) -> f32 { + (h >> 8) as f32 * (1.0 / 16_777_216.0) +} + +pub(super) fn octave_seed(seed: u32, i: u32) -> u32 { + seed.wrapping_add(i.wrapping_mul(OCTAVE_MIX)) +} + +pub(super) fn channel_seed(seed: u32, c: u32) -> u32 { + seed.wrapping_add(c.wrapping_mul(CHANNEL_MIX)) +} + +pub(super) fn seed_of(v: f32) -> u32 { + if v.is_finite() && v > 0.0 { + v.min(SEED_LIMIT) as u32 + } else { + 0 + } +} + +pub(super) fn coord(v: f32) -> f32 { + if v.is_finite() { + v.clamp(-COORD_LIMIT, COORD_LIMIT) + } else { + 0.0 + } +} + +pub(super) fn num(v: f32) -> f32 { + if v.is_finite() { + v + } else { + 0.0 + } +} + +pub(super) fn mode(v: f32, max: u32) -> u32 { + (num(v).clamp(0.0, 255.0) as u32).min(max) +} + +pub(super) fn smoothstep(e0: f32, e1: f32, x: f32) -> f32 { + let t = ((x - e0) / (e1 - e0)).clamp(0.0, 1.0); + t * t * (3.0 - 2.0 * t) +} + +pub(super) fn aa(r: f32) -> f32 { + 1.0 - smoothstep(0.5, 1.0, r) +} + +pub(super) fn lerp(a: f32, b: f32, t: f32) -> f32 { + a + (b - a) * t +} + +pub(super) fn splat(v: f32) -> V4 { + [v, v, v, v] +} + +pub(super) fn colour(c: [f32; 3]) -> V4 { + [c[0], c[1], c[2], 1.0] +} + +pub(super) fn mix3(a: V4, b: V4, t: f32) -> V4 { + [lerp(a[0], b[0], t), lerp(a[1], b[1], t), lerp(a[2], b[2], t), 1.0] +} + +pub(super) fn footprint(v: V4) -> f32 { + if v[3].is_finite() && v[3] > 0.0 { + v[3] + } else { + 0.0 + } +} + +pub(super) fn position(v: V4, scale: f32) -> [f32; 3] { + [coord(v[0] * scale), coord(v[1] * scale), coord(v[2] * scale)] +} diff --git a/native/crates/fsh-materials/src/procedural/noise.rs b/native/crates/fsh-materials/src/procedural/noise.rs new file mode 100644 index 00000000..4d791e1e --- /dev/null +++ b/native/crates/fsh-materials/src/procedural/noise.rs @@ -0,0 +1,114 @@ +use super::common::{aa, channel_seed, footprint, hash, lerp, num, octave_seed, position, seed_of, splat, V4}; + +pub(super) const TURBULENCE_MEAN: f32 = 0.5; + +fn fade(t: f32) -> f32 { + t * t * t * (t * (t * 6.0 - 15.0) + 10.0) +} + +fn grad(h: u32, x: f32, y: f32, z: f32) -> f32 { + let h = h & 15; + let u = if h < 8 { x } else { y }; + let v = if h < 4 { + y + } else if h == 12 || h == 14 { + x + } else { + z + }; + let a = if h & 1 == 0 { u } else { -u }; + let b = if h & 2 == 0 { v } else { -v }; + a + b +} + +pub(super) fn perlin(p: [f32; 3], seed: u32) -> f32 { + let fl = [p[0].floor(), p[1].floor(), p[2].floor()]; + let i = [fl[0] as i32, fl[1] as i32, fl[2] as i32]; + let (x, y, z) = (p[0] - fl[0], p[1] - fl[1], p[2] - fl[2]); + let (u, v, w) = (fade(x), fade(y), fade(z)); + let g = |dx: i32, dy: i32, dz: i32| { + let h = hash([i[0].wrapping_add(dx), i[1].wrapping_add(dy), i[2].wrapping_add(dz)], seed)[0]; + grad(h, x - dx as f32, y - dy as f32, z - dz as f32) + }; + let x00 = lerp(g(0, 0, 0), g(1, 0, 0), u); + let x10 = lerp(g(0, 1, 0), g(1, 1, 0), u); + let x01 = lerp(g(0, 0, 1), g(1, 0, 1), u); + let x11 = lerp(g(0, 1, 1), g(1, 1, 1), u); + lerp(lerp(x00, x10, v), lerp(x01, x11, v), w) +} + +pub(super) struct Fractal { + pub octaves: f32, + pub lacunarity: f32, + pub gain: f32, +} + +pub(super) fn fractal(p: [f32; 3], seed: u32, f: &Fractal, fw: f32, turbulent: bool) -> f32 { + let n = if f.octaves.is_finite() { f.octaves.clamp(1.0, 16.0) } else { 1.0 }; + let whole = n.floor(); + let part = n - whole; + let count = whole as u32 + u32::from(part > 0.0); + let lac = if f.lacunarity.is_finite() { f.lacunarity.clamp(0.0, 16.0) } else { 2.0 }; + let gain = if f.gain.is_finite() { f.gain.clamp(0.0, 4.0) } else { 0.5 }; + let mut sum = 0.0; + let mut norm = 0.0; + let mut amp = 1.0; + let mut freq = 1.0; + for i in 0..count { + let weight = if i as f32 >= whole { amp * part } else { amp }; + let q = [p[0] * freq, p[1] * freq, p[2] * freq]; + let mut v = perlin(q, octave_seed(seed, i)); + if turbulent { + v = v.abs() - TURBULENCE_MEAN; + } + sum += weight * aa(fw * freq) * v; + norm += weight; + amp *= gain; + freq *= lac; + } + if norm > 0.0 { + sum / norm + } else { + 0.0 + } +} + +fn unit_value(n: f32) -> f32 { + (0.5 + 0.5 * n).clamp(0.0, 1.0) +} + +fn channels(output: u32, seed: u32, eval: impl Fn(u32) -> f32) -> V4 { + if output == 1 { + let c = [0, 1, 2].map(|k| unit_value(eval(channel_seed(seed, k)))); + [c[0], c[1], c[2], 1.0] + } else { + splat(unit_value(eval(seed))) + } +} + +pub(super) fn noise(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let detail = num(at(2)[0]).clamp(0.0, 15.0); + let roughness = num(at(3)[0]); + let distortion = num(at(4)[0]); + let seed = seed_of(at(5)[0]); + let fw = footprint(v) * scale.abs(); + let mut p = position(v, scale); + if distortion != 0.0 { + let d = [1u32, 2, 3].map(|k| distortion * aa(fw) * perlin(p, channel_seed(seed, k + 16))); + p = [p[0] + d[0], p[1] + d[1], p[2] + d[2]]; + } + let f = Fractal { octaves: detail + 1.0, lacunarity: 2.0, gain: roughness }; + channels(output, seed, |s| fractal(p, s, &f, fw, false)) +} + +pub(super) fn fbm(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let f = Fractal { octaves: num(at(2)[0]), lacunarity: num(at(3)[0]), gain: num(at(4)[0]) }; + let seed = seed_of(at(5)[0]); + let fw = footprint(v) * scale.abs(); + let p = position(v, scale); + channels(output, seed, |s| fractal(p, s, &f, fw, false)) +} From b41ce0ae827eab8a88e0c2671a67e467f935f8de Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:12 -0500 Subject: [PATCH 215/494] feat(gpu): port gradient noise and fbm procedurals to wgsl The procedural module gains pcg3d, improved noise and the fractal sum, matching the Rust code. Ran both on lavapipe in a compute shader over 8192 points per case: noise and fbm agree bit for bit with the CPU. --- .../src/shaders/procedural.wgsl | 217 +++++++++++++++++- 1 file changed, 216 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 0c5ba913..869803cf 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -1,3 +1,218 @@ -fn procedural(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { +const PROC_SEED_MIX: vec3 = vec3(0x9E3779B9u, 0x85EBCA6Bu, 0xC2B2AE35u); +const PROC_OCTAVE_MIX: u32 = 0x632BE5ABu; +const PROC_CHANNEL_MIX: u32 = 0x2545F491u; +const PROC_COORD_LIMIT: f32 = 1.0e9; +const PROC_SEED_LIMIT: f32 = 4294967040.0; +const PROC_TURBULENCE_MEAN: f32 = 0.5; + +fn proc_pcg3d(v0: vec3) -> vec3 { + var v = v0 * 1664525u + 1013904223u; + v.x += v.y * v.z; + v.y += v.z * v.x; + v.z += v.x * v.y; + v ^= v >> vec3(16u); + v.x += v.y * v.z; + v.y += v.z * v.x; + v.z += v.x * v.y; + return v; +} + +fn proc_hash(c: vec3, seed: u32) -> vec3 { + return proc_pcg3d(bitcast>(c) + seed * PROC_SEED_MIX); +} + +fn proc_unit(h: u32) -> f32 { + return f32(h >> 8u) * (1.0 / 16777216.0); +} + +fn proc_octave_seed(seed: u32, i: u32) -> u32 { + return seed + i * PROC_OCTAVE_MIX; +} + +fn proc_channel_seed(seed: u32, c: u32) -> u32 { + return seed + c * PROC_CHANNEL_MIX; +} + +fn proc_finite(x: f32) -> bool { + return (bitcast(x) & 0x7f800000u) != 0x7f800000u; +} + +fn proc_seed(v: f32) -> u32 { + if (proc_finite(v) && v > 0.0) { + return u32(min(v, PROC_SEED_LIMIT)); + } + return 0u; +} + +fn proc_coord(v: f32) -> f32 { + if (proc_finite(v)) { + return clamp(v, -PROC_COORD_LIMIT, PROC_COORD_LIMIT); + } + return 0.0; +} + +fn proc_num(v: f32) -> f32 { + return select(0.0, v, proc_finite(v)); +} + +fn proc_smooth(e0: f32, e1: f32, x: f32) -> f32 { + let t = clamp((x - e0) / (e1 - e0), 0.0, 1.0); + return t * t * (3.0 - 2.0 * t); +} + +fn proc_aa(r: f32) -> f32 { + return 1.0 - proc_smooth(0.5, 1.0, r); +} + +fn proc_lerp(a: f32, b: f32, t: f32) -> f32 { + return a + (b - a) * t; +} + +fn proc_mix3(a: vec4, b: vec4, t: f32) -> vec4 { + return vec4(proc_lerp(a.x, b.x, t), proc_lerp(a.y, b.y, t), proc_lerp(a.z, b.z, t), 1.0); +} + +fn proc_footprint(v: vec4) -> f32 { + if (proc_finite(v.w) && v.w > 0.0) { + return v.w; + } + return 0.0; +} + +fn proc_position(v: vec4, scale: f32) -> vec3 { + return vec3(proc_coord(v.x * scale), proc_coord(v.y * scale), proc_coord(v.z * scale)); +} + +fn proc_arg(args: ptr, 12>>, count: u32, i: u32) -> vec4 { + if (i >= count || i >= 12u) { + return vec4(0.0); + } + return (*args)[i]; +} + +fn proc_fade(t: f32) -> f32 { + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} + +fn proc_grad(h0: u32, x: f32, y: f32, z: f32) -> f32 { + let h = h0 & 15u; + let u = select(y, x, h < 8u); + var v = z; + if (h < 4u) { + v = y; + } else if (h == 12u || h == 14u) { + v = x; + } + let a = select(-u, u, (h & 1u) == 0u); + let b = select(-v, v, (h & 2u) == 0u); + return a + b; +} + +fn proc_corner(i: vec3, d: vec3, f: vec3, seed: u32) -> f32 { + let h = proc_hash(i + d, seed).x; + return proc_grad(h, f.x - f32(d.x), f.y - f32(d.y), f.z - f32(d.z)); +} + +fn proc_perlin(p: vec3, seed: u32) -> f32 { + let fl = floor(p); + let i = vec3(fl); + let f = p - fl; + let u = proc_fade(f.x); + let v = proc_fade(f.y); + let w = proc_fade(f.z); + let x00 = proc_lerp(proc_corner(i, vec3(0, 0, 0), f, seed), proc_corner(i, vec3(1, 0, 0), f, seed), u); + let x10 = proc_lerp(proc_corner(i, vec3(0, 1, 0), f, seed), proc_corner(i, vec3(1, 1, 0), f, seed), u); + let x01 = proc_lerp(proc_corner(i, vec3(0, 0, 1), f, seed), proc_corner(i, vec3(1, 0, 1), f, seed), u); + let x11 = proc_lerp(proc_corner(i, vec3(0, 1, 1), f, seed), proc_corner(i, vec3(1, 1, 1), f, seed), u); + return proc_lerp(proc_lerp(x00, x10, v), proc_lerp(x01, x11, v), w); +} + +fn proc_fractal(p: vec3, seed: u32, octaves: f32, lacunarity: f32, gain0: f32, fw: f32, turbulent: bool) -> f32 { + let n = select(1.0, clamp(octaves, 1.0, 16.0), proc_finite(octaves)); + let whole = floor(n); + let part = n - whole; + let count = u32(whole) + select(0u, 1u, part > 0.0); + let lac = select(2.0, clamp(lacunarity, 0.0, 16.0), proc_finite(lacunarity)); + let gain = select(0.5, clamp(gain0, 0.0, 4.0), proc_finite(gain0)); + var sum = 0.0; + var norm = 0.0; + var amp = 1.0; + var freq = 1.0; + for (var i = 0u; i < count; i++) { + let weight = select(amp, amp * part, f32(i) >= whole); + let q = vec3(p.x * freq, p.y * freq, p.z * freq); + var v = proc_perlin(q, proc_octave_seed(seed, i)); + if (turbulent) { + v = abs(v) - PROC_TURBULENCE_MEAN; + } + sum += weight * proc_aa(fw * freq) * v; + norm += weight; + amp *= gain; + freq *= lac; + } + if (norm > 0.0) { + return sum / norm; + } + return 0.0; +} + +fn proc_unit_value(n: f32) -> f32 { + return clamp(0.5 + 0.5 * n, 0.0, 1.0); +} + +fn proc_fractal_out(output: u32, p: vec3, seed: u32, octaves: f32, lacunarity: f32, gain: f32, fw: f32) -> vec4 { + if (output == 1u) { + let r = proc_unit_value(proc_fractal(p, proc_channel_seed(seed, 0u), octaves, lacunarity, gain, fw, false)); + let g = proc_unit_value(proc_fractal(p, proc_channel_seed(seed, 1u), octaves, lacunarity, gain, fw, false)); + let b = proc_unit_value(proc_fractal(p, proc_channel_seed(seed, 2u), octaves, lacunarity, gain, fw, false)); + return vec4(r, g, b, 1.0); + } + return vec4(proc_unit_value(proc_fractal(p, seed, octaves, lacunarity, gain, fw, false))); +} + +fn proc_noise(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let detail = clamp(proc_num(proc_arg(args, count, 2u).x), 0.0, 15.0); + let roughness = proc_num(proc_arg(args, count, 3u).x); + let distortion = proc_num(proc_arg(args, count, 4u).x); + let seed = proc_seed(proc_arg(args, count, 5u).x); + let fw = proc_footprint(v) * abs(scale); + var p = proc_position(v, scale); + if (distortion != 0.0) { + let dx = distortion * proc_aa(fw) * proc_perlin(p, proc_channel_seed(seed, 17u)); + let dy = distortion * proc_aa(fw) * proc_perlin(p, proc_channel_seed(seed, 18u)); + let dz = distortion * proc_aa(fw) * proc_perlin(p, proc_channel_seed(seed, 19u)); + p = vec3(p.x + dx, p.y + dy, p.z + dz); + } + return proc_fractal_out(output, p, seed, detail + 1.0, 2.0, roughness, fw); +} + +fn proc_fbm(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let octaves = proc_num(proc_arg(args, count, 2u).x); + let lacunarity = proc_num(proc_arg(args, count, 3u).x); + let gain = proc_num(proc_arg(args, count, 4u).x); + let seed = proc_seed(proc_arg(args, count, 5u).x); + let fw = proc_footprint(v) * abs(scale); + return proc_fractal_out(output, proc_position(v, scale), seed, octaves, lacunarity, gain, fw); +} + +fn proc_neutral(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { return vec4(0.5, 0.5, 0.5, 1.0); } + +fn procedural(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { + switch kind { + case 0u: { + return proc_noise(output, args, count); + } + case 1u: { + return proc_fbm(output, args, count); + } + default: { + return proc_neutral(kind, output, args, count); + } + } +} From 1bb91f716e91ac627eff74002562a7f829bc2ece Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:03:14 -0500 Subject: [PATCH 216/494] feat(materials): add the voronoi procedural after worley F1, F2 and F2 - F1 in three metrics over a 27-cell search, with randomness, cell colour and feature position outputs; detail fades to measured feature means past one cell per footprint. Ran the panel program for all nine metric and feature pairs and measured the means over 400000 points. --- native/crates/fsh-materials/src/procedural.rs | 2 + .../fsh-materials/src/procedural/cells.rs | 91 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 native/crates/fsh-materials/src/procedural/cells.rs diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index 5a67a3af..d0eb0362 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -1,3 +1,4 @@ +mod cells; mod common; mod noise; @@ -96,6 +97,7 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { match kind { ProcKind::Noise => noise::noise(output, at), ProcKind::Fbm => noise::fbm(output, at), + ProcKind::Voronoi => cells::voronoi(output, at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/cells.rs b/native/crates/fsh-materials/src/procedural/cells.rs new file mode 100644 index 00000000..01cd48a8 --- /dev/null +++ b/native/crates/fsh-materials/src/procedural/cells.rs @@ -0,0 +1,91 @@ +use super::common::{aa, footprint, hash, lerp, mode, num, pcg3d, position, seed_of, splat, unit, V4}; + +const FAR: f32 = 1.0e30; + +const MEAN: [[[f32; 3]; 3]; 2] = [ + [[0.4801, 0.7027, 0.2227], [0.7498, 1.0003, 0.2498], [0.3749, 0.6250, 0.2501]], + [[0.5205, 0.7171, 0.1963], [0.7659, 1.0520, 0.2866], [0.4205, 0.5793, 0.1585]], +]; + +pub(super) struct Nearest { + pub f1: f32, + pub f2: f32, + pub cell: [i32; 3], + pub point: [f32; 3], + pub hash: [u32; 3], +} + +fn distance(d: [f32; 3], metric: u32) -> f32 { + let (x, y, z) = (d[0].abs(), d[1].abs(), d[2].abs()); + match metric { + 1 => x + y + z, + 2 => x.max(y).max(z), + _ => (d[0] * d[0] + d[1] * d[1] + d[2] * d[2]).sqrt(), + } +} + +pub(super) fn nearest(p: [f32; 3], seed: u32, randomness: f32, metric: u32) -> Nearest { + let fl = [p[0].floor(), p[1].floor(), p[2].floor()]; + let i = [fl[0] as i32, fl[1] as i32, fl[2] as i32]; + let f = [p[0] - fl[0], p[1] - fl[1], p[2] - fl[2]]; + let mut best = Nearest { f1: FAR, f2: FAR, cell: i, point: [0.5; 3], hash: [0; 3] }; + for dz in -1i32..=1 { + for dy in -1i32..=1 { + for dx in -1i32..=1 { + let c = [i[0].wrapping_add(dx), i[1].wrapping_add(dy), i[2].wrapping_add(dz)]; + let h = hash(c, seed); + let pt = [ + dx as f32 + 0.5 + randomness * (unit(h[0]) - 0.5), + dy as f32 + 0.5 + randomness * (unit(h[1]) - 0.5), + dz as f32 + 0.5 + randomness * (unit(h[2]) - 0.5), + ]; + let d = distance([pt[0] - f[0], pt[1] - f[1], pt[2] - f[2]], metric); + if d < best.f1 { + best.f2 = best.f1; + best.f1 = d; + best.cell = c; + best.point = pt; + best.hash = h; + } else if d < best.f2 { + best.f2 = d; + } + } + } + } + best.point = [fl[0] + best.point[0], fl[1] + best.point[1], fl[2] + best.point[2]]; + best +} + +pub(super) fn voronoi(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let randomness = num(at(2)[0]).clamp(0.0, 1.0); + let settings = at(3); + let seed = seed_of(settings[0]); + let metric = mode(settings[1], 2); + let feature = mode(settings[2], 2); + let t = aa(footprint(v) * scale.abs()); + let n = nearest(position(v, scale), seed, randomness, metric); + match output { + 1 => { + let h = pcg3d(n.hash); + [lerp(0.5, unit(h[0]), t), lerp(0.5, unit(h[1]), t), lerp(0.5, unit(h[2]), t), 1.0] + } + 2 => { + if scale == 0.0 { + return v; + } + let w = [n.point[0] / scale, n.point[1] / scale, n.point[2] / scale]; + [lerp(v[0], w[0], t), lerp(v[1], w[1], t), lerp(v[2], w[2], t), v[3]] + } + _ => { + let d = match feature { + 1 => n.f2, + 2 => n.f2 - n.f1, + _ => n.f1, + }; + let mean = lerp(MEAN[0][metric as usize][feature as usize], MEAN[1][metric as usize][feature as usize], randomness); + splat(lerp(mean, d, t)) + } + } +} From 71d8d513bdece8901e96a9e469ea4b6828f20823 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:03:47 -0500 Subject: [PATCH 217/494] feat(gpu): port the voronoi procedural to wgsl Same 27-cell search, metrics, features, outputs and mean table as the Rust code. Ran twelve voronoi cases on lavapipe against the CPU over 8192 points each: identical values. --- .../src/shaders/procedural.wgsl | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 869803cf..9b7133e1 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -199,6 +199,95 @@ fn proc_fbm(output: u32, args: ptr, 12>>, count: u32) return proc_fractal_out(output, proc_position(v, scale), seed, octaves, lacunarity, gain, fw); } +const PROC_FAR: f32 = 1.0e30; +const PROC_VORONOI_MEAN: array = array( + 0.4801, 0.7027, 0.2227, 0.7498, 1.0003, 0.2498, 0.3749, 0.6250, 0.2501, + 0.5205, 0.7171, 0.1963, 0.7659, 1.0520, 0.2866, 0.4205, 0.5793, 0.1585, +); + +struct ProcNearest { + f1: f32, + f2: f32, + point: vec3, + hash: vec3, +} + +fn proc_mode(v: f32, hi: u32) -> u32 { + return min(u32(clamp(proc_num(v), 0.0, 255.0)), hi); +} + +fn proc_distance(d: vec3, metric: u32) -> f32 { + let a = abs(d); + if (metric == 1u) { + return a.x + a.y + a.z; + } + if (metric == 2u) { + return max(max(a.x, a.y), a.z); + } + return sqrt(d.x * d.x + d.y * d.y + d.z * d.z); +} + +fn proc_nearest(p: vec3, seed: u32, randomness: f32, metric: u32) -> ProcNearest { + let fl = floor(p); + let i = vec3(fl); + let f = p - fl; + var best = ProcNearest(PROC_FAR, PROC_FAR, vec3(0.5), vec3(0u)); + for (var dz = -1; dz <= 1; dz++) { + for (var dy = -1; dy <= 1; dy++) { + for (var dx = -1; dx <= 1; dx++) { + let h = proc_hash(i + vec3(dx, dy, dz), seed); + let pt = vec3( + f32(dx) + 0.5 + randomness * (proc_unit(h.x) - 0.5), + f32(dy) + 0.5 + randomness * (proc_unit(h.y) - 0.5), + f32(dz) + 0.5 + randomness * (proc_unit(h.z) - 0.5), + ); + let d = proc_distance(vec3(pt.x - f.x, pt.y - f.y, pt.z - f.z), metric); + if (d < best.f1) { + best.f2 = best.f1; + best.f1 = d; + best.point = pt; + best.hash = h; + } else if (d < best.f2) { + best.f2 = d; + } + } + } + } + best.point = vec3(fl.x + best.point.x, fl.y + best.point.y, fl.z + best.point.z); + return best; +} + +fn proc_voronoi(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let randomness = clamp(proc_num(proc_arg(args, count, 2u).x), 0.0, 1.0); + let settings = proc_arg(args, count, 3u); + let seed = proc_seed(settings.x); + let metric = proc_mode(settings.y, 2u); + let feature = proc_mode(settings.z, 2u); + let t = proc_aa(proc_footprint(v) * abs(scale)); + let n = proc_nearest(proc_position(v, scale), seed, randomness, metric); + if (output == 1u) { + let h = proc_pcg3d(n.hash); + return vec4(proc_lerp(0.5, proc_unit(h.x), t), proc_lerp(0.5, proc_unit(h.y), t), proc_lerp(0.5, proc_unit(h.z), t), 1.0); + } + if (output == 2u) { + if (scale == 0.0) { + return v; + } + let w = vec3(n.point.x / scale, n.point.y / scale, n.point.z / scale); + return vec4(proc_lerp(v.x, w.x, t), proc_lerp(v.y, w.y, t), proc_lerp(v.z, w.z, t), v.w); + } + var d = n.f1; + if (feature == 1u) { + d = n.f2; + } else if (feature == 2u) { + d = n.f2 - n.f1; + } + let mean = proc_lerp(PROC_VORONOI_MEAN[metric * 3u + feature], PROC_VORONOI_MEAN[9u + metric * 3u + feature], randomness); + return vec4(proc_lerp(mean, d, t)); +} + fn proc_neutral(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { return vec4(0.5, 0.5, 0.5, 1.0); } @@ -211,6 +300,9 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 1u: { return proc_fbm(output, args, count); } + case 2u: { + return proc_voronoi(output, args, count); + } default: { return proc_neutral(kind, output, args, count); } From 9915932cee70c8ab2b77f8d948ad5027998b1dea Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:04:45 -0500 Subject: [PATCH 218/494] feat(materials): add the checker and gradient procedurals A three-dimensional checker that fades to the mean of its two colours past one square per footprint, and linear, quadratic, radial and spherical gradients. Ran the panel program for both and looked at the pictures. --- native/crates/fsh-materials/src/procedural.rs | 3 ++ .../fsh-materials/src/procedural/patterns.rs | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 native/crates/fsh-materials/src/procedural/patterns.rs diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index d0eb0362..d709cede 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -1,6 +1,7 @@ mod cells; mod common; mod noise; +mod patterns; /// Procedural pattern kinds; the numbers are the `Op::Proc` flags. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -98,6 +99,8 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Noise => noise::noise(output, at), ProcKind::Fbm => noise::fbm(output, at), ProcKind::Voronoi => cells::voronoi(output, at), + ProcKind::Checker => patterns::checker(output, at), + ProcKind::Gradient => patterns::gradient(output, at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs new file mode 100644 index 00000000..82da96b3 --- /dev/null +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -0,0 +1,47 @@ +use super::common::{aa, footprint, lerp, mix3, mode, num, position, splat, V4}; +use std::f32::consts::TAU; + +const CHECKER_OFFSET: f32 = 1.0e-4; + +pub(super) fn checker(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let p = position(v, scale); + let i = p.map(|x| (x + CHECKER_OFFSET).floor() as i32); + let parity = i[0].wrapping_add(i[1]).wrapping_add(i[2]) & 1; + let pick = if parity == 0 { 1.0 } else { 0.0 }; + let fac = lerp(0.5, pick, aa(footprint(v) * scale.abs())); + if output == 1 { + splat(fac) + } else { + mix3(at(3), at(2), fac) + } +} + +pub(super) fn gradient(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let p = position(v, 1.0); + let w = footprint(v); + let value = match mode(at(1)[1], 3) { + 1 => { + let x = p[0].clamp(0.0, 1.0); + x * x + } + 2 => { + let r = (p[0] * p[0] + p[1] * p[1]).sqrt(); + if r > 0.0 { + let angle = p[1].atan2(p[0]) / TAU + 0.5; + lerp(0.5, angle, aa(w / (TAU * r))) + } else { + 0.5 + } + } + 3 => (1.0 - (p[0] * p[0] + p[1] * p[1] + p[2] * p[2]).sqrt()).max(0.0), + _ => p[0].clamp(0.0, 1.0), + }; + if output == 1 { + [value, value, value, 1.0] + } else { + splat(value) + } +} From d25d1d8b7e01aa83ad01fea4a7fc69207abfe274 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:05:12 -0500 Subject: [PATCH 219/494] feat(gpu): port the checker and gradient procedurals to wgsl Both follow the Rust code operation for operation. On lavapipe over 8192 points per case the checker matches exactly and the gradients within 5.4e-7 (atan2). --- .../src/shaders/procedural.wgsl | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 9b7133e1..830bb649 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -288,6 +288,49 @@ fn proc_voronoi(output: u32, args: ptr, 12>>, count: u return vec4(proc_lerp(mean, d, t)); } +const PROC_TAU: f32 = 6.28318530717958647692; +const PROC_PI: f32 = 3.14159265358979323846; +const PROC_CHECKER_OFFSET: f32 = 1.0e-4; + +fn proc_checker(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let p = proc_position(v, scale); + let i = vec3(floor(p + vec3(PROC_CHECKER_OFFSET))); + let parity = (i.x + i.y + i.z) & 1; + let pick = select(0.0, 1.0, parity == 0); + let fac = proc_lerp(0.5, pick, proc_aa(proc_footprint(v) * abs(scale))); + if (output == 1u) { + return vec4(fac); + } + return proc_mix3(proc_arg(args, count, 3u), proc_arg(args, count, 2u), fac); +} + +fn proc_gradient(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let p = proc_position(v, 1.0); + let w = proc_footprint(v); + let kind = proc_mode(proc_arg(args, count, 1u).y, 3u); + var value = clamp(p.x, 0.0, 1.0); + if (kind == 1u) { + let x = clamp(p.x, 0.0, 1.0); + value = x * x; + } else if (kind == 2u) { + let r = sqrt(p.x * p.x + p.y * p.y); + value = 0.5; + if (r > 0.0) { + let angle = atan2(p.y, p.x) / PROC_TAU + 0.5; + value = proc_lerp(0.5, angle, proc_aa(w / (PROC_TAU * r))); + } + } else if (kind == 3u) { + value = max(1.0 - sqrt(p.x * p.x + p.y * p.y + p.z * p.z), 0.0); + } + if (output == 1u) { + return vec4(value, value, value, 1.0); + } + return vec4(value); +} + fn proc_neutral(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { return vec4(0.5, 0.5, 0.5, 1.0); } @@ -303,6 +346,12 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 2u: { return proc_voronoi(output, args, count); } + case 3u: { + return proc_checker(output, args, count); + } + case 4u: { + return proc_gradient(output, args, count); + } default: { return proc_neutral(kind, output, args, count); } From cb74df0674fff27fe5121f0ef747ac2c2b535249 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:06:37 -0500 Subject: [PATCH 220/494] feat(materials): add the wave procedural with noise distortion Bands along x or spherical rings with sine, saw and triangle profiles of period one, distorted by the fractal noise and fading to 0.5 once a period, steepened by the distortion, nears the footprint. Ran the panel program for all six shapes and two distorted cases. --- native/crates/fsh-materials/src/procedural.rs | 1 + .../fsh-materials/src/procedural/patterns.rs | 38 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index d709cede..bb937b3f 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -101,6 +101,7 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Voronoi => cells::voronoi(output, at), ProcKind::Checker => patterns::checker(output, at), ProcKind::Gradient => patterns::gradient(output, at), + ProcKind::Wave => patterns::wave(output, at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs index 82da96b3..9f6a07d1 100644 --- a/native/crates/fsh-materials/src/procedural/patterns.rs +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -1,4 +1,5 @@ -use super::common::{aa, footprint, lerp, mix3, mode, num, position, splat, V4}; +use super::common::{aa, footprint, lerp, mix3, mode, num, position, seed_of, splat, V4}; +use super::noise::{fractal, Fractal}; use std::f32::consts::TAU; const CHECKER_OFFSET: f32 = 1.0e-4; @@ -18,6 +19,41 @@ pub(super) fn checker(output: u32, at: impl Fn(usize) -> V4) -> V4 { } } +fn grey(output: u32, value: f32, colour_output: u32) -> V4 { + if output == colour_output { + [value, value, value, 1.0] + } else { + splat(value) + } +} + +pub(super) fn wave(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let distortion = num(at(2)[0]); + let detail = num(at(3)[0]).clamp(0.0, 15.0); + let phase = num(at(4)[0]); + let settings = at(5); + let seed = seed_of(settings[0]); + let rings = mode(settings[1], 1) == 1; + let profile = mode(settings[2], 2); + let fw = footprint(v) * scale.abs(); + let p = position(v, scale); + let mut s = if rings { (p[0] * p[0] + p[1] * p[1] + p[2] * p[2]).sqrt() } else { p[0] }; + if distortion != 0.0 { + let f = Fractal { octaves: detail + 1.0, lacunarity: 2.0, gain: 0.5 }; + s += distortion * fractal(p, seed, &f, fw, false); + } + s += phase; + let fr = s - s.floor(); + let y = match profile { + 1 => fr, + 2 => 1.0 - (2.0 * fr - 1.0).abs(), + _ => 0.5 - 0.5 * (TAU * fr).cos(), + }; + grey(output, lerp(0.5, y, aa(fw * (1.0 + distortion.abs()))), 1) +} + pub(super) fn gradient(output: u32, at: impl Fn(usize) -> V4) -> V4 { let v = at(0); let p = position(v, 1.0); From c6febac1642e4fa49b667f45fb30a850281a2a12 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:07:03 -0500 Subject: [PATCH 221/494] feat(gpu): port the wave procedural to wgsl Bands, rings, three profiles and noise distortion as in the Rust code. On lavapipe over eight cases of 8192 points the largest difference is 1.2e-7 (cosine). --- .../src/shaders/procedural.wgsl | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 830bb649..0474e91a 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -306,6 +306,43 @@ fn proc_checker(output: u32, args: ptr, 12>>, count: u return proc_mix3(proc_arg(args, count, 3u), proc_arg(args, count, 2u), fac); } +fn proc_grey(output: u32, value: f32, colour_output: u32) -> vec4 { + if (output == colour_output) { + return vec4(value, value, value, 1.0); + } + return vec4(value); +} + +fn proc_wave(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let distortion = proc_num(proc_arg(args, count, 2u).x); + let detail = clamp(proc_num(proc_arg(args, count, 3u).x), 0.0, 15.0); + let phase = proc_num(proc_arg(args, count, 4u).x); + let settings = proc_arg(args, count, 5u); + let seed = proc_seed(settings.x); + let rings = proc_mode(settings.y, 1u) == 1u; + let profile = proc_mode(settings.z, 2u); + let fw = proc_footprint(v) * abs(scale); + let p = proc_position(v, scale); + var s = p.x; + if (rings) { + s = sqrt(p.x * p.x + p.y * p.y + p.z * p.z); + } + if (distortion != 0.0) { + s += distortion * proc_fractal(p, seed, detail + 1.0, 2.0, 0.5, fw, false); + } + s += phase; + let fr = s - floor(s); + var y = 0.5 - 0.5 * cos(PROC_TAU * fr); + if (profile == 1u) { + y = fr; + } else if (profile == 2u) { + y = 1.0 - abs(2.0 * fr - 1.0); + } + return proc_grey(output, proc_lerp(0.5, y, proc_aa(fw * (1.0 + abs(distortion)))), 1u); +} + fn proc_gradient(output: u32, args: ptr, 12>>, count: u32) -> vec4 { let v = proc_arg(args, count, 0u); let p = proc_position(v, 1.0); @@ -352,6 +389,9 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 4u: { return proc_gradient(output, args, count); } + case 5u: { + return proc_wave(output, args, count); + } default: { return proc_neutral(kind, output, args, count); } From 341fd7ea4a01b81790b1446ba64171830cee1d89 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:07:47 -0500 Subject: [PATCH 222/494] feat(materials): add the brushed procedural for brushed metal Two layers of gradient noise stretched along object X (streak length in metres, lines per metre across) give a height in 0..1; each layer fades when its finest axis nears the footprint. Ran the panel program from 5 cm to 3.2 m and looked at the streaks. --- native/crates/fsh-materials/src/procedural.rs | 1 + .../fsh-materials/src/procedural/patterns.rs | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index bb937b3f..8ba03349 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -102,6 +102,7 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Checker => patterns::checker(output, at), ProcKind::Gradient => patterns::gradient(output, at), ProcKind::Wave => patterns::wave(output, at), + ProcKind::Brushed => patterns::brushed(at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs index 9f6a07d1..984df64a 100644 --- a/native/crates/fsh-materials/src/procedural/patterns.rs +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -1,5 +1,5 @@ -use super::common::{aa, footprint, lerp, mix3, mode, num, position, seed_of, splat, V4}; -use super::noise::{fractal, Fractal}; +use super::common::{aa, coord, footprint, lerp, mix3, mode, num, octave_seed, position, seed_of, splat, V4}; +use super::noise::{fractal, perlin, Fractal}; use std::f32::consts::TAU; const CHECKER_OFFSET: f32 = 1.0e-4; @@ -54,6 +54,26 @@ pub(super) fn wave(output: u32, at: impl Fn(usize) -> V4) -> V4 { grey(output, lerp(0.5, y, aa(fw * (1.0 + distortion.abs()))), 1) } +const FINE_ACROSS: f32 = 3.1; +const FINE_ALONG: f32 = 0.6; + +pub(super) fn brushed(at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let lines = num(at(1)[0]).abs(); + let length = num(at(2)[0]).abs().max(1.0e-6); + let strength = num(at(3)[0]); + let seed = seed_of(at(4)[0]); + let w = footprint(v); + let (x, y, z) = (coord(v[0]), coord(v[1]), coord(v[2])); + let qa = [coord(x / length), coord(y * lines), coord(z * lines)]; + let a = perlin(qa, seed) * aa((w * lines).max(w / length)); + let fine = lines * FINE_ACROSS; + let short = length * FINE_ALONG; + let qb = [coord(x / short), coord(y * fine), coord(z * fine)]; + let b = perlin(qb, octave_seed(seed, 1)) * aa((w * fine).max(w / short)); + splat((0.5 + strength * (0.6 * a + 0.4 * b)).clamp(0.0, 1.0)) +} + pub(super) fn gradient(output: u32, at: impl Fn(usize) -> V4) -> V4 { let v = at(0); let p = position(v, 1.0); From 4ee78a596a373a1476b1b5e9b5a7523b148731df Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:08:05 -0500 Subject: [PATCH 223/494] feat(gpu): port the brushed procedural to wgsl Same two stretched noise layers and fades as the Rust code. On lavapipe over 8192 points the largest difference from the CPU is 6.0e-8. --- .../src/shaders/procedural.wgsl | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 0474e91a..e6cbf33a 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -343,6 +343,28 @@ fn proc_wave(output: u32, args: ptr, 12>>, count: u32) return proc_grey(output, proc_lerp(0.5, y, proc_aa(fw * (1.0 + abs(distortion)))), 1u); } +const PROC_FINE_ACROSS: f32 = 3.1; +const PROC_FINE_ALONG: f32 = 0.6; + +fn proc_brushed(args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let lines = abs(proc_num(proc_arg(args, count, 1u).x)); + let length = max(abs(proc_num(proc_arg(args, count, 2u).x)), 1.0e-6); + let strength = proc_num(proc_arg(args, count, 3u).x); + let seed = proc_seed(proc_arg(args, count, 4u).x); + let w = proc_footprint(v); + let x = proc_coord(v.x); + let y = proc_coord(v.y); + let z = proc_coord(v.z); + let qa = vec3(proc_coord(x / length), proc_coord(y * lines), proc_coord(z * lines)); + let a = proc_perlin(qa, seed) * proc_aa(max(w * lines, w / length)); + let fine = lines * PROC_FINE_ACROSS; + let short = length * PROC_FINE_ALONG; + let qb = vec3(proc_coord(x / short), proc_coord(y * fine), proc_coord(z * fine)); + let b = proc_perlin(qb, proc_octave_seed(seed, 1u)) * proc_aa(max(w * fine, w / short)); + return vec4(clamp(0.5 + strength * (0.6 * a + 0.4 * b), 0.0, 1.0)); +} + fn proc_gradient(output: u32, args: ptr, 12>>, count: u32) -> vec4 { let v = proc_arg(args, count, 0u); let p = proc_position(v, 1.0); @@ -392,6 +414,9 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 5u: { return proc_wave(output, args, count); } + case 6u: { + return proc_brushed(args, count); + } default: { return proc_neutral(kind, output, args, count); } From 5cdf097eecf727c41323ec285d62e8a2372c1eec Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:08:54 -0500 Subject: [PATCH 224/494] feat(materials): add the metallic flakes procedural Voronoi cells become flakes with probability density, each tilted uniformly within a cone set by spread; outputs are the tangent-space normal, the mask and the normal encoded as a colour, fading to density and the unbent normal. Ran the panel program for normal, mask and colour. --- native/crates/fsh-materials/src/procedural.rs | 1 + .../fsh-materials/src/procedural/cells.rs | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index 8ba03349..9127aa9e 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -103,6 +103,7 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Gradient => patterns::gradient(output, at), ProcKind::Wave => patterns::wave(output, at), ProcKind::Brushed => patterns::brushed(at), + ProcKind::Flakes => cells::flakes(output, at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/cells.rs b/native/crates/fsh-materials/src/procedural/cells.rs index 01cd48a8..46f3f0ff 100644 --- a/native/crates/fsh-materials/src/procedural/cells.rs +++ b/native/crates/fsh-materials/src/procedural/cells.rs @@ -1,4 +1,5 @@ use super::common::{aa, footprint, hash, lerp, mode, num, pcg3d, position, seed_of, splat, unit, V4}; +use std::f32::consts::TAU; const FAR: f32 = 1.0e30; @@ -56,6 +57,35 @@ pub(super) fn nearest(p: [f32; 3], seed: u32, randomness: f32, metric: u32) -> N best } +pub(super) fn flakes(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let density = num(at(2)[0]).clamp(0.0, 1.0); + let spread = num(at(3)[0]).clamp(0.0, 1.0); + let seed = seed_of(at(4)[0]); + let t = aa(footprint(v) * scale.abs()); + let n = nearest(position(v, scale), seed, 1.0, 0); + let h = pcg3d(n.hash); + let on = unit(h[0]) < density; + let mask = lerp(density, if on { 1.0 } else { 0.0 }, t); + let tilt = if on { + let cos_t = 1.0 - unit(h[1]) * spread; + let sin_t = (1.0 - cos_t * cos_t).max(0.0).sqrt(); + let phi = TAU * unit(h[2]); + [sin_t * phi.cos(), sin_t * phi.sin(), cos_t] + } else { + [0.0, 0.0, 1.0] + }; + let m = [tilt[0] * t, tilt[1] * t, lerp(1.0, tilt[2], t)]; + let len = (m[0] * m[0] + m[1] * m[1] + m[2] * m[2]).sqrt(); + let m = if len > 0.0 { [m[0] / len, m[1] / len, m[2] / len] } else { [0.0, 0.0, 1.0] }; + match output { + 1 => splat(mask), + 2 => [0.5 + 0.5 * m[0], 0.5 + 0.5 * m[1], 0.5 + 0.5 * m[2], 1.0], + _ => [m[0], m[1], m[2], 0.0], + } +} + pub(super) fn voronoi(output: u32, at: impl Fn(usize) -> V4) -> V4 { let v = at(0); let scale = num(at(1)[0]); From edebba9c4b93661f8d2d943f3483450fe557c274 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:09:14 -0500 Subject: [PATCH 225/494] feat(gpu): port the flakes procedural to wgsl Reuses the voronoi search for the flake cells and follows the Rust tilt, mask and fade. On lavapipe over three outputs of 8192 points the largest difference is 1.2e-7. --- .../src/shaders/procedural.wgsl | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index e6cbf33a..9026bb8a 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -257,6 +257,40 @@ fn proc_nearest(p: vec3, seed: u32, randomness: f32, metric: u32) -> ProcNe return best; } +fn proc_flakes(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let density = clamp(proc_num(proc_arg(args, count, 2u).x), 0.0, 1.0); + let spread = clamp(proc_num(proc_arg(args, count, 3u).x), 0.0, 1.0); + let seed = proc_seed(proc_arg(args, count, 4u).x); + let t = proc_aa(proc_footprint(v) * abs(scale)); + let n = proc_nearest(proc_position(v, scale), seed, 1.0, 0u); + let h = proc_pcg3d(n.hash); + let on = proc_unit(h.x) < density; + let mask = proc_lerp(density, select(0.0, 1.0, on), t); + var tilt = vec3(0.0, 0.0, 1.0); + if (on) { + let cos_t = 1.0 - proc_unit(h.y) * spread; + let sin_t = sqrt(max(1.0 - cos_t * cos_t, 0.0)); + let phi = PROC_TAU * proc_unit(h.z); + tilt = vec3(sin_t * cos(phi), sin_t * sin(phi), cos_t); + } + var m = vec3(tilt.x * t, tilt.y * t, proc_lerp(1.0, tilt.z, t)); + let len = sqrt(m.x * m.x + m.y * m.y + m.z * m.z); + if (len > 0.0) { + m = vec3(m.x / len, m.y / len, m.z / len); + } else { + m = vec3(0.0, 0.0, 1.0); + } + if (output == 1u) { + return vec4(mask); + } + if (output == 2u) { + return vec4(0.5 + 0.5 * m.x, 0.5 + 0.5 * m.y, 0.5 + 0.5 * m.z, 1.0); + } + return vec4(m, 0.0); +} + fn proc_voronoi(output: u32, args: ptr, 12>>, count: u32) -> vec4 { let v = proc_arg(args, count, 0u); let scale = proc_num(proc_arg(args, count, 1u).x); @@ -417,6 +451,9 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 6u: { return proc_brushed(args, count); } + case 7u: { + return proc_flakes(output, args, count); + } default: { return proc_neutral(kind, output, args, count); } From 5111e4e032784f381b885661ee4db116cdd0656d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:10:53 -0500 Subject: [PATCH 226/494] feat(materials): add the wood procedural Concentric rings about object Y with a noise-wobbled radius, a cubic latewood profile and fine grain from noise stretched along Y, blended between two colours; rings and grain fade to their means. Ran the panel program on the XY and XZ planes and saw straight grain and end-grain rings. --- native/crates/fsh-materials/src/procedural.rs | 1 + .../fsh-materials/src/procedural/patterns.rs | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index 9127aa9e..afe704d7 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -104,6 +104,7 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Wave => patterns::wave(output, at), ProcKind::Brushed => patterns::brushed(at), ProcKind::Flakes => cells::flakes(output, at), + ProcKind::Wood => patterns::wood(output, at), _ => match kind.outputs().get(output as usize) { Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], Some(ProcOutput::Vector) => at(0), diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs index 984df64a..7da68a6c 100644 --- a/native/crates/fsh-materials/src/procedural/patterns.rs +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -74,6 +74,34 @@ pub(super) fn brushed(at: impl Fn(usize) -> V4) -> V4 { splat((0.5 + strength * (0.6 * a + 0.4 * b)).clamp(0.0, 1.0)) } +const GRAIN_ACROSS: f32 = 120.0; +const GRAIN_ALONG: f32 = 3.75; +const RING_MEAN: f32 = 0.25; + +pub(super) fn wood(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let rings = num(at(2)[0]).abs(); + let distortion = num(at(3)[0]); + let seed = seed_of(at(6)[0]); + let fw = footprint(v) * scale.abs(); + let p = position(v, scale); + let f = Fractal { octaves: 2.0, lacunarity: 2.0, gain: 0.5 }; + let wobble = fractal([coord(p[0] * 2.0), coord(p[1] * 0.25), coord(p[2] * 2.0)], seed, &f, fw * 2.0, false); + let r = (p[0] * p[0] + p[2] * p[2]).sqrt(); + let t = r * rings + distortion * 2.0 * wobble; + let s = t - t.floor(); + let ring = lerp(RING_MEAN, s * s * s, aa(fw * rings * (1.0 + distortion.abs()))); + let q = [coord(p[0] * GRAIN_ACROSS), coord(p[1] * GRAIN_ALONG), coord(p[2] * GRAIN_ACROSS)]; + let grain = perlin(q, octave_seed(seed, 7)) * aa(fw * GRAIN_ACROSS); + let value = (0.85 * ring + 0.15 * (0.5 + grain)).clamp(0.0, 1.0); + if output == 1 { + splat(value) + } else { + mix3(at(4), at(5), value) + } +} + pub(super) fn gradient(output: u32, at: impl Fn(usize) -> V4) -> V4 { let v = at(0); let p = position(v, 1.0); From 8fdb3464426ae7de812bc1ef1fa0a64df54735ac Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:11:14 -0500 Subject: [PATCH 227/494] feat(gpu): port the wood procedural to wgsl Rings, wobble, latewood profile and grain follow the Rust code. On lavapipe over three cases of 8192 points the values match the CPU exactly. --- .../src/shaders/procedural.wgsl | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index 9026bb8a..be2693cc 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -399,6 +399,33 @@ fn proc_brushed(args: ptr, 12>>, count: u32) -> vec4(clamp(0.5 + strength * (0.6 * a + 0.4 * b), 0.0, 1.0)); } +const PROC_GRAIN_ACROSS: f32 = 120.0; +const PROC_GRAIN_ALONG: f32 = 3.75; +const PROC_RING_MEAN: f32 = 0.25; + +fn proc_wood(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let rings = abs(proc_num(proc_arg(args, count, 2u).x)); + let distortion = proc_num(proc_arg(args, count, 3u).x); + let seed = proc_seed(proc_arg(args, count, 6u).x); + let fw = proc_footprint(v) * abs(scale); + let p = proc_position(v, scale); + let wq = vec3(proc_coord(p.x * 2.0), proc_coord(p.y * 0.25), proc_coord(p.z * 2.0)); + let wobble = proc_fractal(wq, seed, 2.0, 2.0, 0.5, fw * 2.0, false); + let r = sqrt(p.x * p.x + p.z * p.z); + let t = r * rings + distortion * 2.0 * wobble; + let s = t - floor(t); + let ring = proc_lerp(PROC_RING_MEAN, s * s * s, proc_aa(fw * rings * (1.0 + abs(distortion)))); + let q = vec3(proc_coord(p.x * PROC_GRAIN_ACROSS), proc_coord(p.y * PROC_GRAIN_ALONG), proc_coord(p.z * PROC_GRAIN_ACROSS)); + let grain = proc_perlin(q, proc_octave_seed(seed, 7u)) * proc_aa(fw * PROC_GRAIN_ACROSS); + let value = clamp(0.85 * ring + 0.15 * (0.5 + grain), 0.0, 1.0); + if (output == 1u) { + return vec4(value); + } + return proc_mix3(proc_arg(args, count, 4u), proc_arg(args, count, 5u), value); +} + fn proc_gradient(output: u32, args: ptr, 12>>, count: u32) -> vec4 { let v = proc_arg(args, count, 0u); let p = proc_position(v, 1.0); @@ -454,6 +481,9 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 7u: { return proc_flakes(output, args, count); } + case 8u: { + return proc_wood(output, args, count); + } default: { return proc_neutral(kind, output, args, count); } From 6a8b561e4e2f53cd68ea5a986d1e8a13a2cd0a72 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:13:32 -0500 Subject: [PATCH 228/494] feat(materials): add the marble procedural after perlin 1985 Veins are (1 - sin(pi t))^4 of a phase along x plus turbulence (sum of absolute noise, measured mean 0.2199), blended between base and vein colours; every kind now has its real pattern. Ran the panel program and clippy -D warnings on fsh-materials. --- native/crates/fsh-materials/src/procedural.rs | 6 +--- .../fsh-materials/src/procedural/common.rs | 4 --- .../fsh-materials/src/procedural/noise.rs | 2 +- .../fsh-materials/src/procedural/patterns.rs | 31 +++++++++++++++++-- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/native/crates/fsh-materials/src/procedural.rs b/native/crates/fsh-materials/src/procedural.rs index afe704d7..86a4a72e 100644 --- a/native/crates/fsh-materials/src/procedural.rs +++ b/native/crates/fsh-materials/src/procedural.rs @@ -105,10 +105,6 @@ pub fn procedural(kind: ProcKind, output: u32, args: &[[f32; 4]]) -> [f32; 4] { ProcKind::Brushed => patterns::brushed(at), ProcKind::Flakes => cells::flakes(output, at), ProcKind::Wood => patterns::wood(output, at), - _ => match kind.outputs().get(output as usize) { - Some(ProcOutput::Value) | Some(ProcOutput::Colour) => [0.5, 0.5, 0.5, 1.0], - Some(ProcOutput::Vector) => at(0), - Some(ProcOutput::Normal) | None => [0.0; 4], - }, + ProcKind::Marble => patterns::marble(output, at), } } diff --git a/native/crates/fsh-materials/src/procedural/common.rs b/native/crates/fsh-materials/src/procedural/common.rs index 13a72d91..25d2d976 100644 --- a/native/crates/fsh-materials/src/procedural/common.rs +++ b/native/crates/fsh-materials/src/procedural/common.rs @@ -87,10 +87,6 @@ pub(super) fn splat(v: f32) -> V4 { [v, v, v, v] } -pub(super) fn colour(c: [f32; 3]) -> V4 { - [c[0], c[1], c[2], 1.0] -} - pub(super) fn mix3(a: V4, b: V4, t: f32) -> V4 { [lerp(a[0], b[0], t), lerp(a[1], b[1], t), lerp(a[2], b[2], t), 1.0] } diff --git a/native/crates/fsh-materials/src/procedural/noise.rs b/native/crates/fsh-materials/src/procedural/noise.rs index 4d791e1e..6297a6b6 100644 --- a/native/crates/fsh-materials/src/procedural/noise.rs +++ b/native/crates/fsh-materials/src/procedural/noise.rs @@ -1,6 +1,6 @@ use super::common::{aa, channel_seed, footprint, hash, lerp, num, octave_seed, position, seed_of, splat, V4}; -pub(super) const TURBULENCE_MEAN: f32 = 0.5; +pub(super) const TURBULENCE_MEAN: f32 = 0.2199; fn fade(t: f32) -> f32 { t * t * t * (t * (t * 6.0 - 15.0) + 10.0) diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs index 7da68a6c..c18eb99a 100644 --- a/native/crates/fsh-materials/src/procedural/patterns.rs +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -1,6 +1,6 @@ use super::common::{aa, coord, footprint, lerp, mix3, mode, num, octave_seed, position, seed_of, splat, V4}; -use super::noise::{fractal, perlin, Fractal}; -use std::f32::consts::TAU; +use super::noise::{fractal, perlin, Fractal, TURBULENCE_MEAN}; +use std::f32::consts::{PI, TAU}; const CHECKER_OFFSET: f32 = 1.0e-4; @@ -102,6 +102,33 @@ pub(super) fn wood(output: u32, at: impl Fn(usize) -> V4) -> V4 { } } +const TURBULENCE_FREQUENCY: f32 = 3.0; +const VEIN_MEAN: f32 = 0.1309; + +pub(super) fn marble(output: u32, at: impl Fn(usize) -> V4) -> V4 { + let v = at(0); + let scale = num(at(1)[0]); + let veins = num(at(2)[0]); + let distortion = num(at(3)[0]); + let seed = seed_of(at(6)[0]); + let fw = footprint(v) * scale.abs(); + let p = position(v, scale); + let f = Fractal { octaves: 5.0, lacunarity: 2.0, gain: 0.5 }; + let q = p.map(|x| coord(x * TURBULENCE_FREQUENCY)); + let turbulence = TURBULENCE_MEAN + fractal(q, seed, &f, fw * TURBULENCE_FREQUENCY, true); + let phase = veins * p[0] + distortion * 2.0 * turbulence; + let fr = phase - phase.floor(); + let u = 1.0 - (PI * fr).sin(); + let u2 = u * u; + let vein = u2 * u2; + let value = lerp(VEIN_MEAN, vein, aa(fw * veins.abs() * (1.0 + distortion.abs()))); + if output == 1 { + splat(value) + } else { + mix3(at(4), at(5), value) + } +} + pub(super) fn gradient(output: u32, at: impl Fn(usize) -> V4) -> V4 { let v = at(0); let p = position(v, 1.0); From 8aaf4432ebae9943b8d6650a4125e6bcc2cf6eef Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:14:10 -0500 Subject: [PATCH 229/494] feat(gpu): port the marble procedural to wgsl Marble, the measured turbulence mean and a zero result for unknown kinds complete the WGSL port. On lavapipe all 45 cases of 8192 points agree with the CPU within 5.4e-7, none over 1e-4. --- .../src/shaders/procedural.wgsl | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index be2693cc..dabd3c59 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -3,7 +3,7 @@ const PROC_OCTAVE_MIX: u32 = 0x632BE5ABu; const PROC_CHANNEL_MIX: u32 = 0x2545F491u; const PROC_COORD_LIMIT: f32 = 1.0e9; const PROC_SEED_LIMIT: f32 = 4294967040.0; -const PROC_TURBULENCE_MEAN: f32 = 0.5; +const PROC_TURBULENCE_MEAN: f32 = 0.2199; fn proc_pcg3d(v0: vec3) -> vec3 { var v = v0 * 1664525u + 1013904223u; @@ -451,8 +451,29 @@ fn proc_gradient(output: u32, args: ptr, 12>>, count: return vec4(value); } -fn proc_neutral(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { - return vec4(0.5, 0.5, 0.5, 1.0); +const PROC_TURBULENCE_FREQUENCY: f32 = 3.0; +const PROC_VEIN_MEAN: f32 = 0.1309; + +fn proc_marble(output: u32, args: ptr, 12>>, count: u32) -> vec4 { + let v = proc_arg(args, count, 0u); + let scale = proc_num(proc_arg(args, count, 1u).x); + let veins = proc_num(proc_arg(args, count, 2u).x); + let distortion = proc_num(proc_arg(args, count, 3u).x); + let seed = proc_seed(proc_arg(args, count, 6u).x); + let fw = proc_footprint(v) * abs(scale); + let p = proc_position(v, scale); + let q = vec3(proc_coord(p.x * PROC_TURBULENCE_FREQUENCY), proc_coord(p.y * PROC_TURBULENCE_FREQUENCY), proc_coord(p.z * PROC_TURBULENCE_FREQUENCY)); + let turbulence = PROC_TURBULENCE_MEAN + proc_fractal(q, seed, 5.0, 2.0, 0.5, fw * PROC_TURBULENCE_FREQUENCY, true); + let phase = veins * p.x + distortion * 2.0 * turbulence; + let fr = phase - floor(phase); + let u = 1.0 - sin(PROC_PI * fr); + let u2 = u * u; + let vein = u2 * u2; + let value = proc_lerp(PROC_VEIN_MEAN, vein, proc_aa(fw * abs(veins) * (1.0 + abs(distortion)))); + if (output == 1u) { + return vec4(value); + } + return proc_mix3(proc_arg(args, count, 4u), proc_arg(args, count, 5u), value); } fn procedural(kind: u32, output: u32, args: ptr, 12>>, count: u32) -> vec4 { @@ -484,8 +505,11 @@ fn procedural(kind: u32, output: u32, args: ptr, 12>>, case 8u: { return proc_wood(output, args, count); } + case 9u: { + return proc_marble(output, args, count); + } default: { - return proc_neutral(kind, output, args, count); + return vec4(0.0); } } } From b82d695a1385f737ee8c3c300e0c18d6f7872f78 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:16:47 -0500 Subject: [PATCH 230/494] fix(materials): tie wood grain and wobble to the ring frequency Grain (6 lines per ring across, 32 times longer along Y) and the ring wobble now scale with the rings setting, so real ring counts of a few hundred per metre keep their figure, and the ring fade allows for the wobble's slope. Ran the panel program at 20 and 250 rings per metre on both planes. --- .../fsh-materials/src/procedural/patterns.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/native/crates/fsh-materials/src/procedural/patterns.rs b/native/crates/fsh-materials/src/procedural/patterns.rs index c18eb99a..79ddadce 100644 --- a/native/crates/fsh-materials/src/procedural/patterns.rs +++ b/native/crates/fsh-materials/src/procedural/patterns.rs @@ -74,8 +74,10 @@ pub(super) fn brushed(at: impl Fn(usize) -> V4) -> V4 { splat((0.5 + strength * (0.6 * a + 0.4 * b)).clamp(0.0, 1.0)) } -const GRAIN_ACROSS: f32 = 120.0; -const GRAIN_ALONG: f32 = 3.75; +const GRAIN_ACROSS: f32 = 6.0; +const GRAIN_ALONG: f32 = 0.1875; +const WOBBLE_ACROSS: f32 = 0.1; +const WOBBLE_ALONG: f32 = 0.0125; const RING_MEAN: f32 = 0.25; pub(super) fn wood(output: u32, at: impl Fn(usize) -> V4) -> V4 { @@ -87,13 +89,15 @@ pub(super) fn wood(output: u32, at: impl Fn(usize) -> V4) -> V4 { let fw = footprint(v) * scale.abs(); let p = position(v, scale); let f = Fractal { octaves: 2.0, lacunarity: 2.0, gain: 0.5 }; - let wobble = fractal([coord(p[0] * 2.0), coord(p[1] * 0.25), coord(p[2] * 2.0)], seed, &f, fw * 2.0, false); + let (wa, wl) = (rings * WOBBLE_ACROSS, rings * WOBBLE_ALONG); + let wobble = fractal([coord(p[0] * wa), coord(p[1] * wl), coord(p[2] * wa)], seed, &f, fw * wa, false); let r = (p[0] * p[0] + p[2] * p[2]).sqrt(); let t = r * rings + distortion * 2.0 * wobble; let s = t - t.floor(); - let ring = lerp(RING_MEAN, s * s * s, aa(fw * rings * (1.0 + distortion.abs()))); - let q = [coord(p[0] * GRAIN_ACROSS), coord(p[1] * GRAIN_ALONG), coord(p[2] * GRAIN_ACROSS)]; - let grain = perlin(q, octave_seed(seed, 7)) * aa(fw * GRAIN_ACROSS); + let ring = lerp(RING_MEAN, s * s * s, aa(fw * rings * (1.0 + 0.3 * distortion.abs()))); + let (ga, gl) = (rings * GRAIN_ACROSS, rings * GRAIN_ALONG); + let q = [coord(p[0] * ga), coord(p[1] * gl), coord(p[2] * ga)]; + let grain = perlin(q, octave_seed(seed, 7)) * aa(fw * ga); let value = (0.85 * ring + 0.15 * (0.5 + grain)).clamp(0.0, 1.0); if output == 1 { splat(value) From 97579cd6a48edc714e3757e719eb3b81f055f7d0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:17:12 -0500 Subject: [PATCH 231/494] fix(gpu): follow the wood grain and wobble scaling in wgsl Mirrors the Rust change that ties grain, wobble and the ring fade to the ring frequency. On lavapipe five wood cases of 8192 points match the CPU exactly. --- .../src/shaders/procedural.wgsl | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl index dabd3c59..53850b71 100644 --- a/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl +++ b/native/crates/fsh-render-gpu/src/shaders/procedural.wgsl @@ -399,8 +399,10 @@ fn proc_brushed(args: ptr, 12>>, count: u32) -> vec4(clamp(0.5 + strength * (0.6 * a + 0.4 * b), 0.0, 1.0)); } -const PROC_GRAIN_ACROSS: f32 = 120.0; -const PROC_GRAIN_ALONG: f32 = 3.75; +const PROC_GRAIN_ACROSS: f32 = 6.0; +const PROC_GRAIN_ALONG: f32 = 0.1875; +const PROC_WOBBLE_ACROSS: f32 = 0.1; +const PROC_WOBBLE_ALONG: f32 = 0.0125; const PROC_RING_MEAN: f32 = 0.25; fn proc_wood(output: u32, args: ptr, 12>>, count: u32) -> vec4 { @@ -411,14 +413,18 @@ fn proc_wood(output: u32, args: ptr, 12>>, count: u32) let seed = proc_seed(proc_arg(args, count, 6u).x); let fw = proc_footprint(v) * abs(scale); let p = proc_position(v, scale); - let wq = vec3(proc_coord(p.x * 2.0), proc_coord(p.y * 0.25), proc_coord(p.z * 2.0)); - let wobble = proc_fractal(wq, seed, 2.0, 2.0, 0.5, fw * 2.0, false); + let wa = rings * PROC_WOBBLE_ACROSS; + let wl = rings * PROC_WOBBLE_ALONG; + let wq = vec3(proc_coord(p.x * wa), proc_coord(p.y * wl), proc_coord(p.z * wa)); + let wobble = proc_fractal(wq, seed, 2.0, 2.0, 0.5, fw * wa, false); let r = sqrt(p.x * p.x + p.z * p.z); let t = r * rings + distortion * 2.0 * wobble; let s = t - floor(t); - let ring = proc_lerp(PROC_RING_MEAN, s * s * s, proc_aa(fw * rings * (1.0 + abs(distortion)))); - let q = vec3(proc_coord(p.x * PROC_GRAIN_ACROSS), proc_coord(p.y * PROC_GRAIN_ALONG), proc_coord(p.z * PROC_GRAIN_ACROSS)); - let grain = proc_perlin(q, proc_octave_seed(seed, 7u)) * proc_aa(fw * PROC_GRAIN_ACROSS); + let ring = proc_lerp(PROC_RING_MEAN, s * s * s, proc_aa(fw * rings * (1.0 + 0.3 * abs(distortion)))); + let ga = rings * PROC_GRAIN_ACROSS; + let gl = rings * PROC_GRAIN_ALONG; + let q = vec3(proc_coord(p.x * ga), proc_coord(p.y * gl), proc_coord(p.z * ga)); + let grain = proc_perlin(q, proc_octave_seed(seed, 7u)) * proc_aa(fw * ga); let value = clamp(0.85 * ring + 0.15 * (0.5 + grain), 0.0, 1.0); if (output == 1u) { return vec4(value); From 8de9cd58716990517253516946e5323f04fa51d6 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:22:01 -0500 Subject: [PATCH 232/494] feat(scene): give the wood and stone presets real procedural settings Wood starts with 250 rings per metre, wobble 1.5 and oak-like colours; stone starts with marble at 8 veins per metre between a warm white and a grey vein, colours converted from linear sRGB to ACEScg. Compiled both presets, evaluated them with Program::evaluate on 256 by 256 planes and looked at the base colour pictures. --- native/crates/fsh-scene/src/types.rs | 35 ++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-scene/src/types.rs b/native/crates/fsh-scene/src/types.rs index 647d74f1..4da83e50 100644 --- a/native/crates/fsh-scene/src/types.rs +++ b/native/crates/fsh-scene/src/types.rs @@ -196,13 +196,40 @@ fn flakes_graph() -> MaterialGraph { g } -fn pattern_graph(op: GraphOp) -> MaterialGraph { +fn col(c: [f32; 3]) -> SocketValue { + let r = lin(c); + SocketValue::Colour([r.r, r.g, r.b]) +} + +fn pattern_graph(node: GraphNode) -> MaterialGraph { let mut g = MaterialGraph::new(); - let n = g.add(GraphNode::new(op)); + let n = g.add(node); g.output(MaterialInput::BaseColor, n, "colour"); g } +fn wood_graph() -> MaterialGraph { + pattern_graph( + GraphNode::new(GraphOp::Wood { seed: 0 }) + .with("scale", SocketValue::Float(1.0)) + .with("rings", SocketValue::Float(250.0)) + .with("distortion", SocketValue::Float(1.5)) + .with("colour1", col([0.48, 0.30, 0.15])) + .with("colour2", col([0.20, 0.10, 0.04])), + ) +} + +fn marble_graph() -> MaterialGraph { + pattern_graph( + GraphNode::new(GraphOp::Marble { seed: 0 }) + .with("scale", SocketValue::Float(1.0)) + .with("veins", SocketValue::Float(8.0)) + .with("distortion", SocketValue::Float(1.0)) + .with("colour1", col([0.80, 0.79, 0.76])) + .with("colour2", col([0.22, 0.22, 0.24])), + ) +} + fn build() -> Vec { let d = SurfaceParams::default; let metal = SurfaceParams { @@ -361,7 +388,7 @@ fn build() -> Vec { "Wood", SurfaceParams { specular_roughness: 0.45, base_diffuse_roughness: 0.3, ..d() }, TEXTURED, - Some(pattern_graph(GraphOp::Wood { seed: 0 })), + Some(wood_graph()), ), t( "stone", @@ -369,7 +396,7 @@ fn build() -> Vec { "Stone", SurfaceParams { specular_roughness: 0.5, base_diffuse_roughness: 0.5, ..d() }, TEXTURED, - Some(pattern_graph(GraphOp::Marble { seed: 0 })), + Some(marble_graph()), ), ] } From ddbdb6a8a4cfa72c5fe432c65ff7e28298e2fa40 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:25:29 -0500 Subject: [PATCH 233/494] feat(scene): bend the metallic paint normal by its flakes The paint_metallic preset now uses 0.5 mm flakes (2000 per metre, density 0.5, spread 0.25), tints the base colour by the flake mask and feeds the encoded flake normal through a normal map node into the normal. Compiled and evaluated it on planes at 3 cm and 1 m: flakes show up close and average to the mask-weighted mean far away. --- native/crates/fsh-scene/src/types.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-scene/src/types.rs b/native/crates/fsh-scene/src/types.rs index 4da83e50..bbbd2bac 100644 --- a/native/crates/fsh-scene/src/types.rs +++ b/native/crates/fsh-scene/src/types.rs @@ -176,7 +176,12 @@ fn lin(c: [f32; 3]) -> Rgb { fn flakes_graph() -> MaterialGraph { let mut g = MaterialGraph::new(); - let flakes = g.add(GraphNode::new(GraphOp::Flakes { seed: 0 })); + let flakes = g.add( + GraphNode::new(GraphOp::Flakes { seed: 0 }) + .with("scale", SocketValue::Float(2000.0)) + .with("density", SocketValue::Float(0.5)) + .with("spread", SocketValue::Float(0.25)), + ); let rough = g.add( GraphNode::new(GraphOp::Math { op: MathOp::Lerp }) .with("a", SocketValue::Float(0.35)) @@ -191,8 +196,16 @@ fn flakes_graph() -> MaterialGraph { g.link(flakes, "mask", metal, "c"); g.output(MaterialInput::SpecularRoughness, rough, "value"); g.output(MaterialInput::BaseMetalness, metal, "value"); + let tint = g.add(GraphNode::new(GraphOp::Mix {}).with("a", col([0.08, 0.15, 0.45])).with("b", col([0.16, 0.27, 0.62]))); + g.link(flakes, "mask", tint, "factor"); + g.output(MaterialInput::BaseColor, tint, "result"); + let bent = g.add(GraphNode::new(GraphOp::NormalMap { flip_y: false }).with("strength", SocketValue::Float(1.0))); + g.link(flakes, "colour", bent, "colour"); + g.output(MaterialInput::Normal, bent, "normal"); g.nodes.entry(rough).and_modify(|n| n.position = [240.0, -60.0]); g.nodes.entry(metal).and_modify(|n| n.position = [240.0, 60.0]); + g.nodes.entry(tint).and_modify(|n| n.position = [240.0, 180.0]); + g.nodes.entry(bent).and_modify(|n| n.position = [240.0, 300.0]); g } From bcc426be0d3e090a20851bb0ca16fff8e63b08c0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:30:56 -0500 Subject: [PATCH 234/494] feat(scene): offer a brushed bump graph for brushed metal MaterialType gains optional_graph (also in material.types JSON): metal_brushed offers 1000 lines per metre, 2 cm streaks along object X into a 30 um bump, which a new material does not start with. Compiled and evaluated it on planes at 2 cm and 50 cm (normal bent along X streaks), and clippy -D warnings is clean on fsh-materials and fsh-scene. --- native/crates/fsh-scene/src/types.rs | 38 ++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/native/crates/fsh-scene/src/types.rs b/native/crates/fsh-scene/src/types.rs index bbbd2bac..65058cab 100644 --- a/native/crates/fsh-scene/src/types.rs +++ b/native/crates/fsh-scene/src/types.rs @@ -57,6 +57,8 @@ pub struct MaterialType { pub needs_graph: bool, /// Graph a new material of this type starts with. pub graph: Option, + /// A graph the user may switch on (the brushed bump of brushed metal); a new material does not start with it. + pub optional_graph: Option, } impl MaterialType { @@ -81,6 +83,7 @@ impl MaterialType { v }).collect::>(), "graph": self.graph.as_ref().and_then(|g| serde_json::to_value(g).ok()).unwrap_or(Value::Null), + "optional_graph": self.optional_graph.as_ref().and_then(|g| serde_json::to_value(g).ok()).unwrap_or(Value::Null), }) } } @@ -232,6 +235,21 @@ fn wood_graph() -> MaterialGraph { ) } +fn brushed_graph() -> MaterialGraph { + let mut g = MaterialGraph::new(); + let lines = g.add( + GraphNode::new(GraphOp::Brushed { seed: 0 }) + .with("scale", SocketValue::Float(1000.0)) + .with("length", SocketValue::Float(0.02)) + .with("strength", SocketValue::Float(1.0)), + ); + let bump = g.add(GraphNode::new(GraphOp::Bump {}).with("strength", SocketValue::Float(3.0e-5))); + g.link(lines, "value", bump, "height"); + g.output(MaterialInput::Normal, bump, "normal"); + g.nodes.entry(bump).and_modify(|n| n.position = [240.0, 0.0]); + g +} + fn marble_graph() -> MaterialGraph { pattern_graph( GraphNode::new(GraphOp::Marble { seed: 0 }) @@ -266,6 +284,7 @@ fn build() -> Vec { shown, needs_graph: graph.is_some(), graph, + optional_graph: None, }; vec![ t("generic", "Generic", "Generic", d(), GENERIC, None), @@ -286,14 +305,17 @@ fn build() -> Vec { None, ), t("metal", "Metal", "Metal", metal, METAL_PAGE, None), - t( - "metal_brushed", - "Brushed metal", - "Metal", - SurfaceParams { specular_roughness: 0.3, specular_roughness_anisotropy: 0.7, ..metal }, - METAL_PAGE, - None, - ), + MaterialType { + optional_graph: Some(brushed_graph()), + ..t( + "metal_brushed", + "Brushed metal", + "Metal", + SurfaceParams { specular_roughness: 0.3, specular_roughness_anisotropy: 0.7, ..metal }, + METAL_PAGE, + None, + ) + }, t( "paint", "Paint", From 81ce75012fe23ebed32e333a3a5624b63cf0d8b5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:01:39 -0500 Subject: [PATCH 235/494] feat(backend): accept texture image uploads from the window POST /api/textures stores one PNG, JPEG, HDR or EXR image under the projects root's .textures folder and answers its path; DELETE removes it. Window key, name sanitising and size limits follow the import route. Ran curl against the service: 403 without the key, 200 with it and the bytes identical, 400 for a .py, an empty file and a climbing name, 413 for 600 MB, CON stored as _CON. --- backend/app/routers/textures.py | 202 +++++++++++++++++++++++++++++++- 1 file changed, 201 insertions(+), 1 deletion(-) diff --git a/backend/app/routers/textures.py b/backend/app/routers/textures.py index d1f926ed..8ee1b4b0 100644 --- a/backend/app/routers/textures.py +++ b/backend/app/routers/textures.py @@ -1,5 +1,205 @@ """Texture images a material uses: uploads from the window, kept beside the project (0.6.0).""" -from fastapi import APIRouter +import re +import secrets +import shutil +import unicodedata +from pathlib import Path + +from fastapi import APIRouter, HTTPException, Request + +from app import project_library as library +from app import window_key router = APIRouter() + +FOLDER = ".textures" +ID = re.compile(r"^[a-f0-9]{16}\Z") +BAD = re.compile(r'[\x00-\x1f\x7f<>:"|?*]') +WINDOWS_NAMES = {"con", "prn", "aux", "nul", *(f"com{i}" for i in range(1, 10)), *(f"lpt{i}" for i in range(1, 10))} +IMAGE_SUFFIXES = {".png", ".jpg", ".jpeg", ".hdr", ".exr"} +IMAGE_WORDS = "PNG, JPEG, Radiance HDR and OpenEXR images" +NAME_LIMIT = 120 +FILE_LIMIT = 512 << 20 +HEADER_LIMIT = 16 * 1024 +FIELD_LIMIT = 4096 +TOO_BIG = "The image is too large: one texture may be at most 512 MB" +NOT_MULTIPART = "Send the image as multipart/form-data with one file part named image" + + +def root() -> Path: + return library.PROJECTS / FOLDER + + +def clean_name(raw: str) -> str: + parts = [p for p in re.split(r"[\\/]+", raw or "") if p not in ("", ".")] + if not parts: + raise HTTPException(400, "The image has no file name") + if ".." in parts: + raise HTTPException(400, f"The file name {raw!r} climbs out of its folder") + text = unicodedata.normalize("NFC", parts[-1]) + text = BAD.sub("_", text).strip().lstrip(".").rstrip(". ") + if not text: + raise HTTPException(400, "The file name is empty after removing characters that cannot be in a file name") + if len(text) > NAME_LIMIT: + stem, dot, ext = text.rpartition(".") + keep = f".{ext}" if dot and len(ext) <= 10 else "" + text = text[: NAME_LIMIT - len(keep)].rstrip(". ") + keep + if text.split(".")[0].lower() in WINDOWS_NAMES: + text = f"_{text}" + return text + + +def folder_for(entry: str) -> Path: + if not isinstance(entry, str) or not ID.match(entry): + raise HTTPException(404, "No such texture") + path = root() / entry + if path.is_symlink() or not path.is_dir() or not library.inside(path): + raise HTTPException(404, "No such texture") + return path + + +def disposition(headers: bytes) -> tuple[str, str | None]: + text = headers.decode("utf-8", "replace") + line = next((l for l in text.split("\r\n") if l.lower().startswith("content-disposition:")), "") + name = re.search(r'\bname="((?:[^"\\]|\\.)*)"', line) + filename = re.search(r'\bfilename="((?:[^"\\]|\\.)*)"', line) + unquote = lambda s: s.replace('\\"', '"').replace("%22", '"') + return (unquote(name.group(1)) if name else ""), (unquote(filename.group(1)) if filename else None) + + +class Upload: + def __init__(self, folder: Path) -> None: + self.folder = folder + self.name: str | None = None + self.size = 0 + self.handle = None + self.field: str | None = None + self.value = b"" + + def begin(self, field: str, filename: str | None) -> None: + if filename is None: + self.field = field + self.value = b"" + return + if self.name is not None: + raise HTTPException(400, "Send one image per texture upload") + name = clean_name(filename) + kind = Path(name).suffix.lower() + if kind not in IMAGE_SUFFIXES: + raise HTTPException(400, f"FormShot does not read {kind or 'files without an extension'} as a texture; it reads {IMAGE_WORDS}") + target = self.folder / name + if not library.inside(target.parent): + raise HTTPException(400, library.OUTSIDE) + self.handle = target.open("wb") + self.name = name + + def write(self, data: bytes) -> None: + if not data: + return + if self.handle is None: + if self.field is not None: + self.value += data + if len(self.value) > FIELD_LIMIT: + raise HTTPException(400, "A form field is too long") + return + self.size += len(data) + if self.size > FILE_LIMIT: + raise HTTPException(413, TOO_BIG) + self.handle.write(data) + + def end(self) -> None: + self.close() + self.field = None + + def close(self) -> None: + if self.handle is not None: + self.handle.close() + self.handle = None + + +async def receive(request: Request, upload: Upload, boundary: bytes) -> None: + delimiter = b"\r\n--" + boundary + buffer = b"\r\n" + state = "preamble" + async for chunk in request.stream(): + buffer += chunk + while True: + if state == "preamble": + at = buffer.find(delimiter) + if at < 0: + buffer = buffer[-len(delimiter):] + break + buffer = buffer[at + len(delimiter):] + state = "boundary" + if state == "boundary": + if len(buffer) < 2: + break + if buffer.startswith(b"--"): + return + if not buffer.startswith(b"\r\n"): + raise HTTPException(400, NOT_MULTIPART) + buffer = buffer[2:] + state = "headers" + if state == "headers": + at = buffer.find(b"\r\n\r\n") + if at < 0: + if len(buffer) > HEADER_LIMIT: + raise HTTPException(400, NOT_MULTIPART) + break + field, filename = disposition(buffer[:at]) + buffer = buffer[at + 4:] + upload.begin(field, filename) + state = "body" + if state == "body": + at = buffer.find(delimiter) + if at < 0: + keep = len(delimiter) - 1 + if len(buffer) > keep: + upload.write(buffer[:-keep]) + buffer = buffer[-keep:] + break + upload.write(buffer[:at]) + upload.end() + buffer = buffer[at + len(delimiter):] + state = "boundary" + raise HTTPException(400, "The upload ended before its last part") + + +@router.post("/api/textures") +async def create_texture(request: Request): + window_key.require(request) + kind = request.headers.get("content-type", "") + found = re.search(r'boundary="?([^";]+)"?', kind) + if not kind.lower().startswith("multipart/form-data") or not found: + raise HTTPException(400, NOT_MULTIPART) + declared = request.headers.get("content-length", "") + if declared.isdigit() and int(declared) > FILE_LIMIT + 1_000_000: + raise HTTPException(413, TOO_BIG) + base = root() + base.mkdir(parents=True, exist_ok=True) + if base.is_symlink() or not library.inside(base): + raise HTTPException(400, library.OUTSIDE) + entry = secrets.token_hex(8) + folder = base / entry + folder.mkdir() + upload = Upload(folder) + try: + await receive(request, upload, found.group(1).encode("latin-1")) + if upload.name is None: + raise HTTPException(400, "The upload holds no image") + if upload.size == 0: + raise HTTPException(400, "The image is empty") + except BaseException: + upload.close() + shutil.rmtree(folder, ignore_errors=True) + raise + path = (folder / upload.name).resolve() + return {"id": entry, "path": str(path), "name": upload.name, "bytes": upload.size} + + +@router.delete("/api/textures/{entry}") +def delete_texture(entry: str, request: Request): + window_key.require(request) + shutil.rmtree(folder_for(entry)) + return {"ok": True} From 208fc6813f2d48952da9cd3ded38a3c350a32f9c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:16:46 -0500 Subject: [PATCH 236/494] feat(material-ui): add the material page data model Parses material.types and material JSON, holds field labels, ranges and units for every surface parameter, and converts ACEScg colours to and from sRGB hex for colour fields. Ran npx tsc --noEmit. --- frontend/src/ui/material/model.ts | 262 ++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 frontend/src/ui/material/model.ts diff --git a/frontend/src/ui/material/model.ts b/frontend/src/ui/material/model.ts new file mode 100644 index 00000000..2265e94d --- /dev/null +++ b/frontend/src/ui/material/model.ts @@ -0,0 +1,262 @@ +export type Rgb = [number, number, number]; +export type ParamKind = 'float' | 'colour' | 'bool'; + +export interface FieldSpec { + field: string; + kind: ParamKind; + min: number; + max: number; + unit: string; + slot: boolean; +} + +export interface MaterialType { + id: string; + name: string; + category: string; + needsGraph: boolean; + params: Record; + shown: FieldSpec[]; + graph: unknown; +} + +export interface Metal { id: string; name: string; baseColor: Rgb } + +export interface GraphInfo { nodes: number; outputs: string[]; raw: Record } + +export interface MaterialDoc { + key: string; + name: string; + typeId: string; + params: Record; + slots: Record>; + graph: GraphInfo | null; + textures: string[]; +} + +export interface TextureInfo { key: string; path: string; colourSpace: string | null } + +export interface MaterialRow { key: string; name: string; typeId: string; uses: number } + +export const SLOTTABLE = [ + 'base_color', 'specular_roughness', 'base_metalness', 'specular_weight', 'coat_weight', 'coat_roughness', + 'emission_color', 'geometry_opacity', 'normal', 'bump', 'displacement', +] as const; + +export const GEOMETRY_INPUTS = ['normal', 'bump', 'displacement'] as const; +export const COLOUR_INPUTS: ReadonlySet = new Set(['base_color', 'specular_color', 'transmission_color', 'coat_color', 'fuzz_color', 'emission_color']); + +interface FieldInfo { label: string; kind: ParamKind; min: number; max: number; unit?: string } + +const F = (label: string, min = 0, max = 1, unit = ''): FieldInfo => ({ label, kind: 'float', min, max, unit }); +const C = (label: string): FieldInfo => ({ label, kind: 'colour', min: 0, max: 1 }); + +export const FIELDS: Readonly> = { + base_weight: F('Base weight'), + base_color: C('Base colour'), + base_metalness: F('Metalness'), + base_diffuse_roughness: F('Diffuse roughness'), + specular_weight: F('Specular weight'), + specular_color: C('Specular colour'), + specular_roughness: F('Roughness'), + specular_ior: F('IOR', 1, 4), + specular_roughness_anisotropy: F('Anisotropy'), + transmission_weight: F('Transmission'), + transmission_color: C('Transmission colour'), + transmission_depth: F('Transmission depth', 0, 1, 'm'), + transmission_dispersion_scale: F('Dispersion'), + transmission_dispersion_abbe_number: F('Abbe number', 1, 200), + subsurface_weight: F('Subsurface'), + subsurface_color: C('Subsurface colour'), + subsurface_radius: F('Subsurface radius', 0, 0.1, 'm'), + subsurface_radius_scale: C('Subsurface radius scale'), + coat_weight: F('Coat'), + coat_color: C('Coat colour'), + coat_roughness: F('Coat roughness'), + coat_ior: F('Coat IOR', 1, 3), + coat_darkening: F('Coat darkening'), + fuzz_weight: F('Fuzz'), + fuzz_color: C('Fuzz colour'), + fuzz_roughness: F('Fuzz roughness'), + thin_film_weight: F('Thin film'), + thin_film_thickness: F('Film thickness', 0, 10, 'um'), + thin_film_ior: F('Film IOR', 1, 3), + emission_luminance: F('Emission', 0, 10000, 'nits'), + emission_color: C('Emission colour'), + geometry_opacity: F('Opacity'), + geometry_thin_walled: { label: 'Thin walled', kind: 'bool', min: 0, max: 1 }, + normal: { label: 'Normal', kind: 'float', min: 0, max: 1 }, + bump: { label: 'Bump', kind: 'float', min: 0, max: 1 }, + displacement: { label: 'Displacement', kind: 'float', min: 0, max: 1 }, +}; + +export const FIELD_ORDER: readonly string[] = Object.keys(FIELDS).filter((f) => !(GEOMETRY_INPUTS as readonly string[]).includes(f)); + +export function fieldLabel(field: string): string { + return FIELDS[field]?.label ?? field.replace(/_/g, ' '); +} + +export function unitText(unit: string): string { + return unit === 'um' ? 'µm' : unit; +} + +export function specFor(field: string, type: MaterialType | null): FieldSpec { + const shown = type?.shown.find((s) => s.field === field); + if (shown) return shown; + const info = FIELDS[field]; + return { + field, + kind: info?.kind ?? 'float', + min: info?.min ?? 0, + max: info?.max ?? 1, + unit: info?.unit ?? '', + slot: (SLOTTABLE as readonly string[]).includes(field), + }; +} + +export function stepFor(spec: FieldSpec): number { + const span = Math.max(1e-6, spec.max - spec.min); + const raw = span / 200; + const p = Math.pow(10, Math.floor(Math.log10(raw))); + const n = raw / p; + return +(n < 2 ? p : n < 5 ? 2 * p : 5 * p).toPrecision(6); +} + +export const isObj = (v: unknown): v is Record => !!v && typeof v === 'object' && !Array.isArray(v); +const str = (v: unknown, d = ''): string => typeof v === 'string' ? v : typeof v === 'number' ? String(v) : d; +const num = (v: unknown, d = 0): number => typeof v === 'number' && Number.isFinite(v) ? v : d; + +export function rgbOf(v: unknown): Rgb | null { + if (!Array.isArray(v) || v.length < 3) return null; + const out = v.slice(0, 3).map(Number); + return out.every(Number.isFinite) ? [out[0], out[1], out[2]] : null; +} + +function kindOf(v: unknown): ParamKind { + return v === 'colour' || v === 'color' ? 'colour' : v === 'bool' ? 'bool' : 'float'; +} + +export function parseTypes(raw: unknown): { types: MaterialType[]; metals: Metal[] } { + const o = isObj(raw) ? (isObj(raw.result) ? raw.result : raw) : {}; + const types: MaterialType[] = (Array.isArray(o.types) ? o.types : []).filter(isObj).map((t) => ({ + id: str(t.id), + name: str(t.name, str(t.id)), + category: str(t.category, 'Generic'), + needsGraph: t.needs_graph === true, + params: isObj(t.params) ? t.params : {}, + shown: (Array.isArray(t.shown) ? t.shown : []).filter(isObj).map((s) => ({ + field: str(s.field), kind: kindOf(s.kind), min: num(s.min), max: num(s.max, 1), unit: str(s.unit), slot: s.slot === true, + })).filter((s) => s.field !== ''), + graph: t.graph ?? null, + })).filter((t) => t.id !== ''); + const metals: Metal[] = (Array.isArray(o.metals) ? o.metals : []).filter(isObj).map((m) => ({ + id: str(m.id), name: str(m.name, str(m.id)), baseColor: rgbOf(m.base_color) ?? [0.9, 0.9, 0.9], + })).filter((m) => m.id !== ''); + return { types, metals }; +} + +function graphInfo(v: unknown): GraphInfo | null { + if (!isObj(v)) return null; + const nodes = isObj(v.nodes) ? Object.keys(v.nodes).length : Array.isArray(v.nodes) ? v.nodes.length : 0; + const outputs = isObj(v.outputs) ? Object.keys(v.outputs) : []; + return { nodes, outputs, raw: v }; +} + +export function parseMaterial(key: string, raw: unknown): MaterialDoc | null { + if (!isObj(raw)) return null; + const m = isObj(raw.material) ? raw.material : raw; + const slots: Record> = {}; + if (isObj(m.slots)) for (const [k, v] of Object.entries(m.slots)) if (isObj(v)) slots[k] = v; + return { + key, + name: str(m.name, 'Material'), + typeId: str(m.type_id, 'generic'), + params: isObj(m.params) ? { ...m.params } : {}, + slots, + graph: graphInfo(m.graph), + textures: Array.isArray(m.textures) ? m.textures.map((k) => str(k)) : [], + }; +} + +export function parseTextures(raw: unknown): Map { + const out = new Map(); + const add = (key: string, v: unknown): void => { + if (!isObj(v)) return; + const path = str(v.path); + if (path) out.set(key, { key, path, colourSpace: typeof v.colour_space === 'string' ? v.colour_space : null }); + }; + if (isObj(raw)) for (const [k, v] of Object.entries(raw)) add(k, v); + else if (Array.isArray(raw)) { + for (const item of raw) { + if (Array.isArray(item) && item.length >= 2) add(str(item[0]), item[1]); + else if (isObj(item)) add(str(item.key), isObj(item.texture) ? item.texture : item); + } + } + return out; +} + +export function signature(m: MaterialDoc): string { + return JSON.stringify([m.typeId, m.params, m.slots, m.graph?.raw ?? null]); +} + +export function deepMerge(base: Record, patch: Record): Record { + const out: Record = { ...base }; + for (const [k, v] of Object.entries(patch)) { + const cur = out[k]; + if (isObj(cur) && isObj(v) && !['kind', 'mode', 'type'].some((t) => t in cur && t in v && cur[t] !== v[t])) out[k] = deepMerge(cur, v); + else out[k] = v; + } + return out; +} + +const TO_SRGB = [ + [1.705051, -0.6217921, -0.08325887], + [-0.13025642, 1.1408047, -0.010548319], + [-0.024003357, -0.12896898, 1.1529723], +]; +const TO_ACESCG = [ + [0.6130974, 0.33952315, 0.04737945], + [0.07019372, 0.9163539, 0.0134524], + [0.020615593, 0.10956977, 0.8698146], +]; + +const mul = (m: number[][], c: Rgb): Rgb => [ + m[0][0] * c[0] + m[0][1] * c[1] + m[0][2] * c[2], + m[1][0] * c[0] + m[1][1] * c[1] + m[1][2] * c[2], + m[2][0] * c[0] + m[2][1] * c[1] + m[2][2] * c[2], +]; +const clamp01 = (x: number): number => Math.min(1, Math.max(0, x)); +const encode = (x: number): number => x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055; +const decode = (x: number): number => x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); + +export const acescgToLinearSrgb = (c: Rgb): Rgb => mul(TO_SRGB, c); + +export function linearToHex(c: Rgb): string { + return '#' + c.map((x) => Math.round(clamp01(encode(clamp01(x))) * 255).toString(16).padStart(2, '0')).join(''); +} + +export function acescgToHex(c: Rgb): string { + return linearToHex(mul(TO_SRGB, c)); +} + +export function hexToAcescg(hex: string): Rgb | null { + const m = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex.trim()); + if (!m) return null; + const lin: Rgb = [decode(parseInt(m[1], 16) / 255), decode(parseInt(m[2], 16) / 255), decode(parseInt(m[3], 16) / 255)]; + return mul(TO_ACESCG, lin).map((x) => +clamp01(x).toFixed(6)) as Rgb; +} + +export function uses(nodes: ReadonlyArray<{ kind: string; raw: Record }>): Map { + const out = new Map(); + for (const n of nodes) { + if (n.kind !== 'part') continue; + const k = n.raw.material; + if (typeof k === 'string' || typeof k === 'number') out.set(String(k), (out.get(String(k)) ?? 0) + 1); + } + return out; +} + +export function keyArg(key: string): number | string { + const n = Number(key); + return Number.isSafeInteger(n) ? n : key; +} From a7c4c85212dbeefd969633a8301b932c48aec98f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:16:46 -0500 Subject: [PATCH 237/494] feat(material-ui): keep a window-side store of document materials Rows come from scene.summary with usage counts; full materials are read with material.get when the engine offers it, else from the stored-ZIP project snapshot, only while the page is visible and never during a drag. Ran npx tsc --noEmit. --- frontend/src/ui/material/store.ts | 237 ++++++++++++++++++++++++++++++ frontend/src/ui/material/zip.ts | 35 +++++ 2 files changed, 272 insertions(+) create mode 100644 frontend/src/ui/material/store.ts create mode 100644 frontend/src/ui/material/zip.ts diff --git a/frontend/src/ui/material/store.ts b/frontend/src/ui/material/store.ts new file mode 100644 index 00000000..ba1ec588 --- /dev/null +++ b/frontend/src/ui/material/store.ts @@ -0,0 +1,237 @@ +import { api } from '../../shell/api'; +import type { Workspace } from '../context'; +import { + deepMerge, parseMaterial, parseTextures, parseTypes, signature, uses, + type MaterialDoc, type MaterialRow, type MaterialType, type Metal, type TextureInfo, +} from './model'; +import { readStoredZip } from './zip'; + +export const CMD = { + types: 'material.types', + get: 'material.get', + create: 'material.create', + rename: 'material.rename', + remove: 'material.remove', + assign: 'material.assign', + setParams: 'material.set_params', + setType: 'material.set_type', + setSlot: 'material.set_slot', + clearSlot: 'material.clear_slot', + setGraph: 'material.set_graph', + preview: 'material.preview_maps', + barrier: 'history.barrier', + librarySave: 'library.save', +} as const; + +const QUIET = /^(scene\.(summary|meshes|mesh_data)|render\.|view\.|camera\.|selection\.|app\.|history\.(barrier|begin_group)|file\.(snapshot|export_image|export_model|save|recover_list)|material\.(types|node_kinds|program|preview_maps|get)|import\.(probe|status))/; +const CHANGE_EVENTS = ['scene.changed', 'document.changed', 'history.changed', 'hello', 'resync', 'ui.workspace.loaded']; +const READ_DELAY_MS = 90; + +export class MaterialStore { + types: MaterialType[] = []; + metals: Metal[] = []; + rows: MaterialRow[] = []; + textures = new Map(); + error = ''; + private docs = new Map(); + private sigs = new Map(); + private fns = new Set<() => void>(); + private holds = 0; + private epoch = 0; + private stale = true; + private visible = false; + private reading = false; + private again = false; + private timer: number | undefined; + private typesFor: unknown = null; + private contentRevision = ''; + private rowsKey = ''; + + constructor(private readonly ws: Workspace) { + const { client, ctx } = ws; + client.onSummary(() => this.summaryChanged()); + client.onCatalogue(() => { void this.loadTypes(); this.markStale(); }); + client.onState(() => { if (client.state === 'ready') { void this.loadTypes(); this.markStale(); } }); + client.onDispatch((n) => { + if (QUIET.test(n.name) || client.entry(n.name)?.mutates === false) return; + this.markStale(); + }); + for (const type of CHANGE_EVENTS) ctx.events.on(type, () => this.markStale()); + this.summaryChanged(); + } + + onChange(fn: () => void): () => void { this.fns.add(fn); return () => { this.fns.delete(fn); }; } + + type(id: string): MaterialType | null { return this.types.find((t) => t.id === id) ?? null; } + doc(key: string | null): MaterialDoc | null { return key === null ? null : this.docs.get(key) ?? null; } + sig(key: string): string { return this.sigs.get(key) ?? ''; } + row(key: string | null): MaterialRow | null { return this.rows.find((r) => r.key === key) ?? null; } + hasDocs(): boolean { return this.docs.size > 0 || this.rows.length === 0; } + + setVisible(on: boolean): void { + this.visible = on; + if (on && this.stale) this.schedule(); + } + + markStale(): void { + this.stale = true; + this.schedule(); + } + + hold(): () => void { + this.holds++; + this.epoch++; + let released = false; + return () => { + if (released) return; + released = true; + this.holds--; + this.markStale(); + }; + } + + patchParams(key: string, values: Record): void { + const d = this.docs.get(key); + if (!d) return; + this.epoch++; + d.params = { ...d.params, ...values }; + this.commit(d); + } + + patchSlot(key: string, input: string, slot: Record | null): void { + const d = this.docs.get(key); + if (!d) return; + this.epoch++; + const next = { ...d.slots }; + if (slot === null) delete next[input]; + else next[input] = deepMerge(next[input] ?? {}, slot); + d.slots = next; + this.commit(d); + } + + private commit(d: MaterialDoc): void { + this.sigs.set(d.key, signature(d)); + this.emit(); + } + + private emit(): void { for (const fn of this.fns) fn(); } + + private summaryChanged(): void { + const s = this.ws.client.summary; + const counts = uses(s?.nodes ?? []); + const rows: MaterialRow[] = (s?.materials ?? []).map((m) => { + const key = String(m.key ?? ''); + return { key, name: typeof m.name === 'string' ? m.name : key, typeId: typeof m.type_id === 'string' ? m.type_id : 'generic', uses: counts.get(key) ?? 0 }; + }).filter((r) => r.key !== ''); + const rowsKey = JSON.stringify(rows); + if (rowsKey === this.rowsKey) { this.emit(); return; } + const keysBefore = this.rows.map((r) => r.key).join(','); + this.rowsKey = rowsKey; + this.rows = rows; + for (const r of rows) { + const d = this.docs.get(r.key); + if (d && (d.name !== r.name || d.typeId !== r.typeId)) this.stale = true; + } + if (keysBefore !== rows.map((r) => r.key).join(',')) this.stale = true; + this.emit(); + if (this.stale) this.schedule(); + } + + private async loadTypes(): Promise { + const { client } = this.ws; + if (client.state !== 'ready' || !client.has(CMD.types)) return; + const token = client.entry(CMD.types); + if (token === this.typesFor && this.types.length) return; + this.typesFor = token; + try { + const parsed = parseTypes(await client.dispatch(CMD.types, {})); + this.types = parsed.types; + this.metals = parsed.metals; + this.emit(); + } catch (err) { + this.typesFor = null; + this.error = err instanceof Error ? err.message : String(err); + this.emit(); + } + } + + private schedule(): void { + if (!this.visible || this.holds > 0) return; + window.clearTimeout(this.timer); + this.timer = window.setTimeout(() => { void this.read(); }, READ_DELAY_MS); + } + + private async read(): Promise { + if (!this.stale || !this.visible || this.holds > 0) return; + if (this.reading) { this.again = true; return; } + const { client } = this.ws; + if (client.state !== 'ready') return; + this.reading = true; + this.stale = false; + const epoch = this.epoch; + try { + const got = client.has(CMD.get) ? await this.readByCommand() : await this.readSnapshot(); + if (got && epoch === this.epoch && this.holds === 0) this.apply(got.docs, got.textures); + else if (got) this.stale = true; + if (this.error) { this.error = ''; this.emit(); } + } catch (err) { + this.error = err instanceof Error ? err.message : String(err); + this.emit(); + } finally { + this.reading = false; + if (this.again || this.stale) { this.again = false; this.schedule(); } + } + } + + private async readByCommand(): Promise<{ docs: Map; textures: Map }> { + const docs = new Map(); + const textures = new Map(); + for (const r of this.rows) { + const raw = await this.ws.client.dispatch>(CMD.get, { key: Number(r.key) }); + const d = parseMaterial(r.key, raw); + if (d) docs.set(r.key, d); + const tex = raw && typeof raw === 'object' ? (raw.textures_info ?? raw.texture_refs) : undefined; + for (const [k, v] of parseTextures(tex)) textures.set(k, v); + } + return { docs, textures }; + } + + private async readSnapshot(): Promise<{ docs: Map; textures: Map } | null> { + const res = await fetch(api.url('/api/engine/snapshot'), { cache: 'no-store' }); + if (!res.ok) throw new Error(`The material settings could not be read (${res.status})`); + const revision = res.headers.get('X-Formshot-Content-Revision') ?? ''; + if (revision && revision === this.contentRevision && this.docs.size) return null; + const members = readStoredZip(await res.arrayBuffer(), (n) => n === 'scene.json' || /^materials\/\d+\.json$/.test(n)); + const text = new TextDecoder(); + const docs = new Map(); + let textures = new Map(); + for (const m of members) { + const value: unknown = JSON.parse(text.decode(m.bytes)); + if (m.name === 'scene.json') { + textures = parseTextures((value as Record | null)?.textures); + continue; + } + const key = m.name.slice('materials/'.length, -'.json'.length); + const d = parseMaterial(key, value); + if (d) docs.set(key, d); + } + this.contentRevision = revision; + return { docs, textures }; + } + + private apply(docs: Map, textures: Map): void { + let changed = false; + for (const key of [...this.docs.keys()]) if (!docs.has(key)) { this.docs.delete(key); this.sigs.delete(key); changed = true; } + for (const [key, d] of docs) { + const sig = signature(d); + const old = this.docs.get(key); + if (old && this.sigs.get(key) === sig && old.name === d.name) continue; + this.docs.set(key, d); + this.sigs.set(key, sig); + changed = true; + } + const texKey = JSON.stringify([...textures.values()]); + if (texKey !== JSON.stringify([...this.textures.values()])) { this.textures = textures; changed = true; } + if (changed) this.emit(); + } +} diff --git a/frontend/src/ui/material/zip.ts b/frontend/src/ui/material/zip.ts new file mode 100644 index 00000000..18f603e0 --- /dev/null +++ b/frontend/src/ui/material/zip.ts @@ -0,0 +1,35 @@ +const EOCD = 0x06054b50; +const CENTRAL = 0x02014b50; +const LOCAL = 0x04034b50; + +export interface StoredMember { name: string; bytes: Uint8Array } + +export function readStoredZip(buf: ArrayBuffer, want: (name: string) => boolean): StoredMember[] { + const view = new DataView(buf); + const bytes = new Uint8Array(buf); + const names = new TextDecoder(); + let end = -1; + for (let i = buf.byteLength - 22; i >= Math.max(0, buf.byteLength - 22 - 65535); i--) { + if (view.getUint32(i, true) === EOCD) { end = i; break; } + } + if (end < 0) throw new Error('The project snapshot is not a ZIP archive'); + const count = view.getUint16(end + 10, true); + let at = view.getUint32(end + 16, true); + const out: StoredMember[] = []; + for (let i = 0; i < count; i++) { + if (view.getUint32(at, true) !== CENTRAL) throw new Error('The project snapshot has a damaged directory'); + const method = view.getUint16(at + 10, true); + const size = view.getUint32(at + 20, true); + const nameLen = view.getUint16(at + 28, true); + const extraLen = view.getUint16(at + 30, true); + const commentLen = view.getUint16(at + 32, true); + const local = view.getUint32(at + 42, true); + const name = names.decode(bytes.subarray(at + 46, at + 46 + nameLen)); + at += 46 + nameLen + extraLen + commentLen; + if (method !== 0 || !want(name)) continue; + if (view.getUint32(local, true) !== LOCAL) continue; + const start = local + 30 + view.getUint16(local + 26, true) + view.getUint16(local + 28, true); + out.push({ name, bytes: bytes.subarray(start, start + size) }); + } + return out; +} From 4b4e1aec7fd80d1517706adc05fc29a3ea6a0fdb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:16:46 -0500 Subject: [PATCH 238/494] feat(material-ui): send dragged edits as one undo step Live values are coalesced to one command per frame per target, and the end of a drag drains them and sends history.barrier so the next edit starts a new history entry. Ran npx tsc --noEmit. --- frontend/src/ui/material/edits.ts | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 frontend/src/ui/material/edits.ts diff --git a/frontend/src/ui/material/edits.ts b/frontend/src/ui/material/edits.ts new file mode 100644 index 00000000..77da4517 --- /dev/null +++ b/frontend/src/ui/material/edits.ts @@ -0,0 +1,79 @@ +import type { Workspace } from '../context'; +import { CMD, type MaterialStore } from './store'; + +interface Gesture { + name: string; + pending: Record | null; + inflight: Promise | null; + release: () => void; + queued: boolean; +} + +export class Edits { + private readonly open = new Map(); + + constructor(private readonly ws: Workspace, private readonly store: MaterialStore) {} + + live(target: string, name: string, args: Record): void { + const g = this.gesture(target, name); + g.pending = args; + this.queue(g); + } + + async commit(target: string, name: string, args: Record): Promise { + const g = this.gesture(target, name); + g.pending = args; + this.open.delete(target); + await this.drain(g); + if (this.ws.canRun(CMD.barrier)) await this.ws.run(CMD.barrier, {}); + g.release(); + } + + async once(name: string, args: Record): Promise { + const release = this.store.hold(); + try { + const out = await this.ws.run(name, args); + if (this.ws.canRun(CMD.barrier)) await this.ws.run(CMD.barrier, {}); + return out; + } finally { + release(); + } + } + + active(target: string): boolean { return this.open.has(target); } + + private gesture(target: string, name: string): Gesture { + let g = this.open.get(target); + if (!g) { + g = { name, pending: null, inflight: null, release: this.store.hold(), queued: false }; + this.open.set(target, g); + } + return g; + } + + private queue(g: Gesture): void { + if (g.queued) return; + g.queued = true; + requestAnimationFrame(() => { g.queued = false; this.pump(g); }); + } + + private pump(g: Gesture): void { + if (g.inflight || !g.pending) return; + const args = g.pending; + g.pending = null; + g.inflight = this.ws.run(g.name, args).finally(() => { + g.inflight = null; + if (g.pending) this.queue(g); + }); + } + + private async drain(g: Gesture): Promise { + for (;;) { + if (g.inflight) { await g.inflight; continue; } + if (!g.pending) return; + const args = g.pending; + g.pending = null; + g.inflight = this.ws.run(g.name, args).finally(() => { g.inflight = null; }); + } + } +} From 379d96d2d2cf05de918ba680801f9c4a900cc212 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:42 -0500 Subject: [PATCH 239/494] fix(material-ui): refresh the summary after edits with no render change material.create and material.rename report change level none, so the workspace never re-read scene.summary and new materials did not appear. Found and checked by driving the page in headless Chrome. --- frontend/src/ui/material/store.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/ui/material/store.ts b/frontend/src/ui/material/store.ts index ba1ec588..e559a879 100644 --- a/frontend/src/ui/material/store.ts +++ b/frontend/src/ui/material/store.ts @@ -54,6 +54,7 @@ export class MaterialStore { client.onState(() => { if (client.state === 'ready') { void this.loadTypes(); this.markStale(); } }); client.onDispatch((n) => { if (QUIET.test(n.name) || client.entry(n.name)?.mutates === false) return; + if (n.change === 'none') client.scheduleRefresh(); this.markStale(); }); for (const type of CHANGE_EVENTS) ctx.events.on(type, () => this.markStale()); From da262c65026ac5c1c48a2a2f303c680ebd72b449 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:42 -0500 Subject: [PATCH 240/494] feat(material-ui): draw material swatches into reused canvases Constant materials are shaded locally from their parameters, others from material.preview_maps (constant values or the base colour map); images are cached by material key and content signature and drawn into the existing canvas so a swatch never flashes. Looked at the swatches of the spheres template in headless Chrome. --- frontend/src/ui/material/swatch.ts | 175 +++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 frontend/src/ui/material/swatch.ts diff --git a/frontend/src/ui/material/swatch.ts b/frontend/src/ui/material/swatch.ts new file mode 100644 index 00000000..736e7be5 --- /dev/null +++ b/frontend/src/ui/material/swatch.ts @@ -0,0 +1,175 @@ +import type { Workspace } from '../context'; +import { acescgToLinearSrgb, isObj, keyArg, rgbOf, type MaterialDoc, type Rgb } from './model'; +import { CMD, type MaterialStore } from './store'; + +export const SWATCH_PX = 56; +const PREVIEW_SIZE = 64; +const PARALLEL = 2; +const CACHE_LIMIT = 256; +const DELAY_MS = 160; + +interface Look { albedo: Rgb; roughness: number; metalness: number; opacity: number; map: Uint8ClampedArray | null; mapSize: number } + +const decode = (x: number): number => x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); +const encode = (x: number): number => x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055; +const num = (v: unknown, d: number): number => typeof v === 'number' && Number.isFinite(v) ? v : d; + +function shade(look: Look, size: number): ImageData { + const img = new ImageData(size, size); + const px = img.data; + const L = [-0.45, 0.62, 0.64]; + const H = [L[0], L[1], L[2] + 1]; + const hl = Math.hypot(H[0], H[1], H[2]); + const r = Math.min(1, Math.max(0.02, look.roughness)); + const exponent = 2 / (r * r * r * r + 1e-3); + const specScale = Math.min(6, (exponent + 2) / 8); + for (let y = 0; y < size; y++) { + for (let x = 0; x < size; x++) { + const u = ((x + 0.5) / size) * 2 - 1; + const v = 1 - ((y + 0.5) / size) * 2; + const d2 = u * u + v * v; + const i = (y * size + x) * 4; + if (d2 > 1) { px[i + 3] = 0; continue; } + const z = Math.sqrt(1 - d2); + let a: Rgb = look.albedo; + if (look.map) { + const mx = Math.min(look.mapSize - 1, Math.floor(((u + 1) / 2) * look.mapSize)); + const my = Math.min(look.mapSize - 1, Math.floor(((1 - v) / 2) * look.mapSize)); + const j = (my * look.mapSize + mx) * 4; + a = [decode(look.map[j] / 255), decode(look.map[j + 1] / 255), decode(look.map[j + 2] / 255)]; + } + const ndl = Math.max(0, u * L[0] + v * L[1] + z * L[2]); + const ndh = Math.max(0, (u * H[0] + v * H[1] + z * H[2]) / hl); + const fres = Math.pow(1 - z, 5); + const spec = Math.pow(ndh, exponent) * specScale * ndl; + const out = [0, 0, 0]; + for (let c = 0; c < 3; c++) { + const f0 = look.metalness * a[c] + (1 - look.metalness) * 0.04; + const f = f0 + (1 - f0) * fres * (1 - r) * 0.6; + const diffuse = a[c] * (1 - look.metalness) * (0.12 + 0.88 * ndl); + const env = f * (0.35 + 0.25 * v); + out[c] = diffuse + spec * f + env; + } + px[i] = Math.round(Math.min(1, encode(Math.max(0, out[0]))) * 255); + px[i + 1] = Math.round(Math.min(1, encode(Math.max(0, out[1]))) * 255); + px[i + 2] = Math.round(Math.min(1, encode(Math.max(0, out[2]))) * 255); + const edge = Math.min(1, (1 - Math.sqrt(d2)) * size * 0.5); + px[i + 3] = Math.round(255 * edge * (0.35 + 0.65 * Math.min(1, Math.max(0, look.opacity)))); + } + } + return img; +} + +function localLook(d: MaterialDoc): Look | null { + if (d.graph || Object.keys(d.slots).length) return null; + const base = rgbOf(d.params.base_color) ?? [0.8, 0.8, 0.8]; + return { + albedo: acescgToLinearSrgb(base).map((x) => Math.max(0, x)) as Rgb, + roughness: num(d.params.specular_roughness, 0.3), + metalness: num(d.params.base_metalness, 0), + opacity: num(d.params.geometry_opacity, 1) * (1 - 0.6 * num(d.params.transmission_weight, 0)), + map: null, + mapSize: 0, + }; +} + +async function pixelsOf(b64: string): Promise<{ data: Uint8ClampedArray; size: number } | null> { + const bin = atob(b64); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + const bmp = await createImageBitmap(new Blob([bytes], { type: 'image/png' })); + const c = document.createElement('canvas'); + c.width = bmp.width; + c.height = bmp.height; + const g = c.getContext('2d'); + if (!g) return null; + g.drawImage(bmp, 0, 0); + bmp.close(); + return { data: g.getImageData(0, 0, c.width, c.height).data, size: c.width }; +} + +export class Swatches { + private readonly cache = new Map(); + private readonly wanted = new Map(); + private readonly queue = new Map(); + private running = 0; + private timer: number | undefined; + + constructor(private readonly ws: Workspace, private readonly store: MaterialStore) {} + + paint(canvas: HTMLCanvasElement, key: string): void { + const sig = this.store.sig(key); + const id = `${key}|${sig}`; + if (this.wanted.get(canvas) === id && canvas.dataset.drawn === id) return; + this.wanted.set(canvas, id); + const hit = this.cache.get(id); + if (hit) { this.draw(canvas, hit, id); return; } + const d = this.store.doc(key); + const look = d ? localLook(d) : null; + if (look) { + const img = shade(look, SWATCH_PX); + this.remember(id, img); + this.draw(canvas, img, id); + return; + } + this.queue.set(key, id); + window.clearTimeout(this.timer); + this.timer = window.setTimeout(() => this.pump(), DELAY_MS); + } + + private draw(canvas: HTMLCanvasElement, img: ImageData, id: string): void { + const g = canvas.getContext('2d'); + if (!g) return; + g.putImageData(img, 0, 0); + canvas.dataset.drawn = id; + } + + private remember(id: string, img: ImageData): void { + this.cache.set(id, img); + if (this.cache.size > CACHE_LIMIT) { + const first = this.cache.keys().next().value; + if (first !== undefined) this.cache.delete(first); + } + } + + private pump(): void { + while (this.running < PARALLEL && this.queue.size) { + const [key, id] = this.queue.entries().next().value as [string, string]; + this.queue.delete(key); + this.running++; + void this.fetch(key, id).finally(() => { this.running--; this.pump(); }); + } + } + + private async fetch(key: string, id: string): Promise { + const { client } = this.ws; + let look: Look | null = null; + if (client.state === 'ready' && client.has(CMD.preview)) { + try { + const raw = await client.dispatch>(CMD.preview, { key: keyArg(key), size: PREVIEW_SIZE }); + const values = isObj(raw?.values) ? raw.values : {}; + const maps = isObj(raw?.maps) ? raw.maps : {}; + const base = rgbOf(values.base_color) ?? [0.8, 0.8, 0.8]; + let map: { data: Uint8ClampedArray; size: number } | null = null; + if (raw?.constant !== true && typeof maps.base_color === 'string') map = await pixelsOf(maps.base_color); + look = { + albedo: base, roughness: num(values.roughness, 0.3), metalness: num(values.metalness, 0), opacity: num(values.opacity, 1), + map: map?.data ?? null, mapSize: map?.size ?? 0, + }; + } catch { + look = null; + } + } + if (!look) { + const d = this.store.doc(key); + const base = d ? rgbOf(d.params.base_color) : null; + look = { albedo: base ? acescgToLinearSrgb(base) : [0.5, 0.5, 0.5], roughness: 0.5, metalness: 0, opacity: 1, map: null, mapSize: 0 }; + } + const img = shade(look, SWATCH_PX); + this.remember(id, img); + for (const [canvas, want] of this.wanted) { + if (!canvas.isConnected) { this.wanted.delete(canvas); continue; } + if (want === id) this.draw(canvas, img, id); + } + } +} From 95c1d8b37c1eb81239c4440dec7eb520a68d753f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:01:42 -0500 Subject: [PATCH 241/494] feat(material-ui): list document materials on the material page The Material page lists every material with swatch, type and usage count, highlights the selected parts' materials and follows viewport selection; New opens a type picker grouped by category with the measured metals, and duplicate, rename, assign to selection and delete (refused with the reason while in use) are one undo step each. The stylesheet already carries the rules of the sections that follow. Ran in headless Chrome at 4x CPU throttle against the service and this worktree's engine: created rubber and copper, duplicated, renamed, assigned ceramic to a clicked sphere, clicked four spheres in the viewport and saw each material selected. --- frontend/src/styles/material.css | 103 +++++++++++ frontend/src/ui/inspector.ts | 3 +- frontend/src/ui/material/glyphs.ts | 17 ++ frontend/src/ui/material/list.ts | 261 ++++++++++++++++++++++++++++ frontend/src/ui/material/popover.ts | 42 +++++ frontend/src/ui/pages/material.ts | 102 +++++++++++ 6 files changed, 527 insertions(+), 1 deletion(-) create mode 100644 frontend/src/styles/material.css create mode 100644 frontend/src/ui/material/glyphs.ts create mode 100644 frontend/src/ui/material/list.ts create mode 100644 frontend/src/ui/material/popover.ts create mode 100644 frontend/src/ui/pages/material.ts diff --git a/frontend/src/styles/material.css b/frontend/src/styles/material.css new file mode 100644 index 00000000..246f9749 --- /dev/null +++ b/frontend/src/styles/material.css @@ -0,0 +1,103 @@ +.fsh-mat-status { margin-bottom: var(--space-1); } + +.fsh-mat-tools { display: flex; align-items: center; gap: var(--space-1); height: var(--ctl-md); margin-bottom: var(--space-2); } +.fsh-mat-tools-gap { flex: 1; } +.fsh-mat-new { display: inline-flex; align-items: center; gap: var(--space-1); } +.fsh-mat-tools .fsh-icon-btn[aria-disabled="true"] { opacity: 0.5; } + +.fsh-mat-list { display: flex; flex-direction: column; gap: 1px; } +.fsh-mat-row { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-2); border-radius: var(--radius-md); cursor: pointer; outline: none; } +.fsh-mat-row:hover { background: var(--bg-hover); } +.fsh-mat-row:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-color); } +.fsh-mat-row[aria-selected="true"] { background: var(--accent-tint); } +.fsh-mat-row.is-in-selection::before { content: ""; position: absolute; left: 0; top: var(--space-2); bottom: var(--space-2); width: 2px; border-radius: var(--radius-pill); background: var(--accent-color); } +.fsh-mat-swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); } +.fsh-mat-row-text { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-tight); } +.fsh-mat-row-name { overflow: hidden; color: var(--text-primary); font-size: var(--fs-12); text-overflow: ellipsis; white-space: nowrap; } +.fsh-mat-row-type { overflow: hidden; color: var(--text-faint); font-size: var(--fs-10); text-overflow: ellipsis; white-space: nowrap; } +.fsh-mat-row-uses { min-width: 3ch; color: var(--text-muted); font-size: var(--fs-11); text-align: right; } +.fsh-mat-row.is-renaming .fsh-mat-row-text { visibility: hidden; } +.fsh-mat-rename-input { position: absolute; left: calc(28px + var(--space-4)); right: var(--space-6); height: var(--ctl-sm); font-size: var(--fs-12); } +.fsh-mat-rename-input[hidden] { display: none; } +.fsh-mat-list-empty { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: var(--fs-12); } +.fsh-mat-list-empty[hidden] { display: none; } + +.fsh-mat-pop { position: fixed; left: var(--fsh-mat-pop-x, 0); top: var(--fsh-mat-pop-y, 0); z-index: var(--z-menu); max-height: min(70vh, 560px); overflow-y: auto; padding: var(--space-2); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); pointer-events: auto; } +.fsh-mat-pop[hidden] { display: none; } +.fsh-mat-pop-empty { margin: var(--space-2); color: var(--text-muted); font-size: var(--fs-12); } +.fsh-mat-types { width: 300px; } +.fsh-mat-type-group + .fsh-mat-type-group { margin-top: var(--space-2); } +.fsh-mat-type-group h4 { margin: 0 0 var(--space-1); padding: 0 var(--space-1); color: var(--text-faint); font-size: var(--fs-10); font-weight: var(--fw-semibold); letter-spacing: 0.06em; text-transform: uppercase; } +.fsh-mat-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; } +.fsh-mat-type, .fsh-mat-metal { display: flex; align-items: center; gap: var(--space-2); height: var(--ctl-sm); padding: 0 var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-12); text-align: left; cursor: pointer; } +.fsh-mat-type:hover, .fsh-mat-metal:hover, .fsh-mat-type:focus-visible, .fsh-mat-metal:focus-visible { background: var(--bg-hover); outline: none; } +.fsh-mat-metals { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 2px; padding-top: var(--space-1); border-top: 1px solid var(--line-1); } +.fsh-mat-metal-chip { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--fsh-mat-chip, var(--surface-3)); box-shadow: inset 0 0 0 1px var(--line-2); } + +.fsh-mat-none { margin: 0; color: var(--text-muted); font-size: var(--fs-12); } +.fsh-mat-none[hidden], .fsh-mat-params-wrap[hidden], .fsh-mat-slots[hidden] { display: none; } +.fsh-mat-params { display: flex; flex-direction: column; gap: var(--space-1); } +.fsh-mat-prow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-1); min-height: var(--ctl-md); } +.fsh-mat-prow[hidden] { display: none; } +.fsh-mat-pctl { min-width: 0; } +.fsh-mat-pextra:empty { display: none; } +.fsh-mat-pextra { display: flex; width: var(--ctl-md); justify-content: center; } +.fsh-mat-plabel { overflow: hidden; color: var(--text-secondary); font-size: var(--fs-12); text-overflow: ellipsis; white-space: nowrap; } +.fsh-mat-colour, .fsh-mat-toggle, .fsh-mat-selectrow { display: grid; align-items: center; gap: var(--space-2); height: var(--ctl-md); } +.fsh-mat-colour { grid-template-columns: minmax(0, 1fr) 8ch 40px; padding: 0 var(--space-1) 0 var(--space-2); border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-field); cursor: pointer; } +.fsh-mat-hex { color: var(--text-muted); font: var(--fs-11) var(--mono); text-align: right; } +.fsh-mat-colour-input { width: 40px; height: 20px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: transparent; cursor: pointer; } +.fsh-mat-colour-input:disabled { cursor: default; } +.fsh-mat-toggle { grid-template-columns: minmax(0, 1fr) auto; padding: 0 var(--space-2); cursor: pointer; } +.fsh-mat-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-color); cursor: pointer; } +.fsh-mat-selectrow { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); padding-left: var(--space-2); } +.fsh-mat-select { width: 100%; height: var(--ctl-md); padding: 0 var(--space-1); cursor: pointer; } +.fsh-mat-select:disabled { opacity: 0.5; cursor: default; } +.fsh-mat-prow.is-disabled .fsh-mat-colour, .fsh-mat-prow.is-disabled .fsh-mat-toggle { opacity: 0.55; cursor: default; } +.fsh-mat-tag { padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-10); line-height: 18px; white-space: nowrap; } +.fsh-mat-tag[hidden] { display: none; } +.fsh-mat-typerow { margin-bottom: var(--space-1); } +.fsh-mat-params-note { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: var(--fs-11); } +.fsh-mat-params-note[hidden] { display: none; } +.fsh-mat-slotbtn { width: var(--ctl-sm); height: var(--ctl-sm); color: var(--text-faint); } +.fsh-mat-slotbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-color); } + +.fsh-mat-all { margin-top: var(--space-2); border-top: 1px solid var(--line-0); } +.fsh-mat-all-head { display: flex; align-items: center; height: var(--ctl-md); color: var(--text-muted); font-size: var(--fs-11); cursor: pointer; list-style: none; } +.fsh-mat-all-head::-webkit-details-marker { display: none; } +.fsh-mat-all-head::before { content: ""; width: 0; height: 0; margin-right: var(--space-2); border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid currentColor; transition: transform var(--dur-fast); } +.fsh-mat-all[open] > .fsh-mat-all-head::before { transform: rotate(90deg); } + +.fsh-mat-typechoice { width: 260px; } +.fsh-mat-choice { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-1); } +.fsh-mat-choice-text { flex-basis: 100%; margin: 0 0 var(--space-1); color: var(--text-secondary); font-size: var(--fs-12); } + +.fsh-mat-slot-list { display: flex; flex-direction: column; gap: var(--space-1); } +.fsh-mat-slot { border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-1); } +.fsh-mat-slot.is-driven { opacity: 0.7; } +.fsh-mat-slot-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px; height: var(--ctl); padding-right: var(--space-1); } +.fsh-mat-slot-toggle { display: flex; align-items: center; gap: var(--space-2); min-width: 0; height: 100%; padding: 0 var(--space-2); border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-12); text-align: left; cursor: pointer; } +.fsh-mat-slot-toggle .fsh-icon { flex: none; transition: transform var(--dur-fast); } +.fsh-mat-slot.is-open .fsh-mat-slot-toggle .fsh-icon { transform: rotate(90deg); } +.fsh-mat-slot-input { flex: none; } +.fsh-mat-slot-file { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-mat-slot-body { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-1) var(--space-2) var(--space-2); border-top: 1px solid var(--line-0); } +.fsh-mat-slot-body[hidden] { display: none; } +.fsh-mat-slots-empty { margin: 0; color: var(--text-muted); font-size: var(--fs-12); } +.fsh-mat-slots-empty[hidden] { display: none; } +.fsh-mat-addmap { margin-top: var(--space-1); } +.fsh-mat-addmap.is-shown .fsh-mat-select { opacity: 0.6; } +.fsh-mat-slotbtn.is-shown { color: var(--accent-color); } + +.fsh-mat-graph { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); min-height: 44px; } +.fsh-mat-graph-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; } +.fsh-mat-graph-state { color: var(--text-secondary); font-size: var(--fs-12); } +.fsh-mat-graph-drives { min-height: 1.3em; overflow: hidden; color: var(--text-muted); font-size: var(--fs-11); text-overflow: ellipsis; white-space: nowrap; } +.fsh-mat-graph-edit, .fsh-mat-lib-save { display: inline-flex; align-items: center; gap: var(--space-1); } + +.fsh-mat-labels { min-height: 120px; } + +.fsh-mat-lib { display: flex; align-items: center; gap: var(--space-2); min-height: var(--ctl-md); } +.fsh-mat-lib-why { min-width: 0; color: var(--text-faint); font-size: var(--fs-11); } +.fsh-mat-lib-form { display: flex; flex-direction: column; gap: var(--space-3); min-width: 320px; } +.fsh-mat-lib-field { display: flex; flex-direction: column; gap: var(--space-1); color: var(--text-secondary); font-size: var(--fs-12); } diff --git a/frontend/src/ui/inspector.ts b/frontend/src/ui/inspector.ts index 3525c560..5fe996a4 100644 --- a/frontend/src/ui/inspector.ts +++ b/frontend/src/ui/inspector.ts @@ -8,6 +8,7 @@ import type { Workspace } from './context'; import { mountCameraPage } from './pages/camera'; import { mountEnvironmentPage } from './pages/environment'; import { mountImagePage } from './pages/image'; +import { mountMaterialPage } from './pages/material'; import { emptyPage, type PageMount } from './pages/page'; import { mountScenePage } from './pages/scene'; @@ -17,7 +18,7 @@ interface OwnPage { id: string; title: string; command: string; icon: InspectorP const PAGES: readonly OwnPage[] = [ { id: 'scene', title: 'Scene', command: 'Scene Page', icon: 'scene', order: 10, mount: mountScenePage }, - { id: 'material', title: 'Material', command: 'Material Page', icon: 'material', order: 20, mount: emptyPage('Material', 'Material editing arrives in 0.5.0.') }, + { id: 'material', title: 'Material', command: 'Material Page', icon: 'material', order: 20, mount: mountMaterialPage }, { id: 'environment', title: 'Environment', command: 'Environment Page', icon: 'environment', order: 30, mount: mountEnvironmentPage }, { id: 'lighting', title: 'Lighting', command: 'Lighting Page', icon: 'light', order: 40, mount: emptyPage('Lighting', 'Lights and studio presets arrive in 0.7.0.') }, { id: 'camera', title: 'Camera', command: 'Camera Page', icon: 'camera', order: 50, mount: mountCameraPage }, diff --git a/frontend/src/ui/material/glyphs.ts b/frontend/src/ui/material/glyphs.ts new file mode 100644 index 00000000..3a72dae9 --- /dev/null +++ b/frontend/src/ui/material/glyphs.ts @@ -0,0 +1,17 @@ +const ATTRS = 'viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"'; + +const PATHS = { + copy: '', + pencil: '', + assign: '', + graph: '', + texture: '', + unlink: '', + bookmark: '', +} as const; + +export type MatGlyph = keyof typeof PATHS; + +export function glyph(name: MatGlyph, size = 16): string { + return `${PATHS[name]}`; +} diff --git a/frontend/src/ui/material/list.ts b/frontend/src/ui/material/list.ts new file mode 100644 index 00000000..7c2ac200 --- /dev/null +++ b/frontend/src/ui/material/list.ts @@ -0,0 +1,261 @@ +import { el, escapeHtml, patchList, q, setAttr, setClass, setDisabled, setHidden, setHtml, setText, setTitle } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import type { Edits } from './edits'; +import { glyph } from './glyphs'; +import { acescgToHex, isObj, keyArg, type MaterialRow, type MaterialType } from './model'; +import { Popover } from './popover'; +import { CMD, type MaterialStore } from './store'; +import { SWATCH_PX, type Swatches } from './swatch'; + +export interface ListHost { + current(): string | null; + pick(key: string | null): void; + selectionParts(): string[]; + selectionMaterials(): ReadonlySet; +} + +const CATEGORY_ORDER = ['Generic', 'Plastic', 'Metal', 'Paint', 'Glass', 'Liquid', 'Gem', 'Rubber', 'Fabric', 'Ceramic', 'Wood', 'Stone', 'Emissive']; + +export function typeLabel(store: MaterialStore, id: string): string { + return t(store.type(id)?.name ?? id); +} + +function createdKey(reply: unknown): string | null { + const created = isObj(reply) && Array.isArray(reply.created) ? reply.created : []; + const k = created[0]; + return typeof k === 'string' || typeof k === 'number' ? String(k) : null; +} + +export interface Section { update(): void; dispose(): void } + +export function mountList(host: HTMLElement, ws: Workspace, store: MaterialStore, edits: Edits, swatches: Swatches, page: ListHost): Section { + const root = el(`
      + +
      + +
      `); + host.appendChild(root); + const list = q(root, '.fsh-mat-list'); + const empty = q(root, '.fsh-mat-list-empty'); + const newBtn = q(root, '.fsh-mat-new'); + const assignBtn = q(root, '.fsh-mat-assign'); + const dupBtn = q(root, '.fsh-mat-dup'); + const renameBtn = q(root, '.fsh-mat-rename'); + const deleteBtn = q(root, '.fsh-mat-delete'); + let renaming: string | null = null; + + const picker = new Popover('fsh-mat-types', t('Material types')); + picker.root.addEventListener('click', (e) => { + const b = (e.target as HTMLElement).closest('button[data-type]'); + if (!b) return; + picker.close(); + void create(b.dataset.type ?? 'generic', b.dataset.metal ?? null); + }); + + const paintPicker = (): void => { + const groups = new Map(); + for (const ty of store.types) { + const list = groups.get(ty.category) ?? []; + list.push(ty); + groups.set(ty.category, list); + } + const cats = [...groups.keys()].sort((a, b) => { + const ia = CATEGORY_ORDER.indexOf(a), ib = CATEGORY_ORDER.indexOf(b); + return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib) || a.localeCompare(b); + }); + const html = cats.map((cat) => { + const items = (groups.get(cat) ?? []).map((ty) => ``).join(''); + const metals = cat === 'Metal' && store.metals.length + ? `
      ${store.metals.map((m) => ``).join('')}
      ` + : ''; + return `

      ${escapeHtml(t(cat))}

      ${items}
      ${metals}
      `; + }).join(''); + setHtml(picker.root, html || `

      ${escapeHtml(t('The engine lists no material types yet'))}

      `, JSON.stringify([store.types.map((x) => x.id), store.metals.map((m) => m.id)])); + }; + + const create = async (typeId: string, metalId: string | null): Promise => { + let args: Record = { type: typeId }; + const metal = metalId ? store.metals.find((m) => m.id === metalId) : null; + const ty = store.type(typeId); + if (metal && ty) { + args = { material: { name: t(metal.name), type_id: ty.id, params: { ...ty.params, base_color: metal.baseColor }, textures: [], ...(ty.graph ? { graph: ty.graph } : {}) } }; + } else if (ty) args = { type: typeId, name: t(ty.name) }; + const key = createdKey(await edits.once(CMD.create, args)); + if (key) page.pick(key); + }; + + const duplicate = async (): Promise => { + const key = page.current(); + const d = store.doc(key); + if (!key || !d) return; + const material: Record = { + name: t('{name} copy', { name: d.name }), type_id: d.typeId, params: d.params, textures: d.textures, + }; + if (Object.keys(d.slots).length) material.slots = d.slots; + if (d.graph) material.graph = d.graph.raw; + const made = createdKey(await edits.once(CMD.create, { material })); + if (made) page.pick(made); + }; + + const inUseText = (n: number): string => n === 1 + ? t('In use by 1 part. Assign another material to it first.') + : t('In use by {n} parts. Assign another material to them first.', { n }); + + const remove = async (): Promise => { + const key = page.current(); + const row = store.row(key); + if (!key || !row) return; + if (row.uses > 0) { toast(t('{name} cannot be deleted. {reason}', { name: row.name, reason: inUseText(row.uses) }), 'error'); return; } + const index = store.rows.findIndex((r) => r.key === key); + await edits.once(CMD.remove, { key: keyArg(key) }); + const next = store.rows.filter((r) => r.key !== key)[Math.max(0, index - 1)]; + page.pick(next?.key ?? null); + }; + + const assign = async (): Promise => { + const key = page.current(); + const ids = page.selectionParts(); + if (!key || !ids.length) return; + await edits.once(CMD.assign, { ids: ids.map(keyArg), material: keyArg(key) }); + }; + + const beginRename = (row: HTMLElement): void => { + const r = store.row(row.dataset.key ?? null); + if (!r || !ws.canRun(CMD.rename)) return; + renaming = r.key; + const input = q(row, '.fsh-mat-rename-input'); + input.value = r.name; + setClass(row, 'is-renaming', true); + setHidden(input, false); + input.focus(); + input.select(); + }; + + const endRename = (row: HTMLElement, commit: boolean): void => { + const input = q(row, '.fsh-mat-rename-input'); + const r = store.row(row.dataset.key ?? null); + renaming = null; + setHidden(input, true); + setClass(row, 'is-renaming', false); + const name = input.value.trim(); + if (commit && r && name && name !== r.name) { + setText(q(row, '.fsh-mat-row-name'), name); + void edits.once(CMD.rename, { key: keyArg(r.key), name }); + } + }; + + const paintRow = (row: HTMLElement, r: MaterialRow): void => { + const current = page.current() === r.key; + setAttr(row, 'aria-selected', current ? 'true' : 'false'); + setClass(row, 'is-in-selection', page.selectionMaterials().has(r.key)); + if (renaming !== r.key) setText(q(row, '.fsh-mat-row-name'), r.name); + setText(q(row, '.fsh-mat-row-type'), typeLabel(store, r.typeId)); + const count = q(row, '.fsh-mat-row-uses'); + setText(count, r.uses ? String(r.uses) : ''); + setTitle(count, r.uses === 1 ? t('Used by 1 part') : t('Used by {n} parts', { n: r.uses })); + swatches.paint(q(row, 'canvas'), r.key); + }; + + const action = (b: HTMLButtonElement, label: string, ok: boolean, why: string): void => { + setDisabled(b, !ok); + const text = ok || !why ? t(label) : `${t(label)}: ${why}`; + setTitle(b, text); + setAttr(b, 'aria-label', t(label)); + }; + + const update = (): void => { + patchList(list, store.rows, { + key: (r) => r.key, + create: (r) => { + const row = el(`
      + + + + +
      `); + paintRow(row, r); + return row; + }, + update: paintRow, + }); + const s = ws.client.summary; + const msg = ws.client.state !== 'ready' || !s ? '' : store.rows.length ? '' : t('No materials yet. Create one from a type with New.'); + setText(empty, msg); + setHidden(empty, msg === ''); + const key = page.current(); + const row = store.row(key); + const parts = page.selectionParts(); + action(newBtn, 'New material', ws.canRun(CMD.create) && store.types.length > 0, ws.canRun(CMD.create) ? t('Waiting for the material types') : ws.why(CMD.create)); + action(dupBtn, 'Duplicate material', !!row && !!store.doc(key) && ws.canRun(CMD.create), !row ? t('Pick a material first') : ws.why(CMD.create) || t('Waiting for the material settings')); + action(renameBtn, 'Rename material', !!row && ws.canRun(CMD.rename), !row ? t('Pick a material first') : ws.why(CMD.rename)); + const inUse = row ? row.uses : 0; + action(deleteBtn, 'Delete material', !!row && ws.canRun(CMD.remove), !row ? t('Pick a material first') : ws.why(CMD.remove)); + setAttr(deleteBtn, 'aria-disabled', inUse > 0 ? 'true' : null); + if (inUse > 0) setTitle(deleteBtn, `${t('Delete material')}: ${inUseText(inUse)}`); + const assignWhy = !row ? t('Pick a material first') : !ws.canRun(CMD.assign) ? ws.why(CMD.assign) : parts.length ? '' : t('Select parts in the viewport or the scene first'); + action(assignBtn, 'Assign to selection', !!row && parts.length > 0 && ws.canRun(CMD.assign), assignWhy); + if (picker.isOpen) paintPicker(); + }; + + newBtn.addEventListener('click', () => { + if (picker.isOpen) { picker.close(); return; } + paintPicker(); + picker.open(newBtn); + }); + assignBtn.addEventListener('click', () => { void assign(); }); + dupBtn.addEventListener('click', () => { void duplicate(); }); + renameBtn.addEventListener('click', () => { + const row = Array.from(list.children).find((n) => (n as HTMLElement).dataset.key === page.current()) as HTMLElement | undefined; + if (row) beginRename(row); + }); + deleteBtn.addEventListener('click', () => { void remove(); }); + + const rowOf = (target: EventTarget | null): HTMLElement | null => (target as HTMLElement | null)?.closest('.fsh-mat-row') ?? null; + list.addEventListener('click', (e) => { + const row = rowOf(e.target); + if (!row || (e.target as HTMLElement).closest('input')) return; + row.focus(); + page.pick(row.dataset.key ?? null); + }); + list.addEventListener('dblclick', (e) => { + const row = rowOf(e.target); + if (row && (e.target as HTMLElement).closest('.fsh-mat-row-name')) beginRename(row); + }); + list.addEventListener('keydown', (e) => { + const row = rowOf(e.target); + if (!row) return; + const input = (e.target as HTMLElement).closest('input'); + if (input) { + if (e.key === 'Enter') { endRename(row, true); row.focus(); } + else if (e.key === 'Escape') { endRename(row, false); row.focus(); } + e.stopPropagation(); + return; + } + if (e.key === 'F2') beginRename(row); + else if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { + const next = (e.key === 'ArrowDown' ? row.nextElementSibling : row.previousElementSibling) as HTMLElement | null; + if (next) { next.focus(); page.pick(next.dataset.key ?? null); } + } else return; + e.preventDefault(); + e.stopPropagation(); + }); + list.addEventListener('focusout', (e) => { + const input = (e.target as HTMLElement).closest('.fsh-mat-rename-input'); + const row = rowOf(e.target); + if (input && row && renaming === row.dataset.key) endRename(row, true); + }); + + update(); + const offs = [store.onChange(update), ws.client.onState(update), ws.client.onCatalogue(update)]; + return { update, dispose: () => { picker.close(); picker.root.remove(); for (const off of offs) off(); } }; +} diff --git a/frontend/src/ui/material/popover.ts b/frontend/src/ui/material/popover.ts new file mode 100644 index 00000000..c4ecc123 --- /dev/null +++ b/frontend/src/ui/material/popover.ts @@ -0,0 +1,42 @@ +import { el, setHidden } from '../../shell/dom'; + +export class Popover { + readonly root: HTMLElement; + private anchor: HTMLElement | null = null; + private readonly outside = (e: PointerEvent): void => { + const t = e.target as Node; + if (!this.root.contains(t) && !this.anchor?.contains(t)) this.close(); + }; + + constructor(className: string, label: string) { + this.root = el(``); + this.root.setAttribute('aria-label', label); + this.root.addEventListener('keydown', (e) => { + if (e.key === 'Escape') { e.stopPropagation(); this.close(); this.anchor?.focus(); } + }); + (document.getElementById('overlay-root') ?? document.body).appendChild(this.root); + } + + get isOpen(): boolean { return !this.root.hidden; } + + open(anchor: HTMLElement): void { + this.anchor = anchor; + setHidden(this.root, false); + const r = anchor.getBoundingClientRect(); + const w = this.root.offsetWidth; + const h = this.root.offsetHeight; + const left = Math.max(8, Math.min(window.innerWidth - w - 8, r.left)); + const below = r.bottom + 4; + const top = below + h > window.innerHeight - 8 ? Math.max(8, r.top - h - 4) : below; + this.root.style.setProperty('--fsh-mat-pop-x', `${Math.round(left)}px`); + this.root.style.setProperty('--fsh-mat-pop-y', `${Math.round(top)}px`); + document.addEventListener('pointerdown', this.outside, true); + this.root.querySelector('button:not([disabled])')?.focus(); + } + + close(): void { + if (this.root.hidden) return; + setHidden(this.root, true); + document.removeEventListener('pointerdown', this.outside, true); + } +} diff --git a/frontend/src/ui/pages/material.ts b/frontend/src/ui/pages/material.ts new file mode 100644 index 00000000..83428146 --- /dev/null +++ b/frontend/src/ui/pages/material.ts @@ -0,0 +1,102 @@ +import '../../styles/material.css'; +import { el, setHidden, setText } from '../../shell/dom'; +import type { NodeSummary } from '../../engine/types'; +import type { Workspace } from '../context'; +import { Edits } from '../material/edits'; +import { mountList, type ListHost } from '../material/list'; +import { MaterialStore } from '../material/store'; +import { Swatches } from '../material/swatch'; +import { engineNote, pageHead, section, type PageMount } from './page'; + +function partsUnder(nodes: readonly NodeSummary[], ids: ReadonlyArray): string[] { + const kids = new Map(); + for (const n of nodes) { + if (n.parent === null) continue; + const p = String(n.parent); + const list = kids.get(p) ?? []; + list.push(n); + kids.set(p, list); + } + const byId = new Map(nodes.map((n) => [String(n.id), n])); + const out: string[] = []; + const seen = new Set(); + const walk = (n: NodeSummary): void => { + const k = String(n.id); + if (seen.has(k)) return; + seen.add(k); + if (n.kind === 'part') out.push(k); + for (const c of kids.get(k) ?? []) walk(c); + }; + for (const id of ids) { const n = byId.get(String(id)); if (n) walk(n); } + return out; +} + +const AWAIT_MS = 4000; + +export const mountMaterialPage: PageMount = (host, ws) => { + const store = new MaterialStore(ws); + const edits = new Edits(ws, store); + const swatches = new Swatches(ws, store); + pageHead(host, 'Material'); + const offNote = engineNote(host, ws); + const status = el(''); + host.appendChild(status); + + let current: string | null = null; + let selectionKey = ''; + let parts: string[] = []; + let selected = new Set(); + const listeners = new Set<() => void>(); + + let awaiting: { key: string; until: number } | null = null; + const page: ListHost = { + current: () => current, + pick: (key) => { + if (key !== null && !store.row(key)) awaiting = { key, until: performance.now() + AWAIT_MS }; + if (key === current) return; + current = key; + for (const fn of listeners) fn(); + }, + selectionParts: () => parts, + selectionMaterials: () => selected, + }; + + const listHost = section(host, 'Materials'); + const list = mountList(listHost, ws, store, edits, swatches, page); + listeners.add(list.update); + + const follow = (): void => { + const s = ws.client.summary; + const nodes = s?.nodes ?? []; + const key = (s?.selection ?? []).map(String).join(','); + parts = partsUnder(nodes, s?.selection ?? []); + const byId = new Map(nodes.map((n) => [String(n.id), n])); + selected = new Set(parts.map((p) => byId.get(p)?.raw.material).filter((m): m is string | number => typeof m === 'string' || typeof m === 'number').map(String)); + if (awaiting && (store.row(awaiting.key) || performance.now() > awaiting.until)) awaiting = null; + if (current !== null && !store.row(current) && awaiting?.key !== current) page.pick(store.rows[0]?.key ?? null); + if (current === null && store.rows.length) page.pick(store.rows[0].key); + if (key !== selectionKey) { + selectionKey = key; + const active = s?.active !== null && s?.active !== undefined ? String(s.active) : null; + const first = active && parts.includes(active) ? active : parts[0]; + const m = first ? byId.get(first)?.raw.material : undefined; + if (typeof m === 'string' || typeof m === 'number') page.pick(String(m)); + } + }; + + const paintStatus = (): void => { + setText(status, store.error); + setHidden(status, store.error === ''); + }; + + const visible = (): void => store.setVisible(!host.hidden && ws.ctx.shell.isOpen('inspector')); + const watch = new MutationObserver(visible); + watch.observe(host, { attributes: true, attributeFilter: ['hidden'] }); + const offLayout = ws.ctx.shell.onLayout(visible); + visible(); + + follow(); + paintStatus(); + const offs = [store.onChange(follow), store.onChange(paintStatus), ws.client.onSummary(follow)]; + return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); for (const off of offs) off(); }; +}; From aed5b77bda975510ab601c436741e968e3592fba Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:04:59 -0500 Subject: [PATCH 242/494] feat(material-ui): add number, colour, toggle and select rows Rows wrap the workspace scrub field, a colour input with its hex, a switch and a select, each updating in place and carrying a tag (graph, texture) and an optional trailing button. Ran npx tsc --noEmit. --- frontend/src/ui/material/rows.ts | 102 +++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 frontend/src/ui/material/rows.ts diff --git a/frontend/src/ui/material/rows.ts b/frontend/src/ui/material/rows.ts new file mode 100644 index 00000000..b0c7e718 --- /dev/null +++ b/frontend/src/ui/material/rows.ts @@ -0,0 +1,102 @@ +import { el, escapeHtml, q, setAttr, setChecked, setClass, setDisabled, setHidden, setText, setTitle, setValue } from '../../shell/dom'; +import { t } from '../../i18n'; +import { NumberField } from '../number-field'; + +export interface Control { + readonly root: HTMLElement; + set(value: T): void; + setDisabled(disabled: boolean, why?: string): void; + setTag(text: string, why?: string): void; +} + +function tagged(root: HTMLElement): (text: string, why?: string) => void { + const tag = q(root, '.fsh-mat-tag'); + return (text, why = '') => { + setText(tag, text); + setTitle(tag, why); + setHidden(tag, text === ''); + setClass(root, 'is-tagged', text !== ''); + }; +} + +export interface NumberOptions { + label: string; + min?: number; + max?: number; + step: number; + unit?: string; + integer?: boolean; + onLive: (v: number) => void; + onCommit: (v: number) => void; +} + +export function numberRow(o: NumberOptions, extra?: HTMLElement): Control { + const root = el('
      '); + const field = new NumberField({ + label: o.label, min: o.min, max: o.max, step: o.step, unit: o.unit, integer: o.integer, + onInput: o.onLive, onCommit: o.onCommit, + }); + q(root, '.fsh-mat-pctl').appendChild(field.root); + if (extra) q(root, '.fsh-mat-pextra').appendChild(extra); + return { + root, + set: (v) => field.set(v), + setDisabled: (d, why = '') => { field.setDisabled(d, why); setClass(root, 'is-disabled', d); }, + setTag: tagged(root), + }; +} + +export interface ColourOptions { + label: string; + onLive: (hex: string) => void; + onCommit: (hex: string) => void; +} + +export function colourRow(o: ColourOptions, extra?: HTMLElement): Control { + const root = el(`
      `); + const input = q(root, 'input'); + const hex = q(root, '.fsh-mat-hex'); + let editing = false; + input.addEventListener('input', () => { editing = true; setText(hex, input.value.toUpperCase()); o.onLive(input.value); }); + input.addEventListener('change', () => { editing = false; setText(hex, input.value.toUpperCase()); o.onCommit(input.value); }); + input.addEventListener('blur', () => { editing = false; }); + if (extra) q(root, '.fsh-mat-pextra').appendChild(extra); + return { + root, + set: (v) => { + if (editing) return; + if (input.value !== v) input.value = v; + setText(hex, v.toUpperCase()); + }, + setDisabled: (d, why = '') => { setDisabled(input, d); setTitle(input, why); setClass(root, 'is-disabled', d); }, + setTag: tagged(root), + }; +} + +export function toggleRow(label: string, onChange: (on: boolean) => void, extra?: HTMLElement): Control { + const root = el(`
      `); + const input = q(root, 'input'); + input.addEventListener('change', () => onChange(input.checked)); + if (extra) q(root, '.fsh-mat-pextra').appendChild(extra); + return { + root, + set: (v) => setChecked(input, v), + setDisabled: (d, why = '') => { setDisabled(input, d); setTitle(input, why); setClass(root, 'is-disabled', d); }, + setTag: tagged(root), + }; +} + +export function selectRow(label: string, options: ReadonlyArray, onChange: (v: string) => void): Control { + const opts = options.map(([v, l]) => ``).join(''); + const root = el(`
      `); + const select = q(root, 'select'); + select.addEventListener('change', () => onChange(select.value)); + return { + root, + set: (v) => setValue(select, v), + setDisabled: (d, why = '') => { setDisabled(select, d); setTitle(select, why); setClass(root, 'is-disabled', d); }, + setTag: tagged(root), + }; +} + +export function setAria(node: HTMLElement, label: string): void { setAttr(node, 'aria-label', label); } From 6a601589fdc83ebcfb03455717be857aa8dba7d0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:04:59 -0500 Subject: [PATCH 243/494] feat(material-ui): edit material parameters by type The material's type decides the controls from material.types (sliders with ranges and units, colour fields, switches); a drag is one undo step, a type change asks to keep values or reset to the type, and a collapsed All parameters section shows every surface field. Ran in headless Chrome at 4x throttle: two roughness drags gave history depth 0, 1, 2 and one undo restored the first drag's 0.6, three colour picks then a change gave one step, plastic to rubber reset and rubber to metal kept, zero layout shift during the drags. --- frontend/src/ui/material/params.ts | 187 +++++++++++++++++++++++++++++ frontend/src/ui/pages/material.ts | 14 ++- 2 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 frontend/src/ui/material/params.ts diff --git a/frontend/src/ui/material/params.ts b/frontend/src/ui/material/params.ts new file mode 100644 index 00000000..fe14c9e0 --- /dev/null +++ b/frontend/src/ui/material/params.ts @@ -0,0 +1,187 @@ +import { el, escapeHtml, patchList, q, setDisabled, setHidden, setHtml, setText, setTitle, setValue } from '../../shell/dom'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import type { Edits } from './edits'; +import type { Section } from './list'; +import { + acescgToHex, FIELD_ORDER, fieldLabel, hexToAcescg, keyArg, rgbOf, specFor, stepFor, unitText, + type FieldSpec, type MaterialDoc, type MaterialType, +} from './model'; +import { Popover } from './popover'; +import { colourRow, numberRow, toggleRow, type Control } from './rows'; +import { CMD, type MaterialStore } from './store'; + +export interface ParamsHost { + current(): string | null; + slotButton(field: string): HTMLElement | null; +} + +const CATEGORY_ORDER = ['Generic', 'Plastic', 'Metal', 'Paint', 'Glass', 'Liquid', 'Gem', 'Rubber', 'Fabric', 'Ceramic', 'Wood', 'Stone', 'Emissive']; + +interface Row { field: string; root: HTMLElement; update(d: MaterialDoc | null): void } + +export function mountParams(host: HTMLElement, ws: Workspace, store: MaterialStore, edits: Edits, page: ParamsHost): Section { + const root = el(`
      +
      +
      + +
      All parameters
      +
      `); + host.appendChild(root); + const typeSelect = q(root, '.fsh-mat-type-select'); + const list = q(root, '.fsh-mat-params'); + const note = q(root, '.fsh-mat-params-note'); + const all = q(root, '.fsh-mat-all'); + const allList = q(root, '.fsh-mat-all-list'); + const allRows: Row[] = []; + let pendingType: string | null = null; + + const choice = new Popover('fsh-mat-typechoice', t('Change the material type')); + choice.root.appendChild(el(`
      +

      + + +
      `)); + choice.root.addEventListener('click', (e) => { + const b = (e.target as HTMLElement).closest('button[data-keep]'); + const key = page.current(); + if (!b || !key || !pendingType) return; + const type_id = pendingType; + pendingType = null; + choice.close(); + void edits.once(CMD.setType, { key: keyArg(key), type_id, keep: b.dataset.keep === '1' }); + }); + + const send = (field: string, value: unknown, final: boolean): void => { + const key = page.current(); + if (!key) return; + store.patchParams(key, { [field]: value }); + const args = { key: keyArg(key), values: { [field]: value } }; + const target = `params:${key}`; + if (final) void edits.commit(target, CMD.setParams, args); + else edits.live(target, CMD.setParams, args); + }; + + const makeRow = (field: string, spec: FieldSpec, withSlot: boolean): Row => { + const extra = withSlot ? page.slotButton(field) ?? undefined : undefined; + let control: Control | Control | Control; + let paint: (d: MaterialDoc) => void; + if (spec.kind === 'colour') { + const c = colourRow({ + label: fieldLabel(field), + onLive: (hex) => { const v = hexToAcescg(hex); if (v) send(field, v, false); }, + onCommit: (hex) => { const v = hexToAcescg(hex); if (v) send(field, v, true); }, + }, extra); + control = c; + paint = (d) => { const v = rgbOf(d.params[field]); if (v) c.set(acescgToHex(v)); }; + } else if (spec.kind === 'bool') { + const b = toggleRow(fieldLabel(field), (on) => { + const key = page.current(); + if (!key) return; + store.patchParams(key, { [field]: on }); + void edits.once(CMD.setParams, { key: keyArg(key), values: { [field]: on } }); + }, extra); + control = b; + paint = (d) => b.set(d.params[field] === true); + } else { + const n = numberRow({ + label: fieldLabel(field), min: spec.min, max: spec.max, step: stepFor(spec), unit: unitText(spec.unit), + onLive: (v) => send(field, v, false), + onCommit: (v) => send(field, v, true), + }, extra); + control = n; + paint = (d) => { const v = d.params[field]; if (typeof v === 'number') n.set(v); }; + } + control.root.dataset.field = field; + return { + field, + root: control.root, + update: (d) => { + if (d) paint(d); + const driven = !!d?.graph?.outputs.includes(field); + const slot = d?.slots[field]; + const can = ws.canRun(CMD.setParams); + const why = !d ? t('Reading the material') : !can ? ws.why(CMD.setParams) : driven ? t('Driven by the graph. Edit the graph to change it.') : ''; + control.setDisabled(!d || !can || driven, why); + if (driven) control.setTag(t('Graph'), t('Driven by the graph. Edit the graph to change it.')); + else if (slot) control.setTag(slot.multiply === true ? t('Texture x') : t('Texture'), slot.multiply === true ? t('The texture multiplies this value') : t('A texture drives this value; the value is its fallback')); + else control.setTag(''); + }, + }; + }; + + const shownRows = new Map(); + + const typeOptions = (): void => { + const groups = new Map(); + for (const ty of store.types) groups.set(ty.category, [...(groups.get(ty.category) ?? []), ty]); + const cats = [...groups.keys()].sort((a, b) => { + const ia = CATEGORY_ORDER.indexOf(a), ib = CATEGORY_ORDER.indexOf(b); + return (ia < 0 ? 99 : ia) - (ib < 0 ? 99 : ib) || a.localeCompare(b); + }); + const html = cats.map((c) => `${(groups.get(c) ?? []).map((ty) => ``).join('')}`).join(''); + setHtml(typeSelect, html, store.types.map((x) => x.id).join(',')); + }; + + const buildAll = (): void => { + if (allRows.length) return; + for (const field of FIELD_ORDER) { + const row = makeRow(field, specFor(field, null), false); + allRows.push(row); + allList.appendChild(row.root); + } + }; + + const update = (): void => { + typeOptions(); + const key = page.current(); + const row = store.row(key); + const d = store.doc(key); + const typeId = d?.typeId ?? row?.typeId ?? ''; + const type = store.type(typeId); + if (!typeSelect.querySelector(`option[value="${CSS.escape(typeId)}"]`) && typeId) { + typeSelect.appendChild(el(``)); + } + if (!choice.isOpen) setValue(typeSelect, typeId); + const canType = !!row && ws.canRun(CMD.setType); + setDisabled(typeSelect, !canType); + setTitle(typeSelect, !row ? '' : canType ? '' : ws.why(CMD.setType)); + setHidden(root, !row); + const specs = type?.shown ?? (d ? FIELD_ORDER.slice(0, 6).map((f) => specFor(f, null)) : []); + patchList(list, specs, { + key: (s) => `${s.field}:${s.kind}`, + create: (s) => { + const r = makeRow(s.field, s, s.slot); + shownRows.set(`${s.field}:${s.kind}`, r); + r.update(d); + return r.root; + }, + update: (_node, s) => { shownRows.get(`${s.field}:${s.kind}`)?.update(d); }, + }); + for (const k of [...shownRows.keys()]) if (!specs.some((s) => `${s.field}:${s.kind}` === k)) shownRows.delete(k); + const msg = !row ? '' : !store.types.length ? t('Waiting for the material types') : type ? '' : t('The engine does not know the type {id}; showing the main values.', { id: typeId }); + setText(note, msg); + setHidden(note, msg === ''); + if (all.open) for (const r of allRows) r.update(d); + }; + + typeSelect.addEventListener('change', () => { + const key = page.current(); + const d = store.doc(key); + if (!key) return; + pendingType = typeSelect.value; + const from = store.type(d?.typeId ?? store.row(key)?.typeId ?? ''); + const to = store.type(pendingType); + setText(q(choice.root, '.fsh-mat-choice-text'), t('Change {from} to {to}. Keep the current values, or reset them to the new type?', { from: t(from?.name ?? ''), to: t(to?.name ?? pendingType) })); + choice.open(typeSelect); + }); + all.addEventListener('toggle', () => { if (all.open) { buildAll(); update(); } }); + const closeChoice = new MutationObserver(() => { + if (choice.root.hidden && pendingType !== null) { pendingType = null; update(); } + }); + closeChoice.observe(choice.root, { attributes: true, attributeFilter: ['hidden'] }); + + update(); + const offs = [store.onChange(update), ws.client.onState(update), ws.client.onCatalogue(update)]; + return { update, dispose: () => { closeChoice.disconnect(); choice.root.remove(); for (const off of offs) off(); } }; +} diff --git a/frontend/src/ui/pages/material.ts b/frontend/src/ui/pages/material.ts index 83428146..f23b1f97 100644 --- a/frontend/src/ui/pages/material.ts +++ b/frontend/src/ui/pages/material.ts @@ -4,6 +4,7 @@ import type { NodeSummary } from '../../engine/types'; import type { Workspace } from '../context'; import { Edits } from '../material/edits'; import { mountList, type ListHost } from '../material/list'; +import { mountParams } from '../material/params'; import { MaterialStore } from '../material/store'; import { Swatches } from '../material/swatch'; import { engineNote, pageHead, section, type PageMount } from './page'; @@ -65,6 +66,14 @@ export const mountMaterialPage: PageMount = (host, ws) => { const list = mountList(listHost, ws, store, edits, swatches, page); listeners.add(list.update); + const paramsHost = section(host, 'Parameters'); + const none = el('

      Pick or create a material to edit it.

      '); + paramsHost.appendChild(none); + const params = mountParams(paramsHost, ws, store, edits, { current: () => current, slotButton: () => null }); + listeners.add(params.update); + const paintNone = (): void => setHidden(none, current !== null && store.row(current) !== null); + listeners.add(paintNone); + const follow = (): void => { const s = ws.client.summary; const nodes = s?.nodes ?? []; @@ -97,6 +106,7 @@ export const mountMaterialPage: PageMount = (host, ws) => { follow(); paintStatus(); - const offs = [store.onChange(follow), store.onChange(paintStatus), ws.client.onSummary(follow)]; - return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); for (const off of offs) off(); }; + paintNone(); + const offs = [store.onChange(follow), store.onChange(paintStatus), store.onChange(paintNone), ws.client.onSummary(follow)]; + return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); for (const off of offs) off(); }; }; From aaa2351e7dbd5880e03863e15f04beb832376d32 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:10:53 -0500 Subject: [PATCH 244/494] refactor(backend): share the import route's multipart parser The texture route now uses clean_name and the streaming receive of routers/imports.py instead of its own copy, and accepts the image under any file part name (file, as the graph and labels editors send it, or image). Reran the curl checks: 403 without the key, 200 and identical bytes with it, 400 for .py, empty, climbing and two-file uploads, 413 at 600 MB, _CON.png, DELETE 403, 200 then 404. --- backend/app/routers/textures.py | 87 ++------------------------------- 1 file changed, 3 insertions(+), 84 deletions(-) diff --git a/backend/app/routers/textures.py b/backend/app/routers/textures.py index 8ee1b4b0..7c79679d 100644 --- a/backend/app/routers/textures.py +++ b/backend/app/routers/textures.py @@ -3,53 +3,29 @@ import re import secrets import shutil -import unicodedata from pathlib import Path from fastapi import APIRouter, HTTPException, Request from app import project_library as library from app import window_key +from app.routers.imports import FIELD_LIMIT, clean_name, receive router = APIRouter() FOLDER = ".textures" ID = re.compile(r"^[a-f0-9]{16}\Z") -BAD = re.compile(r'[\x00-\x1f\x7f<>:"|?*]') -WINDOWS_NAMES = {"con", "prn", "aux", "nul", *(f"com{i}" for i in range(1, 10)), *(f"lpt{i}" for i in range(1, 10))} IMAGE_SUFFIXES = {".png", ".jpg", ".jpeg", ".hdr", ".exr"} IMAGE_WORDS = "PNG, JPEG, Radiance HDR and OpenEXR images" -NAME_LIMIT = 120 FILE_LIMIT = 512 << 20 -HEADER_LIMIT = 16 * 1024 -FIELD_LIMIT = 4096 TOO_BIG = "The image is too large: one texture may be at most 512 MB" -NOT_MULTIPART = "Send the image as multipart/form-data with one file part named image" +NOT_MULTIPART = "Send the image as multipart/form-data with one file part (named file or image)" def root() -> Path: return library.PROJECTS / FOLDER -def clean_name(raw: str) -> str: - parts = [p for p in re.split(r"[\\/]+", raw or "") if p not in ("", ".")] - if not parts: - raise HTTPException(400, "The image has no file name") - if ".." in parts: - raise HTTPException(400, f"The file name {raw!r} climbs out of its folder") - text = unicodedata.normalize("NFC", parts[-1]) - text = BAD.sub("_", text).strip().lstrip(".").rstrip(". ") - if not text: - raise HTTPException(400, "The file name is empty after removing characters that cannot be in a file name") - if len(text) > NAME_LIMIT: - stem, dot, ext = text.rpartition(".") - keep = f".{ext}" if dot and len(ext) <= 10 else "" - text = text[: NAME_LIMIT - len(keep)].rstrip(". ") + keep - if text.split(".")[0].lower() in WINDOWS_NAMES: - text = f"_{text}" - return text - - def folder_for(entry: str) -> Path: if not isinstance(entry, str) or not ID.match(entry): raise HTTPException(404, "No such texture") @@ -59,15 +35,6 @@ def folder_for(entry: str) -> Path: return path -def disposition(headers: bytes) -> tuple[str, str | None]: - text = headers.decode("utf-8", "replace") - line = next((l for l in text.split("\r\n") if l.lower().startswith("content-disposition:")), "") - name = re.search(r'\bname="((?:[^"\\]|\\.)*)"', line) - filename = re.search(r'\bfilename="((?:[^"\\]|\\.)*)"', line) - unquote = lambda s: s.replace('\\"', '"').replace("%22", '"') - return (unquote(name.group(1)) if name else ""), (unquote(filename.group(1)) if filename else None) - - class Upload: def __init__(self, folder: Path) -> None: self.folder = folder @@ -84,7 +51,7 @@ def begin(self, field: str, filename: str | None) -> None: return if self.name is not None: raise HTTPException(400, "Send one image per texture upload") - name = clean_name(filename) + name = clean_name(filename, nested=False) kind = Path(name).suffix.lower() if kind not in IMAGE_SUFFIXES: raise HTTPException(400, f"FormShot does not read {kind or 'files without an extension'} as a texture; it reads {IMAGE_WORDS}") @@ -118,54 +85,6 @@ def close(self) -> None: self.handle = None -async def receive(request: Request, upload: Upload, boundary: bytes) -> None: - delimiter = b"\r\n--" + boundary - buffer = b"\r\n" - state = "preamble" - async for chunk in request.stream(): - buffer += chunk - while True: - if state == "preamble": - at = buffer.find(delimiter) - if at < 0: - buffer = buffer[-len(delimiter):] - break - buffer = buffer[at + len(delimiter):] - state = "boundary" - if state == "boundary": - if len(buffer) < 2: - break - if buffer.startswith(b"--"): - return - if not buffer.startswith(b"\r\n"): - raise HTTPException(400, NOT_MULTIPART) - buffer = buffer[2:] - state = "headers" - if state == "headers": - at = buffer.find(b"\r\n\r\n") - if at < 0: - if len(buffer) > HEADER_LIMIT: - raise HTTPException(400, NOT_MULTIPART) - break - field, filename = disposition(buffer[:at]) - buffer = buffer[at + 4:] - upload.begin(field, filename) - state = "body" - if state == "body": - at = buffer.find(delimiter) - if at < 0: - keep = len(delimiter) - 1 - if len(buffer) > keep: - upload.write(buffer[:-keep]) - buffer = buffer[-keep:] - break - upload.write(buffer[:at]) - upload.end() - buffer = buffer[at + len(delimiter):] - state = "boundary" - raise HTTPException(400, "The upload ended before its last part") - - @router.post("/api/textures") async def create_texture(request: Request): window_key.require(request) From 221a3c9b2c038cb2fce4f8bcc545ca05bf0268d4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:13:02 -0500 Subject: [PATCH 245/494] perf(material-ui): hash the material signature for swatch keys The swatch cache key and the canvas data attribute held the whole material JSON; a short FNV-1a hash with the length is enough. Checked the drawn key in headless Chrome. --- frontend/src/ui/material/model.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/material/model.ts b/frontend/src/ui/material/model.ts index 2265e94d..7681326b 100644 --- a/frontend/src/ui/material/model.ts +++ b/frontend/src/ui/material/model.ts @@ -196,7 +196,10 @@ export function parseTextures(raw: unknown): Map { } export function signature(m: MaterialDoc): string { - return JSON.stringify([m.typeId, m.params, m.slots, m.graph?.raw ?? null]); + const text = JSON.stringify([m.typeId, m.params, m.slots, m.graph?.raw ?? null]); + let h = 0x811c9dc5; + for (let i = 0; i < text.length; i++) h = Math.imul(h ^ text.charCodeAt(i), 0x01000193); + return `${(h >>> 0).toString(36)}.${text.length.toString(36)}`; } export function deepMerge(base: Record, patch: Record): Record { From c72ac043f0694755f529b27e30382b58cab1da81 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:13:02 -0500 Subject: [PATCH 246/494] feat(material-ui): choose texture images on desktop and in the browser Desktop uses the Tauri open panel and keeps the real path; the browser uploads the file to POST /api/textures and deletes the upload again when the slot command fails. Ran a browser upload through the page in headless Chrome. --- frontend/src/ui/material/image.ts | 78 +++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 frontend/src/ui/material/image.ts diff --git a/frontend/src/ui/material/image.ts b/frontend/src/ui/material/image.ts new file mode 100644 index 00000000..df5d19a0 --- /dev/null +++ b/frontend/src/ui/material/image.ts @@ -0,0 +1,78 @@ +import { api, ApiError } from '../../shell/api'; +import { inTauri } from '../../shell/dom'; +import { t } from '../../i18n'; + +export const IMAGE_EXTS = ['png', 'jpg', 'jpeg', 'hdr', 'exr'] as const; + +export interface ChosenImage { path: string; upload: string | null; name: string } + +async function desktopPick(): Promise { + try { + const { invoke } = await import('@tauri-apps/api/core'); + const picked = await invoke('plugin:dialog|open', { + options: { multiple: false, directory: false, title: t('Choose a texture image'), filters: [{ name: t('Images'), extensions: [...IMAGE_EXTS] }] }, + }); + if (picked === null) return null; + return Array.isArray(picked) ? picked[0] ?? null : picked; + } catch { + return undefined; + } +} + +function browserPick(): Promise { + return new Promise((resolve) => { + const input = document.createElement('input'); + input.type = 'file'; + input.accept = IMAGE_EXTS.map((e) => `.${e}`).join(','); + input.hidden = true; + let done = false; + const finish = (f: File | null): void => { if (done) return; done = true; input.remove(); resolve(f); }; + input.addEventListener('change', () => finish(input.files?.[0] ?? null)); + input.addEventListener('cancel', () => finish(null)); + document.body.appendChild(input); + input.click(); + }); +} + +export async function uploadImage(file: File): Promise { + const form = new FormData(); + form.append('file', file, file.name); + let res: Response; + try { + res = await fetch(api.url('/api/textures'), { method: 'POST', body: form }); + } catch { + throw new ApiError(t('The FormShot service is not reachable'), 0, 'unreachable'); + } + const body = await res.json().catch(() => ({})) as { path?: unknown; id?: unknown; name?: unknown; detail?: unknown }; + if (!res.ok || typeof body.path !== 'string') { + throw new ApiError(typeof body.detail === 'string' ? body.detail : t('The image could not be uploaded ({status})', { status: res.status }), res.status, ''); + } + return { path: body.path, upload: typeof body.id === 'string' ? body.id : null, name: typeof body.name === 'string' ? body.name : file.name }; +} + +export async function discardUpload(id: string | null): Promise { + if (!id) return; + try { await api.del(`/api/textures/${encodeURIComponent(id)}`); } catch { return; } +} + +export async function chooseImage(onUpload: (busy: boolean) => void): Promise { + if (inTauri()) { + const path = await desktopPick(); + if (path === null) return null; + if (typeof path === 'string') return { path, upload: null, name: baseName(path) }; + } + const file = await browserPick(); + if (!file) return null; + onUpload(true); + try { + return await uploadImage(file); + } finally { + onUpload(false); + } +} + +export function baseName(path: string): string { + const clean = path.startsWith('fshot:') ? path.slice(6) : path; + const name = clean.split(/[\\/]/).pop() ?? clean; + return name.replace(/^[0-9a-f]{16}-\d+\./, 'embedded.'); +} From 1cb4e7f7165033c1ae9acaacf5e5b9b786845c61 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:13:02 -0500 Subject: [PATCH 247/494] feat(material-ui): edit texture slots of a material Every slottable value gets a texture button, and a Textures section holds one editor per slot (projection, uv set, box blend, space, offset, scale, rotation, wrap, filter, colour space, channel, range, invert, multiply, strength, flip green, fallback) plus Add a map for normal, bump and displacement; drags merge into one step. Ran in headless Chrome at 4x throttle: uploaded grad.png into base colour, switched to box, one scale drag and one rotation drag gave one history step each, set mirror, linear and multiply, added a normal map, cleared the base colour slot; the snapshot JSON matched each step. --- frontend/src/ui/material/slots.ts | 284 ++++++++++++++++++++++++++++++ frontend/src/ui/pages/material.ts | 8 +- 2 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 frontend/src/ui/material/slots.ts diff --git a/frontend/src/ui/material/slots.ts b/frontend/src/ui/material/slots.ts new file mode 100644 index 00000000..d3c5a59b --- /dev/null +++ b/frontend/src/ui/material/slots.ts @@ -0,0 +1,284 @@ +import { el, escapeHtml, patchList, pendingClass, q, setAttr, setClass, setDisabled, setHidden, setHtml, setText, setTitle } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { toastError } from '../../shell/toast'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import type { Edits } from './edits'; +import { glyph } from './glyphs'; +import { baseName, chooseImage, discardUpload } from './image'; +import type { Section } from './list'; +import { COLOUR_INPUTS, fieldLabel, isObj, keyArg, SLOTTABLE, type MaterialDoc } from './model'; +import { colourRow, numberRow, selectRow, toggleRow, type Control } from './rows'; +import { CMD, type MaterialStore } from './store'; + +export interface SlotsHost { current(): string | null } + +type Slot = Record; + +const PROJECTIONS = [['uv', 'UV set'], ['box', 'Box'], ['planar', 'Planar'], ['cylindrical', 'Cylindrical'], ['spherical', 'Spherical']] as const; +const SPACES = [['object', 'Object space'], ['world', 'World space']] as const; +const WRAPS = [['repeat', 'Repeat'], ['clamp', 'Clamp'], ['mirror', 'Mirror']] as const; +const FILTERS = [['trilinear', 'Trilinear'], ['bilinear', 'Bilinear'], ['nearest', 'Nearest']] as const; +const SPACES_COLOUR = [['auto', 'Automatic'], ['srgb', 'sRGB'], ['linear', 'Linear sRGB'], ['acescg', 'ACEScg'], ['data', 'Data (raw)']] as const; +const CHANNELS = [['rgb', 'RGB'], ['r', 'Red'], ['g', 'Green'], ['b', 'Blue'], ['a', 'Alpha'], ['luminance', 'Luminance']] as const; +const FALLBACKS = [['auto', 'Automatic'], ['custom', 'Custom colour']] as const; + +const n = (v: unknown, d: number): number => typeof v === 'number' && Number.isFinite(v) ? v : d; +const pair = (v: unknown, d: [number, number]): [number, number] => Array.isArray(v) && v.length >= 2 ? [n(v[0], d[0]), n(v[1], d[1])] : d; +const RAD = Math.PI / 180; + +function hexOf(c: unknown): string { + const a = Array.isArray(c) ? c : [0, 0, 0]; + return '#' + [0, 1, 2].map((i) => Math.round(Math.min(1, Math.max(0, n(a[i], 0))) * 255).toString(16).padStart(2, '0')).join(''); +} + +function rgbaOf(hex: string, alpha: number): [number, number, number, number] { + const m = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex) ?? ['', '00', '00', '00']; + return [parseInt(m[1], 16) / 255, parseInt(m[2], 16) / 255, parseInt(m[3], 16) / 255, alpha]; +} + +interface Editor { input: string; root: HTMLElement; update(d: MaterialDoc): void; setOpen(open: boolean): void } + +export interface SlotsSection extends Section { + button(field: string): HTMLElement; + open(input: string): void; +} + +export function mountSlots(host: HTMLElement, ws: Workspace, store: MaterialStore, edits: Edits, page: SlotsHost): SlotsSection { + const root = el(`
      +
      +

      No textures. Use the texture button beside a value, or add a map here.

      +
      +
      `); + host.appendChild(root); + const list = q(root, '.fsh-mat-slot-list'); + const empty = q(root, '.fsh-mat-slots-empty'); + const add = q(root, '.fsh-mat-addmap select'); + const buttons = new Map>(); + const editors = new Map(); + const opened = new Set(); + + const send = (input: string, slot: Slot, final: boolean): void => { + const key = page.current(); + if (!key) return; + store.patchSlot(key, input, slot); + const args = { key: keyArg(key), input, slot }; + const target = `slot:${key}:${input}`; + if (final) void edits.commit(target, CMD.setSlot, args); + else edits.live(target, CMD.setSlot, args); + }; + + const pick = async (input: string, busyNode: HTMLElement): Promise => { + const key = page.current(); + if (!key || !ws.canRun(CMD.setSlot)) return; + let stop: (() => void) | null = null; + let image; + try { + image = await chooseImage((busy) => { + if (busy) stop = pendingClass(busyNode); + else { stop?.(); stop = null; } + }); + } catch (err) { + toastError(err); + return; + } + if (!image) return; + const reply = await edits.once(CMD.setSlot, { key: keyArg(key), input, slot: {}, path: image.path }); + if (reply === undefined) { void discardUpload(image.upload); return; } + opened.add(input); + update(); + }; + + const clear = (input: string): void => { + const key = page.current(); + if (!key) return; + store.patchSlot(key, input, null); + opened.delete(input); + void edits.once(CMD.clearSlot, { key: keyArg(key), input }); + }; + + const makeEditor = (input: string): Editor => { + const colour = COLOUR_INPUTS.has(input); + const geometry = input === 'normal' || input === 'bump' || input === 'displacement'; + const node = el(`
      +
      + + + +
      + +
      `); + setText(q(node, '.fsh-mat-slot-input'), t(fieldLabel(input))); + const replace = q(node, '.fsh-mat-slot-replace'); + const clearBtn = q(node, '.fsh-mat-slot-clear'); + setTitle(replace, t('Replace the image')); + setAttr(replace, 'aria-label', t('Replace the image')); + setTitle(clearBtn, t('Clear the texture slot')); + setAttr(clearBtn, 'aria-label', t('Clear the texture slot')); + replace.addEventListener('click', () => { void pick(input, replace); }); + clearBtn.addEventListener('click', () => clear(input)); + const toggle = q(node, '.fsh-mat-slot-toggle'); + const body = q(node, '.fsh-mat-slot-body'); + toggle.addEventListener('click', () => { + if (opened.has(input)) opened.delete(input); else opened.add(input); + setOpen(opened.has(input)); + }); + + let cur: Slot = {}; + const get = (): Slot => cur; + const proj = (): Slot => isObj(get().projection) ? get().projection as Slot : { kind: 'uv', set: 0 }; + const xf = (): Slot => isObj(get().transform) ? get().transform as Slot : {}; + + const controls: Array<{ c: Control | Control | Control | Control; paint: () => void; show?: () => boolean }> = []; + const addRow = (c: Control, paint: (c: Control) => void, show?: () => boolean): void => { + body.appendChild(c.root); + controls.push({ c: c as unknown as Control, paint: () => paint(c), show }); + }; + + addRow(selectRow('Projection', PROJECTIONS, (v) => { + const p = v === 'uv' ? { kind: 'uv', set: n(proj().set, 0) } : v === 'box' ? { kind: 'box', blend: n(proj().blend, 0.5) } : { kind: v }; + send(input, { projection: p }, true); + }), (c) => c.set(String(proj().kind ?? 'uv'))); + addRow(numberRow({ label: 'UV set', min: 0, max: 3, step: 1, integer: true, onLive: (v) => send(input, { projection: { kind: 'uv', set: v } }, false), onCommit: (v) => send(input, { projection: { kind: 'uv', set: v } }, true) }), + (c) => c.set(n(proj().set, 0)), () => proj().kind === 'uv'); + addRow(numberRow({ label: 'Blend', min: 0, max: 1, step: 0.01, onLive: (v) => send(input, { projection: { kind: 'box', blend: v } }, false), onCommit: (v) => send(input, { projection: { kind: 'box', blend: v } }, true) }), + (c) => c.set(n(proj().blend, 0.5)), () => proj().kind === 'box'); + addRow(selectRow('Space', SPACES, (v) => send(input, { transform: { space: v } }, true)), + (c) => c.set(String(xf().space ?? 'object')), () => proj().kind !== 'uv'); + const vec = (field: 'offset' | 'scale', i: 0 | 1, label: string, d: [number, number]): void => { + const value = (v: number): Slot => { const p = pair(xf()[field], d); p[i] = v; return { transform: { [field]: p } }; }; + addRow(numberRow({ label, step: 0.01, onLive: (v) => send(input, value(v), false), onCommit: (v) => send(input, value(v), true) }), + (c) => c.set(pair(xf()[field], d)[i])); + }; + vec('offset', 0, 'Offset U', [0, 0]); + vec('offset', 1, 'Offset V', [0, 0]); + vec('scale', 0, 'Scale U', [1, 1]); + vec('scale', 1, 'Scale V', [1, 1]); + addRow(numberRow({ label: 'Rotation', min: -180, max: 180, step: 1, unit: '°', onLive: (v) => send(input, { transform: { rotation: v * RAD } }, false), onCommit: (v) => send(input, { transform: { rotation: v * RAD } }, true) }), + (c) => c.set(Math.round(n(xf().rotation, 0) / RAD * 100) / 100)); + addRow(selectRow('Wrap', WRAPS, (v) => send(input, { wrap: v }, true)), (c) => c.set(String(get().wrap ?? 'repeat'))); + addRow(selectRow('Filter', FILTERS, (v) => send(input, { filter: v }, true)), (c) => c.set(String(get().filter ?? 'trilinear'))); + addRow(selectRow('Colour space', SPACES_COLOUR, (v) => send(input, { colour_space: v === 'auto' ? null : v }, true)), + (c) => c.set(typeof get().colour_space === 'string' ? String(get().colour_space) : 'auto')); + addRow(selectRow('Channel', CHANNELS, (v) => send(input, { channel: v }, true)), (c) => c.set(String(get().channel ?? 'rgb'))); + if (!colour && !geometry) { + const range = (i: 0 | 1, label: string): void => { + const value = (v: number): Slot => { const r = pair(get().range, [0, 1]); r[i] = v; return { range: r }; }; + addRow(numberRow({ label, step: 0.01, onLive: (v) => send(input, value(v), false), onCommit: (v) => send(input, value(v), true) }), + (c) => c.set(pair(get().range, [0, 1])[i])); + }; + range(0, 'Range from'); + range(1, 'Range to'); + addRow(toggleRow('Invert', (on) => send(input, { invert: on }, true)), (c) => c.set(get().invert === true)); + } + if (!geometry) addRow(toggleRow('Multiply by the value', (on) => send(input, { multiply: on }, true)), (c) => c.set(get().multiply === true)); + if (geometry) { + const unit = input === 'normal' ? '' : 'm'; + const step = input === 'normal' ? 0.01 : 0.0001; + addRow(numberRow({ label: 'Strength', min: 0, max: input === 'normal' ? 4 : input === 'bump' ? 0.01 : 0.1, step, unit, onLive: (v) => send(input, { strength: v }, false), onCommit: (v) => send(input, { strength: v }, true) }), + (c) => c.set(n(get().strength, input === 'normal' ? 1 : input === 'bump' ? 0.001 : 0.01))); + } + if (input === 'normal') addRow(toggleRow('Flip green (DirectX)', (on) => send(input, { flip_y: on }, true)), (c) => c.set(get().flip_y === true)); + addRow(selectRow('Fallback', FALLBACKS, (v) => send(input, { fallback: v === 'auto' ? null : rgbaOf(hexOf(get().fallback), 1) }, true)), + (c) => c.set(Array.isArray(get().fallback) ? 'custom' : 'auto')); + addRow(colourRow({ label: 'Fallback colour', onLive: (hex) => send(input, { fallback: rgbaOf(hex, 1) }, false), onCommit: (hex) => send(input, { fallback: rgbaOf(hex, 1) }, true) }), + (c) => c.set(hexOf(get().fallback)), () => Array.isArray(get().fallback)); + + const setOpen = (open: boolean): void => { + setHidden(body, !open); + setAttr(toggle, 'aria-expanded', open ? 'true' : 'false'); + setClass(node, 'is-open', open); + }; + + return { + input, + root: node, + setOpen, + update: (d) => { + cur = d.slots[input] ?? {}; + const tex = store.textures.get(String(cur.texture ?? '')); + const file = tex ? baseName(tex.path) : t('Texture {key}', { key: String(cur.texture ?? '') }); + setText(q(node, '.fsh-mat-slot-file'), file); + setTitle(toggle, tex?.path ?? ''); + const can = ws.canRun(CMD.setSlot); + const driven = !!d.graph?.outputs.includes(input); + setDisabled(replace, !can); + setDisabled(clearBtn, !ws.canRun(CMD.clearSlot)); + setClass(node, 'is-driven', driven); + for (const x of controls) { + x.paint(); + x.c.setDisabled(!can, can ? '' : ws.why(CMD.setSlot)); + if (x.show) setHidden(x.c.root, !x.show()); + } + setOpen(opened.has(input)); + }, + }; + }; + + const update = (): void => { + const key = page.current(); + const d = store.doc(key); + const inputs = d ? Object.keys(d.slots) : []; + setHidden(root, !store.row(key)); + patchList(list, inputs, { + key: (i) => i, + create: (i) => { + const ed = makeEditor(i); + editors.set(i, ed); + if (d) ed.update(d); + return ed.root; + }, + update: (_node, i) => { if (d) editors.get(i)?.update(d); }, + }); + for (const k of [...editors.keys()]) if (!inputs.includes(k)) editors.delete(k); + setHidden(empty, inputs.length > 0 || !d); + const free = (SLOTTABLE as readonly string[]).filter((i) => !inputs.includes(i)); + const opts = `` + free.map((i) => ``).join(''); + setHtml(add, opts, free.join(',')); + const can = !!d && ws.canRun(CMD.setSlot); + setDisabled(add, !can || !free.length); + setTitle(add, !d ? t('Reading the material') : ws.canRun(CMD.setSlot) ? '' : ws.why(CMD.setSlot)); + for (const [field, set] of buttons) { + for (const b of [...set]) { + if (!b.isConnected) { set.delete(b); continue; } + const has = !!d?.slots[field]; + const label = has ? t('Edit the texture of {input}', { input: t(fieldLabel(field)) }) : t('Drive {input} with a texture', { input: t(fieldLabel(field)) }); + setAttr(b, 'aria-pressed', has ? 'true' : 'false'); + setTitle(b, can ? label : !d ? t('Reading the material') : ws.why(CMD.setSlot)); + setAttr(b, 'aria-label', label); + setDisabled(b, !can); + } + } + }; + + add.addEventListener('change', () => { + const input = add.value; + add.value = ''; + if (input) void pick(input, add.closest('.fsh-mat-addmap') as HTMLElement); + }); + + const open = (input: string): void => { + opened.add(input); + const ed = editors.get(input); + if (!ed) return; + ed.setOpen(true); + ed.root.scrollIntoView({ block: 'nearest' }); + }; + + const button = (field: string): HTMLElement => { + const b = el(``); + b.addEventListener('click', () => { + const d = store.doc(page.current()); + if (d?.slots[field]) open(field); + else void pick(field, b); + }); + let set = buttons.get(field); + if (!set) { set = new Set(); buttons.set(field, set); } + set.add(b); + return b; + }; + + update(); + const offs = [store.onChange(update), ws.client.onState(update), ws.client.onCatalogue(update)]; + return { update, button, open, dispose: () => { for (const off of offs) off(); } }; +} diff --git a/frontend/src/ui/pages/material.ts b/frontend/src/ui/pages/material.ts index f23b1f97..db89ce03 100644 --- a/frontend/src/ui/pages/material.ts +++ b/frontend/src/ui/pages/material.ts @@ -5,6 +5,7 @@ import type { Workspace } from '../context'; import { Edits } from '../material/edits'; import { mountList, type ListHost } from '../material/list'; import { mountParams } from '../material/params'; +import { mountSlots } from '../material/slots'; import { MaterialStore } from '../material/store'; import { Swatches } from '../material/swatch'; import { engineNote, pageHead, section, type PageMount } from './page'; @@ -69,8 +70,11 @@ export const mountMaterialPage: PageMount = (host, ws) => { const paramsHost = section(host, 'Parameters'); const none = el('

      Pick or create a material to edit it.

      '); paramsHost.appendChild(none); - const params = mountParams(paramsHost, ws, store, edits, { current: () => current, slotButton: () => null }); + const texHost = section(host, 'Textures'); + const slots = mountSlots(texHost, ws, store, edits, { current: () => current }); + const params = mountParams(paramsHost, ws, store, edits, { current: () => current, slotButton: (f) => slots.button(f) }); listeners.add(params.update); + listeners.add(slots.update); const paintNone = (): void => setHidden(none, current !== null && store.row(current) !== null); listeners.add(paintNone); @@ -108,5 +112,5 @@ export const mountMaterialPage: PageMount = (host, ws) => { paintStatus(); paintNone(); const offs = [store.onChange(follow), store.onChange(paintStatus), store.onChange(paintNone), ws.client.onSummary(follow)]; - return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); for (const off of offs) off(); }; + return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); slots.dispose(); for (const off of offs) off(); }; }; From 62bc6befc4791f5b6ace9b5fe50d2213ffc44c63 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:14:27 -0500 Subject: [PATCH 248/494] feat(material-ui): show the material graph and open its editor A Graph section says whether the material has a graph, how many nodes and which inputs it drives, and Edit graph calls openGraphEditor(ws, key); driven values are read-only with a Graph tag. Ran in headless Chrome: wood showed 1 node driving base colour, metallic paint 3 nodes driving metalness and roughness with both rows read-only, plastic no graph. --- frontend/src/ui/material/graph.ts | 45 +++++++++++++++++++++++++++++++ frontend/src/ui/pages/material.ts | 6 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 frontend/src/ui/material/graph.ts diff --git a/frontend/src/ui/material/graph.ts b/frontend/src/ui/material/graph.ts new file mode 100644 index 00000000..0d1c19a5 --- /dev/null +++ b/frontend/src/ui/material/graph.ts @@ -0,0 +1,45 @@ +import { el, q, setDisabled, setText, setTitle } from '../../shell/dom'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import { openGraphEditor } from '../graph'; +import { glyph } from './glyphs'; +import type { Section } from './list'; +import { fieldLabel } from './model'; +import type { MaterialStore } from './store'; + +export interface GraphHost { current(): string | null } + +export function mountGraph(host: HTMLElement, ws: Workspace, store: MaterialStore, page: GraphHost): Section { + const root = el(`
      +
      + +
      `); + host.appendChild(root); + const state = q(root, '.fsh-mat-graph-state'); + const drives = q(root, '.fsh-mat-graph-drives'); + const edit = q(root, '.fsh-mat-graph-edit'); + + const update = (): void => { + const key = page.current(); + const row = store.row(key); + const d = store.doc(key); + const type = store.type(d?.typeId ?? row?.typeId ?? ''); + const g = d?.graph ?? null; + setText(state, !row ? '' : !d ? t('Reading the material') : g + ? (g.nodes === 1 ? t('A graph of 1 node') : t('A graph of {n} nodes', { n: g.nodes })) + : type?.needsGraph ? t('No graph. This type looks right only with its graph; reset to type to get it back.') : t('No graph')); + const names = (g?.outputs ?? []).map((o) => t(fieldLabel(o))); + setText(drives, names.length ? t('Drives {inputs}', { inputs: names.join(', ') }) : g ? t('Drives no input yet') : ''); + setDisabled(edit, !row); + setTitle(edit, row ? t('Open the node editor for this material') : ''); + }; + + edit.addEventListener('click', () => { + const key = page.current(); + if (key) openGraphEditor(ws, key); + }); + + update(); + const offs = [store.onChange(update), ws.client.onState(update)]; + return { update, dispose: () => { for (const off of offs) off(); } }; +} diff --git a/frontend/src/ui/pages/material.ts b/frontend/src/ui/pages/material.ts index db89ce03..81634fe3 100644 --- a/frontend/src/ui/pages/material.ts +++ b/frontend/src/ui/pages/material.ts @@ -3,6 +3,7 @@ import { el, setHidden, setText } from '../../shell/dom'; import type { NodeSummary } from '../../engine/types'; import type { Workspace } from '../context'; import { Edits } from '../material/edits'; +import { mountGraph } from '../material/graph'; import { mountList, type ListHost } from '../material/list'; import { mountParams } from '../material/params'; import { mountSlots } from '../material/slots'; @@ -75,6 +76,9 @@ export const mountMaterialPage: PageMount = (host, ws) => { const params = mountParams(paramsHost, ws, store, edits, { current: () => current, slotButton: (f) => slots.button(f) }); listeners.add(params.update); listeners.add(slots.update); + + const graph = mountGraph(section(host, 'Graph'), ws, store, { current: () => current }); + listeners.add(graph.update); const paintNone = (): void => setHidden(none, current !== null && store.row(current) !== null); listeners.add(paintNone); @@ -112,5 +116,5 @@ export const mountMaterialPage: PageMount = (host, ws) => { paintStatus(); paintNone(); const offs = [store.onChange(follow), store.onChange(paintStatus), store.onChange(paintNone), ws.client.onSummary(follow)]; - return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); slots.dispose(); for (const off of offs) off(); }; + return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); slots.dispose(); graph.dispose(); for (const off of offs) off(); }; }; From 731f6c0cafbe994d9bfe0c0eb115173cd36763ca Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:15:39 -0500 Subject: [PATCH 249/494] feat(material-ui): add the save to library action Save to library opens a name and category dialog and runs library.save {material, name, category}; until the engine lists library.save the button stays in place, disabled, with the reason written beside it. Ran npx tsc --noEmit. --- frontend/src/ui/material/library.ts | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 frontend/src/ui/material/library.ts diff --git a/frontend/src/ui/material/library.ts b/frontend/src/ui/material/library.ts new file mode 100644 index 00000000..69e19aae --- /dev/null +++ b/frontend/src/ui/material/library.ts @@ -0,0 +1,71 @@ +import { Dialog } from '../../shell/dialog'; +import { el, escapeHtml, q, setDisabled, setText, setTitle } from '../../shell/dom'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import { glyph } from './glyphs'; +import type { Section } from './list'; +import { keyArg } from './model'; +import { CMD, type MaterialStore } from './store'; + +export interface LibraryHost { current(): string | null } + +const CATEGORIES = ['Metal', 'Plastic', 'Glass', 'Paint', 'Rubber', 'Fabric', 'Wood', 'Stone', 'Ceramic', 'Liquid', 'Gem', 'Emissive', 'Generic']; + +export function mountLibraryHook(host: HTMLElement, ws: Workspace, store: MaterialStore, page: LibraryHost): Section { + const root = el(`
      + + +
      `); + host.appendChild(root); + const save = q(root, '.fsh-mat-lib-save'); + const why = q(root, '.fsh-mat-lib-why'); + + const reason = (): string => { + const row = store.row(page.current()); + if (!row) return t('Pick a material first'); + if (ws.client.state !== 'ready') return ws.why(CMD.librarySave); + if (!ws.client.has(CMD.librarySave)) return t('Saving to the library needs an engine with library.save.'); + return ''; + }; + + const update = (): void => { + const r = reason(); + setDisabled(save, r !== ''); + setTitle(save, r || t('Keep this material as a preset in your library')); + setText(why, store.row(page.current()) ? r : ''); + }; + + const open = (): void => { + const key = page.current(); + const row = store.row(key); + if (!key || !row || reason()) return; + const category = store.type(row.typeId)?.category ?? 'Generic'; + const d = new Dialog('Save to library'); + const cats = [...new Set([category, ...CATEGORIES])]; + d.body.appendChild(el(`
      + + +
      `)); + const name = q(d.body, '.fsh-mat-lib-name'); + const cat = q(d.body, '.fsh-mat-lib-cat'); + name.value = row.name; + cat.value = category; + const go = async (): Promise => { + const text = name.value.trim(); + if (!text) { name.focus(); return; } + d.close(); + const out = await ws.run(CMD.librarySave, { material: keyArg(key), name: text, category: cat.value }); + if (out !== undefined) toast(t('Saved {name} to your library', { name: text })); + }; + name.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); void go(); } }); + d.action('Cancel', () => d.close()); + d.action('Save', go, 'primary'); + d.open(); + }; + + save.addEventListener('click', open); + update(); + const offs = [store.onChange(update), ws.client.onState(update), ws.client.onCatalogue(update)]; + return { update, dispose: () => { for (const off of offs) off(); } }; +} From 72f3ae87d4e1efb5206d639b6df1a8412096ef43 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:15:39 -0500 Subject: [PATCH 250/494] feat(material-ui): mount the labels and library sections The page calls mountLabels once into a host with reserved height and show(key) only when the material changes, and mounts the library action under it. Ran in headless Chrome: the labels host stayed 120 px while switching between four materials with zero layout shift, and Save to library showed the missing-command reason. --- frontend/src/ui/pages/material.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/src/ui/pages/material.ts b/frontend/src/ui/pages/material.ts index 81634fe3..25ef2ee2 100644 --- a/frontend/src/ui/pages/material.ts +++ b/frontend/src/ui/pages/material.ts @@ -3,7 +3,9 @@ import { el, setHidden, setText } from '../../shell/dom'; import type { NodeSummary } from '../../engine/types'; import type { Workspace } from '../context'; import { Edits } from '../material/edits'; +import { mountLabels } from '../labels'; import { mountGraph } from '../material/graph'; +import { mountLibraryHook } from '../material/library'; import { mountList, type ListHost } from '../material/list'; import { mountParams } from '../material/params'; import { mountSlots } from '../material/slots'; @@ -79,6 +81,21 @@ export const mountMaterialPage: PageMount = (host, ws) => { const graph = mountGraph(section(host, 'Graph'), ws, store, { current: () => current }); listeners.add(graph.update); + + const labelsHost = el('
      '); + section(host, 'Labels').appendChild(labelsHost); + const labels = mountLabels(labelsHost, ws); + let labelsFor: string | null | undefined; + const showLabels = (): void => { + const key = current !== null && store.row(current) ? current : null; + if (key === labelsFor) return; + labelsFor = key; + labels.show(key); + }; + listeners.add(showLabels); + + const library = mountLibraryHook(section(host, 'Library'), ws, store, { current: () => current }); + listeners.add(library.update); const paintNone = (): void => setHidden(none, current !== null && store.row(current) !== null); listeners.add(paintNone); @@ -115,6 +132,7 @@ export const mountMaterialPage: PageMount = (host, ws) => { follow(); paintStatus(); paintNone(); + showLabels(); const offs = [store.onChange(follow), store.onChange(paintStatus), store.onChange(paintNone), ws.client.onSummary(follow)]; - return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); slots.dispose(); graph.dispose(); for (const off of offs) off(); }; + return () => { watch.disconnect(); offLayout(); offNote(); list.dispose(); params.dispose(); slots.dispose(); graph.dispose(); library.dispose(); for (const off of offs) off(); }; }; From dbc2dc4d1e93f47463e39c02e027c1aced9e597f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:17:24 -0500 Subject: [PATCH 251/494] feat(i18n): add the material namespace strings.json lists the 152 strings the material page shows that no other namespace already has (labels, type and metal names from material.types, reasons and slot options); the 23 language tables hold English placeholders and es-MX and fr-CA are empty. The multiply tag now reads Texture with a times sign. Checked every table has the same key set; ran npx tsc --noEmit and vite build. --- frontend/src/i18n/modules/material/cs.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/da.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/de.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/es-MX.json | 1 + frontend/src/i18n/modules/material/es.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/fi.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/fr-CA.json | 1 + frontend/src/i18n/modules/material/fr.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/hu.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/id.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/it.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/ja.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/ko.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/nb.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/nl.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/pl.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/pt-BR.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/ru.json | 154 ++++++++++++++++++ .../src/i18n/modules/material/strings.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/sv.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/th.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/tr.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/uk.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/vi.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/zh-CN.json | 154 ++++++++++++++++++ frontend/src/i18n/modules/material/zh-TW.json | 154 ++++++++++++++++++ frontend/src/ui/material/params.ts | 2 +- 27 files changed, 3699 insertions(+), 1 deletion(-) create mode 100644 frontend/src/i18n/modules/material/cs.json create mode 100644 frontend/src/i18n/modules/material/da.json create mode 100644 frontend/src/i18n/modules/material/de.json create mode 100644 frontend/src/i18n/modules/material/es-MX.json create mode 100644 frontend/src/i18n/modules/material/es.json create mode 100644 frontend/src/i18n/modules/material/fi.json create mode 100644 frontend/src/i18n/modules/material/fr-CA.json create mode 100644 frontend/src/i18n/modules/material/fr.json create mode 100644 frontend/src/i18n/modules/material/hu.json create mode 100644 frontend/src/i18n/modules/material/id.json create mode 100644 frontend/src/i18n/modules/material/it.json create mode 100644 frontend/src/i18n/modules/material/ja.json create mode 100644 frontend/src/i18n/modules/material/ko.json create mode 100644 frontend/src/i18n/modules/material/nb.json create mode 100644 frontend/src/i18n/modules/material/nl.json create mode 100644 frontend/src/i18n/modules/material/pl.json create mode 100644 frontend/src/i18n/modules/material/pt-BR.json create mode 100644 frontend/src/i18n/modules/material/ru.json create mode 100644 frontend/src/i18n/modules/material/strings.json create mode 100644 frontend/src/i18n/modules/material/sv.json create mode 100644 frontend/src/i18n/modules/material/th.json create mode 100644 frontend/src/i18n/modules/material/tr.json create mode 100644 frontend/src/i18n/modules/material/uk.json create mode 100644 frontend/src/i18n/modules/material/vi.json create mode 100644 frontend/src/i18n/modules/material/zh-CN.json create mode 100644 frontend/src/i18n/modules/material/zh-TW.json diff --git a/frontend/src/i18n/modules/material/cs.json b/frontend/src/i18n/modules/material/cs.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/cs.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/da.json b/frontend/src/i18n/modules/material/da.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/da.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/de.json b/frontend/src/i18n/modules/material/de.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/de.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/es-MX.json b/frontend/src/i18n/modules/material/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/material/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/material/es.json b/frontend/src/i18n/modules/material/es.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/es.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/fi.json b/frontend/src/i18n/modules/material/fi.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/fi.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/fr-CA.json b/frontend/src/i18n/modules/material/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/material/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/material/fr.json b/frontend/src/i18n/modules/material/fr.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/fr.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/hu.json b/frontend/src/i18n/modules/material/hu.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/hu.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/id.json b/frontend/src/i18n/modules/material/id.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/id.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/it.json b/frontend/src/i18n/modules/material/it.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/it.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/ja.json b/frontend/src/i18n/modules/material/ja.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/ja.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/ko.json b/frontend/src/i18n/modules/material/ko.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/ko.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/nb.json b/frontend/src/i18n/modules/material/nb.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/nb.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/nl.json b/frontend/src/i18n/modules/material/nl.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/nl.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/pl.json b/frontend/src/i18n/modules/material/pl.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/pl.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/pt-BR.json b/frontend/src/i18n/modules/material/pt-BR.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/pt-BR.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/ru.json b/frontend/src/i18n/modules/material/ru.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/ru.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/strings.json b/frontend/src/i18n/modules/material/strings.json new file mode 100644 index 00000000..c3fb7e18 --- /dev/null +++ b/frontend/src/i18n/modules/material/strings.json @@ -0,0 +1,154 @@ +[ + "A graph of 1 node", + "A graph of {n} nodes", + "A texture drives this value; the value is its fallback", + "ACEScg", + "Abbe number", + "Add a map", + "All parameters", + "Alpha", + "Aluminium", + "Anisotropy", + "Assign to selection", + "Base weight", + "Bilinear", + "Blend", + "Blue", + "Box", + "Brushed metal", + "Bump", + "Category", + "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel", + "Choose a texture image", + "Choose an input", + "Chromium", + "Clamp", + "Clear plastic", + "Clear the texture slot", + "Coat", + "Coat IOR", + "Coat colour", + "Coat darkening", + "Coat roughness", + "Cobalt", + "Colour space", + "Copper", + "Custom colour", + "Cylindrical", + "Data (raw)", + "Delete material", + "Diffuse", + "Diffuse roughness", + "Dispersion", + "Displacement", + "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.", + "Drives no input yet", + "Drives {inputs}", + "Duplicate material", + "Edit graph", + "Edit the texture of {input}", + "Emission colour", + "Fallback", + "Fallback colour", + "Film IOR", + "Film thickness", + "Filter", + "Flip green (DirectX)", + "Fuzz", + "Fuzz colour", + "Fuzz roughness", + "Generic", + "Gold", + "Graph", + "Green", + "IOR", + "Images", + "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.", + "Invert", + "Iron", + "Keep this material as a preset in your library", + "Keep values", + "Labels", + "Linear sRGB", + "Luminance", + "Material types", + "Measured metals", + "Metallic paint", + "Mirror", + "Multiply by the value", + "Name", + "Nearest", + "New", + "New material", + "Nickel", + "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.", + "Object space", + "Offset U", + "Offset V", + "Open the node editor for this material", + "Parameters", + "Pick a material first", + "Pick or create a material to edit it.", + "Planar", + "Platinum", + "Projection", + "RGB", + "Range from", + "Range to", + "Reading the material", + "Red", + "Rename material", + "Repeat", + "Replace the image", + "Reset to type", + "Save to library", + "Saved {name} to your library", + "Saving to the library needs an engine with library.save.", + "Scale U", + "Scale V", + "Select parts in the viewport or the scene first", + "Silver", + "Space", + "Specular colour", + "Specular weight", + "Spherical", + "Strength", + "Subsurface", + "Subsurface colour", + "Subsurface radius", + "Subsurface radius scale", + "Texture", + "Texture {key}", + "Texture ×", + "Textures", + "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet", + "The image could not be uploaded ({status})", + "The texture multiplies this value", + "Thin film", + "Thin glass", + "Thin walled", + "Titanium", + "Transmission", + "Transmission colour", + "Transmission depth", + "Trilinear", + "Type", + "UV set", + "Used by 1 part", + "Used by {n} parts", + "Waiting for the material settings", + "Waiting for the material types", + "World space", + "Wrap", + "sRGB", + "{name} cannot be deleted. {reason}", + "{name} copy" +] diff --git a/frontend/src/i18n/modules/material/sv.json b/frontend/src/i18n/modules/material/sv.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/sv.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/th.json b/frontend/src/i18n/modules/material/th.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/th.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/tr.json b/frontend/src/i18n/modules/material/tr.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/tr.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/uk.json b/frontend/src/i18n/modules/material/uk.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/uk.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/vi.json b/frontend/src/i18n/modules/material/vi.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/vi.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/zh-CN.json b/frontend/src/i18n/modules/material/zh-CN.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/zh-CN.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/i18n/modules/material/zh-TW.json b/frontend/src/i18n/modules/material/zh-TW.json new file mode 100644 index 00000000..defb761f --- /dev/null +++ b/frontend/src/i18n/modules/material/zh-TW.json @@ -0,0 +1,154 @@ +{ + "A graph of 1 node": "A graph of 1 node", + "A graph of {n} nodes": "A graph of {n} nodes", + "A texture drives this value; the value is its fallback": "A texture drives this value; the value is its fallback", + "ACEScg": "ACEScg", + "Abbe number": "Abbe number", + "Add a map": "Add a map", + "All parameters": "All parameters", + "Alpha": "Alpha", + "Aluminium": "Aluminium", + "Anisotropy": "Anisotropy", + "Assign to selection": "Assign to selection", + "Base weight": "Base weight", + "Bilinear": "Bilinear", + "Blend": "Blend", + "Blue": "Blue", + "Box": "Box", + "Brushed metal": "Brushed metal", + "Bump": "Bump", + "Category": "Category", + "Change the material type": "Change the material type", + "Change {from} to {to}. Keep the current values, or reset them to the new type?": "Change {from} to {to}. Keep the current values, or reset them to the new type?", + "Channel": "Channel", + "Choose a texture image": "Choose a texture image", + "Choose an input": "Choose an input", + "Chromium": "Chromium", + "Clamp": "Clamp", + "Clear plastic": "Clear plastic", + "Clear the texture slot": "Clear the texture slot", + "Coat": "Coat", + "Coat IOR": "Coat IOR", + "Coat colour": "Coat colour", + "Coat darkening": "Coat darkening", + "Coat roughness": "Coat roughness", + "Cobalt": "Cobalt", + "Colour space": "Colour space", + "Copper": "Copper", + "Custom colour": "Custom colour", + "Cylindrical": "Cylindrical", + "Data (raw)": "Data (raw)", + "Delete material": "Delete material", + "Diffuse": "Diffuse", + "Diffuse roughness": "Diffuse roughness", + "Dispersion": "Dispersion", + "Displacement": "Displacement", + "Drive {input} with a texture": "Drive {input} with a texture", + "Driven by the graph. Edit the graph to change it.": "Driven by the graph. Edit the graph to change it.", + "Drives no input yet": "Drives no input yet", + "Drives {inputs}": "Drives {inputs}", + "Duplicate material": "Duplicate material", + "Edit graph": "Edit graph", + "Edit the texture of {input}": "Edit the texture of {input}", + "Emission colour": "Emission colour", + "Fallback": "Fallback", + "Fallback colour": "Fallback colour", + "Film IOR": "Film IOR", + "Film thickness": "Film thickness", + "Filter": "Filter", + "Flip green (DirectX)": "Flip green (DirectX)", + "Fuzz": "Fuzz", + "Fuzz colour": "Fuzz colour", + "Fuzz roughness": "Fuzz roughness", + "Generic": "Generic", + "Gold": "Gold", + "Graph": "Graph", + "Green": "Green", + "IOR": "IOR", + "Images": "Images", + "In use by 1 part. Assign another material to it first.": "In use by 1 part. Assign another material to it first.", + "In use by {n} parts. Assign another material to them first.": "In use by {n} parts. Assign another material to them first.", + "Invert": "Invert", + "Iron": "Iron", + "Keep this material as a preset in your library": "Keep this material as a preset in your library", + "Keep values": "Keep values", + "Labels": "Labels", + "Linear sRGB": "Linear sRGB", + "Luminance": "Luminance", + "Material types": "Material types", + "Measured metals": "Measured metals", + "Metallic paint": "Metallic paint", + "Mirror": "Mirror", + "Multiply by the value": "Multiply by the value", + "Name": "Name", + "Nearest": "Nearest", + "New": "New", + "New material": "New material", + "Nickel": "Nickel", + "No graph": "No graph", + "No graph. This type looks right only with its graph; reset to type to get it back.": "No graph. This type looks right only with its graph; reset to type to get it back.", + "No materials yet. Create one from a type with New.": "No materials yet. Create one from a type with New.", + "No textures. Use the texture button beside a value, or add a map here.": "No textures. Use the texture button beside a value, or add a map here.", + "Object space": "Object space", + "Offset U": "Offset U", + "Offset V": "Offset V", + "Open the node editor for this material": "Open the node editor for this material", + "Parameters": "Parameters", + "Pick a material first": "Pick a material first", + "Pick or create a material to edit it.": "Pick or create a material to edit it.", + "Planar": "Planar", + "Platinum": "Platinum", + "Projection": "Projection", + "RGB": "RGB", + "Range from": "Range from", + "Range to": "Range to", + "Reading the material": "Reading the material", + "Red": "Red", + "Rename material": "Rename material", + "Repeat": "Repeat", + "Replace the image": "Replace the image", + "Reset to type": "Reset to type", + "Save to library": "Save to library", + "Saved {name} to your library": "Saved {name} to your library", + "Saving to the library needs an engine with library.save.": "Saving to the library needs an engine with library.save.", + "Scale U": "Scale U", + "Scale V": "Scale V", + "Select parts in the viewport or the scene first": "Select parts in the viewport or the scene first", + "Silver": "Silver", + "Space": "Space", + "Specular colour": "Specular colour", + "Specular weight": "Specular weight", + "Spherical": "Spherical", + "Strength": "Strength", + "Subsurface": "Subsurface", + "Subsurface colour": "Subsurface colour", + "Subsurface radius": "Subsurface radius", + "Subsurface radius scale": "Subsurface radius scale", + "Texture": "Texture", + "Texture {key}": "Texture {key}", + "Texture ×": "Texture ×", + "Textures": "Textures", + "The engine does not know the type {id}; showing the main values.": "The engine does not know the type {id}; showing the main values.", + "The engine lists no material types yet": "The engine lists no material types yet", + "The image could not be uploaded ({status})": "The image could not be uploaded ({status})", + "The texture multiplies this value": "The texture multiplies this value", + "Thin film": "Thin film", + "Thin glass": "Thin glass", + "Thin walled": "Thin walled", + "Titanium": "Titanium", + "Transmission": "Transmission", + "Transmission colour": "Transmission colour", + "Transmission depth": "Transmission depth", + "Trilinear": "Trilinear", + "Type": "Type", + "UV set": "UV set", + "Used by 1 part": "Used by 1 part", + "Used by {n} parts": "Used by {n} parts", + "Waiting for the material settings": "Waiting for the material settings", + "Waiting for the material types": "Waiting for the material types", + "World space": "World space", + "Wrap": "Wrap", + "sRGB": "sRGB", + "{name} cannot be deleted. {reason}": "{name} cannot be deleted. {reason}", + "{name} copy": "{name} copy" +} diff --git a/frontend/src/ui/material/params.ts b/frontend/src/ui/material/params.ts index fe14c9e0..76ccd6d9 100644 --- a/frontend/src/ui/material/params.ts +++ b/frontend/src/ui/material/params.ts @@ -104,7 +104,7 @@ export function mountParams(host: HTMLElement, ws: Workspace, store: MaterialSto const why = !d ? t('Reading the material') : !can ? ws.why(CMD.setParams) : driven ? t('Driven by the graph. Edit the graph to change it.') : ''; control.setDisabled(!d || !can || driven, why); if (driven) control.setTag(t('Graph'), t('Driven by the graph. Edit the graph to change it.')); - else if (slot) control.setTag(slot.multiply === true ? t('Texture x') : t('Texture'), slot.multiply === true ? t('The texture multiplies this value') : t('A texture drives this value; the value is its fallback')); + else if (slot) control.setTag(slot.multiply === true ? t('Texture ×') : t('Texture'), slot.multiply === true ? t('The texture multiplies this value') : t('A texture drives this value; the value is its fallback')); else control.setTag(''); }, }; From 157bc5dfd9ae914686a7355fb6efaca9cd99cd5f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:27:51 -0500 Subject: [PATCH 252/494] fix(material-ui): keep the textures empty line while a material loads The line appeared only after the material was read, pushing the graph, labels and library sections down. Measured with a layout-shift observer in headless Chrome: that shift is gone. --- frontend/src/ui/material/slots.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/material/slots.ts b/frontend/src/ui/material/slots.ts index d3c5a59b..26153050 100644 --- a/frontend/src/ui/material/slots.ts +++ b/frontend/src/ui/material/slots.ts @@ -231,7 +231,7 @@ export function mountSlots(host: HTMLElement, ws: Workspace, store: MaterialStor update: (_node, i) => { if (d) editors.get(i)?.update(d); }, }); for (const k of [...editors.keys()]) if (!inputs.includes(k)) editors.delete(k); - setHidden(empty, inputs.length > 0 || !d); + setHidden(empty, inputs.length > 0); const free = (SLOTTABLE as readonly string[]).filter((i) => !inputs.includes(i)); const opts = `` + free.map((i) => ``).join(''); setHtml(add, opts, free.join(',')); From 403d63b23eb73bd024af60e7f4bc61e3c413cd73 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:00:34 -0500 Subject: [PATCH 253/494] feat(library): add the library client for presets and project materials Parses library.list, library.get and library.recent replies in the documented shapes, builds thumbnail URLs and applies presets or project materials by scope. Ran npx tsc --noEmit. --- frontend/src/ui/library/data.ts | 220 ++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 frontend/src/ui/library/data.ts diff --git a/frontend/src/ui/library/data.ts b/frontend/src/ui/library/data.ts new file mode 100644 index 00000000..20575273 --- /dev/null +++ b/frontend/src/ui/library/data.ts @@ -0,0 +1,220 @@ +import { api } from '../../shell/api'; +import type { SceneSummary } from '../../engine/types'; +import type { Workspace } from '../context'; + +export const LIST = 'library.list'; +export const GET = 'library.get'; +export const APPLY = 'library.apply'; +export const FAVORITE = 'library.favorite'; +export const SAVE = 'library.save'; +export const REMOVE = 'library.remove'; +export const RECENT = 'library.recent'; +export const ASSIGN = 'material.assign'; + +export const CATEGORIES: readonly string[] = ['Metal', 'Plastic', 'Glass', 'Paint', 'Rubber', 'Fabric', 'Wood', 'Stone', 'Ceramic', 'Liquid', 'Gem', 'Emissive']; + +export type Shelf = 'all' | 'favorites' | 'recent' | 'project' | 'user'; +export const SHELVES: ReadonlyArray = [ + ['all', 'All'], + ['favorites', 'Favorites'], + ['recent', 'Recent'], + ['project', 'In project'], + ['user', 'User'], +]; + +export type Scope = 'part' | 'group' | 'same_material'; + +export const TYPE_LABEL: Readonly> = { + generic: 'Generic', plastic: 'Plastic', plastic_clear: 'Clear plastic', metal: 'Metal', metal_brushed: 'Brushed metal', + paint: 'Paint', paint_metallic: 'Metallic paint', glass: 'Glass', glass_thin: 'Thin glass', liquid: 'Liquid', gem: 'Gem', + rubber: 'Rubber', fabric: 'Fabric', ceramic: 'Ceramic', diffuse: 'Diffuse', emissive: 'Emissive', wood: 'Wood', stone: 'Stone', +}; + +export interface Preset { + readonly id: string; + readonly name: string; + readonly category: string; + readonly type: string; + readonly tags: readonly string[]; + favorite: boolean; + readonly user: boolean; + readonly material: string | null; + readonly hash: string; +} + +export interface PresetDetail { + id: string; + name: string; + category: string; + type: string; + tags: string[]; + params: Record; + sourceKind: string; + reference: string; + notes: string; + urls: string[]; + authored: string[]; + licence: string; +} + +function obj(v: unknown): Record | null { + return v && typeof v === 'object' && !Array.isArray(v) ? v as Record : null; +} + +function str(v: unknown, fallback = ''): string { + return typeof v === 'string' ? v : typeof v === 'number' ? String(v) : fallback; +} + +function strings(v: unknown): string[] { + return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string') : []; +} + +export function parsePreset(raw: unknown, favorites?: ReadonlySet): Preset | null { + const o = obj(raw); + const id = o ? str(o.id) : ''; + if (!o || !id) return null; + return { + id, + name: str(o.name, id), + category: str(o.category), + type: str(o.type, str(o.type_id)), + tags: strings(o.tags), + favorite: o.favorite === true || o.favourite === true || (favorites?.has(id) ?? false), + user: o.user === true || o.source === 'user' || id.startsWith('user/'), + material: null, + hash: str(o.sha256, str(o.hash)), + }; +} + +function listOf(o: Record | null, raw: unknown): unknown[] { + if (Array.isArray(raw)) return raw; + for (const k of ['presets', 'items', 'results', 'ids', 'recent']) if (o && Array.isArray(o[k])) return o[k] as unknown[]; + return []; +} + +export function parseList(raw: unknown): Preset[] { + const top = obj(raw); + const o = obj(top?.result) ?? top; + const favs = new Set(strings(o?.favorites ?? o?.favourites)); + const out: Preset[] = []; + const seen = new Set(); + for (const item of listOf(o, obj(raw) ? o : raw)) { + const p = typeof item === 'string' ? parsePreset({ id: item }, favs) : parsePreset(item, favs); + if (p && !seen.has(p.id)) { seen.add(p.id); out.push(p); } + } + return out; +} + +export function parseIds(raw: unknown): string[] { + const top = obj(raw); + const o = obj(top?.result) ?? top; + return listOf(o, obj(raw) ? o : raw).map((x) => typeof x === 'string' ? x : str(obj(x)?.id)).filter(Boolean); +} + +export function parseDetail(raw: unknown): PresetDetail | null { + const top = obj(raw); + const o = obj(top?.preset) ?? obj(top?.result) ?? top; + if (!o || !str(o.id)) return null; + const src = obj(o.source); + return { + id: str(o.id), + name: str(o.name, str(o.id)), + category: str(o.category), + type: str(o.type, str(o.type_id)), + tags: strings(o.tags), + params: obj(o.params) ?? {}, + sourceKind: str(src?.kind), + reference: str(src?.reference), + notes: str(src?.notes), + urls: strings(src?.urls), + authored: strings(src?.authored), + licence: str(o.licence, str(o.license)), + }; +} + +export function categoryOfType(type: string): string { + const base = type.split('_')[0]; + const hit = CATEGORIES.find((c) => c.toLowerCase() === base); + if (hit) return hit; + return base === 'diffuse' || base === 'generic' ? 'Plastic' : ''; +} + +export function projectMaterials(summary: SceneSummary | null): Preset[] { + if (!summary) return []; + return summary.materials.map((m) => { + const key = str(m.key); + const type = str(m.type_id, 'generic'); + return { + id: `project/${key}`, + name: str(m.name, key), + category: categoryOfType(type), + type, + tags: [], + favorite: false, + user: false, + material: key, + hash: '', + }; + }).filter((p) => p.material !== ''); +} + +export function thumbUrl(id: string, size: number): string { + const path = id.split('/').map(encodeURIComponent).join('/'); + return api.url(`/api/library/thumbnail/${path}?size=${size}`); +} + +export function partMaterial(summary: SceneSummary | null, node: string): string | null { + const n = summary?.nodes.find((x) => String(x.id) === node); + const m = n?.raw.material; + return typeof m === 'string' || typeof m === 'number' ? String(m) : null; +} + +export function selectedParts(summary: SceneSummary | null): string[] { + return (summary?.selection ?? []).map(String); +} + +export function scopeNodes(summary: SceneSummary | null, nodes: readonly string[], scope: Scope): string[] { + if (!summary || scope === 'part') return [...nodes]; + const byId = new Map(summary.nodes.map((n) => [String(n.id), n])); + if (scope === 'group') { + const out = new Set(); + for (const id of nodes) { + const n = byId.get(id); + const parent = n?.parent; + out.add(parent !== null && parent !== undefined && byId.get(String(parent))?.kind === 'group' ? String(parent) : id); + } + return [...out]; + } + const keys = new Set(nodes.map((id) => partMaterial(summary, id)).filter((k): k is string => k !== null)); + if (!keys.size) return [...nodes]; + return summary.nodes.filter((n) => n.kind === 'part' && keys.has(String(n.raw.material ?? ''))).map((n) => String(n.id)); +} + +export function descendants(summary: SceneSummary | null, ids: readonly string[]): Set { + const out = new Set(ids); + if (!summary) return out; + let grew = true; + while (grew) { + grew = false; + for (const n of summary.nodes) { + const id = String(n.id); + if (!out.has(id) && n.parent !== null && out.has(String(n.parent))) { out.add(id); grew = true; } + } + } + return out; +} + +export interface ApplyOutcome { ok: boolean; message: string } + +export async function applyPreset(ws: Workspace, preset: Preset, nodes: readonly string[], scope: Scope): Promise { + if (!nodes.length) return { ok: false, message: 'Select a part first' }; + if (preset.material !== null) { + if (!ws.canRun(ASSIGN)) return { ok: false, message: ws.why(ASSIGN) }; + const ids = scopeNodes(ws.client.summary, nodes, scope); + await ws.client.dispatch(ASSIGN, { ids, material: preset.material }); + return { ok: true, message: '' }; + } + if (!ws.canRun(APPLY)) return { ok: false, message: ws.why(APPLY) }; + await ws.client.dispatch(APPLY, { id: preset.id, nodes: [...nodes], scope }); + return { ok: true, message: '' }; +} From 7cd11590798ef337110626688f69b9c1e5a3a3af Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:00:34 -0500 Subject: [PATCH 254/494] feat(library): keep the library panel state across reloads Shelf, category, query, tile size, scroll offset and the active tile are stored in one localStorage entry, written after a short delay and on page hide. Ran npx tsc --noEmit. --- frontend/src/ui/library/state.ts | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 frontend/src/ui/library/state.ts diff --git a/frontend/src/ui/library/state.ts b/frontend/src/ui/library/state.ts new file mode 100644 index 00000000..fe7d0f1f --- /dev/null +++ b/frontend/src/ui/library/state.ts @@ -0,0 +1,62 @@ +import { CATEGORIES, SHELVES, type Shelf } from './data'; + +const KEY = 'formshot.library.panel'; +const OLD_SHELF_KEY = 'formshot.library.shelf'; +const SAVE_DELAY_MS = 250; + +export const TILE_SIZES: readonly number[] = [72, 96, 128]; + +export interface PanelState { + shelf: Shelf; + category: string; + query: string; + size: number; + scroll: number; + view: string; + active: string; +} + +function read(): Record { + try { + const raw = localStorage.getItem(KEY); + const v: unknown = raw ? JSON.parse(raw) : null; + if (v && typeof v === 'object' && !Array.isArray(v)) return v as Record; + const old = localStorage.getItem(OLD_SHELF_KEY); + return old ? { shelf: old } : {}; + } catch { + return {}; + } +} + +export function loadState(): PanelState { + const o = read(); + const shelf = SHELVES.some(([id]) => id === o.shelf) ? o.shelf as Shelf : 'all'; + const category = typeof o.category === 'string' && CATEGORIES.includes(o.category) ? o.category : ''; + const size = typeof o.size === 'number' && o.size >= 0 && o.size < TILE_SIZES.length ? Math.floor(o.size) : 1; + return { + shelf, + category, + query: typeof o.query === 'string' ? o.query.slice(0, 200) : '', + size, + scroll: typeof o.scroll === 'number' && o.scroll > 0 ? o.scroll : 0, + view: typeof o.view === 'string' ? o.view : '', + active: typeof o.active === 'string' ? o.active : '', + }; +} + +export function viewKey(s: PanelState): string { + return `${s.shelf}|${s.category}|${s.query.trim().toLowerCase()}|${s.size}`; +} + +export function stateSaver(state: PanelState): () => void { + let timer: number | undefined; + const write = (): void => { + timer = undefined; + try { localStorage.setItem(KEY, JSON.stringify({ ...state, view: viewKey(state) })); } catch { return; } + }; + window.addEventListener('pagehide', () => { if (timer !== undefined) { window.clearTimeout(timer); write(); } }); + return () => { + if (timer !== undefined) return; + timer = window.setTimeout(write, SAVE_DELAY_MS); + }; +} From 687752945d211b8b943392c8113ce52ba3448bb8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:03:59 -0500 Subject: [PATCH 255/494] feat(i18n): add the library namespace with every language file Shelf, category, type and empty-state strings of the Library panel; strings another namespace already translates keep that translation, the rest are English placeholders, es-MX and fr-CA are empty. Checked strings.json is sorted and unique. --- frontend/src/i18n/modules/library/cs.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/da.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/de.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/es-MX.json | 1 + frontend/src/i18n/modules/library/es.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/fi.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/fr-CA.json | 1 + frontend/src/i18n/modules/library/fr.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/hu.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/id.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/it.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/ja.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/ko.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/nb.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/nl.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/pl.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/pt-BR.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/ru.json | 40 +++++++++++++++++++ .../src/i18n/modules/library/strings.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/sv.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/th.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/tr.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/uk.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/vi.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/zh-CN.json | 40 +++++++++++++++++++ frontend/src/i18n/modules/library/zh-TW.json | 40 +++++++++++++++++++ 26 files changed, 962 insertions(+) create mode 100644 frontend/src/i18n/modules/library/cs.json create mode 100644 frontend/src/i18n/modules/library/da.json create mode 100644 frontend/src/i18n/modules/library/de.json create mode 100644 frontend/src/i18n/modules/library/es-MX.json create mode 100644 frontend/src/i18n/modules/library/es.json create mode 100644 frontend/src/i18n/modules/library/fi.json create mode 100644 frontend/src/i18n/modules/library/fr-CA.json create mode 100644 frontend/src/i18n/modules/library/fr.json create mode 100644 frontend/src/i18n/modules/library/hu.json create mode 100644 frontend/src/i18n/modules/library/id.json create mode 100644 frontend/src/i18n/modules/library/it.json create mode 100644 frontend/src/i18n/modules/library/ja.json create mode 100644 frontend/src/i18n/modules/library/ko.json create mode 100644 frontend/src/i18n/modules/library/nb.json create mode 100644 frontend/src/i18n/modules/library/nl.json create mode 100644 frontend/src/i18n/modules/library/pl.json create mode 100644 frontend/src/i18n/modules/library/pt-BR.json create mode 100644 frontend/src/i18n/modules/library/ru.json create mode 100644 frontend/src/i18n/modules/library/strings.json create mode 100644 frontend/src/i18n/modules/library/sv.json create mode 100644 frontend/src/i18n/modules/library/th.json create mode 100644 frontend/src/i18n/modules/library/tr.json create mode 100644 frontend/src/i18n/modules/library/uk.json create mode 100644 frontend/src/i18n/modules/library/vi.json create mode 100644 frontend/src/i18n/modules/library/zh-CN.json create mode 100644 frontend/src/i18n/modules/library/zh-TW.json diff --git a/frontend/src/i18n/modules/library/cs.json b/frontend/src/i18n/modules/library/cs.json new file mode 100644 index 00000000..da6f1b00 --- /dev/null +++ b/frontend/src/i18n/modules/library/cs.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Vše", + "Brushed metal": "Brushed metal", + "Categories": "Kategorie", + "Ceramic": "Keramika", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emise", + "Fabric": "Látka", + "Favorites": "Oblíbené", + "Gem": "Drahokam", + "Generic": "Generic", + "Glass": "Sklo", + "In project": "V projektu", + "Library": "Knihovna", + "Liquid": "Kapalina", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Kov", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Lak", + "Plastic": "Plast", + "Recent": "Nedávné", + "Resize the library": "Změnit velikost knihovny", + "Rubber": "Guma", + "Search materials": "Hledat materiály", + "Shelves": "Police", + "Stone": "Kámen", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Dřevo", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/da.json b/frontend/src/i18n/modules/library/da.json new file mode 100644 index 00000000..45de3bb4 --- /dev/null +++ b/frontend/src/i18n/modules/library/da.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Alle", + "Brushed metal": "Brushed metal", + "Categories": "Kategorier", + "Ceramic": "Keramik", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissiv", + "Fabric": "Stof", + "Favorites": "Favoritter", + "Gem": "Ædelsten", + "Generic": "Generic", + "Glass": "Glas", + "In project": "I projektet", + "Library": "Bibliotek", + "Liquid": "Væske", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Maling", + "Plastic": "Plastik", + "Recent": "Seneste", + "Resize the library": "Tilpas bibliotekets størrelse", + "Rubber": "Gummi", + "Search materials": "Søg i materialer", + "Shelves": "Hylder", + "Stone": "Sten", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Træ", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/de.json b/frontend/src/i18n/modules/library/de.json new file mode 100644 index 00000000..9daefedf --- /dev/null +++ b/frontend/src/i18n/modules/library/de.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Alle", + "Brushed metal": "Brushed metal", + "Categories": "Kategorien", + "Ceramic": "Keramik", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissiv", + "Fabric": "Stoff", + "Favorites": "Favoriten", + "Gem": "Edelstein", + "Generic": "Generic", + "Glass": "Glas", + "In project": "Im Projekt", + "Library": "Bibliothek", + "Liquid": "Flüssigkeit", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metall", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Lack", + "Plastic": "Kunststoff", + "Recent": "Zuletzt", + "Resize the library": "Größe der Bibliothek ändern", + "Rubber": "Gummi", + "Search materials": "Materialien durchsuchen", + "Shelves": "Regale", + "Stone": "Stein", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Holz", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/es-MX.json b/frontend/src/i18n/modules/library/es-MX.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/library/es-MX.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/library/es.json b/frontend/src/i18n/modules/library/es.json new file mode 100644 index 00000000..afb3b50f --- /dev/null +++ b/frontend/src/i18n/modules/library/es.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Todo", + "Brushed metal": "Brushed metal", + "Categories": "Categorías", + "Ceramic": "Cerámica", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emisivo", + "Fabric": "Tela", + "Favorites": "Favoritos", + "Gem": "Gema", + "Generic": "Generic", + "Glass": "Vidrio", + "In project": "En el proyecto", + "Library": "Biblioteca", + "Liquid": "Líquido", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Pintura", + "Plastic": "Plástico", + "Recent": "Recientes", + "Resize the library": "Cambiar el tamaño de la biblioteca", + "Rubber": "Goma", + "Search materials": "Buscar materiales", + "Shelves": "Estantes", + "Stone": "Piedra", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Madera", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/fi.json b/frontend/src/i18n/modules/library/fi.json new file mode 100644 index 00000000..561afe8c --- /dev/null +++ b/frontend/src/i18n/modules/library/fi.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Kaikki", + "Brushed metal": "Brushed metal", + "Categories": "Luokat", + "Ceramic": "Keramiikka", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissiivinen", + "Fabric": "Kangas", + "Favorites": "Suosikit", + "Gem": "Jalokivi", + "Generic": "Generic", + "Glass": "Lasi", + "In project": "Projektissa", + "Library": "Kirjasto", + "Liquid": "Neste", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metalli", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Maali", + "Plastic": "Muovi", + "Recent": "Viimeisimmät", + "Resize the library": "Muuta kirjaston kokoa", + "Rubber": "Kumi", + "Search materials": "Hae materiaaleja", + "Shelves": "Hyllyt", + "Stone": "Kivi", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Puu", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/fr-CA.json b/frontend/src/i18n/modules/library/fr-CA.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/frontend/src/i18n/modules/library/fr-CA.json @@ -0,0 +1 @@ +{} diff --git a/frontend/src/i18n/modules/library/fr.json b/frontend/src/i18n/modules/library/fr.json new file mode 100644 index 00000000..07154b67 --- /dev/null +++ b/frontend/src/i18n/modules/library/fr.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Tout", + "Brushed metal": "Brushed metal", + "Categories": "Catégories", + "Ceramic": "Céramique", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Émissif", + "Fabric": "Tissu", + "Favorites": "Favoris", + "Gem": "Gemme", + "Generic": "Generic", + "Glass": "Verre", + "In project": "Dans le projet", + "Library": "Bibliothèque", + "Liquid": "Liquide", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Métal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Peinture", + "Plastic": "Plastique", + "Recent": "Récents", + "Resize the library": "Redimensionner la bibliothèque", + "Rubber": "Caoutchouc", + "Search materials": "Rechercher des matériaux", + "Shelves": "Étagères", + "Stone": "Pierre", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Bois", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/hu.json b/frontend/src/i18n/modules/library/hu.json new file mode 100644 index 00000000..9c7ca31f --- /dev/null +++ b/frontend/src/i18n/modules/library/hu.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Mind", + "Brushed metal": "Brushed metal", + "Categories": "Kategóriák", + "Ceramic": "Kerámia", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissziós", + "Fabric": "Szövet", + "Favorites": "Kedvencek", + "Gem": "Ékkő", + "Generic": "Generic", + "Glass": "Üveg", + "In project": "A projektben", + "Library": "Könyvtár", + "Liquid": "Folyadék", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Fém", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Festék", + "Plastic": "Műanyag", + "Recent": "Legutóbbiak", + "Resize the library": "Könyvtár átméretezése", + "Rubber": "Gumi", + "Search materials": "Anyagok keresése", + "Shelves": "Polcok", + "Stone": "Kő", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Fa", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/id.json b/frontend/src/i18n/modules/library/id.json new file mode 100644 index 00000000..579988cc --- /dev/null +++ b/frontend/src/i18n/modules/library/id.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Semua", + "Brushed metal": "Brushed metal", + "Categories": "Kategori", + "Ceramic": "Keramik", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emisif", + "Fabric": "Kain", + "Favorites": "Favorit", + "Gem": "Permata", + "Generic": "Generic", + "Glass": "Kaca", + "In project": "Dalam proyek", + "Library": "Pustaka", + "Liquid": "Cairan", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Logam", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Cat", + "Plastic": "Plastik", + "Recent": "Terbaru", + "Resize the library": "Ubah ukuran pustaka", + "Rubber": "Karet", + "Search materials": "Cari material", + "Shelves": "Rak", + "Stone": "Batu", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Kayu", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/it.json b/frontend/src/i18n/modules/library/it.json new file mode 100644 index 00000000..3bfcf45b --- /dev/null +++ b/frontend/src/i18n/modules/library/it.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Tutto", + "Brushed metal": "Brushed metal", + "Categories": "Categorie", + "Ceramic": "Ceramica", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissivo", + "Fabric": "Tessuto", + "Favorites": "Preferiti", + "Gem": "Gemma", + "Generic": "Generic", + "Glass": "Vetro", + "In project": "Nel progetto", + "Library": "Libreria", + "Liquid": "Liquido", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metallo", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Vernice", + "Plastic": "Plastica", + "Recent": "Recenti", + "Resize the library": "Ridimensiona la libreria", + "Rubber": "Gomma", + "Search materials": "Cerca materiali", + "Shelves": "Scaffali", + "Stone": "Pietra", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Legno", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/ja.json b/frontend/src/i18n/modules/library/ja.json new file mode 100644 index 00000000..a78971e9 --- /dev/null +++ b/frontend/src/i18n/modules/library/ja.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "すべて", + "Brushed metal": "Brushed metal", + "Categories": "カテゴリ", + "Ceramic": "セラミック", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "エミッシブ", + "Fabric": "ファブリック", + "Favorites": "お気に入り", + "Gem": "宝石", + "Generic": "Generic", + "Glass": "ガラス", + "In project": "プロジェクト内", + "Library": "ライブラリ", + "Liquid": "液体", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "メタル", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "塗装", + "Plastic": "プラスチック", + "Recent": "最近", + "Resize the library": "ライブラリのサイズを変更", + "Rubber": "ゴム", + "Search materials": "マテリアルを検索", + "Shelves": "棚", + "Stone": "石", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "木材", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/ko.json b/frontend/src/i18n/modules/library/ko.json new file mode 100644 index 00000000..fef59689 --- /dev/null +++ b/frontend/src/i18n/modules/library/ko.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "모두", + "Brushed metal": "Brushed metal", + "Categories": "카테고리", + "Ceramic": "세라믹", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "발광", + "Fabric": "패브릭", + "Favorites": "즐겨찾기", + "Gem": "보석", + "Generic": "Generic", + "Glass": "유리", + "In project": "프로젝트에 있음", + "Library": "라이브러리", + "Liquid": "액체", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "금속", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "페인트", + "Plastic": "플라스틱", + "Recent": "최근", + "Resize the library": "라이브러리 크기 조절", + "Rubber": "고무", + "Search materials": "머티리얼 검색", + "Shelves": "선반", + "Stone": "돌", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "목재", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/nb.json b/frontend/src/i18n/modules/library/nb.json new file mode 100644 index 00000000..ba4a7bec --- /dev/null +++ b/frontend/src/i18n/modules/library/nb.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Alle", + "Brushed metal": "Brushed metal", + "Categories": "Kategorier", + "Ceramic": "Keramikk", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissiv", + "Fabric": "Stoff", + "Favorites": "Favoritter", + "Gem": "Edelstein", + "Generic": "Generic", + "Glass": "Glass", + "In project": "I prosjektet", + "Library": "Bibliotek", + "Liquid": "Væske", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metall", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Lakk", + "Plastic": "Plast", + "Recent": "Nylige", + "Resize the library": "Endre størrelsen på biblioteket", + "Rubber": "Gummi", + "Search materials": "Søk i materialer", + "Shelves": "Hyller", + "Stone": "Stein", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Tre", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/nl.json b/frontend/src/i18n/modules/library/nl.json new file mode 100644 index 00000000..f8d20c0b --- /dev/null +++ b/frontend/src/i18n/modules/library/nl.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Alle", + "Brushed metal": "Brushed metal", + "Categories": "Categorieën", + "Ceramic": "Keramiek", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissief", + "Fabric": "Stof", + "Favorites": "Favorieten", + "Gem": "Edelsteen", + "Generic": "Generic", + "Glass": "Glas", + "In project": "In project", + "Library": "Bibliotheek", + "Liquid": "Vloeistof", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metaal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Verf", + "Plastic": "Kunststof", + "Recent": "Recent", + "Resize the library": "Formaat van de bibliotheek wijzigen", + "Rubber": "Rubber", + "Search materials": "Materialen zoeken", + "Shelves": "Planken", + "Stone": "Steen", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Hout", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/pl.json b/frontend/src/i18n/modules/library/pl.json new file mode 100644 index 00000000..20d92990 --- /dev/null +++ b/frontend/src/i18n/modules/library/pl.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Wszystko", + "Brushed metal": "Brushed metal", + "Categories": "Kategorie", + "Ceramic": "Ceramika", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emisja", + "Fabric": "Tkanina", + "Favorites": "Ulubione", + "Gem": "Klejnot", + "Generic": "Generic", + "Glass": "Szkło", + "In project": "W projekcie", + "Library": "Biblioteka", + "Liquid": "Ciecz", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Lakier", + "Plastic": "Plastik", + "Recent": "Ostatnie", + "Resize the library": "Zmień rozmiar biblioteki", + "Rubber": "Guma", + "Search materials": "Szukaj materiałów", + "Shelves": "Półki", + "Stone": "Kamień", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Drewno", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/pt-BR.json b/frontend/src/i18n/modules/library/pt-BR.json new file mode 100644 index 00000000..776e9b0e --- /dev/null +++ b/frontend/src/i18n/modules/library/pt-BR.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Tudo", + "Brushed metal": "Brushed metal", + "Categories": "Categorias", + "Ceramic": "Cerâmica", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissivo", + "Fabric": "Tecido", + "Favorites": "Favoritos", + "Gem": "Gema", + "Generic": "Generic", + "Glass": "Vidro", + "In project": "No projeto", + "Library": "Biblioteca", + "Liquid": "Líquido", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Tinta", + "Plastic": "Plástico", + "Recent": "Recentes", + "Resize the library": "Redimensionar a biblioteca", + "Rubber": "Borracha", + "Search materials": "Buscar materiais", + "Shelves": "Prateleiras", + "Stone": "Pedra", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Madeira", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/ru.json b/frontend/src/i18n/modules/library/ru.json new file mode 100644 index 00000000..6e5f4555 --- /dev/null +++ b/frontend/src/i18n/modules/library/ru.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Все", + "Brushed metal": "Brushed metal", + "Categories": "Категории", + "Ceramic": "Керамика", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Излучение", + "Fabric": "Ткань", + "Favorites": "Избранное", + "Gem": "Драгоценный камень", + "Generic": "Generic", + "Glass": "Стекло", + "In project": "В проекте", + "Library": "Библиотека", + "Liquid": "Жидкость", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Металл", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Краска", + "Plastic": "Пластик", + "Recent": "Недавние", + "Resize the library": "Изменить размер библиотеки", + "Rubber": "Резина", + "Search materials": "Поиск материалов", + "Shelves": "Полки", + "Stone": "Камень", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Дерево", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/strings.json b/frontend/src/i18n/modules/library/strings.json new file mode 100644 index 00000000..6de72094 --- /dev/null +++ b/frontend/src/i18n/modules/library/strings.json @@ -0,0 +1,40 @@ +[ + "1 material", + "All", + "Brushed metal", + "Categories", + "Ceramic", + "Clear plastic", + "Diffuse", + "Emissive", + "Fabric", + "Favorites", + "Gem", + "Generic", + "Glass", + "In project", + "Library", + "Liquid", + "Materials", + "Materials you apply appear here.", + "Materials you save from the selection appear here.", + "Metal", + "Metallic paint", + "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here", + "Paint", + "Plastic", + "Recent", + "Resize the library", + "Rubber", + "Search materials", + "Shelves", + "Stone", + "The library is empty", + "Thin glass", + "This project has no materials yet.", + "Tile size", + "User", + "Wood", + "{n} materials" +] diff --git a/frontend/src/i18n/modules/library/sv.json b/frontend/src/i18n/modules/library/sv.json new file mode 100644 index 00000000..7c467903 --- /dev/null +++ b/frontend/src/i18n/modules/library/sv.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Alla", + "Brushed metal": "Brushed metal", + "Categories": "Kategorier", + "Ceramic": "Keramik", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emissiv", + "Fabric": "Tyg", + "Favorites": "Favoriter", + "Gem": "Ädelsten", + "Generic": "Generic", + "Glass": "Glas", + "In project": "I projektet", + "Library": "Bibliotek", + "Liquid": "Vätska", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metall", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Lack", + "Plastic": "Plast", + "Recent": "Senaste", + "Resize the library": "Ändra bibliotekets storlek", + "Rubber": "Gummi", + "Search materials": "Sök bland material", + "Shelves": "Hyllor", + "Stone": "Sten", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Trä", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/th.json b/frontend/src/i18n/modules/library/th.json new file mode 100644 index 00000000..53010fe6 --- /dev/null +++ b/frontend/src/i18n/modules/library/th.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "ทั้งหมด", + "Brushed metal": "Brushed metal", + "Categories": "หมวดหมู่", + "Ceramic": "เซรามิก", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "การเรืองแสง", + "Fabric": "ผ้า", + "Favorites": "รายการโปรด", + "Gem": "อัญมณี", + "Generic": "Generic", + "Glass": "แก้ว", + "In project": "ในโปรเจกต์", + "Library": "คลัง", + "Liquid": "ของเหลว", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "โลหะ", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "สี", + "Plastic": "พลาสติก", + "Recent": "ล่าสุด", + "Resize the library": "ปรับขนาดคลัง", + "Rubber": "ยาง", + "Search materials": "ค้นหาแมทีเรียล", + "Shelves": "ชั้นวาง", + "Stone": "หิน", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "ไม้", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/tr.json b/frontend/src/i18n/modules/library/tr.json new file mode 100644 index 00000000..44b62a76 --- /dev/null +++ b/frontend/src/i18n/modules/library/tr.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Tümü", + "Brushed metal": "Brushed metal", + "Categories": "Kategoriler", + "Ceramic": "Seramik", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Emisyon", + "Fabric": "Kumaş", + "Favorites": "Sık Kullanılanlar", + "Gem": "Değerli taş", + "Generic": "Generic", + "Glass": "Cam", + "In project": "Projede", + "Library": "Kitaplık", + "Liquid": "Sıvı", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Metal", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Boya", + "Plastic": "Plastik", + "Recent": "Son kullanılanlar", + "Resize the library": "Kitaplığı yeniden boyutlandır", + "Rubber": "Kauçuk", + "Search materials": "Malzemelerde ara", + "Shelves": "Raflar", + "Stone": "Taş", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Ahşap", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/uk.json b/frontend/src/i18n/modules/library/uk.json new file mode 100644 index 00000000..d280d21a --- /dev/null +++ b/frontend/src/i18n/modules/library/uk.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Усі", + "Brushed metal": "Brushed metal", + "Categories": "Категорії", + "Ceramic": "Кераміка", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Випромінювання", + "Fabric": "Тканина", + "Favorites": "Улюблені", + "Gem": "Дорогоцінний камінь", + "Generic": "Generic", + "Glass": "Скло", + "In project": "У проєкті", + "Library": "Бібліотека", + "Liquid": "Рідина", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Метал", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Фарба", + "Plastic": "Пластик", + "Recent": "Недавні", + "Resize the library": "Змінити розмір бібліотеки", + "Rubber": "Гума", + "Search materials": "Пошук матеріалів", + "Shelves": "Полиці", + "Stone": "Камінь", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Дерево", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/vi.json b/frontend/src/i18n/modules/library/vi.json new file mode 100644 index 00000000..fa0a02e3 --- /dev/null +++ b/frontend/src/i18n/modules/library/vi.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "Tất cả", + "Brushed metal": "Brushed metal", + "Categories": "Danh mục", + "Ceramic": "Gốm sứ", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "Phát sáng", + "Fabric": "Vải", + "Favorites": "Yêu thích", + "Gem": "Đá quý", + "Generic": "Generic", + "Glass": "Kính", + "In project": "Trong dự án", + "Library": "Thư viện", + "Liquid": "Chất lỏng", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "Kim loại", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "Sơn", + "Plastic": "Nhựa", + "Recent": "Gần đây", + "Resize the library": "Đổi kích thước thư viện", + "Rubber": "Cao su", + "Search materials": "Tìm vật liệu", + "Shelves": "Kệ", + "Stone": "Đá", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "Gỗ", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/zh-CN.json b/frontend/src/i18n/modules/library/zh-CN.json new file mode 100644 index 00000000..6dfc7bea --- /dev/null +++ b/frontend/src/i18n/modules/library/zh-CN.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "全部", + "Brushed metal": "Brushed metal", + "Categories": "分类", + "Ceramic": "陶瓷", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "自发光", + "Fabric": "织物", + "Favorites": "收藏", + "Gem": "宝石", + "Generic": "Generic", + "Glass": "玻璃", + "In project": "项目中", + "Library": "资源库", + "Liquid": "液体", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "金属", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "油漆", + "Plastic": "塑料", + "Recent": "最近", + "Resize the library": "调整资源库大小", + "Rubber": "橡胶", + "Search materials": "搜索材质", + "Shelves": "货架", + "Stone": "石头", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "木材", + "{n} materials": "{n} materials" +} diff --git a/frontend/src/i18n/modules/library/zh-TW.json b/frontend/src/i18n/modules/library/zh-TW.json new file mode 100644 index 00000000..299f6232 --- /dev/null +++ b/frontend/src/i18n/modules/library/zh-TW.json @@ -0,0 +1,40 @@ +{ + "1 material": "1 material", + "All": "全部", + "Brushed metal": "Brushed metal", + "Categories": "類別", + "Ceramic": "陶瓷", + "Clear plastic": "Clear plastic", + "Diffuse": "Diffuse", + "Emissive": "自發光", + "Fabric": "織物", + "Favorites": "我的最愛", + "Gem": "寶石", + "Generic": "Generic", + "Glass": "玻璃", + "In project": "專案中", + "Library": "資源庫", + "Liquid": "液體", + "Materials": "Materials", + "Materials you apply appear here.": "Materials you apply appear here.", + "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Metal": "金屬", + "Metallic paint": "Metallic paint", + "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "Nothing in {category} here": "Nothing in {category} here", + "Paint": "烤漆", + "Plastic": "塑膠", + "Recent": "最近", + "Resize the library": "調整資源庫大小", + "Rubber": "橡膠", + "Search materials": "搜尋材質", + "Shelves": "層架", + "Stone": "石材", + "The library is empty": "The library is empty", + "Thin glass": "Thin glass", + "This project has no materials yet.": "This project has no materials yet.", + "Tile size": "Tile size", + "User": "User", + "Wood": "木材", + "{n} materials": "{n} materials" +} From beb280802ce2b086ab2ffba8af2dd4800414821a Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:03:59 -0500 Subject: [PATCH 256/494] feat(library): load preset thumbnails through a small decode queue Three thumbnails at a time, newest request first, decoded before they are handed to a tile, so a tile never shows a half-drawn image; a request is dropped when its tile leaves the view and failures wait a minute before a retry. Ran npx tsc --noEmit. --- frontend/src/ui/library/thumbs.ts | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 frontend/src/ui/library/thumbs.ts diff --git a/frontend/src/ui/library/thumbs.ts b/frontend/src/ui/library/thumbs.ts new file mode 100644 index 00000000..9c9dee54 --- /dev/null +++ b/frontend/src/ui/library/thumbs.ts @@ -0,0 +1,65 @@ +const CONCURRENCY = 3; +const RETRY_MS = 60000; + +type Done = (ok: boolean) => void; + +interface Job { url: string; waiters: Set } + +export class ThumbLoader { + private readonly loaded = new Set(); + private readonly failed = new Map(); + private readonly queue: Job[] = []; + private readonly jobs = new Map(); + private running = 0; + + isLoaded(url: string): boolean { return this.loaded.has(url); } + + request(url: string, done: Done): () => void { + if (this.loaded.has(url)) { done(true); return () => undefined; } + const failedAt = this.failed.get(url); + if (failedAt !== undefined && performance.now() - failedAt < RETRY_MS) { done(false); return () => undefined; } + let job = this.jobs.get(url); + if (!job) { + job = { url, waiters: new Set() }; + this.jobs.set(url, job); + this.queue.push(job); + } + job.waiters.add(done); + const j = job; + this.pump(); + return () => { + j.waiters.delete(done); + if (j.waiters.size) return; + const i = this.queue.indexOf(j); + if (i >= 0) { this.queue.splice(i, 1); this.jobs.delete(j.url); } + }; + } + + private pump(): void { + while (this.running < CONCURRENCY) { + const job = this.queue.pop(); + if (!job) return; + this.running++; + void this.fetch(job.url).then((ok) => { + this.running--; + this.jobs.delete(job.url); + if (ok) { this.loaded.add(job.url); this.failed.delete(job.url); } else this.failed.set(job.url, performance.now()); + for (const fn of job.waiters) fn(ok); + this.pump(); + }); + } + } + + private fetch(url: string): Promise { + return new Promise((resolve) => { + const img = new Image(); + img.decoding = 'async'; + img.onload = () => { + if (typeof img.decode === 'function') img.decode().then(() => resolve(true), () => resolve(true)); + else resolve(true); + }; + img.onerror = () => resolve(false); + img.src = url; + }); + } +} From 6182fc49199a4c1196c9ef9b0f8b623c5fa82d35 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:03:59 -0500 Subject: [PATCH 257/494] feat(library): add a virtual tile grid that recycles its nodes Tiles are a fixed pool positioned by transform inside a sized spacer, rebound in place on scroll or new results, with thumbnails requested only once an IntersectionObserver sees the tile and a fade on the image alone. Arrow keys, Page keys, Home, End, Enter and the menu key work on the focused grid. Ran npx tsc --noEmit. --- frontend/src/ui/library/grid.ts | 323 ++++++++++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 frontend/src/ui/library/grid.ts diff --git a/frontend/src/ui/library/grid.ts b/frontend/src/ui/library/grid.ts new file mode 100644 index 00000000..40df66cd --- /dev/null +++ b/frontend/src/ui/library/grid.ts @@ -0,0 +1,323 @@ +import { el, setAttr, setClass, setStyleVar, setText, setTitle } from '../../shell/dom'; +import { frameLater } from '../context'; +import type { Preset } from './data'; +import { ThumbLoader } from './thumbs'; + +const GAP = 8; +const PAD = 12; +const NAME_H = 22; +const OVERSCAN_ROWS = 2; +const STAR = ''; + +export interface GridHooks { + thumb(item: Preset, px: number): string | null; + badge(item: Preset): string; + activate(item: Preset): void; + menu(item: Preset, x: number, y: number, keyboard: boolean): void; + press(item: Preset, e: PointerEvent): void; + activeChanged(item: Preset | null): void; + scrolled(top: number): void; +} + +interface Tile { + node: HTMLElement; + img: HTMLImageElement; + badge: HTMLElement; + name: HTMLElement; + index: number; + id: string; + url: string | null; + pending: (() => void) | null; + visible: boolean; + x: number; + y: number; +} + +let serial = 0; + +export class VirtualGrid { + readonly root: HTMLElement; + private readonly space: HTMLElement; + private readonly tiles: Tile[] = []; + private readonly byNode = new WeakMap(); + private readonly loader = new ThumbLoader(); + private readonly io: IntersectionObserver; + private readonly uid = ++serial; + private items: readonly Preset[] = []; + private tileW = 96; + private cols = 1; + private rowH = 96 + NAME_H + GAP; + private left = PAD; + private width = 0; + private height = 0; + private activeIndex = -1; + private readonly schedule: () => void; + + constructor(private readonly hooks: GridHooks, label: string) { + this.root = el(`
      `); + this.space = this.root.firstElementChild as HTMLElement; + this.schedule = frameLater(() => this.render()); + this.io = new IntersectionObserver((entries) => { + for (const e of entries) { + const tile = this.byNode.get(e.target); + if (!tile) continue; + tile.visible = e.isIntersecting; + if (tile.visible) this.load(tile); + else this.cancel(tile); + } + }, { root: this.root, rootMargin: '48px 0px' }); + this.root.addEventListener('scroll', () => { this.schedule(); this.hooks.scrolled(this.root.scrollTop); }, { passive: true }); + new ResizeObserver(() => this.layout()).observe(this.root); + this.root.addEventListener('keydown', (e) => this.key(e)); + this.root.addEventListener('pointerdown', (e) => { + const tile = this.tileAt(e.target); + if (!tile) return; + this.setActive(tile.index, false); + this.root.focus({ preventScroll: true }); + if (e.button === 0) this.hooks.press(this.items[tile.index], e); + }); + this.root.addEventListener('dblclick', (e) => { + const tile = this.tileAt(e.target); + if (tile) this.hooks.activate(this.items[tile.index]); + }); + this.root.addEventListener('contextmenu', (e) => { + const tile = this.tileAt(e.target); + if (!tile) return; + e.preventDefault(); + this.setActive(tile.index, false); + this.hooks.menu(this.items[tile.index], e.clientX, e.clientY, false); + }); + } + + get active(): Preset | null { return this.items[this.activeIndex] ?? null; } + get count(): number { return this.items.length; } + + setTileSize(px: number): void { + if (px === this.tileW) return; + const anchor = this.firstVisible(); + this.tileW = px; + this.layout(true); + if (anchor >= 0) this.root.scrollTop = Math.floor(anchor / this.cols) * this.rowH; + this.render(true); + } + + setItems(items: readonly Preset[], activeId = ''): void { + const prev = this.active?.id ?? ''; + this.items = items; + const want = activeId || prev; + const i = want ? items.findIndex((p) => p.id === want) : -1; + this.activeIndex = i; + this.layout(true); + this.render(true); + this.hooks.activeChanged(this.active); + } + + refreshItem(id: string): void { + for (const tile of this.tiles) if (tile.id === id && tile.index >= 0) this.paint(tile, true); + } + + scrollTo(top: number): void { this.root.scrollTop = top; this.render(); } + + focus(): void { this.root.focus({ preventScroll: true }); } + + rectOf(id: string): DOMRect | null { + const tile = this.tiles.find((x) => x.id === id && x.index >= 0 && !x.node.hidden); + return tile ? tile.node.getBoundingClientRect() : null; + } + + private firstVisible(): number { + return Math.floor(this.root.scrollTop / this.rowH) * this.cols; + } + + private layout(force = false): void { + const w = this.root.clientWidth; + const h = this.root.clientHeight; + if (!force && w === this.width && h === this.height) return; + this.width = w; + this.height = h; + const inner = Math.max(this.tileW, w - PAD * 2); + this.cols = Math.max(1, Math.floor((inner + GAP) / (this.tileW + GAP))); + this.rowH = this.tileW + NAME_H + GAP; + const used = this.cols * this.tileW + (this.cols - 1) * GAP; + this.left = Math.max(PAD, Math.floor((w - used) / 2)); + const rows = Math.ceil(this.items.length / this.cols); + setStyleVar(this.root, '--fsh-lib-tile', `${this.tileW}px`); + setStyleVar(this.space, '--fsh-lib-space-h', `${rows ? rows * this.rowH - GAP + PAD * 2 : 0}px`); + this.render(true); + } + + private poolSize(): number { + const rows = Math.ceil(this.height / this.rowH) + 1 + OVERSCAN_ROWS * 2; + return rows * this.cols; + } + + private ensurePool(n: number): void { + while (this.tiles.length < n) { + const node = el(``); + const tile: Tile = { + node, + img: node.querySelector('img') as HTMLImageElement, + badge: node.querySelector('.fsh-lib-badge') as HTMLElement, + name: node.querySelector('.fsh-lib-name') as HTMLElement, + index: -1, id: '', url: null, pending: null, visible: false, x: -1, y: -1, + }; + tile.img.addEventListener('load', () => { if (tile.img.getAttribute('src')) setClass(tile.img, 'is-loaded', true); }); + this.byNode.set(node, tile); + this.tiles.push(tile); + this.space.appendChild(node); + this.io.observe(node); + } + } + + private render(rebind = false): void { + const n = this.items.length; + const first = Math.max(0, Math.floor((this.root.scrollTop - PAD) / this.rowH) - OVERSCAN_ROWS) * this.cols; + const pool = this.poolSize(); + this.ensurePool(pool); + const size = this.tiles.length; + const last = Math.min(n, first + Math.min(pool, size)); + const used = new Set(); + for (let i = first; i < last; i++) { + const tile = this.tiles[i % size]; + used.add(tile); + const changed = tile.index !== i || tile.id !== this.items[i].id; + tile.index = i; + this.place(tile, i); + if (changed || rebind) this.paint(tile, changed); + if (tile.node.hidden) tile.node.hidden = false; + } + for (const tile of this.tiles) { + if (used.has(tile)) continue; + if (!tile.node.hidden) tile.node.hidden = true; + tile.index = -1; + this.cancel(tile); + } + const act = this.tiles.find((x) => x.index === this.activeIndex && this.activeIndex >= 0); + setAttr(this.root, 'aria-activedescendant', act ? act.node.id : null); + } + + private place(tile: Tile, i: number): void { + const x = this.left + (i % this.cols) * (this.tileW + GAP); + const y = PAD + Math.floor(i / this.cols) * this.rowH; + if (x === tile.x && y === tile.y) return; + tile.x = x; + tile.y = y; + tile.node.style.transform = `translate3d(${x}px, ${y}px, 0)`; + } + + private paint(tile: Tile, changed: boolean): void { + const item = this.items[tile.index]; + tile.id = item.id; + setText(tile.name, item.name); + setTitle(tile.node, item.name); + setText(tile.badge, this.hooks.badge(item)); + setClass(tile.node, 'is-favorite', item.favorite); + setClass(tile.node, 'is-user', item.user); + setAttr(tile.node, 'aria-selected', tile.index === this.activeIndex ? 'true' : 'false'); + setAttr(tile.node, 'aria-posinset', String(tile.index + 1)); + setAttr(tile.node, 'aria-setsize', String(this.items.length)); + setAttr(tile.node, 'aria-label', item.name); + const px = Math.round(this.tileW * Math.min(window.devicePixelRatio || 1, 2)); + const url = this.hooks.thumb(item, px); + if (url === tile.url && (!changed || tile.img.getAttribute('src') === url || tile.pending)) return; + this.cancel(tile); + tile.url = url; + if (url && this.loader.isLoaded(url)) { + setClass(tile.img, 'is-instant', true); + tile.img.src = url; + setClass(tile.img, 'is-loaded', true); + return; + } + setClass(tile.img, 'is-loaded', false); + setClass(tile.img, 'is-instant', false); + if (tile.img.hasAttribute('src')) tile.img.removeAttribute('src'); + if (url && tile.visible) this.load(tile); + } + + private load(tile: Tile): void { + const url = tile.url; + if (!url || tile.pending || tile.img.getAttribute('src') === url) return; + tile.pending = this.loader.request(url, (ok) => { + tile.pending = null; + if (!ok || tile.url !== url) return; + setClass(tile.img, 'is-instant', false); + tile.img.src = url; + }); + } + + private cancel(tile: Tile): void { + if (!tile.pending) return; + const stop = tile.pending; + tile.pending = null; + stop(); + } + + private tileAt(target: EventTarget | null): Tile | null { + const node = target instanceof Element ? target.closest('.fsh-lib-tile') : null; + const tile = node ? this.byNode.get(node) : undefined; + return tile && tile.index >= 0 && tile.index < this.items.length ? tile : null; + } + + setActive(index: number, reveal = true): void { + const next = this.items.length ? Math.max(0, Math.min(this.items.length - 1, index)) : -1; + if (next === this.activeIndex) { if (reveal) this.reveal(next); return; } + this.activeIndex = next; + for (const tile of this.tiles) if (tile.index >= 0) setAttr(tile.node, 'aria-selected', tile.index === next ? 'true' : 'false'); + if (reveal) this.reveal(next); + this.render(); + this.hooks.activeChanged(this.active); + } + + private reveal(i: number): void { + if (i < 0) return; + const top = PAD + Math.floor(i / this.cols) * this.rowH; + const bottom = top + this.rowH - GAP; + const st = this.root.scrollTop, vh = this.root.clientHeight; + if (top < st + PAD) this.root.scrollTop = Math.max(0, top - PAD); + else if (bottom > st + vh - PAD) this.root.scrollTop = bottom - vh + PAD; + } + + private key(e: KeyboardEvent): void { + if (e.target !== this.root || !this.items.length) return; + const i = this.activeIndex < 0 ? 0 : this.activeIndex; + const page = Math.max(1, Math.floor(this.root.clientHeight / this.rowH)) * this.cols; + let next: number | null = null; + switch (e.key) { + case 'ArrowRight': next = this.activeIndex < 0 ? 0 : Math.min(i + 1, this.items.length - 1); break; + case 'ArrowLeft': next = Math.max(0, i - 1); break; + case 'ArrowDown': next = this.activeIndex < 0 ? 0 : i + this.cols < this.items.length ? i + this.cols : i; break; + case 'ArrowUp': next = i - this.cols >= 0 ? i - this.cols : i; break; + case 'PageDown': next = i + page; break; + case 'PageUp': next = i - page; break; + case 'Home': next = 0; break; + case 'End': next = this.items.length - 1; break; + case 'Enter': { + const item = this.active; + if (item) this.hooks.activate(item); + break; + } + case 'ContextMenu': { + const item = this.active; + if (item) this.keyboardMenu(item); + break; + } + case 'F10': + if (!e.shiftKey) return; + if (this.active) this.keyboardMenu(this.active); + break; + default: return; + } + e.preventDefault(); + e.stopPropagation(); + if (next !== null) this.setActive(next); + } + + private keyboardMenu(item: Preset): void { + this.reveal(this.activeIndex); + this.render(); + const r = this.rectOf(item.id); + this.hooks.menu(item, r ? r.left + r.width / 2 : 0, r ? r.top + r.height / 2 : 0, true); + } +} From 814ce89c20198b1c8e5faf2fc1bfa8217fd89790 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:41 -0500 Subject: [PATCH 258/494] feat(library): send the preset hash with thumbnail requests lib-engine's thumbnail route serves a cached file as immutable when the preset's sha256 comes along, so the URL carries it whenever the list reply has one. Ran npx tsc --noEmit. --- frontend/src/ui/library/data.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/ui/library/data.ts b/frontend/src/ui/library/data.ts index 20575273..ab4bf446 100644 --- a/frontend/src/ui/library/data.ts +++ b/frontend/src/ui/library/data.ts @@ -158,9 +158,10 @@ export function projectMaterials(summary: SceneSummary | null): Preset[] { }).filter((p) => p.material !== ''); } -export function thumbUrl(id: string, size: number): string { - const path = id.split('/').map(encodeURIComponent).join('/'); - return api.url(`/api/library/thumbnail/${path}?size=${size}`); +export function thumbUrl(preset: Pick, size: number): string { + const path = preset.id.split('/').map(encodeURIComponent).join('/'); + const h = preset.hash ? `&h=${encodeURIComponent(preset.hash)}` : ''; + return api.url(`/api/library/thumbnail/${path}?size=${size}${h}`); } export function partMaterial(summary: SceneSummary | null, node: string): string | null { From fc71d5660ae1f4c6a6a331120c57715be243ef04 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:41 -0500 Subject: [PATCH 259/494] feat(library): add the preset details popover A glass popover in the overlay root, built once and patched, shows the preset's swatch, category and type, its main surface values, tags and the source citation with notes, from library.get. Ran npx tsc --noEmit. --- frontend/src/ui/library/details.ts | 159 +++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 frontend/src/ui/library/details.ts diff --git a/frontend/src/ui/library/details.ts b/frontend/src/ui/library/details.ts new file mode 100644 index 00000000..095c454d --- /dev/null +++ b/frontend/src/ui/library/details.ts @@ -0,0 +1,159 @@ +import { el, escapeHtml, patchList, q, setAttr, setHidden, setStyleVar, setText } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import { TYPE_LABEL, parseDetail, type Preset, type PresetDetail } from './data'; + +const WIDTH = 300; +const MARGIN = 8; + +type Format = (v: unknown) => string | null; + +const num = (digits: number, unit = ''): Format => (v) => typeof v === 'number' && Number.isFinite(v) ? `${v.toFixed(digits)}${unit}` : null; +const flag: Format = (v) => typeof v === 'boolean' ? (v ? t('Yes') : t('No')) : null; + +const VALUES: ReadonlyArray = [ + ['base_metalness', 'Metalness', num(2)], + ['specular_roughness', 'Roughness', num(2)], + ['specular_ior', 'Index of refraction', num(3)], + ['specular_roughness_anisotropy', 'Anisotropy', num(2)], + ['transmission_weight', 'Transmission', num(2)], + ['transmission_depth', 'Transmission depth', num(3, ' m')], + ['transmission_dispersion_abbe_number', 'Abbe number', num(1)], + ['subsurface_weight', 'Subsurface', num(2)], + ['coat_weight', 'Coat', num(2)], + ['coat_roughness', 'Coat roughness', num(2)], + ['fuzz_weight', 'Fuzz', num(2)], + ['thin_film_thickness', 'Thin film thickness', num(3, ' µm')], + ['emission_luminance', 'Emission', num(0, ' cd/m²')], + ['geometry_opacity', 'Opacity', num(2)], + ['geometry_thin_walled', 'Thin walled', flag], +]; + +const SOURCE_KIND: Readonly> = { measured: 'Measured', published: 'Published', authored: 'Authored' }; + +export function displayColor(acescg: unknown): string | null { + if (!Array.isArray(acescg) || acescg.length < 3) return null; + const c = acescg.slice(0, 3).map(Number); + if (!c.every(Number.isFinite)) return null; + const m = [[1.70505, -0.62179, -0.08326], [-0.13026, 1.1408, -0.01055], [-0.024, -0.12897, 1.15297]]; + const enc = (x: number): number => { + const v = Math.max(0, Math.min(1, x)); + return Math.round((v <= 0.0031308 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055) * 255); + }; + const rgb = m.map((r) => enc(r[0] * c[0] + r[1] * c[1] + r[2] * c[2])); + return `#${rgb.map((v) => v.toString(16).padStart(2, '0')).join('')}`; +} + +interface Row { key: string; label: string; value: string } + +export class DetailsPopover { + private readonly root: HTMLElement; + private readonly swatch: HTMLElement; + private readonly name: HTMLElement; + private readonly meta: HTMLElement; + private readonly values: HTMLElement; + private readonly tags: HTMLElement; + private readonly kind: HTMLElement; + private readonly reference: HTMLElement; + private readonly notes: HTMLElement; + private readonly status: HTMLElement; + private seq = 0; + private before: Element | null = null; + + constructor(overlayRoot: HTMLElement) { + this.root = el(``); + overlayRoot.appendChild(this.root); + this.swatch = q(this.root, '.fsh-lib-pop-swatch'); + this.name = q(this.root, '.fsh-lib-pop-name'); + this.meta = q(this.root, '.fsh-lib-pop-meta'); + this.values = q(this.root, '.fsh-lib-pop-values'); + this.tags = q(this.root, '.fsh-lib-pop-tags'); + this.kind = q(this.root, '.fsh-lib-pop-kind'); + this.reference = q(this.root, '.fsh-lib-pop-ref'); + this.notes = q(this.root, '.fsh-lib-pop-notes'); + this.status = q(this.root, '.fsh-lib-pop-status'); + q(this.root, '.fsh-lib-pop-x').addEventListener('click', () => this.close()); + this.root.addEventListener('keydown', (e) => { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); this.close(); } }); + document.addEventListener('pointerdown', (e) => { if (!this.root.hidden && !this.root.contains(e.target as Node)) this.close(); }, true); + window.addEventListener('blur', () => this.close()); + } + + open(preset: Preset, anchor: DOMRect | null, detail: Promise): void { + const seq = ++this.seq; + this.before = document.activeElement; + setText(this.name, preset.name); + setText(this.meta, `${t(preset.category)} · ${t(TYPE_LABEL[preset.type] ?? preset.type)}`); + setStyleVar(this.swatch, '--fsh-lib-swatch', 'transparent'); + setText(this.status, t('Loading')); + setHidden(this.status, false); + this.fill(null); + this.place(anchor); + setHidden(this.root, false); + this.root.focus({ preventScroll: true }); + detail.then((raw) => { + if (seq !== this.seq) return; + const d = parseDetail(raw); + if (!d) throw new Error(t('The engine sent the preset in an unknown shape')); + setHidden(this.status, true); + this.fill(d); + }).catch((err: unknown) => { + if (seq !== this.seq) return; + setText(this.status, err instanceof Error ? err.message : String(err)); + }); + } + + close(): void { + if (this.root.hidden) return; + this.seq++; + setHidden(this.root, true); + if (this.before instanceof HTMLElement && document.contains(this.before)) this.before.focus({ preventScroll: true }); + } + + private place(anchor: DOMRect | null): void { + const vw = window.innerWidth, vh = window.innerHeight; + let x = anchor ? anchor.right + MARGIN : (vw - WIDTH) / 2; + if (x + WIDTH > vw - MARGIN) x = Math.max(MARGIN, (anchor ? anchor.left - WIDTH - MARGIN : vw - WIDTH - MARGIN)); + const y = Math.max(MARGIN, Math.min(anchor ? anchor.top : vh / 4, vh - 360)); + setStyleVar(this.root, '--fsh-lib-pop-x', `${Math.round(x)}px`); + setStyleVar(this.root, '--fsh-lib-pop-y', `${Math.round(y)}px`); + } + + private fill(d: PresetDetail | null): void { + const color = d ? displayColor(d.params.base_color ?? d.params.transmission_color ?? d.params.emission_color) : null; + setStyleVar(this.swatch, '--fsh-lib-swatch', color ?? 'transparent'); + const rows: Row[] = []; + if (d && color) rows.push({ key: 'base_color', label: t('Base color'), value: color.toUpperCase() }); + for (const [key, label, format] of VALUES) { + const value = d ? format(d.params[key]) : null; + if (value !== null) rows.push({ key, label: t(label), value }); + } + patchList(this.values, rows, { + key: (r) => r.key, + create: (r) => { const n = el(`
      `); this.row(n, r); return n; }, + update: (n, r) => this.row(n, r), + }); + patchList(this.tags, d?.tags ?? [], { + key: (s) => s, + create: (s) => { const n = el(''); n.textContent = s; return n; }, + update: () => undefined, + }); + setHidden(this.tags, !d?.tags.length); + const kind = d ? SOURCE_KIND[d.sourceKind] : undefined; + setText(this.kind, kind ? t(kind) : d?.sourceKind ?? ''); + setText(this.reference, d?.reference ?? ''); + setText(this.notes, d?.notes ?? ''); + setAttr(this.reference, 'title', d?.urls.join('\n') || null); + setHidden(q(this.root, '.fsh-lib-pop-source'), !d || (!d.reference && !d.sourceKind)); + } + + private row(n: HTMLElement, r: Row): void { + setText(q(n, 'dt'), r.label); + setText(q(n, 'dd'), r.value); + } +} From 51e6d77a2b45626373b59e4ad8c9caf9a77de0c8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:41 -0500 Subject: [PATCH 260/494] feat(library): add apply, favorite and remove actions with a tile menu Commands for applying a preset to the selected parts, their groups or every part with the same material, toggling a favorite, opening details and removing a user preset, gathered in the context.library.tile menu. Ran npx tsc --noEmit. --- frontend/src/ui/library/actions.ts | 143 +++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 frontend/src/ui/library/actions.ts diff --git a/frontend/src/ui/library/actions.ts b/frontend/src/ui/library/actions.ts new file mode 100644 index 00000000..76e4d0e7 --- /dev/null +++ b/frontend/src/ui/library/actions.ts @@ -0,0 +1,143 @@ +import { registerCommands, registerMenu, runCommand, refreshState } from '../../shell/registry'; +import { toast } from '../../shell/toast'; +import { confirmDialog } from '../../shell/dialog'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import { APPLY, ASSIGN, FAVORITE, GET, REMOVE, applyPreset, selectedParts, type Preset, type Scope } from './data'; +import { DetailsPopover } from './details'; + +export const TILE_MENU = 'context.library.tile'; + +export interface PanelLink { + find(id: string): Preset | undefined; + active(): Preset | null; + reload(): void; + repaint(id: string): void; + rectOf(id: string): DOMRect | null; + shelf(): string; +} + +export interface LibraryActions { + apply(preset: Preset, scope: Scope, nodes?: readonly string[]): Promise; + menu(preset: Preset, x: number, y: number): void; + favorite(preset: Preset, on: boolean): Promise; + details(preset: Preset): void; + remove(preset: Preset): Promise; +} + +const SCOPE_DONE: Record = { + part: 'Applied {name} to the selected parts', + group: 'Applied {name} to their groups', + same_material: 'Applied {name} to every part with the same material', +}; + +export function libraryActions(ws: Workspace, panel: PanelLink): LibraryActions { + let target: Preset | null = null; + const details = new DetailsPopover(ws.ctx.slots.overlayRoot); + + const fromArgs = (args?: Record): Preset | null => { + const id = typeof args?.id === 'string' ? args.id : ''; + return (id ? panel.find(id) : undefined) ?? target ?? panel.active(); + }; + const canApply = (p: Preset | null): boolean => { + if (!p) return false; + if (!selectedParts(ws.client.summary).length) return false; + return ws.canRun(p.material !== null ? ASSIGN : APPLY); + }; + + const actions: LibraryActions = { + async apply(preset, scope, nodes) { + const picked = nodes ?? selectedParts(ws.client.summary); + try { + const out = await applyPreset(ws, preset, picked, scope); + if (!out.ok) { toast(out.message, 'error'); return false; } + } catch (err) { + toast(err instanceof Error ? err.message : String(err), 'error'); + return false; + } + ws.client.message(t(SCOPE_DONE[scope], { name: preset.name })); + if (panel.shelf() === 'recent') panel.reload(); + return true; + }, + menu(preset, x, y) { + target = preset; + refreshState(); + runCommand('menu.context', { id: TILE_MENU, x, y, args: { id: preset.id } }); + }, + async favorite(preset, on) { + if (!ws.canRun(FAVORITE)) { toast(ws.why(FAVORITE), 'error'); return; } + try { + await ws.client.dispatch(FAVORITE, { id: preset.id, on }); + } catch (err) { + toast(err instanceof Error ? err.message : String(err), 'error'); + return; + } + preset.favorite = on; + panel.repaint(preset.id); + if (panel.shelf() === 'favorites') panel.reload(); + }, + details(preset) { + const rect = panel.rectOf(preset.id); + details.open(preset, rect, ws.canRun(GET) ? ws.client.dispatch(GET, { id: preset.id }) : Promise.reject(new Error(ws.why(GET)))); + }, + async remove(preset) { + if (!preset.user) return; + if (!ws.canRun(REMOVE)) { toast(ws.why(REMOVE), 'error'); return; } + const sure = await confirmDialog('Remove from Library', t('Remove {name} from your library? Documents that use it keep their material.', { name: preset.name }), { ok: 'Remove', danger: true }); + if (!sure) return; + try { + await ws.client.dispatch(REMOVE, { id: preset.id }); + } catch (err) { + toast(err instanceof Error ? err.message : String(err), 'error'); + return; + } + panel.reload(); + }, + }; + + registerCommands([ + { + id: 'preset.apply', label: 'Apply to Selected Parts', group: 'Library', palette: false, + enabled: () => canApply(fromArgs()), + run: (args) => { const p = fromArgs(args); if (p) void actions.apply(p, 'part'); }, + }, + { + id: 'preset.applyGroup', label: 'Apply to Their Groups', group: 'Library', palette: false, + enabled: () => canApply(fromArgs()), + run: (args) => { const p = fromArgs(args); if (p) void actions.apply(p, 'group'); }, + }, + { + id: 'preset.applySameMaterial', label: 'Apply to Every Part with the Same Material', group: 'Library', palette: false, + enabled: () => canApply(fromArgs()), + run: (args) => { const p = fromArgs(args); if (p) void actions.apply(p, 'same_material'); }, + }, + { + id: 'preset.favorite', label: 'Favorite', group: 'Library', palette: false, + enabled: () => { const p = fromArgs(); return !!p && p.material === null && ws.canRun(FAVORITE); }, + checked: () => fromArgs()?.favorite === true, + run: (args) => { const p = fromArgs(args); if (p) void actions.favorite(p, !p.favorite); }, + }, + { + id: 'preset.details', label: 'Details', group: 'Library', palette: false, + enabled: () => { const p = fromArgs(); return !!p && p.material === null; }, + run: (args) => { const p = fromArgs(args); if (p) actions.details(p); }, + }, + { + id: 'preset.remove', label: 'Remove from Library', group: 'Library', palette: false, + enabled: () => { const p = fromArgs(); return !!p && p.user && ws.canRun(REMOVE); }, + run: (args) => { const p = fromArgs(args); if (p) void actions.remove(p); }, + }, + ]); + registerMenu({ + id: TILE_MENU, + items: [ + { command: 'preset.apply', section: 0 }, + { command: 'preset.applyGroup', section: 0 }, + { command: 'preset.applySameMaterial', section: 0 }, + { command: 'preset.favorite', section: 1 }, + { command: 'preset.details', section: 1 }, + { command: 'preset.remove', section: 2 }, + ], + }); + return actions; +} From 33eb3ad699cfde88212fcbeb741dac484efe69d5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:46 -0500 Subject: [PATCH 261/494] feat(library): add a viewport drop target for presets Finds the part under a point with the raster id buffer, or view.pick when there is no raster scene, and outlines the parts a drop would change through the raster renderer's selection outline, restoring the real selection afterwards. Ran npx tsc --noEmit. --- frontend/src/ui/library/drop.ts | 123 ++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 frontend/src/ui/library/drop.ts diff --git a/frontend/src/ui/library/drop.ts b/frontend/src/ui/library/drop.ts new file mode 100644 index 00000000..4f878cb9 --- /dev/null +++ b/frontend/src/ui/library/drop.ts @@ -0,0 +1,123 @@ +import type { Workspace } from '../context'; +import type { RasterView } from '../raster-view'; +import { descendants, scopeNodes, type Scope } from './data'; + +const PICK = 'view.pick'; + +export interface DropHit { + inside: boolean; + node: string | null; + name: string; +} + +export interface DropTarget { + over(clientX: number, clientY: number, scope: Scope): DropHit; + settle(clientX: number, clientY: number): Promise; + clear(): void; +} + +export interface ViewportDropHost { + frame(): DOMRect; + size(): { width: number; height: number }; + raster(): RasterView | null; + dpr(): number; +} + +let current: DropTarget | null = null; + +export function dropTarget(): DropTarget | null { return current; } + +export function attachPresetDrop(ws: Workspace, host: ViewportDropHost): void { + let lastKey = ''; + let lit = false; + let asyncHit: { x: number; y: number; node: string | null } | null = null; + let asking = false; + let want: { x: number; y: number } | null = null; + + const local = (cx: number, cy: number): { x: number; y: number; inside: boolean } => { + const r = host.frame(); + const s = host.size(); + const x = cx - r.left, y = cy - r.top; + return { x, y, inside: x >= 0 && y >= 0 && x <= s.width && y <= s.height && s.width > 0 }; + }; + const nameOf = (node: string | null): string => { + if (node === null) return ''; + return ws.client.summary?.nodes.find((n) => String(n.id) === node)?.name ?? node; + }; + const partOf = (node: string | null): string | null => { + if (node === null) return null; + const n = ws.client.summary?.nodes.find((x) => String(x.id) === node); + return n && n.kind !== 'part' && n.kind !== 'group' ? null : node; + }; + const rasterPick = (x: number, y: number): string | null | undefined => { + const r = host.raster(); + if (!r || !r.usable) return undefined; + const k = host.dpr(); + return r.renderer.pick(x * k, y * k); + }; + const ask = (): void => { + if (asking || !want || !ws.canRun(PICK)) return; + const at = want; + want = null; + asking = true; + const s = host.size(); + ws.client.dispatch>(PICK, { x: at.x, y: at.y, width: s.width, height: s.height }).then((reply) => { + const n = reply && typeof reply === 'object' ? reply.node : null; + asyncHit = { x: at.x, y: at.y, node: typeof n === 'string' || typeof n === 'number' ? String(n) : null }; + }, () => { asyncHit = { x: at.x, y: at.y, node: null }; }).finally(() => { asking = false; ask(); }); + }; + const highlight = (node: string | null, scope: Scope): void => { + const r = host.raster(); + if (!r) return; + const key = node === null ? '' : `${node}|${scope}`; + if (key === lastKey) return; + lastKey = key; + if (node === null) { + if (lit) { lit = false; r.select(); } + return; + } + const summary = ws.client.summary; + const set = descendants(summary, scopeNodes(summary, [node], scope)); + lit = true; + r.renderer.setSelected(set); + }; + + const pickAt = (x: number, y: number): string | null => { + const fast = rasterPick(x, y); + if (fast !== undefined) return partOf(fast); + want = { x, y }; + ask(); + return asyncHit ? partOf(asyncHit.node) : null; + }; + + current = { + over(cx, cy, scope) { + const p = local(cx, cy); + if (!p.inside) { highlight(null, scope); return { inside: false, node: null, name: '' }; } + const node = pickAt(p.x, p.y); + highlight(node, scope); + return { inside: true, node, name: nameOf(node) }; + }, + async settle(cx, cy) { + const p = local(cx, cy); + if (!p.inside) return { inside: false, node: null, name: '' }; + const fast = rasterPick(p.x, p.y); + if (fast !== undefined) return { inside: true, node: partOf(fast), name: nameOf(partOf(fast)) }; + if (!ws.canRun(PICK)) return { inside: true, node: null, name: '' }; + try { + const s = host.size(); + const reply = await ws.client.dispatch>(PICK, { x: p.x, y: p.y, width: s.width, height: s.height }); + const n = reply && typeof reply === 'object' ? reply.node : null; + const node = partOf(typeof n === 'string' || typeof n === 'number' ? String(n) : null); + return { inside: true, node, name: nameOf(node) }; + } catch { + return { inside: true, node: null, name: '' }; + } + }, + clear() { + asyncHit = null; + want = null; + highlight(null, 'part'); + }, + }; +} From 802e157d5de04a7f66fec9bcb94c78a57df063b3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:46 -0500 Subject: [PATCH 262/494] feat(library): drag a preset tile with a hint near the pointer A pointer drag past five pixels shows a small glass hint in the overlay root naming the part under the pointer; Alt targets the group, Shift every part with the same material, Escape cancels and a drop on empty space only shows a toast. Ran npx tsc --noEmit. --- frontend/src/ui/library/drag.ts | 162 ++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 frontend/src/ui/library/drag.ts diff --git a/frontend/src/ui/library/drag.ts b/frontend/src/ui/library/drag.ts new file mode 100644 index 00000000..5e9ac579 --- /dev/null +++ b/frontend/src/ui/library/drag.ts @@ -0,0 +1,162 @@ +import { el, escapeHtml, q, setAttr, setClass, setHidden, setStyleVar, setText } from '../../shell/dom'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import type { Preset, Scope } from './data'; +import { dropTarget, type DropHit } from './drop'; + +const SLOP_PX = 5; + +function quietly(fn: () => void): void { + try { fn(); } catch { return; } +} + +export interface DragHooks { + thumb(preset: Preset): string | null; + drop(preset: Preset, node: string, scope: Scope): void; +} + +export class PresetDrag { + private readonly ghost: HTMLElement; + private readonly img: HTMLImageElement; + private readonly name: HTMLElement; + private readonly hint: HTMLElement; + private preset: Preset | null = null; + private pointer = -1; + private start = { x: 0, y: 0 }; + private last = { x: 0, y: 0 }; + private dragging = false; + private scope: Scope = 'part'; + private hit: DropHit = { inside: false, node: null, name: '' }; + private frame = 0; + + constructor(overlayRoot: HTMLElement, private readonly capture: HTMLElement, private readonly hooks: DragHooks) { + this.ghost = el(``); + overlayRoot.appendChild(this.ghost); + this.img = q(this.ghost, 'img'); + this.name = q(this.ghost, '.fsh-lib-ghost-name'); + this.hint = q(this.ghost, '.fsh-lib-ghost-hint'); + window.addEventListener('pointermove', (e) => this.move(e), true); + window.addEventListener('pointerup', (e) => this.up(e), true); + window.addEventListener('pointercancel', (e) => { if (e.pointerId === this.pointer) this.cancel(); }, true); + window.addEventListener('keydown', (e) => this.key(e), true); + window.addEventListener('keyup', (e) => this.key(e), true); + window.addEventListener('blur', () => this.cancel()); + } + + get active(): boolean { return this.dragging; } + + press(preset: Preset, e: PointerEvent): void { + if (e.pointerType === 'touch' || this.pointer !== -1) return; + this.preset = preset; + this.pointer = e.pointerId; + this.start = { x: e.clientX, y: e.clientY }; + this.last = this.start; + } + + private scopeOf(e: { altKey: boolean; shiftKey: boolean }): Scope { + if (e.altKey) return 'group'; + if (e.shiftKey) return 'same_material'; + return 'part'; + } + + private move(e: PointerEvent): void { + if (e.pointerId !== this.pointer || !this.preset) return; + this.last = { x: e.clientX, y: e.clientY }; + if (!this.dragging) { + if (Math.hypot(e.clientX - this.start.x, e.clientY - this.start.y) < SLOP_PX) return; + this.begin(); + } + e.preventDefault(); + this.scope = this.scopeOf(e); + this.schedule(); + } + + private begin(): void { + const p = this.preset as Preset; + this.dragging = true; + quietly(() => this.capture.setPointerCapture(this.pointer)); + setClass(this.capture, 'is-dragging', true); + setText(this.name, p.name); + const url = this.hooks.thumb(p); + if (url) { if (this.img.getAttribute('src') !== url) this.img.src = url; } else this.img.removeAttribute('src'); + this.hit = { inside: false, node: null, name: '' }; + this.paint(); + setHidden(this.ghost, false); + } + + private schedule(): void { + if (this.frame) return; + this.frame = requestAnimationFrame(() => { + this.frame = 0; + if (!this.dragging) return; + const target = dropTarget(); + this.hit = target ? target.over(this.last.x, this.last.y, this.scope) : { inside: false, node: null, name: '' }; + this.paint(); + }); + } + + private paint(): void { + setStyleVar(this.ghost, '--fsh-lib-ghost-x', `${Math.round(this.last.x + 14)}px`); + setStyleVar(this.ghost, '--fsh-lib-ghost-y', `${Math.round(this.last.y + 14)}px`); + let hint: string; + if (!this.hit.inside) hint = t('Drop on a part in the viewport'); + else if (this.hit.node === null) hint = t('No part here'); + else if (this.scope === 'group') hint = t('Apply to the group of {name}', { name: this.hit.name }); + else if (this.scope === 'same_material') hint = t('Apply to every part with the material of {name}', { name: this.hit.name }); + else hint = t('Apply to {name}', { name: this.hit.name }); + setText(this.hint, hint); + setAttr(this.ghost, 'data-state', !this.hit.inside ? 'out' : this.hit.node === null ? 'empty' : 'part'); + } + + private key(e: KeyboardEvent): void { + if (!this.dragging) return; + if (e.type === 'keydown' && e.key === 'Escape') { + e.preventDefault(); + e.stopPropagation(); + this.cancel(); + return; + } + if (e.key !== 'Alt' && e.key !== 'Shift') return; + e.preventDefault(); + const next = this.scopeOf(e); + if (next !== this.scope) { this.scope = next; this.schedule(); } + } + + private up(e: PointerEvent): void { + if (e.pointerId !== this.pointer) return; + const preset = this.preset; + const was = this.dragging; + const scope = this.scopeOf(e); + this.reset(); + if (!was || !preset) return; + e.preventDefault(); + const target = dropTarget(); + if (!target) return; + void target.settle(e.clientX, e.clientY).then((hit) => { + target.clear(); + if (!hit.inside) return; + if (hit.node === null) { toast('Drop the material on a part', 'info'); return; } + this.hooks.drop(preset, hit.node, scope); + }); + } + + private cancel(): void { + if (this.pointer === -1) return; + const was = this.dragging; + this.reset(); + if (was) dropTarget()?.clear(); + } + + private reset(): void { + if (this.dragging) { + quietly(() => this.capture.releasePointerCapture(this.pointer)); + } + if (this.frame) { cancelAnimationFrame(this.frame); this.frame = 0; } + this.dragging = false; + this.pointer = -1; + this.preset = null; + this.scope = 'part'; + setClass(this.capture, 'is-dragging', false); + setHidden(this.ghost, true); + } +} From 77f9de883ba419557c28b053f76c06356f2ebba9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:10:47 -0500 Subject: [PATCH 263/494] feat(library): add the save selected material sheet A small dialog for the name and category of the selected part's material, sent with library.save; the command is enabled only when the engine has library.save and a selected part wears a material. Ran npx tsc --noEmit. --- frontend/src/ui/library/save.ts | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 frontend/src/ui/library/save.ts diff --git a/frontend/src/ui/library/save.ts b/frontend/src/ui/library/save.ts new file mode 100644 index 00000000..69b6efe9 --- /dev/null +++ b/frontend/src/ui/library/save.ts @@ -0,0 +1,79 @@ +import { Dialog } from '../../shell/dialog'; +import { el, escapeHtml, q, setDisabled, setHidden, setText } from '../../shell/dom'; +import { registerCommand } from '../../shell/registry'; +import { toast } from '../../shell/toast'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import { CATEGORIES, SAVE, categoryOfType, partMaterial, selectedParts } from './data'; + +export const SAVE_COMMAND = 'preset.saveSelected'; + +interface Source { key: string; name: string; type: string } + +function selectedMaterial(ws: Workspace): Source | null { + const summary = ws.client.summary; + for (const id of selectedParts(summary)) { + const key = partMaterial(summary, id); + if (key === null) continue; + const m = summary?.materials.find((x) => String(x.key) === key); + return { key, name: typeof m?.name === 'string' ? m.name : key, type: typeof m?.type_id === 'string' ? m.type_id : '' }; + } + return null; +} + +export function registerSaveCommand(ws: Workspace, saved: () => void): void { + registerCommand({ + id: SAVE_COMMAND, + label: 'Save Selected Material to Library', + group: 'Library', + icon: 'plus', + description: 'Keeps the material of the selected part as one of your own presets.', + enabled: () => ws.canRun(SAVE) && selectedMaterial(ws) !== null, + run: () => { + const source = selectedMaterial(ws); + if (!source) { toast('Select a part with a material first', 'error'); return; } + openSaveSheet(ws, source, saved); + }, + }); +} + +function openSaveSheet(ws: Workspace, source: Source, saved: () => void): void { + const d = new Dialog('Save Material to Library'); + const options = CATEGORIES.map((c) => ``).join(''); + const form = el(`
      + + + +
      `); + d.body.appendChild(form); + const name = q(form, 'input[name="name"]'); + const category = q(form, 'select[name="category"]'); + const error = q(form, '.fsh-lib-save-error'); + name.value = source.name.slice(0, 48); + category.value = categoryOfType(source.type) || 'Plastic'; + let busy = false; + const submit = async (): Promise => { + if (busy) return; + const label = name.value.trim(); + if (!label) { setText(error, t('Give the material a name')); setHidden(error, false); name.focus(); return; } + busy = true; + setDisabled(ok, true); + try { + await ws.client.dispatch(SAVE, { material: source.key, name: label, category: category.value }); + } catch (err) { + busy = false; + setDisabled(ok, false); + setText(error, err instanceof Error ? err.message : String(err)); + setHidden(error, false); + return; + } + d.close(); + toast(t('Saved {name} to your library', { name: label })); + saved(); + }; + form.addEventListener('submit', (e) => { e.preventDefault(); void submit(); }); + d.action('Cancel', () => d.close()); + const ok = d.action('Save', submit, 'primary'); + d.open(); + name.select(); +} From 13634e62560eefd6c0c40372a2ac36b42a0063e2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:23:04 -0500 Subject: [PATCH 264/494] feat(i18n): add the library panel, menu, popover and sheet strings Every string the Library panel, its tile menu, the details popover, the drag hint and the save sheet show, in strings.json and every language file of the namespace. Regenerated the tables from strings.json and checked the order. --- frontend/src/i18n/modules/library/cs.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/da.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/de.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/es.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/fi.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/fr.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/hu.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/id.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/it.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/ja.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/ko.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/nb.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/nl.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/pl.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/pt-BR.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/ru.json | 55 +++++++++++++++++++ .../src/i18n/modules/library/strings.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/sv.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/th.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/tr.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/uk.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/vi.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/zh-CN.json | 55 +++++++++++++++++++ frontend/src/i18n/modules/library/zh-TW.json | 55 +++++++++++++++++++ 24 files changed, 1320 insertions(+) diff --git a/frontend/src/i18n/modules/library/cs.json b/frontend/src/i18n/modules/library/cs.json index da6f1b00..aad790ab 100644 --- a/frontend/src/i18n/modules/library/cs.json +++ b/frontend/src/i18n/modules/library/cs.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Vše", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Zrušit", "Categories": "Kategorie", + "Category": "Category", "Ceramic": "Keramika", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emise", "Fabric": "Látka", + "Favorite": "Favorite", "Favorites": "Oblíbené", + "Fuzz": "Fuzz", "Gem": "Drahokam", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Sklo", "In project": "V projektu", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Knihovna", "Liquid": "Kapalina", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Kov", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Lak", "Plastic": "Plast", + "Published": "Published", "Recent": "Nedávné", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Změnit velikost knihovny", + "Roughness": "Roughness", "Rubber": "Guma", + "Save": "Uložit", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Hledat materiály", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Police", + "Source": "Source", "Stone": "Kámen", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Dřevo", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/da.json b/frontend/src/i18n/modules/library/da.json index 45de3bb4..5f92a9ae 100644 --- a/frontend/src/i18n/modules/library/da.json +++ b/frontend/src/i18n/modules/library/da.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Alle", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Annuller", "Categories": "Kategorier", + "Category": "Category", "Ceramic": "Keramik", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissiv", "Fabric": "Stof", + "Favorite": "Favorite", "Favorites": "Favoritter", + "Fuzz": "Fuzz", "Gem": "Ædelsten", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Glas", "In project": "I projektet", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliotek", "Liquid": "Væske", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Maling", "Plastic": "Plastik", + "Published": "Published", "Recent": "Seneste", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Tilpas bibliotekets størrelse", + "Roughness": "Roughness", "Rubber": "Gummi", + "Save": "Gem", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Søg i materialer", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Hylder", + "Source": "Source", "Stone": "Sten", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Træ", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/de.json b/frontend/src/i18n/modules/library/de.json index 9daefedf..1f28f4dd 100644 --- a/frontend/src/i18n/modules/library/de.json +++ b/frontend/src/i18n/modules/library/de.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Alle", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Abbrechen", "Categories": "Kategorien", + "Category": "Category", "Ceramic": "Keramik", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissiv", "Fabric": "Stoff", + "Favorite": "Favorite", "Favorites": "Favoriten", + "Fuzz": "Fuzz", "Gem": "Edelstein", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Glas", "In project": "Im Projekt", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliothek", "Liquid": "Flüssigkeit", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metall", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Lack", "Plastic": "Kunststoff", + "Published": "Published", "Recent": "Zuletzt", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Größe der Bibliothek ändern", + "Roughness": "Roughness", "Rubber": "Gummi", + "Save": "Speichern", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Materialien durchsuchen", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Regale", + "Source": "Source", "Stone": "Stein", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Holz", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/es.json b/frontend/src/i18n/modules/library/es.json index afb3b50f..62c38441 100644 --- a/frontend/src/i18n/modules/library/es.json +++ b/frontend/src/i18n/modules/library/es.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Todo", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Cancelar", "Categories": "Categorías", + "Category": "Category", "Ceramic": "Cerámica", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emisivo", "Fabric": "Tela", + "Favorite": "Favorite", "Favorites": "Favoritos", + "Fuzz": "Fuzz", "Gem": "Gema", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Vidrio", "In project": "En el proyecto", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Biblioteca", "Liquid": "Líquido", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Pintura", "Plastic": "Plástico", + "Published": "Published", "Recent": "Recientes", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Cambiar el tamaño de la biblioteca", + "Roughness": "Roughness", "Rubber": "Goma", + "Save": "Guardar", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Buscar materiales", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Estantes", + "Source": "Source", "Stone": "Piedra", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Madera", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/fi.json b/frontend/src/i18n/modules/library/fi.json index 561afe8c..454ee8d7 100644 --- a/frontend/src/i18n/modules/library/fi.json +++ b/frontend/src/i18n/modules/library/fi.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Kaikki", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Peruuta", "Categories": "Luokat", + "Category": "Category", "Ceramic": "Keramiikka", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissiivinen", "Fabric": "Kangas", + "Favorite": "Favorite", "Favorites": "Suosikit", + "Fuzz": "Fuzz", "Gem": "Jalokivi", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Lasi", "In project": "Projektissa", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Kirjasto", "Liquid": "Neste", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metalli", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Maali", "Plastic": "Muovi", + "Published": "Published", "Recent": "Viimeisimmät", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Muuta kirjaston kokoa", + "Roughness": "Roughness", "Rubber": "Kumi", + "Save": "Tallenna", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Hae materiaaleja", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Hyllyt", + "Source": "Source", "Stone": "Kivi", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Puu", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/fr.json b/frontend/src/i18n/modules/library/fr.json index 07154b67..5f9920d3 100644 --- a/frontend/src/i18n/modules/library/fr.json +++ b/frontend/src/i18n/modules/library/fr.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Tout", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Annuler", "Categories": "Catégories", + "Category": "Category", "Ceramic": "Céramique", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Émissif", "Fabric": "Tissu", + "Favorite": "Favorite", "Favorites": "Favoris", + "Fuzz": "Fuzz", "Gem": "Gemme", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Verre", "In project": "Dans le projet", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliothèque", "Liquid": "Liquide", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Métal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Peinture", "Plastic": "Plastique", + "Published": "Published", "Recent": "Récents", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Redimensionner la bibliothèque", + "Roughness": "Roughness", "Rubber": "Caoutchouc", + "Save": "Enregistrer", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Rechercher des matériaux", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Étagères", + "Source": "Source", "Stone": "Pierre", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Bois", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/hu.json b/frontend/src/i18n/modules/library/hu.json index 9c7ca31f..e008ca3e 100644 --- a/frontend/src/i18n/modules/library/hu.json +++ b/frontend/src/i18n/modules/library/hu.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Mind", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Mégse", "Categories": "Kategóriák", + "Category": "Category", "Ceramic": "Kerámia", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissziós", "Fabric": "Szövet", + "Favorite": "Favorite", "Favorites": "Kedvencek", + "Fuzz": "Fuzz", "Gem": "Ékkő", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Üveg", "In project": "A projektben", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Könyvtár", "Liquid": "Folyadék", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Fém", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Festék", "Plastic": "Műanyag", + "Published": "Published", "Recent": "Legutóbbiak", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Könyvtár átméretezése", + "Roughness": "Roughness", "Rubber": "Gumi", + "Save": "Mentés", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Anyagok keresése", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Polcok", + "Source": "Source", "Stone": "Kő", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Fa", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/id.json b/frontend/src/i18n/modules/library/id.json index 579988cc..9dfec9d0 100644 --- a/frontend/src/i18n/modules/library/id.json +++ b/frontend/src/i18n/modules/library/id.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Semua", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Batal", "Categories": "Kategori", + "Category": "Category", "Ceramic": "Keramik", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emisif", "Fabric": "Kain", + "Favorite": "Favorite", "Favorites": "Favorit", + "Fuzz": "Fuzz", "Gem": "Permata", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Kaca", "In project": "Dalam proyek", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Pustaka", "Liquid": "Cairan", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Logam", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Cat", "Plastic": "Plastik", + "Published": "Published", "Recent": "Terbaru", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Ubah ukuran pustaka", + "Roughness": "Roughness", "Rubber": "Karet", + "Save": "Simpan", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Cari material", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Rak", + "Source": "Source", "Stone": "Batu", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Kayu", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/it.json b/frontend/src/i18n/modules/library/it.json index 3bfcf45b..84b042b5 100644 --- a/frontend/src/i18n/modules/library/it.json +++ b/frontend/src/i18n/modules/library/it.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Tutto", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Annulla", "Categories": "Categorie", + "Category": "Category", "Ceramic": "Ceramica", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissivo", "Fabric": "Tessuto", + "Favorite": "Favorite", "Favorites": "Preferiti", + "Fuzz": "Fuzz", "Gem": "Gemma", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Vetro", "In project": "Nel progetto", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Libreria", "Liquid": "Liquido", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metallo", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Vernice", "Plastic": "Plastica", + "Published": "Published", "Recent": "Recenti", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Ridimensiona la libreria", + "Roughness": "Roughness", "Rubber": "Gomma", + "Save": "Salva", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Cerca materiali", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Scaffali", + "Source": "Source", "Stone": "Pietra", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Legno", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/ja.json b/frontend/src/i18n/modules/library/ja.json index a78971e9..73c0b34c 100644 --- a/frontend/src/i18n/modules/library/ja.json +++ b/frontend/src/i18n/modules/library/ja.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "すべて", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "キャンセル", "Categories": "カテゴリ", + "Category": "Category", "Ceramic": "セラミック", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "エミッシブ", "Fabric": "ファブリック", + "Favorite": "Favorite", "Favorites": "お気に入り", + "Fuzz": "Fuzz", "Gem": "宝石", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "ガラス", "In project": "プロジェクト内", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "ライブラリ", "Liquid": "液体", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "メタル", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "塗装", "Plastic": "プラスチック", + "Published": "Published", "Recent": "最近", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "ライブラリのサイズを変更", + "Roughness": "Roughness", "Rubber": "ゴム", + "Save": "保存", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "マテリアルを検索", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "棚", + "Source": "Source", "Stone": "石", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "木材", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/ko.json b/frontend/src/i18n/modules/library/ko.json index fef59689..b606549d 100644 --- a/frontend/src/i18n/modules/library/ko.json +++ b/frontend/src/i18n/modules/library/ko.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "모두", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "취소", "Categories": "카테고리", + "Category": "Category", "Ceramic": "세라믹", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "발광", "Fabric": "패브릭", + "Favorite": "Favorite", "Favorites": "즐겨찾기", + "Fuzz": "Fuzz", "Gem": "보석", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "유리", "In project": "프로젝트에 있음", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "라이브러리", "Liquid": "액체", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "금속", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "페인트", "Plastic": "플라스틱", + "Published": "Published", "Recent": "최근", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "라이브러리 크기 조절", + "Roughness": "Roughness", "Rubber": "고무", + "Save": "저장", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "머티리얼 검색", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "선반", + "Source": "Source", "Stone": "돌", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "목재", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/nb.json b/frontend/src/i18n/modules/library/nb.json index ba4a7bec..ff6e4c5d 100644 --- a/frontend/src/i18n/modules/library/nb.json +++ b/frontend/src/i18n/modules/library/nb.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Alle", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Avbryt", "Categories": "Kategorier", + "Category": "Category", "Ceramic": "Keramikk", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissiv", "Fabric": "Stoff", + "Favorite": "Favorite", "Favorites": "Favoritter", + "Fuzz": "Fuzz", "Gem": "Edelstein", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Glass", "In project": "I prosjektet", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliotek", "Liquid": "Væske", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metall", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Lakk", "Plastic": "Plast", + "Published": "Published", "Recent": "Nylige", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Endre størrelsen på biblioteket", + "Roughness": "Roughness", "Rubber": "Gummi", + "Save": "Lagre", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Søk i materialer", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Hyller", + "Source": "Source", "Stone": "Stein", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Tre", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/nl.json b/frontend/src/i18n/modules/library/nl.json index f8d20c0b..77dd7319 100644 --- a/frontend/src/i18n/modules/library/nl.json +++ b/frontend/src/i18n/modules/library/nl.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Alle", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Annuleren", "Categories": "Categorieën", + "Category": "Category", "Ceramic": "Keramiek", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissief", "Fabric": "Stof", + "Favorite": "Favorite", "Favorites": "Favorieten", + "Fuzz": "Fuzz", "Gem": "Edelsteen", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Glas", "In project": "In project", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliotheek", "Liquid": "Vloeistof", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metaal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Verf", "Plastic": "Kunststof", + "Published": "Published", "Recent": "Recent", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Formaat van de bibliotheek wijzigen", + "Roughness": "Roughness", "Rubber": "Rubber", + "Save": "Opslaan", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Materialen zoeken", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Planken", + "Source": "Source", "Stone": "Steen", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Hout", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/pl.json b/frontend/src/i18n/modules/library/pl.json index 20d92990..c82620de 100644 --- a/frontend/src/i18n/modules/library/pl.json +++ b/frontend/src/i18n/modules/library/pl.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Wszystko", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Anuluj", "Categories": "Kategorie", + "Category": "Category", "Ceramic": "Ceramika", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emisja", "Fabric": "Tkanina", + "Favorite": "Favorite", "Favorites": "Ulubione", + "Fuzz": "Fuzz", "Gem": "Klejnot", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Szkło", "In project": "W projekcie", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Biblioteka", "Liquid": "Ciecz", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Lakier", "Plastic": "Plastik", + "Published": "Published", "Recent": "Ostatnie", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Zmień rozmiar biblioteki", + "Roughness": "Roughness", "Rubber": "Guma", + "Save": "Zapisz", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Szukaj materiałów", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Półki", + "Source": "Source", "Stone": "Kamień", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Drewno", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/pt-BR.json b/frontend/src/i18n/modules/library/pt-BR.json index 776e9b0e..304bb448 100644 --- a/frontend/src/i18n/modules/library/pt-BR.json +++ b/frontend/src/i18n/modules/library/pt-BR.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Tudo", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Cancelar", "Categories": "Categorias", + "Category": "Category", "Ceramic": "Cerâmica", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissivo", "Fabric": "Tecido", + "Favorite": "Favorite", "Favorites": "Favoritos", + "Fuzz": "Fuzz", "Gem": "Gema", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Vidro", "In project": "No projeto", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Biblioteca", "Liquid": "Líquido", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Tinta", "Plastic": "Plástico", + "Published": "Published", "Recent": "Recentes", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Redimensionar a biblioteca", + "Roughness": "Roughness", "Rubber": "Borracha", + "Save": "Salvar", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Buscar materiais", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Prateleiras", + "Source": "Source", "Stone": "Pedra", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Madeira", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/ru.json b/frontend/src/i18n/modules/library/ru.json index 6e5f4555..2ef33ac8 100644 --- a/frontend/src/i18n/modules/library/ru.json +++ b/frontend/src/i18n/modules/library/ru.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Все", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Отмена", "Categories": "Категории", + "Category": "Category", "Ceramic": "Керамика", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Излучение", "Fabric": "Ткань", + "Favorite": "Favorite", "Favorites": "Избранное", + "Fuzz": "Fuzz", "Gem": "Драгоценный камень", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Стекло", "In project": "В проекте", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Библиотека", "Liquid": "Жидкость", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Металл", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Краска", "Plastic": "Пластик", + "Published": "Published", "Recent": "Недавние", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Изменить размер библиотеки", + "Roughness": "Roughness", "Rubber": "Резина", + "Save": "Сохранить", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Поиск материалов", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Полки", + "Source": "Source", "Stone": "Камень", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Дерево", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/strings.json b/frontend/src/i18n/modules/library/strings.json index 6de72094..1378aabc 100644 --- a/frontend/src/i18n/modules/library/strings.json +++ b/frontend/src/i18n/modules/library/strings.json @@ -1,40 +1,95 @@ [ "1 material", + "Abbe number", "All", + "Alt: whole group. Shift: same material.", + "Anisotropy", + "Applied {name} to every part with the same material", + "Applied {name} to the selected parts", + "Applied {name} to their groups", + "Apply to Every Part with the Same Material", + "Apply to Selected Parts", + "Apply to Their Groups", + "Apply to every part with the material of {name}", + "Apply to the group of {name}", + "Apply to {name}", + "Authored", + "Base color", "Brushed metal", + "Cancel", "Categories", + "Category", "Ceramic", "Clear plastic", + "Coat", + "Coat roughness", + "Details", "Diffuse", + "Drop on a part in the viewport", + "Drop the material on a part", + "Emission", "Emissive", "Fabric", + "Favorite", "Favorites", + "Fuzz", "Gem", "Generic", + "Give the material a name", "Glass", "In project", + "Index of refraction", + "Keeps the material of the selected part as one of your own presets.", "Library", "Liquid", + "Loading", + "Material details", "Materials", "Materials you apply appear here.", "Materials you save from the selection appear here.", + "Measured", "Metal", "Metallic paint", + "Metalness", + "Name", + "No", "No favorites yet. Right-click a material to add one.", + "No materials match {query}", + "No part here", "Nothing in {category} here", + "Opacity", "Paint", "Plastic", + "Published", "Recent", + "Remove", + "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.", "Resize the library", + "Roughness", "Rubber", + "Save", + "Save Material to Library", + "Save Selected Material to Library", + "Saved {name} to your library", "Search materials", + "Select a part first", + "Select a part with a material first", "Shelves", + "Source", "Stone", + "Subsurface", + "The engine sent the preset in an unknown shape", "The library is empty", + "Thin film thickness", "Thin glass", + "Thin walled", "This project has no materials yet.", "Tile size", + "Transmission", + "Transmission depth", "User", "Wood", + "Yes", "{n} materials" ] diff --git a/frontend/src/i18n/modules/library/sv.json b/frontend/src/i18n/modules/library/sv.json index 7c467903..26104a1e 100644 --- a/frontend/src/i18n/modules/library/sv.json +++ b/frontend/src/i18n/modules/library/sv.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Alla", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Avbryt", "Categories": "Kategorier", + "Category": "Category", "Ceramic": "Keramik", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emissiv", "Fabric": "Tyg", + "Favorite": "Favorite", "Favorites": "Favoriter", + "Fuzz": "Fuzz", "Gem": "Ädelsten", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Glas", "In project": "I projektet", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Bibliotek", "Liquid": "Vätska", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metall", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Lack", "Plastic": "Plast", + "Published": "Published", "Recent": "Senaste", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Ändra bibliotekets storlek", + "Roughness": "Roughness", "Rubber": "Gummi", + "Save": "Spara", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Sök bland material", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Hyllor", + "Source": "Source", "Stone": "Sten", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Trä", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/th.json b/frontend/src/i18n/modules/library/th.json index 53010fe6..517db66a 100644 --- a/frontend/src/i18n/modules/library/th.json +++ b/frontend/src/i18n/modules/library/th.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "ทั้งหมด", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "ยกเลิก", "Categories": "หมวดหมู่", + "Category": "Category", "Ceramic": "เซรามิก", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "การเรืองแสง", "Fabric": "ผ้า", + "Favorite": "Favorite", "Favorites": "รายการโปรด", + "Fuzz": "Fuzz", "Gem": "อัญมณี", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "แก้ว", "In project": "ในโปรเจกต์", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "คลัง", "Liquid": "ของเหลว", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "โลหะ", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "สี", "Plastic": "พลาสติก", + "Published": "Published", "Recent": "ล่าสุด", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "ปรับขนาดคลัง", + "Roughness": "Roughness", "Rubber": "ยาง", + "Save": "บันทึก", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "ค้นหาแมทีเรียล", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "ชั้นวาง", + "Source": "Source", "Stone": "หิน", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "ไม้", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/tr.json b/frontend/src/i18n/modules/library/tr.json index 44b62a76..0fd67e66 100644 --- a/frontend/src/i18n/modules/library/tr.json +++ b/frontend/src/i18n/modules/library/tr.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Tümü", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "İptal", "Categories": "Kategoriler", + "Category": "Category", "Ceramic": "Seramik", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Emisyon", "Fabric": "Kumaş", + "Favorite": "Favorite", "Favorites": "Sık Kullanılanlar", + "Fuzz": "Fuzz", "Gem": "Değerli taş", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Cam", "In project": "Projede", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Kitaplık", "Liquid": "Sıvı", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Metal", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Boya", "Plastic": "Plastik", + "Published": "Published", "Recent": "Son kullanılanlar", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Kitaplığı yeniden boyutlandır", + "Roughness": "Roughness", "Rubber": "Kauçuk", + "Save": "Kaydet", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Malzemelerde ara", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Raflar", + "Source": "Source", "Stone": "Taş", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Ahşap", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/uk.json b/frontend/src/i18n/modules/library/uk.json index d280d21a..6232f2c0 100644 --- a/frontend/src/i18n/modules/library/uk.json +++ b/frontend/src/i18n/modules/library/uk.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Усі", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Скасувати", "Categories": "Категорії", + "Category": "Category", "Ceramic": "Кераміка", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Випромінювання", "Fabric": "Тканина", + "Favorite": "Favorite", "Favorites": "Улюблені", + "Fuzz": "Fuzz", "Gem": "Дорогоцінний камінь", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Скло", "In project": "У проєкті", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Бібліотека", "Liquid": "Рідина", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Метал", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Фарба", "Plastic": "Пластик", + "Published": "Published", "Recent": "Недавні", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Змінити розмір бібліотеки", + "Roughness": "Roughness", "Rubber": "Гума", + "Save": "Зберегти", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Пошук матеріалів", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Полиці", + "Source": "Source", "Stone": "Камінь", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Дерево", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/vi.json b/frontend/src/i18n/modules/library/vi.json index fa0a02e3..ea7c39d8 100644 --- a/frontend/src/i18n/modules/library/vi.json +++ b/frontend/src/i18n/modules/library/vi.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "Tất cả", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "Hủy", "Categories": "Danh mục", + "Category": "Category", "Ceramic": "Gốm sứ", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "Phát sáng", "Fabric": "Vải", + "Favorite": "Favorite", "Favorites": "Yêu thích", + "Fuzz": "Fuzz", "Gem": "Đá quý", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "Kính", "In project": "Trong dự án", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "Thư viện", "Liquid": "Chất lỏng", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "Kim loại", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "Sơn", "Plastic": "Nhựa", + "Published": "Published", "Recent": "Gần đây", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "Đổi kích thước thư viện", + "Roughness": "Roughness", "Rubber": "Cao su", + "Save": "Lưu", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "Tìm vật liệu", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "Kệ", + "Source": "Source", "Stone": "Đá", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "Gỗ", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/zh-CN.json b/frontend/src/i18n/modules/library/zh-CN.json index 6dfc7bea..469d16fe 100644 --- a/frontend/src/i18n/modules/library/zh-CN.json +++ b/frontend/src/i18n/modules/library/zh-CN.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "全部", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "取消", "Categories": "分类", + "Category": "Category", "Ceramic": "陶瓷", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "自发光", "Fabric": "织物", + "Favorite": "Favorite", "Favorites": "收藏", + "Fuzz": "Fuzz", "Gem": "宝石", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "玻璃", "In project": "项目中", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "资源库", "Liquid": "液体", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "金属", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "油漆", "Plastic": "塑料", + "Published": "Published", "Recent": "最近", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "调整资源库大小", + "Roughness": "Roughness", "Rubber": "橡胶", + "Save": "保存", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "搜索材质", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "货架", + "Source": "Source", "Stone": "石头", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "木材", + "Yes": "Yes", "{n} materials": "{n} materials" } diff --git a/frontend/src/i18n/modules/library/zh-TW.json b/frontend/src/i18n/modules/library/zh-TW.json index 299f6232..b2f049d5 100644 --- a/frontend/src/i18n/modules/library/zh-TW.json +++ b/frontend/src/i18n/modules/library/zh-TW.json @@ -1,40 +1,95 @@ { "1 material": "1 material", + "Abbe number": "Abbe number", "All": "全部", + "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", + "Anisotropy": "Anisotropy", + "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the selected parts": "Applied {name} to the selected parts", + "Applied {name} to their groups": "Applied {name} to their groups", + "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", + "Apply to Selected Parts": "Apply to Selected Parts", + "Apply to Their Groups": "Apply to Their Groups", + "Apply to every part with the material of {name}": "Apply to every part with the material of {name}", + "Apply to the group of {name}": "Apply to the group of {name}", + "Apply to {name}": "Apply to {name}", + "Authored": "Authored", + "Base color": "Base color", "Brushed metal": "Brushed metal", + "Cancel": "取消", "Categories": "類別", + "Category": "Category", "Ceramic": "陶瓷", "Clear plastic": "Clear plastic", + "Coat": "Coat", + "Coat roughness": "Coat roughness", + "Details": "Details", "Diffuse": "Diffuse", + "Drop on a part in the viewport": "Drop on a part in the viewport", + "Drop the material on a part": "Drop the material on a part", + "Emission": "Emission", "Emissive": "自發光", "Fabric": "織物", + "Favorite": "Favorite", "Favorites": "我的最愛", + "Fuzz": "Fuzz", "Gem": "寶石", "Generic": "Generic", + "Give the material a name": "Give the material a name", "Glass": "玻璃", "In project": "專案中", + "Index of refraction": "Index of refraction", + "Keeps the material of the selected part as one of your own presets.": "Keeps the material of the selected part as one of your own presets.", "Library": "資源庫", "Liquid": "液體", + "Loading": "Loading", + "Material details": "Material details", "Materials": "Materials", "Materials you apply appear here.": "Materials you apply appear here.", "Materials you save from the selection appear here.": "Materials you save from the selection appear here.", + "Measured": "Measured", "Metal": "金屬", "Metallic paint": "Metallic paint", + "Metalness": "Metalness", + "Name": "Name", + "No": "No", "No favorites yet. Right-click a material to add one.": "No favorites yet. Right-click a material to add one.", + "No materials match {query}": "No materials match {query}", + "No part here": "No part here", "Nothing in {category} here": "Nothing in {category} here", + "Opacity": "Opacity", "Paint": "烤漆", "Plastic": "塑膠", + "Published": "Published", "Recent": "最近", + "Remove": "Remove", + "Remove from Library": "Remove from Library", + "Remove {name} from your library? Documents that use it keep their material.": "Remove {name} from your library? Documents that use it keep their material.", "Resize the library": "調整資源庫大小", + "Roughness": "Roughness", "Rubber": "橡膠", + "Save": "儲存", + "Save Material to Library": "Save Material to Library", + "Save Selected Material to Library": "Save Selected Material to Library", + "Saved {name} to your library": "Saved {name} to your library", "Search materials": "搜尋材質", + "Select a part first": "Select a part first", + "Select a part with a material first": "Select a part with a material first", "Shelves": "層架", + "Source": "Source", "Stone": "石材", + "Subsurface": "Subsurface", + "The engine sent the preset in an unknown shape": "The engine sent the preset in an unknown shape", "The library is empty": "The library is empty", + "Thin film thickness": "Thin film thickness", "Thin glass": "Thin glass", + "Thin walled": "Thin walled", "This project has no materials yet.": "This project has no materials yet.", "Tile size": "Tile size", + "Transmission": "Transmission", + "Transmission depth": "Transmission depth", "User": "User", "Wood": "木材", + "Yes": "Yes", "{n} materials": "{n} materials" } From fc8cd1b9a7ad697fcfbae5a9141893f66977de8e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:23:04 -0500 Subject: [PATCH 265/494] feat(library): build the Library panel on the virtual grid Shelves All, Favorites, Recent, In project and User, categories with counts of the current shelf and search, a debounced library.list search, a three-step tile size slider and the state restored on reload; double-click or Enter applies to the selection and right-click opens the tile menu. Ran tsc and vite build, then scrolled 1992 tiles in headless Chrome at 4x CPU throttle against a stand-in: 20 tile nodes throughout. --- frontend/src/ui/library.ts | 73 +------- frontend/src/ui/library/library.css | 83 +++++++++ frontend/src/ui/library/panel.ts | 263 ++++++++++++++++++++++++++++ 3 files changed, 351 insertions(+), 68 deletions(-) create mode 100644 frontend/src/ui/library/library.css create mode 100644 frontend/src/ui/library/panel.ts diff --git a/frontend/src/ui/library.ts b/frontend/src/ui/library.ts index 4d9b5296..ffe9d3d5 100644 --- a/frontend/src/ui/library.ts +++ b/frontend/src/ui/library.ts @@ -1,30 +1,8 @@ -import { el, q, setAttr, setClass } from '../shell/dom'; -import { icon } from '../shell/icons'; +import { el, q, setClass } from '../shell/dom'; import { registerPanel } from '../shell/registry'; import { t } from '../i18n'; import type { Workspace } from './context'; - -const SHELF_KEY = 'formshot.library.shelf'; -const SHELVES: ReadonlyArray = [ - ['all', 'All'], - ['favorites', 'Favorites'], - ['recent', 'Recent'], - ['project', 'In project'], -]; -const CATEGORIES: readonly string[] = ['Metal', 'Plastic', 'Glass', 'Paint', 'Rubber', 'Fabric', 'Wood', 'Stone', 'Ceramic', 'Liquid', 'Gem', 'Emissive']; - -function storedShelf(): string { - try { - const v = localStorage.getItem(SHELF_KEY); - return SHELVES.some(([id]) => id === v) ? v as string : 'all'; - } catch { - return 'all'; - } -} - -function saveShelf(id: string): void { - try { localStorage.setItem(SHELF_KEY, id); } catch { return; } -} +import { mountLibraryPanel } from './library/panel'; export function mountLibrary(ws: Workspace): void { registerPanel({ @@ -34,50 +12,9 @@ export function mountLibrary(ws: Workspace): void { grow: true, title: 'Library', mount(host) { - const shelves = SHELVES.map(([id, label]) => ``).join(''); - const cats = CATEGORIES.map((c) => `
    • `).join(''); - const root = el(`
      -
      ${icon('library', 14)}${t('Library')}
      - -
      ${shelves}
      -
      -
        ${cats}
      -
      -
      ${icon('material', 28)}

      ${t('Materials arrive in 0.5.0')}

      -
      -
      - -
      `); - host.appendChild(root); - - let shelf = storedShelf(); - let category = ''; - const paint = (): void => { - for (const b of root.querySelectorAll('.fsh-ws-shelf')) { - const on = b.dataset.shelf === shelf; - setAttr(b, 'aria-selected', on ? 'true' : 'false'); - setAttr(b, 'tabindex', on ? '0' : '-1'); - } - for (const b of root.querySelectorAll('.fsh-ws-cat')) setAttr(b, 'aria-pressed', b.dataset.cat === category ? 'true' : 'false'); - }; - q(root, '.fsh-ws-lib-shelves').addEventListener('click', (e) => { - const b = (e.target as HTMLElement).closest('.fsh-ws-shelf'); - if (!b?.dataset.shelf) return; - shelf = b.dataset.shelf; - saveShelf(shelf); - paint(); - }); - q(root, '.fsh-ws-lib-cats').addEventListener('click', (e) => { - const b = (e.target as HTMLElement).closest('.fsh-ws-cat'); - if (!b?.dataset.cat) return; - category = category === b.dataset.cat ? '' : b.dataset.cat; - paint(); - }); - const search = q(root, 'input[type="search"]'); - search.addEventListener('keydown', (e) => { - if (e.key === 'Escape' && search.value) { search.value = ''; e.stopPropagation(); } - }); - paint(); + const panel = mountLibraryPanel(ws, host); + const root = panel.root; + root.appendChild(el(``)); splitter(q(root, '.fsh-ws-splitter'), root, ws); }, }); diff --git a/frontend/src/ui/library/library.css b/frontend/src/ui/library/library.css new file mode 100644 index 00000000..96d8b34d --- /dev/null +++ b/frontend/src/ui/library/library.css @@ -0,0 +1,83 @@ +.fsh-lib { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; } +.fsh-lib .fsh-ws-lib-head { justify-content: space-between; gap: var(--space-2); } +.fsh-lib-head-tools { display: inline-flex; align-items: center; gap: var(--space-0); } +.fsh-lib-head-tools .fsh-icon-btn { width: var(--ctl-sm); height: var(--ctl-sm); } +.fsh-lib-head-tools .fsh-icon-btn[hidden] { display: none; } +.fsh-lib .fsh-ws-shelf { flex: 1 1 auto; padding: 0 var(--space-1); } +.fsh-lib-body { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; } +.fsh-lib .fsh-ws-lib-cats { margin: var(--space-2) var(--space-3) 0; } +.fsh-lib .fsh-ws-cat-count { min-width: 4ch; text-align: right; } +.fsh-lib .fsh-ws-cat.is-empty .fsh-ws-cat-name { color: var(--text-faint); } +.fsh-lib-pane { position: relative; display: flex; flex: 1 1 0; min-height: 0; margin-top: var(--space-2); border-top: 1px solid var(--line-0); } +.fsh-lib-busy { position: absolute; top: 0; left: 0; right: 0; z-index: var(--z-raised); height: 2px; background: var(--accent-color); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) ease; } +.fsh-lib-busy.is-shown { opacity: 0.8; } +.fsh-lib-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-4); color: var(--text-muted); font-size: var(--fs-12); text-align: center; pointer-events: none; } +.fsh-lib-note[hidden] { display: none; } +.fsh-lib-note > p { margin: 0; max-width: 28ch; } +.fsh-lib-note > .fsh-icon { color: var(--text-faint); } + +.fsh-lib-grid { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; outline: none; contain: strict; } +.fsh-lib-space { position: relative; height: var(--fsh-lib-space-h, 0px); } +.fsh-lib-tile { position: absolute; top: 0; left: 0; width: var(--fsh-lib-tile, 96px); height: calc(var(--fsh-lib-tile, 96px) + 22px); border-radius: var(--radius-md); cursor: pointer; contain: layout paint style; user-select: none; -webkit-user-select: none; touch-action: none; } +.fsh-lib-tile[hidden] { display: none; } +.fsh-lib-thumb { position: relative; width: var(--fsh-lib-tile, 96px); height: var(--fsh-lib-tile, 96px); overflow: hidden; border-radius: var(--radius-md); background: radial-gradient(circle at 38% 32%, var(--surface-3), var(--surface-1) 72%); } +.fsh-lib-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-1); pointer-events: none; } +.fsh-lib-tile:hover .fsh-lib-thumb::after { box-shadow: inset 0 0 0 1px var(--line-3); } +.fsh-lib-tile[aria-selected="true"] .fsh-lib-thumb::after { box-shadow: inset 0 0 0 2px var(--accent-line); } +.fsh-lib-grid:focus-visible .fsh-lib-tile[aria-selected="true"] .fsh-lib-thumb::after { box-shadow: inset 0 0 0 2px var(--accent-color); } +.fsh-lib-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur) ease; } +.fsh-lib-img:not([src]) { visibility: hidden; } +.fsh-lib-img.is-loaded { opacity: 1; } +.fsh-lib-img.is-instant { transition: none; } +.fsh-lib-badge { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); height: 14px; padding: 0 4px; overflow: hidden; border-radius: var(--radius-xs); background: var(--bg-scrim); color: var(--text-primary); font-size: var(--fs-9); line-height: 14px; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; } +.fsh-lib-fav { position: absolute; top: 4px; right: 4px; display: block; color: var(--warn); visibility: hidden; pointer-events: none; } +.fsh-lib-tile.is-favorite .fsh-lib-fav { visibility: visible; } +.fsh-lib-fav > svg { display: block; } +.fsh-lib-name { height: 22px; padding: 0 2px; overflow: hidden; color: var(--text-secondary); font-size: var(--fs-11); line-height: 22px; white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-tile[aria-selected="true"] .fsh-lib-name { color: var(--text-primary); } + +.fsh-lib-pop { position: fixed; top: 0; left: 0; z-index: var(--z-menu); width: 300px; max-height: min(70vh, 520px); overflow-y: auto; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-12); transform: translate(var(--fsh-lib-pop-x, 0px), var(--fsh-lib-pop-y, 0px)); pointer-events: auto; outline: none; } +.fsh-lib-pop[hidden] { display: none; } +.fsh-lib-pop-head { display: flex; align-items: center; gap: var(--space-2); } +.fsh-lib-pop-swatch { flex: none; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--fsh-lib-swatch, transparent); box-shadow: inset 0 0 0 1px var(--line-2); } +.fsh-lib-pop-title { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; } +.fsh-lib-pop-name { overflow: hidden; font-size: var(--fs-13); font-weight: var(--fw-semibold); white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-pop-meta { color: var(--text-muted); font-size: var(--fs-11); } +.fsh-lib-pop-status { margin: var(--space-2) 0 0; color: var(--text-muted); } +.fsh-lib-pop-status[hidden] { display: none; } +.fsh-lib-pop-values { display: grid; grid-template-columns: 1fr auto; gap: var(--space-0) var(--space-3); margin: var(--space-3) 0 0; } +.fsh-lib-pop-row { display: contents; } +.fsh-lib-pop-row > dt { color: var(--text-muted); } +.fsh-lib-pop-row > dd { margin: 0; text-align: right; } +.fsh-lib-pop-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-3); } +.fsh-lib-pop-tags[hidden] { display: none; } +.fsh-lib-pop-tag { padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--surface-field); color: var(--text-secondary); font-size: var(--fs-10); line-height: 18px; } +.fsh-lib-pop-source { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line-1); } +.fsh-lib-pop-source[hidden] { display: none; } +.fsh-lib-pop-source > h4 { margin: 0 0 var(--space-1); color: var(--text-muted); font-size: var(--fs-11); font-weight: var(--fw-medium); } +.fsh-lib-pop-source > p { margin: 0 0 var(--space-1); line-height: var(--lh); } +.fsh-lib-pop-kind { color: var(--text-secondary); } +.fsh-lib-pop-notes { color: var(--text-muted); font-size: var(--fs-11); } +.fsh-lib-pop-notes:empty { display: none; } + +.fsh-lib-grid.is-dragging, .fsh-lib-grid.is-dragging .fsh-lib-tile { cursor: grabbing; } +.fsh-lib-ghost { position: fixed; top: 0; left: 0; z-index: var(--z-drag); display: flex; align-items: center; gap: var(--space-2); max-width: 300px; padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1); border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-11); transform: translate(var(--fsh-lib-ghost-x, 0px), var(--fsh-lib-ghost-y, 0px)); pointer-events: none; will-change: transform; } +.fsh-lib-ghost[hidden] { display: none; } +.fsh-lib-ghost-thumb { flex: none; width: 36px; height: 36px; overflow: hidden; border-radius: var(--radius); background: radial-gradient(circle at 38% 32%, var(--surface-3), var(--surface-1) 72%); } +.fsh-lib-ghost-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; } +.fsh-lib-ghost-thumb > img:not([src]) { visibility: hidden; } +.fsh-lib-ghost-text { display: flex; flex-direction: column; min-width: 0; } +.fsh-lib-ghost-name { overflow: hidden; font-weight: var(--fw-semibold); white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-ghost-hint { overflow: hidden; color: var(--text-secondary); white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-ghost[data-state="part"] .fsh-lib-ghost-hint { color: var(--accent-color); } +.fsh-lib-ghost-keys { color: var(--text-faint); font-size: var(--fs-10); } + +.fsh-lib-save { display: flex; flex-direction: column; gap: var(--space-3); min-width: 300px; } +.fsh-lib-save-row { display: flex; flex-direction: column; gap: var(--space-1); color: var(--text-secondary); font-size: var(--fs-12); } +.fsh-lib-save-error { margin: 0; color: var(--danger-text); } +.fsh-lib-save-error[hidden] { display: none; } + +.fsh-lib-foot { display: flex; flex: none; align-items: center; justify-content: space-between; gap: var(--space-2); height: 32px; padding: 0 var(--space-3); border-top: 1px solid var(--line-0); color: var(--text-muted); font-size: var(--fs-11); } +.fsh-lib-count { min-width: 12ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-size { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-faint); } +.fsh-lib-size > input { width: 72px; margin: 0; accent-color: var(--accent-color); } diff --git a/frontend/src/ui/library/panel.ts b/frontend/src/ui/library/panel.ts new file mode 100644 index 00000000..ed21a52b --- /dev/null +++ b/frontend/src/ui/library/panel.ts @@ -0,0 +1,263 @@ +import './library.css'; +import { el, escapeHtml, pendingClass, q, setAttr, setClass, setDisabled, setHidden, setText } from '../../shell/dom'; +import { icon } from '../../shell/icons'; +import { t } from '../../i18n'; +import type { Workspace } from '../context'; +import { CATEGORIES, LIST, SAVE, SHELVES, TYPE_LABEL, parseList, projectMaterials, thumbUrl, type Preset, type Shelf } from './data'; +import { VirtualGrid } from './grid'; +import { TILE_SIZES, loadState, stateSaver, viewKey } from './state'; +import { libraryActions, type LibraryActions, type PanelLink } from './actions'; +import { PresetDrag } from './drag'; +import { SAVE_COMMAND, registerSaveCommand } from './save'; +import { commandEnabled, getCommand, onRegistryChange } from '../../shell/registry'; + +export interface LibraryPanel { + readonly root: HTMLElement; + readonly grid: VirtualGrid; + readonly actions: LibraryActions; + reload(): void; +} + +const EMPTY_NOTE: Record = { + all: 'The library is empty', + favorites: 'No favorites yet. Right-click a material to add one.', + recent: 'Materials you apply appear here.', + project: 'This project has no materials yet.', + user: 'Materials you save from the selection appear here.', +}; + +const SEARCH_DELAY_MS = 180; + +export function thumbSize(px: number): number { + return px <= 128 ? 128 : 256; +} + +export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPanel { + const state = loadState(); + const save = stateSaver(state); + const restoreView = state.view; + let restored = false; + + const shelves = SHELVES.map(([id, label]) => ``).join(''); + const cats = CATEGORIES.map((c) => `
    • `).join(''); + const root = el(`
      +
      ${icon('library', 14)}${escapeHtml(t('Library'))}
      + +
      ${shelves}
      +
      +
        ${cats}
      +
      + + +
      +
      +
      +
      `); + host.appendChild(root); + + const pane = q(root, '.fsh-lib-pane'); + const busy = q(root, '.fsh-lib-busy'); + const note = q(root, '.fsh-lib-note'); + const noteText = q(note, 'p'); + const count = q(root, '.fsh-lib-count'); + const sizeInput = q(root, '.fsh-lib-size > input'); + const catButtons = [...root.querySelectorAll('.fsh-ws-cat')]; + const catCounts = new Map(catButtons.map((b) => [b.dataset.cat ?? '', q(b, '.fsh-ws-cat-count')])); + + let all: Preset[] = []; + let problem = ''; + let loadSeq = 0; + + let byId = new Map(); + const link: PanelLink = { + find: (id) => byId.get(id), + active: () => grid.active, + reload: () => { void load(); }, + repaint: (id) => grid.refreshItem(id), + rectOf: (id) => grid.rectOf(id), + shelf: () => state.shelf, + }; + const actions = libraryActions(ws, link); + const grid = new VirtualGrid({ + thumb: (item, px) => item.material !== null ? null : thumbUrl(item, thumbSize(px)), + badge: (item) => t(TYPE_LABEL[item.type] ?? item.type), + activate: (item) => { void actions.apply(item, 'part'); }, + menu: (item, x, y) => actions.menu(item, x, y), + press: (item, e) => drag.press(item, e), + activeChanged: (item) => { state.active = item?.id ?? ''; save(); }, + scrolled: (top) => { state.scroll = Math.round(top); state.view = viewKey(state); save(); }, + }, escapeHtml(t('Materials'))); + pane.insertBefore(grid.root, note); + const drag = new PresetDrag(ws.ctx.slots.overlayRoot, grid.root, { + thumb: (item) => item.material !== null ? null : thumbUrl(item, thumbSize(TILE_SIZES[state.size])), + drop: (item, node, scope) => { void actions.apply(item, scope, [node]); }, + }); + grid.setTileSize(TILE_SIZES[state.size]); + + const paintControls = (): void => { + for (const b of root.querySelectorAll('.fsh-ws-shelf')) { + const on = b.dataset.shelf === state.shelf; + setAttr(b, 'aria-selected', on ? 'true' : 'false'); + setAttr(b, 'tabindex', on ? '0' : '-1'); + } + for (const b of catButtons) setAttr(b, 'aria-pressed', b.dataset.cat === state.category ? 'true' : 'false'); + if (sizeInput.value !== String(state.size)) sizeInput.value = String(state.size); + }; + + const show = (): void => { + const counts = new Map(CATEGORIES.map((c) => [c, 0])); + for (const p of all) counts.set(p.category, (counts.get(p.category) ?? 0) + 1); + for (const [cat, node] of catCounts) { + const n = counts.get(cat) ?? 0; + setText(node, String(n)); + setClass(node.parentElement, 'is-empty', n === 0); + } + byId = new Map(all.map((p) => [p.id, p])); + const items = state.category ? all.filter((p) => p.category === state.category) : all; + grid.setItems(items, restored ? '' : state.active); + if (!restored && viewKey(state) === restoreView && items.length) grid.scrollTo(state.scroll); + if (items.length || problem) restored = true; + let text = problem; + if (!text && !items.length && state.query.trim()) text = t('No materials match {query}', { query: state.query.trim() }); + if (!text && !items.length) text = state.category && all.length ? t('Nothing in {category} here', { category: t(state.category) }) : t(EMPTY_NOTE[state.shelf]); + setText(noteText, text); + setHidden(note, items.length > 0 && !problem); + setText(count, problem ? '' : items.length === 1 ? t('1 material') : t('{n} materials', { n: items.length })); + }; + + const fetchList = async (): Promise => { + const args: Record = {}; + const query = state.query.trim(); + if (query) args.query = query; + if (state.shelf !== 'all') args.shelf = state.shelf; + const list = parseList(await ws.client.dispatch(LIST, args)); + return state.shelf === 'user' ? list.filter((p) => p.user) : list; + }; + + const load = async (): Promise => { + const seq = ++loadSeq; + if (state.shelf === 'project') { + problem = ''; + const words = state.query.trim().toLowerCase().split(/\s+/).filter(Boolean); + all = projectMaterials(ws.client.summary).filter((p) => { + const hay = `${p.name} ${p.category} ${p.type}`.toLowerCase(); + return words.every((w) => hay.includes(w)); + }); + show(); + return; + } + if (!ws.canRun(LIST)) { + all = []; + problem = ws.why(LIST); + show(); + return; + } + const stop = pendingClass(busy); + try { + const list = await fetchList(); + if (seq !== loadSeq) return; + all = list; + problem = ''; + } catch (err) { + if (seq !== loadSeq) return; + all = []; + problem = err instanceof Error ? err.message : String(err); + } finally { + stop(); + } + show(); + }; + + q(root, '.fsh-ws-lib-shelves').addEventListener('click', (e) => { + const b = (e.target as HTMLElement).closest('.fsh-ws-shelf'); + const next = b?.dataset.shelf as Shelf | undefined; + if (!next || next === state.shelf) return; + state.shelf = next; + state.scroll = 0; + save(); + paintControls(); + grid.scrollTo(0); + void load(); + }); + q(root, '.fsh-ws-lib-shelves').addEventListener('keydown', (e) => { + if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return; + const i = SHELVES.findIndex(([id]) => id === state.shelf); + const next = SHELVES[(i + (e.key === 'ArrowRight' ? 1 : SHELVES.length - 1)) % SHELVES.length][0]; + e.preventDefault(); + e.stopPropagation(); + root.querySelector(`.fsh-ws-shelf[data-shelf="${next}"]`)?.click(); + root.querySelector(`.fsh-ws-shelf[data-shelf="${next}"]`)?.focus(); + }); + q(root, '.fsh-ws-lib-cats').addEventListener('click', (e) => { + const b = (e.target as HTMLElement).closest('.fsh-ws-cat'); + if (!b?.dataset.cat) return; + state.category = state.category === b.dataset.cat ? '' : b.dataset.cat; + state.scroll = 0; + save(); + paintControls(); + grid.scrollTo(0); + show(); + }); + const search = q(root, 'input[type="search"]'); + search.value = state.query; + let searchTimer: number | undefined; + const searchNow = (): void => { + window.clearTimeout(searchTimer); + searchTimer = undefined; + if (search.value === state.query) return; + state.query = search.value; + state.scroll = 0; + save(); + grid.scrollTo(0); + void load(); + }; + search.addEventListener('input', () => { + window.clearTimeout(searchTimer); + searchTimer = window.setTimeout(searchNow, SEARCH_DELAY_MS); + }); + search.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && search.value) { search.value = ''; searchNow(); e.stopPropagation(); return; } + if (e.key === 'Enter') { searchNow(); e.preventDefault(); return; } + if (e.key === 'ArrowDown') { searchNow(); grid.focus(); if (!grid.active) grid.setActive(0); e.preventDefault(); } + }); + sizeInput.addEventListener('input', () => { + const n = Math.max(0, Math.min(TILE_SIZES.length - 1, Number(sizeInput.value) | 0)); + if (n === state.size) return; + state.size = n; + save(); + grid.setTileSize(TILE_SIZES[n]); + }); + + let materialsSig = ''; + ws.client.onSummary(() => { + const sig = (ws.client.summary?.materials ?? []).map((m) => `${String(m.key)}:${String(m.name)}:${String(m.type_id)}`).join('|'); + if (sig === materialsSig) return; + materialsSig = sig; + if (state.shelf === 'project') void load(); + }); + const saveBtn = q(root, '.fsh-lib-save-btn'); + registerSaveCommand(ws, () => { if (state.shelf === 'user') void load(); }); + const paintSave = (): void => { + setHidden(saveBtn, !ws.client.has(SAVE)); + const cmd = getCommand(SAVE_COMMAND); + setDisabled(saveBtn, !cmd || !commandEnabled(cmd)); + }; + onRegistryChange('state', paintSave); + ws.client.onSummary(paintSave); + ws.client.onCatalogue(paintSave); + paintSave(); + let listed = ws.canRun(LIST); + const catalogue = (): void => { + const has = ws.canRun(LIST); + if (has === listed) return; + listed = has; + void load(); + }; + ws.client.onCatalogue(catalogue); + ws.client.onState(catalogue); + + paintControls(); + show(); + void load(); + return { root, grid, actions, reload: () => { void load(); } }; +} From 2b3dc6b17b0d9502e7ea0f7b587b2d635b3cdf8d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:25:23 -0500 Subject: [PATCH 266/494] fix(library): restore scroll and the active tile only after the list lands The first empty render before the engine answered saved an empty active tile and a zero scroll over the stored ones; the panel now ignores scroll and active changes until a real list arrived, then restores both. Checked in headless Chrome: Glass, scroll 1500 and the active tile survive a reload. --- frontend/src/ui/library/panel.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/library/panel.ts b/frontend/src/ui/library/panel.ts index ed21a52b..f932484a 100644 --- a/frontend/src/ui/library/panel.ts +++ b/frontend/src/ui/library/panel.ts @@ -37,6 +37,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane const save = stateSaver(state); const restoreView = state.view; let restored = false; + let settled = false; const shelves = SHELVES.map(([id, label]) => ``).join(''); const cats = CATEGORIES.map((c) => `
    • `).join(''); @@ -84,8 +85,8 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane activate: (item) => { void actions.apply(item, 'part'); }, menu: (item, x, y) => actions.menu(item, x, y), press: (item, e) => drag.press(item, e), - activeChanged: (item) => { state.active = item?.id ?? ''; save(); }, - scrolled: (top) => { state.scroll = Math.round(top); state.view = viewKey(state); save(); }, + activeChanged: (item) => { if (!restored) return; state.active = item?.id ?? ''; save(); }, + scrolled: (top) => { if (!restored) return; state.scroll = Math.round(top); save(); }, }, escapeHtml(t('Materials'))); pane.insertBefore(grid.root, note); const drag = new PresetDrag(ws.ctx.slots.overlayRoot, grid.root, { @@ -115,8 +116,10 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane byId = new Map(all.map((p) => [p.id, p])); const items = state.category ? all.filter((p) => p.category === state.category) : all; grid.setItems(items, restored ? '' : state.active); - if (!restored && viewKey(state) === restoreView && items.length) grid.scrollTo(state.scroll); - if (items.length || problem) restored = true; + if (!restored && settled) { + if (viewKey(state) === restoreView && items.length) grid.scrollTo(state.scroll); + restored = true; + } let text = problem; if (!text && !items.length && state.query.trim()) text = t('No materials match {query}', { query: state.query.trim() }); if (!text && !items.length) text = state.category && all.length ? t('Nothing in {category} here', { category: t(state.category) }) : t(EMPTY_NOTE[state.shelf]); @@ -143,6 +146,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane const hay = `${p.name} ${p.category} ${p.type}`.toLowerCase(); return words.every((w) => hay.includes(w)); }); + if (ws.client.summary) settled = true; show(); return; } @@ -165,6 +169,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane } finally { stop(); } + settled = true; show(); }; From 543149edb9430a69a14878461a9761370ff504ca Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:26:26 -0500 Subject: [PATCH 267/494] fix(library): keep the result count from resizing the footer The count grew from empty to its text and widened its box when the list arrived; it now fills the footer's free width. Checked in headless Chrome: no tile, category, count or grid box moves while the list and thumbnails arrive, and no layout-shift entries. --- frontend/src/ui/library/library.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/library/library.css b/frontend/src/ui/library/library.css index 96d8b34d..58317768 100644 --- a/frontend/src/ui/library/library.css +++ b/frontend/src/ui/library/library.css @@ -78,6 +78,6 @@ .fsh-lib-save-error[hidden] { display: none; } .fsh-lib-foot { display: flex; flex: none; align-items: center; justify-content: space-between; gap: var(--space-2); height: 32px; padding: 0 var(--space-3); border-top: 1px solid var(--line-0); color: var(--text-muted); font-size: var(--fs-11); } -.fsh-lib-count { min-width: 12ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.fsh-lib-count { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .fsh-lib-size { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-faint); } .fsh-lib-size > input { width: 72px; margin: 0; accent-color: var(--accent-color); } From 61c7d99a65aae1947efa5403d9ec0a62c7d82ff4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:48:52 -0500 Subject: [PATCH 268/494] fix(library): drop thumbnail downloads whose tiles scrolled away The service holds a thumbnail request open while the engine renders it, so three slow requests for tiles already gone could block the ones in view; a running request without waiters is now cancelled and its slot freed. Scrolled 1992 tiles at 4x throttle again: thumbnails in view load once the scroll stops. --- frontend/src/ui/library/thumbs.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/frontend/src/ui/library/thumbs.ts b/frontend/src/ui/library/thumbs.ts index 9c9dee54..6ae1c02d 100644 --- a/frontend/src/ui/library/thumbs.ts +++ b/frontend/src/ui/library/thumbs.ts @@ -3,7 +3,7 @@ const RETRY_MS = 60000; type Done = (ok: boolean) => void; -interface Job { url: string; waiters: Set } +interface Job { url: string; waiters: Set; stop: (() => void) | null; aborted: boolean } export class ThumbLoader { private readonly loaded = new Set(); @@ -20,7 +20,7 @@ export class ThumbLoader { if (failedAt !== undefined && performance.now() - failedAt < RETRY_MS) { done(false); return () => undefined; } let job = this.jobs.get(url); if (!job) { - job = { url, waiters: new Set() }; + job = { url, waiters: new Set(), stop: null, aborted: false }; this.jobs.set(url, job); this.queue.push(job); } @@ -31,7 +31,8 @@ export class ThumbLoader { j.waiters.delete(done); if (j.waiters.size) return; const i = this.queue.indexOf(j); - if (i >= 0) { this.queue.splice(i, 1); this.jobs.delete(j.url); } + if (i >= 0) { this.queue.splice(i, 1); this.jobs.delete(j.url); return; } + if (j.stop) { j.aborted = true; this.jobs.delete(j.url); j.stop(); } }; } @@ -40,17 +41,20 @@ export class ThumbLoader { const job = this.queue.pop(); if (!job) return; this.running++; - void this.fetch(job.url).then((ok) => { + void this.fetch(job).then((ok) => { this.running--; - this.jobs.delete(job.url); - if (ok) { this.loaded.add(job.url); this.failed.delete(job.url); } else this.failed.set(job.url, performance.now()); - for (const fn of job.waiters) fn(ok); + if (this.jobs.get(job.url) === job) this.jobs.delete(job.url); + job.stop = null; + if (!job.aborted) { + if (ok) { this.loaded.add(job.url); this.failed.delete(job.url); } else this.failed.set(job.url, performance.now()); + for (const fn of job.waiters) fn(ok); + } this.pump(); }); } } - private fetch(url: string): Promise { + private fetch(job: Job): Promise { return new Promise((resolve) => { const img = new Image(); img.decoding = 'async'; @@ -59,7 +63,13 @@ export class ThumbLoader { else resolve(true); }; img.onerror = () => resolve(false); - img.src = url; + job.stop = () => { + img.onload = null; + img.onerror = null; + img.removeAttribute('src'); + resolve(false); + }; + img.src = job.url; }); } } From cc6def6811e93df712251160bf642da2b16697f0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:11:29 -0500 Subject: [PATCH 269/494] feat(viewport): accept preset drops from the library One hook after the input router hands the frame box, fitted size, raster view and pixel ratio to the library's drop target. Dragged a tile onto the sample scene in headless Chrome at 4x throttle: the cylinder under the pointer was outlined, the hint followed Alt and Shift, the drop applied and a drop on empty space showed the toast. --- frontend/src/ui/viewport.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/ui/viewport.ts b/frontend/src/ui/viewport.ts index 4efffe7b..bb591f53 100644 --- a/frontend/src/ui/viewport.ts +++ b/frontend/src/ui/viewport.ts @@ -17,6 +17,7 @@ import { DEFAULT_POSE } from '../engine/camera-nav'; const VIEW_FRAME = 'view.frame'; import { createPicker } from './picking'; import { attachInput } from './viewport-input'; +import { attachPresetDrop } from './library/drop'; import { GizmoControl } from './gizmo-control'; import { Overlay } from './overlay'; import { hud, hudTitle } from './hud'; @@ -483,6 +484,7 @@ export function mountViewport(ws: Workspace): ViewportControls { sendRegion({ x: x0 / w, y: y0 / h, width: (x1 - x0) / w, height: (y1 - y0) / h }); }, }); + attachPresetDrop(ws, { frame: () => frame.getBoundingClientRect(), size: () => fitted, raster: () => raster, dpr }); } return api; From b92ef12e65a80f6979e9a43bcfcf137cfa2ddaa0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:11:30 -0500 Subject: [PATCH 270/494] feat(library): show preset thumbnails for project materials made from them A project material whose type and name match a library preset, as applied presets are named, borrows that preset's thumbnail on the In project shelf; the drag hint is a little wider so its line fits. Ran tsc and checked the shelf in headless Chrome. --- frontend/src/ui/library/library.css | 2 +- frontend/src/ui/library/panel.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/ui/library/library.css b/frontend/src/ui/library/library.css index 58317768..7a8f021e 100644 --- a/frontend/src/ui/library/library.css +++ b/frontend/src/ui/library/library.css @@ -61,7 +61,7 @@ .fsh-lib-pop-notes:empty { display: none; } .fsh-lib-grid.is-dragging, .fsh-lib-grid.is-dragging .fsh-lib-tile { cursor: grabbing; } -.fsh-lib-ghost { position: fixed; top: 0; left: 0; z-index: var(--z-drag); display: flex; align-items: center; gap: var(--space-2); max-width: 300px; padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1); border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-11); transform: translate(var(--fsh-lib-ghost-x, 0px), var(--fsh-lib-ghost-y, 0px)); pointer-events: none; will-change: transform; } +.fsh-lib-ghost { position: fixed; top: 0; left: 0; z-index: var(--z-drag); display: flex; align-items: center; gap: var(--space-2); max-width: 380px; padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1); border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-11); transform: translate(var(--fsh-lib-ghost-x, 0px), var(--fsh-lib-ghost-y, 0px)); pointer-events: none; will-change: transform; } .fsh-lib-ghost[hidden] { display: none; } .fsh-lib-ghost-thumb { flex: none; width: 36px; height: 36px; overflow: hidden; border-radius: var(--radius); background: radial-gradient(circle at 38% 32%, var(--surface-3), var(--surface-1) 72%); } .fsh-lib-ghost-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; } diff --git a/frontend/src/ui/library/panel.ts b/frontend/src/ui/library/panel.ts index f932484a..36c728f9 100644 --- a/frontend/src/ui/library/panel.ts +++ b/frontend/src/ui/library/panel.ts @@ -70,6 +70,12 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane let loadSeq = 0; let byId = new Map(); + const byName = new Map(); + const thumbFor = (item: Preset, size: number): string | null => { + if (item.material === null) return thumbUrl(item, size); + const same = byName.get(`${item.type}|${item.name}`); + return same ? thumbUrl(same, size) : null; + }; const link: PanelLink = { find: (id) => byId.get(id), active: () => grid.active, @@ -80,7 +86,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane }; const actions = libraryActions(ws, link); const grid = new VirtualGrid({ - thumb: (item, px) => item.material !== null ? null : thumbUrl(item, thumbSize(px)), + thumb: (item, px) => thumbFor(item, thumbSize(px)), badge: (item) => t(TYPE_LABEL[item.type] ?? item.type), activate: (item) => { void actions.apply(item, 'part'); }, menu: (item, x, y) => actions.menu(item, x, y), @@ -90,7 +96,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane }, escapeHtml(t('Materials'))); pane.insertBefore(grid.root, note); const drag = new PresetDrag(ws.ctx.slots.overlayRoot, grid.root, { - thumb: (item) => item.material !== null ? null : thumbUrl(item, thumbSize(TILE_SIZES[state.size])), + thumb: (item) => thumbFor(item, thumbSize(TILE_SIZES[state.size])), drop: (item, node, scope) => { void actions.apply(item, scope, [node]); }, }); grid.setTileSize(TILE_SIZES[state.size]); @@ -161,6 +167,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane const list = await fetchList(); if (seq !== loadSeq) return; all = list; + for (const p of list) byName.set(`${p.type}|${p.name}`, p); problem = ''; } catch (err) { if (seq !== loadSeq) return; From 8009745ccbb5a94d994dde45c76888f64c5adc3d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:16:59 -0500 Subject: [PATCH 271/494] fix(library): say plainly when the engine has no library commands The note stayed on Waiting for the engine after the catalogue arrived without library.list; it now follows the engine's state and names the missing command. Checked in headless Chrome against the base engine with nothing standing in. --- frontend/src/ui/library/panel.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/ui/library/panel.ts b/frontend/src/ui/library/panel.ts index 36c728f9..4f4773cd 100644 --- a/frontend/src/ui/library/panel.ts +++ b/frontend/src/ui/library/panel.ts @@ -261,6 +261,7 @@ export function mountLibraryPanel(ws: Workspace, host: HTMLElement): LibraryPane let listed = ws.canRun(LIST); const catalogue = (): void => { const has = ws.canRun(LIST); + if (!has && state.shelf !== 'project' && problem !== ws.why(LIST)) { problem = ws.why(LIST); show(); } if (has === listed) return; listed = has; void load(); From 4aa42dd56b691f78a13bef060ddc4483b4b4c4e7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:33:12 -0500 Subject: [PATCH 272/494] fix(library): name the part a dropped preset went to A drop reported the selection message although it applied to the part under the pointer; the status line now names that part, its group or its material. Ran against lib-engine's engine on the product scene: Shift-drop changed Body and Shoulder, Alt-drop the whole group, one Ctrl+Z undid it. --- frontend/src/i18n/modules/library/cs.json | 3 +++ frontend/src/i18n/modules/library/da.json | 3 +++ frontend/src/i18n/modules/library/de.json | 3 +++ frontend/src/i18n/modules/library/es.json | 3 +++ frontend/src/i18n/modules/library/fi.json | 3 +++ frontend/src/i18n/modules/library/fr.json | 3 +++ frontend/src/i18n/modules/library/hu.json | 3 +++ frontend/src/i18n/modules/library/id.json | 3 +++ frontend/src/i18n/modules/library/it.json | 3 +++ frontend/src/i18n/modules/library/ja.json | 3 +++ frontend/src/i18n/modules/library/ko.json | 3 +++ frontend/src/i18n/modules/library/nb.json | 3 +++ frontend/src/i18n/modules/library/nl.json | 3 +++ frontend/src/i18n/modules/library/pl.json | 3 +++ frontend/src/i18n/modules/library/pt-BR.json | 3 +++ frontend/src/i18n/modules/library/ru.json | 3 +++ frontend/src/i18n/modules/library/strings.json | 3 +++ frontend/src/i18n/modules/library/sv.json | 3 +++ frontend/src/i18n/modules/library/th.json | 3 +++ frontend/src/i18n/modules/library/tr.json | 3 +++ frontend/src/i18n/modules/library/uk.json | 3 +++ frontend/src/i18n/modules/library/vi.json | 3 +++ frontend/src/i18n/modules/library/zh-CN.json | 3 +++ frontend/src/i18n/modules/library/zh-TW.json | 3 +++ frontend/src/ui/library/actions.ts | 9 ++++++++- 25 files changed, 80 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n/modules/library/cs.json b/frontend/src/i18n/modules/library/cs.json index aad790ab..e8cf010f 100644 --- a/frontend/src/i18n/modules/library/cs.json +++ b/frontend/src/i18n/modules/library/cs.json @@ -4,9 +4,12 @@ "All": "Vše", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/da.json b/frontend/src/i18n/modules/library/da.json index 5f92a9ae..62848b9d 100644 --- a/frontend/src/i18n/modules/library/da.json +++ b/frontend/src/i18n/modules/library/da.json @@ -4,9 +4,12 @@ "All": "Alle", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/de.json b/frontend/src/i18n/modules/library/de.json index 1f28f4dd..fcd35814 100644 --- a/frontend/src/i18n/modules/library/de.json +++ b/frontend/src/i18n/modules/library/de.json @@ -4,9 +4,12 @@ "All": "Alle", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/es.json b/frontend/src/i18n/modules/library/es.json index 62c38441..753888ce 100644 --- a/frontend/src/i18n/modules/library/es.json +++ b/frontend/src/i18n/modules/library/es.json @@ -4,9 +4,12 @@ "All": "Todo", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/fi.json b/frontend/src/i18n/modules/library/fi.json index 454ee8d7..309601b9 100644 --- a/frontend/src/i18n/modules/library/fi.json +++ b/frontend/src/i18n/modules/library/fi.json @@ -4,9 +4,12 @@ "All": "Kaikki", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/fr.json b/frontend/src/i18n/modules/library/fr.json index 5f9920d3..61652fa6 100644 --- a/frontend/src/i18n/modules/library/fr.json +++ b/frontend/src/i18n/modules/library/fr.json @@ -4,9 +4,12 @@ "All": "Tout", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/hu.json b/frontend/src/i18n/modules/library/hu.json index e008ca3e..f583573f 100644 --- a/frontend/src/i18n/modules/library/hu.json +++ b/frontend/src/i18n/modules/library/hu.json @@ -4,9 +4,12 @@ "All": "Mind", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/id.json b/frontend/src/i18n/modules/library/id.json index 9dfec9d0..186cf312 100644 --- a/frontend/src/i18n/modules/library/id.json +++ b/frontend/src/i18n/modules/library/id.json @@ -4,9 +4,12 @@ "All": "Semua", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/it.json b/frontend/src/i18n/modules/library/it.json index 84b042b5..5e778b89 100644 --- a/frontend/src/i18n/modules/library/it.json +++ b/frontend/src/i18n/modules/library/it.json @@ -4,9 +4,12 @@ "All": "Tutto", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/ja.json b/frontend/src/i18n/modules/library/ja.json index 73c0b34c..6ba98524 100644 --- a/frontend/src/i18n/modules/library/ja.json +++ b/frontend/src/i18n/modules/library/ja.json @@ -4,9 +4,12 @@ "All": "すべて", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/ko.json b/frontend/src/i18n/modules/library/ko.json index b606549d..984e0a90 100644 --- a/frontend/src/i18n/modules/library/ko.json +++ b/frontend/src/i18n/modules/library/ko.json @@ -4,9 +4,12 @@ "All": "모두", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/nb.json b/frontend/src/i18n/modules/library/nb.json index ff6e4c5d..9e199693 100644 --- a/frontend/src/i18n/modules/library/nb.json +++ b/frontend/src/i18n/modules/library/nb.json @@ -4,9 +4,12 @@ "All": "Alle", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/nl.json b/frontend/src/i18n/modules/library/nl.json index 77dd7319..b92a93c4 100644 --- a/frontend/src/i18n/modules/library/nl.json +++ b/frontend/src/i18n/modules/library/nl.json @@ -4,9 +4,12 @@ "All": "Alle", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/pl.json b/frontend/src/i18n/modules/library/pl.json index c82620de..6c03b89a 100644 --- a/frontend/src/i18n/modules/library/pl.json +++ b/frontend/src/i18n/modules/library/pl.json @@ -4,9 +4,12 @@ "All": "Wszystko", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/pt-BR.json b/frontend/src/i18n/modules/library/pt-BR.json index 304bb448..9ce6a51e 100644 --- a/frontend/src/i18n/modules/library/pt-BR.json +++ b/frontend/src/i18n/modules/library/pt-BR.json @@ -4,9 +4,12 @@ "All": "Tudo", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/ru.json b/frontend/src/i18n/modules/library/ru.json index 2ef33ac8..1f8343ed 100644 --- a/frontend/src/i18n/modules/library/ru.json +++ b/frontend/src/i18n/modules/library/ru.json @@ -4,9 +4,12 @@ "All": "Все", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/strings.json b/frontend/src/i18n/modules/library/strings.json index 1378aabc..0d026a9e 100644 --- a/frontend/src/i18n/modules/library/strings.json +++ b/frontend/src/i18n/modules/library/strings.json @@ -4,9 +4,12 @@ "All", "Alt: whole group. Shift: same material.", "Anisotropy", + "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}", "Applied {name} to the selected parts", "Applied {name} to their groups", + "Applied {name} to {part}", "Apply to Every Part with the Same Material", "Apply to Selected Parts", "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/sv.json b/frontend/src/i18n/modules/library/sv.json index 26104a1e..0bf9b483 100644 --- a/frontend/src/i18n/modules/library/sv.json +++ b/frontend/src/i18n/modules/library/sv.json @@ -4,9 +4,12 @@ "All": "Alla", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/th.json b/frontend/src/i18n/modules/library/th.json index 517db66a..b26c5bda 100644 --- a/frontend/src/i18n/modules/library/th.json +++ b/frontend/src/i18n/modules/library/th.json @@ -4,9 +4,12 @@ "All": "ทั้งหมด", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/tr.json b/frontend/src/i18n/modules/library/tr.json index 0fd67e66..ca2534a7 100644 --- a/frontend/src/i18n/modules/library/tr.json +++ b/frontend/src/i18n/modules/library/tr.json @@ -4,9 +4,12 @@ "All": "Tümü", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/uk.json b/frontend/src/i18n/modules/library/uk.json index 6232f2c0..90c5cc25 100644 --- a/frontend/src/i18n/modules/library/uk.json +++ b/frontend/src/i18n/modules/library/uk.json @@ -4,9 +4,12 @@ "All": "Усі", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/vi.json b/frontend/src/i18n/modules/library/vi.json index ea7c39d8..d7f6689a 100644 --- a/frontend/src/i18n/modules/library/vi.json +++ b/frontend/src/i18n/modules/library/vi.json @@ -4,9 +4,12 @@ "All": "Tất cả", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/zh-CN.json b/frontend/src/i18n/modules/library/zh-CN.json index 469d16fe..f759635a 100644 --- a/frontend/src/i18n/modules/library/zh-CN.json +++ b/frontend/src/i18n/modules/library/zh-CN.json @@ -4,9 +4,12 @@ "All": "全部", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/i18n/modules/library/zh-TW.json b/frontend/src/i18n/modules/library/zh-TW.json index b2f049d5..85bd0d54 100644 --- a/frontend/src/i18n/modules/library/zh-TW.json +++ b/frontend/src/i18n/modules/library/zh-TW.json @@ -4,9 +4,12 @@ "All": "全部", "Alt: whole group. Shift: same material.": "Alt: whole group. Shift: same material.", "Anisotropy": "Anisotropy", + "Applied {name} to every part with the material of {part}": "Applied {name} to every part with the material of {part}", "Applied {name} to every part with the same material": "Applied {name} to every part with the same material", + "Applied {name} to the group of {part}": "Applied {name} to the group of {part}", "Applied {name} to the selected parts": "Applied {name} to the selected parts", "Applied {name} to their groups": "Applied {name} to their groups", + "Applied {name} to {part}": "Applied {name} to {part}", "Apply to Every Part with the Same Material": "Apply to Every Part with the Same Material", "Apply to Selected Parts": "Apply to Selected Parts", "Apply to Their Groups": "Apply to Their Groups", diff --git a/frontend/src/ui/library/actions.ts b/frontend/src/ui/library/actions.ts index 76e4d0e7..de4f34e6 100644 --- a/frontend/src/ui/library/actions.ts +++ b/frontend/src/ui/library/actions.ts @@ -31,6 +31,12 @@ const SCOPE_DONE: Record = { same_material: 'Applied {name} to every part with the same material', }; +const DROP_DONE: Record = { + part: 'Applied {name} to {part}', + group: 'Applied {name} to the group of {part}', + same_material: 'Applied {name} to every part with the material of {part}', +}; + export function libraryActions(ws: Workspace, panel: PanelLink): LibraryActions { let target: Preset | null = null; const details = new DetailsPopover(ws.ctx.slots.overlayRoot); @@ -55,7 +61,8 @@ export function libraryActions(ws: Workspace, panel: PanelLink): LibraryActions toast(err instanceof Error ? err.message : String(err), 'error'); return false; } - ws.client.message(t(SCOPE_DONE[scope], { name: preset.name })); + const part = nodes?.length === 1 ? ws.client.summary?.nodes.find((n) => String(n.id) === nodes[0])?.name : undefined; + ws.client.message(part ? t(DROP_DONE[scope], { name: preset.name, part }) : t(SCOPE_DONE[scope], { name: preset.name })); if (panel.shelf() === 'recent') panel.reload(); return true; }, From 0e4eb4b8f48b08a6712f1e40b71167625ef57216 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:35:15 -0500 Subject: [PATCH 273/494] fix(library): give the details popover an opaque surface Over a busy rendered frame the see-through glass made the citation hard to read; the popover now sits on surface-2 with the glass border and shadow, and tags use surface-3. Opened it from the menu key in headless Chrome and read the screenshot. --- frontend/src/ui/library/library.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/library/library.css b/frontend/src/ui/library/library.css index 7a8f021e..3f11e7bd 100644 --- a/frontend/src/ui/library/library.css +++ b/frontend/src/ui/library/library.css @@ -36,7 +36,7 @@ .fsh-lib-name { height: 22px; padding: 0 2px; overflow: hidden; color: var(--text-secondary); font-size: var(--fs-11); line-height: 22px; white-space: nowrap; text-overflow: ellipsis; } .fsh-lib-tile[aria-selected="true"] .fsh-lib-name { color: var(--text-primary); } -.fsh-lib-pop { position: fixed; top: 0; left: 0; z-index: var(--z-menu); width: 300px; max-height: min(70vh, 520px); overflow-y: auto; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); color: var(--text-primary); font-size: var(--fs-12); transform: translate(var(--fsh-lib-pop-x, 0px), var(--fsh-lib-pop-y, 0px)); pointer-events: auto; outline: none; } +.fsh-lib-pop { position: fixed; top: 0; left: 0; z-index: var(--z-menu); width: 300px; max-height: min(70vh, 520px); overflow-y: auto; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow); color: var(--text-primary); font-size: var(--fs-12); transform: translate(var(--fsh-lib-pop-x, 0px), var(--fsh-lib-pop-y, 0px)); pointer-events: auto; outline: none; } .fsh-lib-pop[hidden] { display: none; } .fsh-lib-pop-head { display: flex; align-items: center; gap: var(--space-2); } .fsh-lib-pop-swatch { flex: none; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--fsh-lib-swatch, transparent); box-shadow: inset 0 0 0 1px var(--line-2); } @@ -51,7 +51,7 @@ .fsh-lib-pop-row > dd { margin: 0; text-align: right; } .fsh-lib-pop-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-3); } .fsh-lib-pop-tags[hidden] { display: none; } -.fsh-lib-pop-tag { padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--surface-field); color: var(--text-secondary); font-size: var(--fs-10); line-height: 18px; } +.fsh-lib-pop-tag { padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--surface-3); color: var(--text-secondary); font-size: var(--fs-10); line-height: 18px; } .fsh-lib-pop-source { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line-1); } .fsh-lib-pop-source[hidden] { display: none; } .fsh-lib-pop-source > h4 { margin: 0 0 var(--space-1); color: var(--text-muted); font-size: var(--fs-11); font-weight: var(--fw-medium); } From 3260ea13109ec1ad039ef30b34b96fcb44eae26e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:35:37 -0500 Subject: [PATCH 274/494] refactor(library): drop the unused recent reply parser The Recent shelf reads library.list with shelf recent, which lib-engine orders most recent first, so the separate library.recent parser is not needed. Ran tsc and vite build. --- frontend/src/ui/library/data.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/frontend/src/ui/library/data.ts b/frontend/src/ui/library/data.ts index ab4bf446..6852d6c0 100644 --- a/frontend/src/ui/library/data.ts +++ b/frontend/src/ui/library/data.ts @@ -8,7 +8,6 @@ export const APPLY = 'library.apply'; export const FAVORITE = 'library.favorite'; export const SAVE = 'library.save'; export const REMOVE = 'library.remove'; -export const RECENT = 'library.recent'; export const ASSIGN = 'material.assign'; export const CATEGORIES: readonly string[] = ['Metal', 'Plastic', 'Glass', 'Paint', 'Rubber', 'Fabric', 'Wood', 'Stone', 'Ceramic', 'Liquid', 'Gem', 'Emissive']; @@ -105,12 +104,6 @@ export function parseList(raw: unknown): Preset[] { return out; } -export function parseIds(raw: unknown): string[] { - const top = obj(raw); - const o = obj(top?.result) ?? top; - return listOf(o, obj(raw) ? o : raw).map((x) => typeof x === 'string' ? x : str(obj(x)?.id)).filter(Boolean); -} - export function parseDetail(raw: unknown): PresetDetail | null { const top = obj(raw); const o = obj(top?.preset) ?? obj(top?.result) ?? top; From 830389e345c5491fc3a044704580096d08190b36 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:14:34 -0500 Subject: [PATCH 275/494] feat(meshes): send uv set 0, tangents and material revisions scene.mesh_data adds uv0_b64 and tangents_b64 when the mesh carries them, and scene.meshes lists every material with a revision that moves only when its content or texture files change. Ran cargo clippy -p fsh-commands with -D warnings. --- native/crates/fsh-commands/src/meshes.rs | 55 ++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-commands/src/meshes.rs b/native/crates/fsh-commands/src/meshes.rs index b13531ef..edec1f7c 100644 --- a/native/crates/fsh-commands/src/meshes.rs +++ b/native/crates/fsh-commands/src/meshes.rs @@ -14,6 +14,23 @@ pub(crate) struct MeshView { print: Option, revision: u64, meshes: BTreeMap, u64)>, + materials: BTreeMap, + material_counter: u64, +} + +fn material_print(doc: &Document, m: &fsh_scene::Material) -> u64 { + let mut text = serde_json::to_string(m).unwrap_or_default(); + for k in m.texture_keys() { + if let Some(t) = doc.textures().get(&k) { + text.push('\n'); + text.push_str(&t.path); + if let Ok(meta) = std::fs::metadata(&t.path) { + let modified = meta.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_nanos()).unwrap_or(0); + text.push_str(&format!(" {} {modified}", meta.len())); + } + } + } + hash_bytes(text.as_bytes()) } fn display_colour(c: Rgb) -> Value { @@ -58,7 +75,8 @@ fn le_f32(values: impl Iterator) -> String { } /// `{key, vertices, indices, positions_b64, normals_b64, indices_b64}`: little-endian f32 xyz positions and normals -/// (computed when the mesh has none) and u32 indices. +/// (computed when the mesh has none) and u32 indices; plus `uv0_b64` (f32 uv of set 0) and `tangents_b64` (f32 xyz and +/// handedness sign) only when the mesh carries them, one entry per vertex. pub(crate) fn mesh_data(doc: &Document, key: u64) -> Result { let mesh = doc .mesh(MeshKey::from_raw(key)) @@ -73,14 +91,22 @@ pub(crate) fn mesh_data(doc: &Document, key: u64) -> Result { &computed }; let indices: Vec = m.indices.iter().flat_map(|i| i.to_le_bytes()).collect(); - Ok(json!({ + let mut v = json!({ "key": key.to_string(), "vertices": m.positions.len(), "indices": m.indices.len(), "positions_b64": le_f32(m.positions.iter().flat_map(|p| [p.x, p.y, p.z])), "normals_b64": le_f32(m.normals.iter().flat_map(|n| [n.x, n.y, n.z])), "indices_b64": base64(&indices), - })) + }); + let count = m.positions.len(); + if let Some(uv) = m.uvs.first().filter(|uv| uv.len() == count && count > 0) { + v["uv0_b64"] = Value::String(le_f32(uv.iter().flat_map(|t| [t.x, t.y]))); + } + if m.tangents.len() == count && count > 0 { + v["tangents_b64"] = Value::String(le_f32(m.tangents.iter().flat_map(|t| [t.x, t.y, t.z, if t.w < 0.0 { -1.0 } else { 1.0 }]))); + } + Ok(v) } impl MeshView { @@ -116,6 +142,27 @@ impl MeshView { .iter() .map(|(k, (m, r))| json!({"key": k.to_string(), "vertices": m.vertex_count(), "triangles": m.triangle_count(), "revision": r})) .collect(); - json!({"meshes": meshes, "instances": instances, "revision": self.revision}) + let materials = self.material_revisions(ed.document()); + json!({"meshes": meshes, "instances": instances, "materials": materials, "revision": self.revision}) + } + + /// `[{key, revision}]` for every material: the revision moves when the material's content, or the path, length or + /// modified time of a texture it names, changes, so the window refetches only that material's preview maps. + fn material_revisions(&mut self, doc: &Document) -> Vec { + let old = std::mem::take(&mut self.materials); + let mut out = Vec::with_capacity(doc.materials().len()); + for (k, m) in doc.materials() { + let print = material_print(doc, m); + let rev = match old.get(&k.raw()) { + Some((p, r)) if *p == print => *r, + _ => { + self.material_counter += 1; + self.material_counter + } + }; + self.materials.insert(k.raw(), (print, rev)); + out.push(json!({"key": k.raw().to_string(), "revision": rev})); + } + out } } From 6b0a69be99ad759b0427399112d9291bc764fa67 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:15:12 -0500 Subject: [PATCH 276/494] feat(service): add uv and tangent sections to the FSHM mesh block The mesh route appends uv set 0 and tangents after the indices when the engine sends them and marks each in the high half of the version word (bit 16 uv0, bit 17 tangents), so readers that ignore the flags read the same prefix. Ran mesh_block on a synthetic reply with and without the sections in the service venv. --- backend/app/engine_routes.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/backend/app/engine_routes.py b/backend/app/engine_routes.py index 2c74365f..c69dba14 100644 --- a/backend/app/engine_routes.py +++ b/backend/app/engine_routes.py @@ -67,6 +67,37 @@ async def dispatch(call: Call, response: Response): return result +import base64 # noqa: E402 +import binascii # noqa: E402 +import struct # noqa: E402 + +MESH_FLAG_UV0 = 1 +MESH_FLAG_TANGENTS = 2 +MESH_SECTIONS = (("uv0_b64", MESH_FLAG_UV0, 8), ("tangents_b64", MESH_FLAG_TANGENTS, 16)) + + +def mesh_block(reply) -> bytes: + data = mesh_bytes(reply) + vertices = struct.unpack_from(" Response: window_key.held_or_ticket(request) @@ -74,7 +105,7 @@ async def mesh(key: str, request: Request) -> Response: raise HTTPException(400, "A mesh key is a decimal number from scene.meshes") reply = await run("scene.mesh_data", {"key": key}) try: - data = mesh_bytes(reply) + data = mesh_block(reply) except EngineError as error: raise HTTPException(error.status, str(error)) from None return Response(content=data, media_type="application/octet-stream", headers={"Cache-Control": "no-store"}) From 0d7bc0b756c9a94ea01237aa5f7383e9324d4c96 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:16:27 -0500 Subject: [PATCH 277/494] feat(raster): read uv0, tangents and material revisions The FSHM parser reads the flagged uv0 and tangent sections after the indices (the base64 fallback reads uv0_b64 and tangents_b64), and the scene listing keeps the per-material revisions. Ran npx tsc --noEmit. --- frontend/src/engine/raster/scene-data.ts | 47 +++++++++++++++++++----- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/frontend/src/engine/raster/scene-data.ts b/frontend/src/engine/raster/scene-data.ts index 50e24051..07d8ceb3 100644 --- a/frontend/src/engine/raster/scene-data.ts +++ b/frontend/src/engine/raster/scene-data.ts @@ -22,7 +22,12 @@ export interface RasterInstance { export interface MaterialLook { base: Vec3; metalness: number; roughness: number } -export interface SceneMeshes { meshes: MeshInfo[]; instances: RasterInstance[]; revision: number } +export interface MaterialInfo { key: string; revision: number } + +export interface SceneMeshes { meshes: MeshInfo[]; instances: RasterInstance[]; materials: MaterialInfo[] | null; revision: number } + +export const FLAG_UV0 = 1; +export const FLAG_TANGENTS = 2; export interface MeshData { key: string; @@ -30,6 +35,8 @@ export interface MeshData { positions: Float32Array; normals: Float32Array; indices: Uint32Array; + uv0: Float32Array | null; + tangents: Float32Array | null; min: Vec3; max: Vec3; } @@ -89,7 +96,16 @@ export function parseSceneMeshes(raw: unknown): SceneMeshes | null { shade: look(e, color), }); } - return { meshes, instances, revision: num(o.revision) }; + let materials: MaterialInfo[] | null = null; + if (Array.isArray(o.materials)) { + materials = []; + for (const m of o.materials) { + const e = obj(m); + const key = str(e?.key); + if (e && key) materials.push({ key, revision: num(e.revision) }); + } + } + return { meshes, instances, materials, revision: num(o.revision) }; } function computeNormals(positions: Float32Array, indices: Uint32Array): Float32Array { @@ -108,7 +124,9 @@ function computeNormals(positions: Float32Array, indices: Uint32Array): Float32A return n; } -function finish(key: string, revision: number, positions: Float32Array, normals: Float32Array | null, indices: Uint32Array): MeshData { +interface Extra { uv0: Float32Array | null; tangents: Float32Array | null } + +function finish(key: string, revision: number, positions: Float32Array, normals: Float32Array | null, indices: Uint32Array, extra: Extra): MeshData { const min: Vec3 = [Infinity, Infinity, Infinity], max: Vec3 = [-Infinity, -Infinity, -Infinity]; for (let i = 0; i < positions.length; i += 3) { for (let a = 0; a < 3; a++) { @@ -119,23 +137,32 @@ function finish(key: string, revision: number, positions: Float32Array, normals: } if (!Number.isFinite(min[0])) { min.fill(0); max.fill(0); } const usable = normals && normals.length === positions.length && normals.some((v) => v !== 0); - return { key, revision, positions, normals: usable ? normals : computeNormals(positions, indices), indices, min, max }; + const vc = positions.length / 3; + const uv0 = extra.uv0 && extra.uv0.length === vc * 2 && vc > 0 ? extra.uv0 : null; + const tangents = uv0 && extra.tangents && extra.tangents.length === vc * 4 ? extra.tangents : null; + return { key, revision, positions, normals: usable ? normals : computeNormals(positions, indices), indices, uv0, tangents, min, max }; } export function parseMeshBinary(key: string, revision: number, buf: ArrayBuffer): MeshData { if (buf.byteLength < 16) throw new Error('The mesh reply is too short'); const head = new DataView(buf, 0, 16); if (head.getUint32(0, true) !== MAGIC) throw new Error('The mesh reply is not an FSHM block'); + const flags = head.getUint32(4, true) >>> 16; const vc = head.getUint32(8, true); let ic = head.getUint32(12, true); const plain = 16 + vc * 24 + ic * 4; - if (buf.byteLength !== plain && buf.byteLength === 16 + vc * 24 + ic * 12) ic *= 3; - if (buf.byteLength < 16 + vc * 24 + ic * 4) throw new Error('The mesh reply is shorter than its header says'); - const copy = buf.slice(16, 16 + vc * 24 + ic * 4); + if (flags === 0 && buf.byteLength !== plain && buf.byteLength === 16 + vc * 24 + ic * 12) ic *= 3; + const base = 16 + vc * 24 + ic * 4; + const uvBytes = flags & FLAG_UV0 ? vc * 8 : 0; + const tanBytes = flags & FLAG_TANGENTS ? vc * 16 : 0; + if (buf.byteLength < base + uvBytes + tanBytes) throw new Error('The mesh reply is shorter than its header says'); + const copy = buf.slice(16, base + uvBytes + tanBytes); const positions = new Float32Array(copy, 0, vc * 3); const normals = new Float32Array(copy, vc * 12, vc * 3); const indices = new Uint32Array(copy, vc * 24, ic); - return finish(key, revision, positions, normals, indices); + const uv0 = uvBytes ? new Float32Array(copy, base - 16, vc * 2) : null; + const tangents = tanBytes ? new Float32Array(copy, base - 16 + uvBytes, vc * 4) : null; + return finish(key, revision, positions, normals, indices, { uv0, tangents }); } function fromBase64(b64: unknown, Kind: { new (b: ArrayBuffer): T }): T { @@ -194,6 +221,8 @@ export class MeshSource { if (!this.has(MESH_DATA_COMMAND)) throw new Error('The engine cannot send mesh data'); const top = obj(await this.dispatch(MESH_DATA_COMMAND, { key: info.key })); const o = obj(top?.result) ?? top ?? {}; - return finish(info.key, info.revision, fromBase64(o.positions_b64, Float32Array), fromBase64(o.normals_b64, Float32Array), fromBase64(o.indices_b64, Uint32Array)); + const uv0 = typeof o.uv0_b64 === 'string' && o.uv0_b64 ? fromBase64(o.uv0_b64, Float32Array) : null; + const tangents = typeof o.tangents_b64 === 'string' && o.tangents_b64 ? fromBase64(o.tangents_b64, Float32Array) : null; + return finish(info.key, info.revision, fromBase64(o.positions_b64, Float32Array), fromBase64(o.normals_b64, Float32Array), fromBase64(o.indices_b64, Uint32Array), { uv0, tangents }); } } From 602a053ef96f200981d40d1541dfd1a7de1671e2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:17:47 -0500 Subject: [PATCH 278/494] feat(meshes): mark instances whose part colour replaces the material scene.meshes instances carry tinted, so the raster material view knows a part tint overrides the base colour map as it does in the path tracers. Ran cargo clippy -p fsh-commands with -D warnings and npx tsc --noEmit. --- frontend/src/engine/raster/scene-data.ts | 2 ++ native/crates/fsh-commands/src/meshes.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/frontend/src/engine/raster/scene-data.ts b/frontend/src/engine/raster/scene-data.ts index 07d8ceb3..bdd91860 100644 --- a/frontend/src/engine/raster/scene-data.ts +++ b/frontend/src/engine/raster/scene-data.ts @@ -17,6 +17,7 @@ export interface RasterInstance { color: Vec3; visible: boolean; selected: boolean; + tinted: boolean; shade: MaterialLook | null; } @@ -93,6 +94,7 @@ export function parseSceneMeshes(raw: unknown): SceneMeshes | null { color, visible: e.visible !== false, selected: e.selected === true, + tinted: e.tinted === true, shade: look(e, color), }); } diff --git a/native/crates/fsh-commands/src/meshes.rs b/native/crates/fsh-commands/src/meshes.rs index edec1f7c..d792f6c9 100644 --- a/native/crates/fsh-commands/src/meshes.rs +++ b/native/crates/fsh-commands/src/meshes.rs @@ -59,6 +59,7 @@ fn walk(ed: &Editor, id: NodeId, out: &mut Vec, used: &mut BTreeMap Date: Wed, 2 Dec 2026 14:20:27 -0500 Subject: [PATCH 279/494] feat(raster): fetch and decode material preview maps MaterialSource asks material.preview_maps for a material at a size, decodes the four PNG maps into ImageBitmaps without colour conversion or premultiplication, shares requests in flight and remembers failures per key, revision and size. Ran npx tsc --noEmit. --- frontend/src/engine/raster/materials.ts | 94 +++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 frontend/src/engine/raster/materials.ts diff --git a/frontend/src/engine/raster/materials.ts b/frontend/src/engine/raster/materials.ts new file mode 100644 index 00000000..30f24634 --- /dev/null +++ b/frontend/src/engine/raster/materials.ts @@ -0,0 +1,94 @@ +import type { Vec3 } from '../types'; + +export const PREVIEW_COMMAND = 'material.preview_maps'; +export const PREVIEW_SIZES = { smooth: 64, balanced: 128, sharp: 256 } as const; +export const PREVIEW_DEFAULT = 128; + +export type MapName = 'base_color' | 'roughness' | 'metalness' | 'normal'; +export const MAP_NAMES: readonly MapName[] = ['base_color', 'roughness', 'metalness', 'normal']; + +export interface PreviewValues { base: Vec3; roughness: number; metalness: number; opacity: number } + +export interface PreviewMaps { + key: string; + revision: number; + size: number; + constant: boolean; + values: PreviewValues; + images: Record | null; +} + +type Dispatch = (name: string, args: Record) => Promise; + +const obj = (v: unknown): Record | null => (v && typeof v === 'object' && !Array.isArray(v) ? v as Record : null); +const num = (v: unknown, d: number): number => (typeof v === 'number' && Number.isFinite(v) ? v : d); +const clamp01 = (v: number): number => Math.min(1, Math.max(0, v)); + +function values(v: unknown): PreviewValues { + const o = obj(v) ?? {}; + const c = Array.isArray(o.base_color) ? o.base_color : []; + return { + base: [clamp01(num(c[0], 0.8)), clamp01(num(c[1], 0.8)), clamp01(num(c[2], 0.8))], + roughness: clamp01(num(o.roughness, 0.5)), + metalness: clamp01(num(o.metalness, 0)), + opacity: clamp01(num(o.opacity, 1)), + }; +} + +async function decode(b64: unknown): Promise { + if (typeof b64 !== 'string' || !b64) throw new Error('The preview map is missing'); + const bin = atob(b64); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + return createImageBitmap(new Blob([bytes], { type: 'image/png' }), { premultiplyAlpha: 'none', colorSpaceConversion: 'none' }); +} + +export async function parsePreview(raw: unknown, key: string, revision: number): Promise { + const top = obj(raw); + const o = obj(top?.result) ?? top ?? {}; + const constant = o.constant === true; + const size = num(o.size, PREVIEW_DEFAULT); + const maps = obj(o.maps); + let images: PreviewMaps['images'] = null; + if (!constant && maps) { + const list = await Promise.all(MAP_NAMES.map((n) => decode(maps[n]))); + images = { base_color: list[0], roughness: list[1], metalness: list[2], normal: list[3] }; + } + return { key, revision, size, constant, values: values(o.values), images }; +} + +export function closePreview(p: PreviewMaps): void { + if (!p.images) return; + for (const n of MAP_NAMES) p.images[n].close(); + p.images = null; +} + +export class MaterialSource { + private readonly inflight = new Map>(); + private readonly failed = new Map(); + + constructor(private readonly dispatch: Dispatch, private readonly has: (name: string) => boolean) {} + + available(): boolean { return this.has(PREVIEW_COMMAND); } + + failure(key: string, revision: number, size: number): string | null { return this.failed.get(`${key}@${revision}x${size}`) ?? null; } + + maps(key: string, revision: number, size: number): Promise { + const id = `${key}@${revision}x${size}`; + const running = this.inflight.get(id); + if (running) return running; + const job = this.dispatch(PREVIEW_COMMAND, { key, size }) + .then((raw) => parsePreview(raw, key, revision)) + .catch((err: unknown) => { + this.failed.set(id, err instanceof Error ? err.message : String(err)); + throw err; + }) + .finally(() => this.inflight.delete(id)); + this.inflight.set(id, job); + return job; + } + + forget(keep: ReadonlySet): void { + for (const id of [...this.failed.keys()]) if (!keep.has(id.slice(0, id.indexOf('@')))) this.failed.delete(id); + } +} From 73df230e3669d348057692074031b7f974aec0a8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:20:27 -0500 Subject: [PATCH 280/494] feat(raster): shade material mode from preview maps with ggx lights Meshes upload uv0 and tangents as attributes 2 and 3; materials upload base colour (sRGB), roughness, metalness and normal maps with mipmaps, replacing old textures only after the new ones exist. The material shader samples them by uv0 with a tangent or derivative frame and replaces the studio light lobes with GGX lights; solid, wireframe and overlay are unchanged. Ran npx tsc --noEmit. --- frontend/src/engine/raster/renderer.ts | 138 ++++++++++++++++++++++++- frontend/src/engine/raster/shaders.ts | 94 ++++++++++++++--- 2 files changed, 211 insertions(+), 21 deletions(-) diff --git a/frontend/src/engine/raster/renderer.ts b/frontend/src/engine/raster/renderer.ts index 2e7490b8..c3ba6c97 100644 --- a/frontend/src/engine/raster/renderer.ts +++ b/frontend/src/engine/raster/renderer.ts @@ -3,6 +3,7 @@ import { maxSamples, Program, Target } from './gl'; import { add, identity, invert, length, lookAt, multiply, normalize, normalMatrix, orthographic, perspective, scale, sub, transformPoint, type Mat4, } from './math'; +import { closePreview, MAP_NAMES, type MapName, type PreviewMaps, type PreviewValues } from './materials'; import type { MeshData, RasterInstance } from './scene-data'; import { BLUR_FS, FULLSCREEN_VS, GROUND_FS, GROUND_VS, ID_FS, LINE_FS, LINE_VS, MESH_VS, OUTLINE_FS, SHADOW_FS, SHADOW_VS, SURFACE_FS, @@ -48,9 +49,26 @@ interface GpuMesh { vao: WebGLVertexArrayObject; buffers: WebGLBuffer[]; count: number; + hasUv: boolean; + hasTangent: boolean; edges: { vao: WebGLVertexArrayObject; buffer: WebGLBuffer; count: number } | null; } +interface GpuMaterial { + revision: number; + size: number; + constant: boolean; + values: PreviewValues; + textures: Record | null; +} + +const MAP_UNIT: Record = { base_color: 1, roughness: 2, metalness: 3, normal: 4 }; +const MAP_UNIFORM: Record = { base_color: 'uBaseMap', roughness: 'uRoughMap', metalness: 'uMetalMap', normal: 'uNormalMap' }; + +function srgbEncode(c: Vec3): Vec3 { + return c.map((x) => (x <= 0.0031308 ? x * 12.92 : 1.055 * Math.pow(x, 1 / 2.4) - 0.055)) as Vec3; +} + interface LineSet { vao: WebGLVertexArrayObject; buffer: WebGLBuffer; count: number; color: [number, number, number, number] } const SHADOW_SIZE = 256; @@ -120,6 +138,9 @@ export class RasterRenderer { private selected = new Set(); private readonly meshes = new Map(); private readonly meshData = new Map(); + private readonly materials = new Map(); + private envTint: Vec3 = [1, 1, 1]; + private anisotropy: { ext: EXT_texture_filter_anisotropic; max: number } | null = null; private lines: LineSet[] = []; private lineSource: { segments: Float32Array; color: [number, number, number, number] }[] = []; private programs: Record<'surface' | 'id' | 'line' | 'shadow' | 'blur' | 'ground' | 'outline', Program> | null = null; @@ -135,6 +156,7 @@ export class RasterRenderer { private frame = 0; private lost = false; private readonly drawFns = new Set<() => void>(); + private readonly restoreFns = new Set<() => void>(); constructor(readonly canvas: HTMLCanvasElement) { let gl: WebGL2RenderingContext | null = null; @@ -146,7 +168,7 @@ export class RasterRenderer { this.gl = gl; if (!gl) { this.error ||= 'WebGL2 is not available in this window'; return; } canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); this.lost = true; this.programs = null; }); - canvas.addEventListener('webglcontextrestored', () => { this.lost = false; this.init(); this.invalidate(); }); + canvas.addEventListener('webglcontextrestored', () => { this.lost = false; this.init(); this.invalidate(); for (const fn of this.restoreFns) fn(); }); this.init(); } @@ -159,6 +181,8 @@ export class RasterRenderer { onDraw(fn: () => void): () => void { this.drawFns.add(fn); return () => { this.drawFns.delete(fn); }; } + onRestore(fn: () => void): () => void { this.restoreFns.add(fn); return () => { this.restoreFns.delete(fn); }; } + private init(): void { const gl = this.gl; if (!gl) return; @@ -193,6 +217,11 @@ export class RasterRenderer { gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); this.emptyVao = gl.createVertexArray(); gl.bindVertexArray(null); + const aniso = gl.getExtension('EXT_texture_filter_anisotropic'); + this.anisotropy = aniso ? { ext: aniso, max: Math.min(4, Number(gl.getParameter(aniso.MAX_TEXTURE_MAX_ANISOTROPY_EXT)) || 1) } : null; + const sp = this.programs.surface.use(); + for (const n of MAP_NAMES) sp.int(MAP_UNIFORM[n], MAP_UNIT[n]); + this.materials.clear(); this.meshes.clear(); for (const m of this.meshData.values()) this.upload(m); this.setLines(this.lineSource); @@ -276,6 +305,51 @@ export class RasterRenderer { } } + hasMaterial(key: string, revision: number, size: number): boolean { + const m = this.materials.get(key); + return !!m && m.revision === revision && (m.constant || m.size === size); + } + + setMaterial(maps: PreviewMaps): void { + const gl = this.gl; + if (!gl || !this.ready) { closePreview(maps); return; } + let textures: GpuMaterial['textures'] = null; + if (!maps.constant && maps.images) { + const made: Partial> = {}; + for (const n of MAP_NAMES) { + const t = this.mapTexture(maps.images[n], n === 'base_color'); + if (t) made[n] = t; + } + if (MAP_NAMES.every((n) => made[n])) textures = made as Record; + else for (const t of Object.values(made)) gl.deleteTexture(t); + } + closePreview(maps); + const old = this.materials.get(maps.key); + this.materials.set(maps.key, { revision: maps.revision, size: maps.size, constant: maps.constant || !textures, values: maps.values, textures }); + if (old) this.freeTextures(old); + if (this.mode === 'material') this.invalidate(); + } + + keepMaterials(keys: ReadonlySet): void { + for (const [k, m] of [...this.materials]) { + if (keys.has(k)) continue; + this.freeTextures(m); + this.materials.delete(k); + } + } + + get materialBytes(): number { + let n = 0; + for (const m of this.materials.values()) if (m.textures) n += Math.round(m.size * m.size * 4 * 4 * 4 / 3); + return n; + } + + setEnvironmentTint(tint: Vec3): void { + if (tint.every((v, i) => v === this.envTint[i])) return; + this.envTint = [...tint]; + if (this.mode === 'material') this.invalidate(); + } + setLines(sets: { segments: Float32Array; color: [number, number, number, number] }[]): void { this.lineSource = sets; const gl = this.gl; @@ -406,6 +480,7 @@ export class RasterRenderer { if (this.frame) cancelAnimationFrame(this.frame); this.frame = 0; for (const k of [...this.meshes.keys()]) this.freeMesh(k); + this.keepMaterials(new Set()); this.setLines([]); this.scene?.release(); this.ids?.release(); @@ -437,8 +512,46 @@ export class RasterRenderer { gl.vertexAttribPointer(1, 3, gl.FLOAT, false, 0, 0); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, idx); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data.indices, gl.STATIC_DRAW); + const buffers = [pos, nor, idx]; + const extra = (location: number, values: Float32Array | null, width: number): boolean => { + const b = values ? gl.createBuffer() : null; + if (!values || !b) { gl.disableVertexAttribArray(location); return false; } + gl.bindBuffer(gl.ARRAY_BUFFER, b); + gl.bufferData(gl.ARRAY_BUFFER, values, gl.STATIC_DRAW); + gl.enableVertexAttribArray(location); + gl.vertexAttribPointer(location, width, gl.FLOAT, false, 0, 0); + buffers.push(b); + return true; + }; + const hasUv = extra(2, data.uv0, 2); + const hasTangent = hasUv && extra(3, data.tangents, 4); gl.bindVertexArray(null); - this.meshes.set(data.key, { data, vao, buffers: [pos, nor, idx], count: data.indices.length, edges: null }); + this.meshes.set(data.key, { data, vao, buffers, count: data.indices.length, hasUv, hasTangent, edges: null }); + } + + private mapTexture(image: ImageBitmap, srgb: boolean): WebGLTexture | null { + const gl = this.gl as WebGL2RenderingContext; + const t = gl.createTexture(); + if (!t) return null; + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, t); + gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); + gl.texImage2D(gl.TEXTURE_2D, 0, srgb ? gl.SRGB8_ALPHA8 : gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, image); + gl.generateMipmap(gl.TEXTURE_2D); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + if (this.anisotropy) gl.texParameterf(gl.TEXTURE_2D, this.anisotropy.ext.TEXTURE_MAX_ANISOTROPY_EXT, this.anisotropy.max); + gl.bindTexture(gl.TEXTURE_2D, null); + return t; + } + + private freeTextures(m: GpuMaterial): void { + const gl = this.gl; + if (!gl || !m.textures) return; + for (const n of MAP_NAMES) gl.deleteTexture(m.textures[n]); + m.textures = null; } private edgesOf(mesh: GpuMesh): GpuMesh['edges'] { @@ -487,11 +600,28 @@ export class RasterRenderer { gl.disable(gl.BLEND); gl.disable(gl.CULL_FACE); p.mat4('uViewProj', m.viewProj).vec3('uEye', m.eye).vec3('uCamRight', m.right).vec3('uCamUp', m.up).vec3('uCamBack', m.back); - p.int('uMode', this.mode === 'material' ? 1 : 0); + const material = this.mode === 'material'; + p.int('uMode', material ? 1 : 0).vec3('uEnvTint', this.envTint); + let bound: GpuMaterial | null = null; for (const { inst, mesh, world } of this.visible()) { - const look = this.mode === 'material' ? inst.shade : null; + let look = material ? inst.shade : null; + const mat = material && inst.material ? this.materials.get(inst.material) ?? null : null; + if (mat && (mat.constant || !mesh.hasUv)) { + const v = mat.values; + look = { base: inst.tinted ? inst.color : srgbEncode(v.base), metalness: v.metalness, roughness: Math.max(0.02, v.roughness) }; + } + const maps = mat && !mat.constant && mat.textures && mesh.hasUv ? mat : null; p.mat4('uModel', world).mat3('uNormalMat', normalMatrix(world)); p.vec3('uColor', look ? look.base : inst.color).float('uMetal', look ? look.metalness : 0).float('uRough', look ? look.roughness : 0.5); + p.int('uMaps', maps ? 1 : 0).int('uHasTangent', maps && mesh.hasTangent ? 1 : 0).int('uTint', inst.tinted ? 1 : 0); + if (maps && maps !== bound && maps.textures) { + for (const n of MAP_NAMES) { + gl.activeTexture(gl.TEXTURE0 + MAP_UNIT[n]); + gl.bindTexture(gl.TEXTURE_2D, maps.textures[n]); + } + gl.activeTexture(gl.TEXTURE0); + bound = maps; + } gl.bindVertexArray(mesh.vao); gl.drawElements(gl.TRIANGLES, mesh.count, gl.UNSIGNED_INT, 0); } diff --git a/frontend/src/engine/raster/shaders.ts b/frontend/src/engine/raster/shaders.ts index 4cb1de8f..5c7e7882 100644 --- a/frontend/src/engine/raster/shaders.ts +++ b/frontend/src/engine/raster/shaders.ts @@ -14,21 +14,30 @@ vec3 toLinear(vec3 c) { export const MESH_VS = `${HEAD} layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; +layout(location = 2) in vec2 aUv; +layout(location = 3) in vec4 aTangent; uniform mat4 uViewProj; uniform mat4 uModel; uniform mat3 uNormalMat; out vec3 vWorld; out vec3 vNormal; +out vec2 vUv; +out vec4 vTangent; void main() { vec4 w = uModel * vec4(aPos, 1.0); vWorld = w.xyz; vNormal = uNormalMat * aNormal; + mat3 m = mat3(uModel); + vUv = aUv; + vTangent = vec4(m * aTangent.xyz, (aTangent.w < 0.0 ? -1.0 : 1.0) * (determinant(m) < 0.0 ? -1.0 : 1.0)); gl_Position = uViewProj * w; }`; export const SURFACE_FS = `${HEAD} in vec3 vWorld; in vec3 vNormal; +in vec2 vUv; +in vec4 vTangent; uniform vec3 uEye; uniform vec3 uColor; uniform float uMetal; @@ -37,6 +46,14 @@ uniform int uMode; uniform vec3 uCamRight; uniform vec3 uCamUp; uniform vec3 uCamBack; +uniform int uMaps; +uniform int uHasTangent; +uniform int uTint; +uniform vec3 uEnvTint; +uniform sampler2D uBaseMap; +uniform sampler2D uRoughMap; +uniform sampler2D uMetalMap; +uniform sampler2D uNormalMap; out vec4 outColor; ${TONE} const vec3 KEY_DIR = vec3(-0.55, 0.75, 0.45); @@ -51,20 +68,8 @@ vec3 gradient(vec3 d, float soft) { vec3 c = mix(vec3(0.035, 0.035, 0.04), vec3(0.2, 0.205, 0.215), smoothstep(-0.3 - soft * 0.4, 0.05 + soft * 0.3, d.y)); return mix(c, vec3(0.34, 0.345, 0.36), smoothstep(0.15, 0.9 + soft * 0.3, d.y)); } -vec3 lobe(vec3 d, vec3 l, vec3 e, float w0, float rough) { - float w = w0 + rough * rough * 1.2; - return e / (6.2832 * w0) * exp((dot(d, normalize(l)) - 1.0) / w) * (w0 / w); -} -vec3 studioSpecular(vec3 r, float rough) { - vec3 c = gradient(r, rough); - c += lobe(r, KEY_DIR, KEY_E, 0.02, rough); - c += lobe(r, FILL_DIR, FILL_E, 0.035, rough); - c += lobe(r, BACK_DIR, BACK_E, 0.025, rough); - c += lobe(r, TOP_DIR, TOP_E, 0.1, rough); - return c; -} vec3 studioIrradiance(vec3 n) { - vec3 c = gradient(n, 1.0) * 0.9; + vec3 c = gradient(n, 1.0) * 0.9 * uEnvTint; c += KEY_E * max(dot(n, normalize(KEY_DIR)), 0.0) * 0.32; c += FILL_E * max(dot(n, normalize(FILL_DIR)), 0.0) * 0.32; c += BACK_E * max(dot(n, normalize(BACK_DIR)), 0.0) * 0.32; @@ -78,11 +83,66 @@ vec2 envBrdf(float nv, float rough) { float a004 = min(r.x * r.x, exp2(-9.28 * nv)) * r.x + r.y; return vec2(-1.04, 1.04) * a004 + r.zw; } +float ggx(float nh, float a) { + float a2 = a * a; + float d = nh * nh * (a2 - 1.0) + 1.0; + return a2 / (3.14159265 * d * d); +} +float smithVis(float nl, float nv, float a) { + float a2 = a * a; + float gv = nl * sqrt(nv * nv * (1.0 - a2) + a2); + float gl = nv * sqrt(nl * nl * (1.0 - a2) + a2); + return 0.5 / max(gv + gl, 1e-5); +} +vec3 lightGgx(vec3 n, vec3 v, vec3 dir, vec3 e, float w0, float rough, vec3 f0) { + vec3 l = normalize(dir); + float nl = dot(n, l); + if (nl <= 0.0) return vec3(0.0); + vec3 h = normalize(v + l); + float nh = max(dot(n, h), 0.0), nv = clamp(dot(n, v), 1e-3, 1.0), vh = max(dot(v, h), 0.0); + float a = sqrt(rough * rough * rough * rough + 0.5 * w0); + vec3 f = f0 + (1.0 - f0) * pow(1.0 - vh, 5.0); + return e * ggx(nh, a) * smithVis(nl, nv, a) * f * nl; +} +vec3 studioGgx(vec3 n, vec3 v, float rough, vec3 f0) { + vec3 c = lightGgx(n, v, KEY_DIR, KEY_E, 0.02, rough, f0); + c += lightGgx(n, v, FILL_DIR, FILL_E, 0.035, rough, f0); + c += lightGgx(n, v, BACK_DIR, BACK_E, 0.025, rough, f0); + c += lightGgx(n, v, TOP_DIR, TOP_E, 0.1, rough, f0); + return c; +} +mat3 tangentFrame(vec3 n) { + if (uHasTangent == 1) { + vec3 t = vTangent.xyz - n * dot(n, vTangent.xyz); + float l = length(t); + if (l > 1e-8) { t /= l; return mat3(t, vTangent.w * cross(n, t), n); } + } + vec3 dp1 = dFdx(vWorld), dp2 = dFdy(vWorld); + vec2 duv1 = dFdx(vUv), duv2 = dFdy(vUv); + vec3 dp2perp = cross(dp2, n), dp1perp = cross(n, dp1); + vec3 t = dp2perp * duv1.x + dp1perp * duv2.x; + vec3 b = dp2perp * duv1.y + dp1perp * duv2.y; + float m = max(dot(t, t), dot(b, b)); + if (!(m > 1e-30)) return mat3(vec3(0.0), vec3(0.0), n); + float s = inversesqrt(m); + return mat3(t * s, b * s, n); +} void main() { vec3 n = normalize(vNormal); vec3 v = normalize(uEye - vWorld); if (!gl_FrontFacing) n = -n; vec3 base = toLinear(uColor); + float metal = uMetal; + float roughIn = uRough; + if (uMode != 0 && uMaps == 1) { + vec2 st = vec2(vUv.x, 1.0 - vUv.y); + if (uTint == 0) base = texture(uBaseMap, st).rgb; + roughIn = texture(uRoughMap, st).r; + metal = texture(uMetalMap, st).r; + vec3 tn = texture(uNormalMap, st).xyz * 2.0 - 1.0; + vec3 bent = tangentFrame(n) * tn; + if (dot(bent, bent) > 1e-12) n = normalize(bent); + } vec3 col; if (uMode == 0) { vec3 key = normalize(-0.45 * uCamRight + 0.75 * uCamUp + 0.55 * uCamBack); @@ -93,13 +153,13 @@ void main() { float rim = pow(1.0 - max(dot(n, v), 0.0), 3.0); col = base * (0.95 * k + 0.28 * f + mix(0.12, 0.3, hemi)) + vec3(0.05) * rim; } else { - float rough = clamp(uRough, 0.03, 1.0); + float rough = clamp(roughIn, 0.03, 1.0); float nv = clamp(dot(n, v), 1e-3, 1.0); - vec3 f0 = mix(vec3(0.04), base, uMetal); + vec3 f0 = mix(vec3(0.04), base, metal); vec2 ab = envBrdf(nv, rough); vec3 fresnel = f0 * ab.x + ab.y; - vec3 spec = studioSpecular(reflect(-v, n), rough) * fresnel; - vec3 diff = studioIrradiance(n) * base * (1.0 - uMetal) * (1.0 - fresnel); + vec3 spec = gradient(reflect(-v, n), rough) * uEnvTint * fresnel + studioGgx(n, v, rough, f0); + vec3 diff = studioIrradiance(n) * base * (1.0 - metal) * (1.0 - fresnel); col = diff + spec; } outColor = vec4(toDisplay(col), 1.0); From 8ab40e2c9e6ed491567cafa133bde733e429d419 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:21:20 -0500 Subject: [PATCH 281/494] feat(viewport): load preview maps for the raster material view In material mode the raster view fetches preview maps for the materials parts wear, keyed by material revision and a size from the viewport quality (64, 128 or 256, default 128), drops late answers for superseded revisions, frees textures of removed materials and tints the environment by the document's environment colour. Ran npx tsc --noEmit. --- frontend/src/ui/raster-view.ts | 86 +++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/frontend/src/ui/raster-view.ts b/frontend/src/ui/raster-view.ts index be793d89..6f3aa74e 100644 --- a/frontend/src/ui/raster-view.ts +++ b/frontend/src/ui/raster-view.ts @@ -1,5 +1,7 @@ +import { qualityOf, STATUS_COMMAND } from '../engine/devices'; +import { closePreview, MaterialSource, PREVIEW_DEFAULT, PREVIEW_SIZES } from '../engine/raster/materials'; import { RasterRenderer, type RasterMode } from '../engine/raster/renderer'; -import { MeshSource, type RasterInstance } from '../engine/raster/scene-data'; +import { MeshSource, type MaterialInfo, type RasterInstance } from '../engine/raster/scene-data'; import { SceneGraph } from '../engine/scene-graph'; import type { Vec3 } from '../engine/types'; import { onTheme } from '../shell/themes'; @@ -29,6 +31,19 @@ export function cssColor(host: Element, name: string, fallback: Vec3): Vec3 { return p.length >= 3 && p.slice(0, 3).every(Number.isFinite) ? [p[0] / 255, p[1] / 255, p[2] / 255] : fallback; } +const SKY_TINT: Vec3 = [0.9, 0.97, 1.1]; + +export function environmentTint(env: unknown): Vec3 { + const e = env && typeof env === 'object' ? env as Record : {}; + let c: Vec3 = [1, 1, 1]; + const u = e.uniform_colour; + if (e.source === 'uniform' && Array.isArray(u) && u.length >= 3 && u.slice(0, 3).every((x) => typeof x === 'number' && Number.isFinite(x))) c = [u[0], u[1], u[2]]; + else if (e.source === 'sky') c = SKY_TINT; + const lum = 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; + if (!(lum > 1e-4)) return [1, 1, 1]; + return c.map((x) => Math.min(2, Math.max(0, x / lum))) as Vec3; +} + export class RasterView { readonly renderer: RasterRenderer; readonly source: MeshSource; @@ -44,11 +59,20 @@ export class RasterView { private holding = false; private outlineSig = ''; lightsMissing = 0; + readonly materials: MaterialSource; + pendingMaterials = 0; + previewSize = PREVIEW_DEFAULT; + private mode: RasterMode = 'solid'; + private materialList: MaterialInfo[] = []; + private readonly wantedMaterial = new Map(); + private qualityAt = 0; private readonly fns = new Set<() => void>(); constructor(private readonly ws: Workspace, readonly canvas: HTMLCanvasElement, private readonly camera: ViewCamera) { this.renderer = new RasterRenderer(canvas); this.source = new MeshSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); + this.materials = new MaterialSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); + this.renderer.onRestore(() => { void this.syncMaterials(); }); if (!this.renderer.gl || this.renderer.error) { this.state = 'unsupported'; this.message = this.renderer.error; } camera.onChange(() => this.renderer.setCamera(camera.raster())); this.renderer.setCamera(camera.raster()); @@ -60,7 +84,60 @@ export class RasterView { get usable(): boolean { return this.state === 'ready' || (this.state === 'loading' && this.instances.length > 0); } - setMode(mode: RasterMode): void { this.renderer.setMode(mode); } + setMode(mode: RasterMode): void { + this.mode = mode; + this.renderer.setMode(mode); + if (mode === 'material') void this.syncMaterials(); + } + + setPreviewSize(size: number): void { + const s = Math.min(512, Math.max(16, Math.round(size))); + if (s === this.previewSize) return; + this.previewSize = s; + if (this.mode === 'material') void this.syncMaterials(); + } + + private async refreshQuality(): Promise { + const client = this.ws.client; + if (!client.has(STATUS_COMMAND) || performance.now() - this.qualityAt < 5000) return; + this.qualityAt = performance.now(); + try { + const raw = await client.dispatch(STATUS_COMMAND, {}) as Record | null; + const o = (raw && typeof raw.result === 'object' && raw.result ? raw.result : raw) as Record | null; + const q = qualityOf(o?.budget_ms); + this.previewSize = q ? PREVIEW_SIZES[q] : PREVIEW_DEFAULT; + } catch { + this.previewSize = PREVIEW_DEFAULT; + } + } + + private async syncMaterials(): Promise { + if (this.mode !== 'material' || !this.materials.available() || !this.renderer.ready) return; + this.renderer.setEnvironmentTint(environmentTint(this.ws.client.summary?.environment)); + await this.refreshQuality(); + const used = new Set(this.instances.map((i) => i.material).filter((k): k is string => k !== null)); + const size = this.previewSize; + const wanted = this.materialList.filter((m) => used.has(m.key) && !this.renderer.hasMaterial(m.key, m.revision, size) + && this.wantedMaterial.get(m.key) !== m.revision * 1024 + size && !this.materials.failure(m.key, m.revision, size)); + if (!wanted.length) return; + this.pendingMaterials += wanted.length; + this.emit(); + await Promise.all(wanted.map(async (m) => { + const ticket = m.revision * 1024 + size; + this.wantedMaterial.set(m.key, ticket); + try { + const maps = await this.materials.maps(m.key, m.revision, size); + if (this.wantedMaterial.get(m.key) === ticket) this.renderer.setMaterial(maps); + else closePreview(maps); + } catch { + this.renderer.invalidate(); + } finally { + if (this.wantedMaterial.get(m.key) === ticket) this.wantedMaterial.delete(m.key); + this.pendingMaterials--; + this.emit(); + } + })); + } setSize(width: number, height: number, dpr: number): void { this.renderer.setSize(width * dpr, height * dpr); @@ -107,6 +184,11 @@ export class RasterView { this.renderer.setInstances(this.instances); this.renderer.keepMeshes(new Set(scene.meshes.map((m) => m.key))); this.source.forget(new Set(scene.meshes.map((m) => m.key))); + this.materialList = scene.materials ?? []; + const materialKeys = new Set(this.materialList.map((m) => m.key)); + this.renderer.keepMaterials(materialKeys); + this.materials.forget(materialKeys); + void this.syncMaterials(); this.select(); const wanted = scene.meshes.filter((m) => !this.renderer.hasMesh(m.key, m.revision)); this.pendingMeshes = wanted.length; From 8f5aec80c4e9d81d9c8975c541fae8dbf7d70ab4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:14:05 -0500 Subject: [PATCH 282/494] feat(viewport): scale the raster environment by its average colour The material view's environment term is scaled by the document environment's average colour relative to the studio average (uniform colour times intensity, a fixed sky average, the studio itself as 1), and ?raster-debug exposes the raster view for checks. Ran npx tsc --noEmit and the material view in headless Chrome. --- frontend/src/ui/raster-view.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/ui/raster-view.ts b/frontend/src/ui/raster-view.ts index 6f3aa74e..26a25789 100644 --- a/frontend/src/ui/raster-view.ts +++ b/frontend/src/ui/raster-view.ts @@ -31,17 +31,17 @@ export function cssColor(host: Element, name: string, fallback: Vec3): Vec3 { return p.length >= 3 && p.slice(0, 3).every(Number.isFinite) ? [p[0] / 255, p[1] / 255, p[2] / 255] : fallback; } -const SKY_TINT: Vec3 = [0.9, 0.97, 1.1]; +const STUDIO_AVERAGE = 0.55; +const SKY_AVERAGE: Vec3 = [0.5, 0.54, 0.6]; export function environmentTint(env: unknown): Vec3 { const e = env && typeof env === 'object' ? env as Record : {}; - let c: Vec3 = [1, 1, 1]; + const k = typeof e.intensity === 'number' && Number.isFinite(e.intensity) && e.intensity >= 0 ? e.intensity : 1; + let c: Vec3 = [STUDIO_AVERAGE, STUDIO_AVERAGE, STUDIO_AVERAGE]; const u = e.uniform_colour; if (e.source === 'uniform' && Array.isArray(u) && u.length >= 3 && u.slice(0, 3).every((x) => typeof x === 'number' && Number.isFinite(x))) c = [u[0], u[1], u[2]]; - else if (e.source === 'sky') c = SKY_TINT; - const lum = 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; - if (!(lum > 1e-4)) return [1, 1, 1]; - return c.map((x) => Math.min(2, Math.max(0, x / lum))) as Vec3; + else if (e.source === 'sky') c = SKY_AVERAGE; + return c.map((x) => Math.min(4, Math.max(0, (x * k) / STUDIO_AVERAGE))) as Vec3; } export class RasterView { @@ -73,6 +73,7 @@ export class RasterView { this.source = new MeshSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); this.materials = new MaterialSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); this.renderer.onRestore(() => { void this.syncMaterials(); }); + if (new URLSearchParams(window.location.search).has('raster-debug')) (window as unknown as Record).__formshotRaster = this; if (!this.renderer.gl || this.renderer.error) { this.state = 'unsupported'; this.message = this.renderer.error; } camera.onChange(() => this.renderer.setCamera(camera.raster())); this.renderer.setCamera(camera.raster()); From 60c9f47a60c1c1bdb822ac7d8552e126e75e91e3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:17:42 -0500 Subject: [PATCH 283/494] fix(viewport): keep one preview request per material in flight While a material changes quickly the raster view now waits for its running preview request, shows that answer, and then asks once more for the newest revision instead of starting a request per revision. Ran twelve quick material.set_params edits in headless Chrome: nine requests, the last matching the engine's revision. --- frontend/src/ui/raster-view.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/ui/raster-view.ts b/frontend/src/ui/raster-view.ts index 26a25789..c379bf1e 100644 --- a/frontend/src/ui/raster-view.ts +++ b/frontend/src/ui/raster-view.ts @@ -64,7 +64,7 @@ export class RasterView { previewSize = PREVIEW_DEFAULT; private mode: RasterMode = 'solid'; private materialList: MaterialInfo[] = []; - private readonly wantedMaterial = new Map(); + private readonly busyMaterials = new Set(); private qualityAt = 0; private readonly fns = new Set<() => void>(); @@ -118,26 +118,26 @@ export class RasterView { await this.refreshQuality(); const used = new Set(this.instances.map((i) => i.material).filter((k): k is string => k !== null)); const size = this.previewSize; - const wanted = this.materialList.filter((m) => used.has(m.key) && !this.renderer.hasMaterial(m.key, m.revision, size) - && this.wantedMaterial.get(m.key) !== m.revision * 1024 + size && !this.materials.failure(m.key, m.revision, size)); + const wanted = this.materialList.filter((m) => used.has(m.key) && !this.busyMaterials.has(m.key) + && !this.renderer.hasMaterial(m.key, m.revision, size) && !this.materials.failure(m.key, m.revision, size)); if (!wanted.length) return; + for (const m of wanted) this.busyMaterials.add(m.key); this.pendingMaterials += wanted.length; this.emit(); await Promise.all(wanted.map(async (m) => { - const ticket = m.revision * 1024 + size; - this.wantedMaterial.set(m.key, ticket); try { const maps = await this.materials.maps(m.key, m.revision, size); - if (this.wantedMaterial.get(m.key) === ticket) this.renderer.setMaterial(maps); + if (this.materialList.some((x) => x.key === m.key)) this.renderer.setMaterial(maps); else closePreview(maps); } catch { this.renderer.invalidate(); } finally { - if (this.wantedMaterial.get(m.key) === ticket) this.wantedMaterial.delete(m.key); + this.busyMaterials.delete(m.key); this.pendingMaterials--; this.emit(); } })); + void this.syncMaterials(); } setSize(width: number, height: number, dpr: number): void { From 3f93b30bc18ddc5def907be761c44193726dff79 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:19:24 -0500 Subject: [PATCH 284/494] feat(viewport): follow the viewport quality for preview map sizes A render.viewport reply from the window's client sets the preview map size at once (smooth 64, balanced 128, sharp 256), and render.status is read through parseEngineView. Ran sharp, smooth and balanced in headless Chrome: each refetched the three textured materials at the new size and not the constant one. --- frontend/src/ui/raster-view.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/ui/raster-view.ts b/frontend/src/ui/raster-view.ts index c379bf1e..b52cdda3 100644 --- a/frontend/src/ui/raster-view.ts +++ b/frontend/src/ui/raster-view.ts @@ -1,4 +1,4 @@ -import { qualityOf, STATUS_COMMAND } from '../engine/devices'; +import { parseEngineView, STATUS_COMMAND, VIEWPORT_COMMAND } from '../engine/devices'; import { closePreview, MaterialSource, PREVIEW_DEFAULT, PREVIEW_SIZES } from '../engine/raster/materials'; import { RasterRenderer, type RasterMode } from '../engine/raster/renderer'; import { MeshSource, type MaterialInfo, type RasterInstance } from '../engine/raster/scene-data'; @@ -73,6 +73,13 @@ export class RasterView { this.source = new MeshSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); this.materials = new MaterialSource((name, args) => ws.client.dispatch(name, args), (name) => ws.client.has(name)); this.renderer.onRestore(() => { void this.syncMaterials(); }); + ws.client.onDispatch((n) => { + if (n.name !== VIEWPORT_COMMAND) return; + const q = parseEngineView(n.result).quality; + if (!q) return; + this.qualityAt = performance.now(); + this.setPreviewSize(PREVIEW_SIZES[q]); + }); if (new URLSearchParams(window.location.search).has('raster-debug')) (window as unknown as Record).__formshotRaster = this; if (!this.renderer.gl || this.renderer.error) { this.state = 'unsupported'; this.message = this.renderer.error; } camera.onChange(() => this.renderer.setCamera(camera.raster())); @@ -103,9 +110,7 @@ export class RasterView { if (!client.has(STATUS_COMMAND) || performance.now() - this.qualityAt < 5000) return; this.qualityAt = performance.now(); try { - const raw = await client.dispatch(STATUS_COMMAND, {}) as Record | null; - const o = (raw && typeof raw.result === 'object' && raw.result ? raw.result : raw) as Record | null; - const q = qualityOf(o?.budget_ms); + const q = parseEngineView(await client.dispatch(STATUS_COMMAND, {})).quality; this.previewSize = q ? PREVIEW_SIZES[q] : PREVIEW_DEFAULT; } catch { this.previewSize = PREVIEW_DEFAULT; From 6937cc414c2255b0beff5cb2696f2d3890352a6d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:37:59 -0500 Subject: [PATCH 285/494] fix(meshes): stat only absolute texture paths for material revisions Relative and embedded texture paths were looked up against the engine's working folder; the material fingerprint now reads file length and modified time only for absolute paths and uses the path text otherwise. Ran cargo clippy -p fsh-commands with -D warnings. --- native/crates/fsh-commands/src/meshes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/meshes.rs b/native/crates/fsh-commands/src/meshes.rs index d792f6c9..d4f6d212 100644 --- a/native/crates/fsh-commands/src/meshes.rs +++ b/native/crates/fsh-commands/src/meshes.rs @@ -24,7 +24,8 @@ fn material_print(doc: &Document, m: &fsh_scene::Material) -> u64 { if let Some(t) = doc.textures().get(&k) { text.push('\n'); text.push_str(&t.path); - if let Ok(meta) = std::fs::metadata(&t.path) { + let path = std::path::Path::new(&t.path); + if let Some(meta) = path.is_absolute().then(|| std::fs::metadata(path).ok()).flatten() { let modified = meta.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_nanos()).unwrap_or(0); text.push_str(&format!(" {} {modified}", meta.len())); } From 71282709238f80de02ced523f880848cb839f2e1 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:46:08 -0500 Subject: [PATCH 286/494] perf(viewport): fetch preview maps only for materials on visible parts Hidden parts no longer cost a preview bake; showing the part fetches its material's maps on the next scene load. Ran in headless Chrome with the bricks sphere hidden: three materials fetched, and showing it fetched the fourth. --- frontend/src/ui/raster-view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/raster-view.ts b/frontend/src/ui/raster-view.ts index b52cdda3..3175e037 100644 --- a/frontend/src/ui/raster-view.ts +++ b/frontend/src/ui/raster-view.ts @@ -121,7 +121,7 @@ export class RasterView { if (this.mode !== 'material' || !this.materials.available() || !this.renderer.ready) return; this.renderer.setEnvironmentTint(environmentTint(this.ws.client.summary?.environment)); await this.refreshQuality(); - const used = new Set(this.instances.map((i) => i.material).filter((k): k is string => k !== null)); + const used = new Set(this.instances.filter((i) => i.visible).map((i) => i.material).filter((k): k is string => k !== null)); const size = this.previewSize; const wanted = this.materialList.filter((m) => used.has(m.key) && !this.busyMaterials.has(m.key) && !this.renderer.hasMaterial(m.key, m.revision, size) && !this.materials.failure(m.key, m.revision, size)); From b54db98dd33cf4dd7dd2e4de8b0f2e0c2ca1ca6c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 287/494] feat(library): add a sha-256 digest for preset hashes The engine has no hashing crate, so the library carries a small FIPS 180-4 SHA-256 to check presets against the index and key thumbnails. Compiled with cargo check -p fsh-commands once the library commands use it. --- .../fsh-commands/src/ext/library/sha256.rs | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/sha256.rs diff --git a/native/crates/fsh-commands/src/ext/library/sha256.rs b/native/crates/fsh-commands/src/ext/library/sha256.rs new file mode 100644 index 00000000..88eb22d5 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/sha256.rs @@ -0,0 +1,73 @@ +//! SHA-256 (FIPS 180-4), for preset hashes and thumbnail cache keys. + +const K: [u32; 64] = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, + 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, + 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, +]; + +const H0: [u32; 8] = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]; + +fn block(h: &mut [u32; 8], chunk: &[u8]) { + let mut w = [0u32; 64]; + for (i, word) in chunk.chunks_exact(4).enumerate() { + w[i] = u32::from_be_bytes([word[0], word[1], word[2], word[3]]); + } + for i in 16..64 { + let s0 = w[i - 15].rotate_right(7) ^ w[i - 15].rotate_right(18) ^ (w[i - 15] >> 3); + let s1 = w[i - 2].rotate_right(17) ^ w[i - 2].rotate_right(19) ^ (w[i - 2] >> 10); + w[i] = w[i - 16].wrapping_add(s0).wrapping_add(w[i - 7]).wrapping_add(s1); + } + let [mut a, mut b, mut c, mut d, mut e, mut f, mut g, mut hh] = *h; + for i in 0..64 { + let s1 = e.rotate_right(6) ^ e.rotate_right(11) ^ e.rotate_right(25); + let ch = (e & f) ^ (!e & g); + let t1 = hh.wrapping_add(s1).wrapping_add(ch).wrapping_add(K[i]).wrapping_add(w[i]); + let s0 = a.rotate_right(2) ^ a.rotate_right(13) ^ a.rotate_right(22); + let maj = (a & b) ^ (a & c) ^ (b & c); + let t2 = s0.wrapping_add(maj); + hh = g; + g = f; + f = e; + e = d.wrapping_add(t1); + d = c; + c = b; + b = a; + a = t1.wrapping_add(t2); + } + for (x, y) in h.iter_mut().zip([a, b, c, d, e, f, g, hh]) { + *x = x.wrapping_add(y); + } +} + +/// The digest of `data` as 32 bytes. +pub(crate) fn digest(data: &[u8]) -> [u8; 32] { + let mut h = H0; + let mut chunks = data.chunks_exact(64); + for c in &mut chunks { + block(&mut h, c); + } + let rest = chunks.remainder(); + let mut tail = [0u8; 128]; + tail[..rest.len()].copy_from_slice(rest); + tail[rest.len()] = 0x80; + let n = if rest.len() < 56 { 64 } else { 128 }; + tail[n - 8..n].copy_from_slice(&((data.len() as u64) * 8).to_be_bytes()); + for c in tail[..n].chunks_exact(64) { + block(&mut h, c); + } + let mut out = [0u8; 32]; + for (o, v) in out.chunks_exact_mut(4).zip(h) { + o.copy_from_slice(&v.to_be_bytes()); + } + out +} + +/// The digest of `data` as 64 lower-case hex digits. +pub(crate) fn hex(data: &[u8]) -> String { + digest(data).iter().map(|b| format!("{b:02x}")).collect() +} From 5aaa68f0079bfd2b6dadef687df87e9b24c0a8b0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 288/494] feat(library): find the library root, user data and cache folders The root is FORMSHOT_LIBRARY, then the desktop bundle's resource folder for each platform, then assets/library above the running program. User data and cache follow the platform rules with FORMSHOT_USER_DATA and FORMSHOT_CACHE overrides, and writes go through an atomic rename. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/locate.rs | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/locate.rs diff --git a/native/crates/fsh-commands/src/ext/library/locate.rs b/native/crates/fsh-commands/src/ext/library/locate.rs new file mode 100644 index 00000000..a709fcd1 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/locate.rs @@ -0,0 +1,146 @@ +//! Where the library lives: the built-in presets, the user's own presets and state, the thumbnail cache. + +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicU64, Ordering}; + +/// Environment variable naming the library root (the folder holding `materials/index.json`). +pub(crate) const LIBRARY_ENV: &str = "FORMSHOT_LIBRARY"; +/// Environment variable replacing the platform's user data folder. +pub(crate) const USER_DATA_ENV: &str = "FORMSHOT_USER_DATA"; +/// Environment variable replacing the platform's user cache folder (shared with the CAD worker cache). +pub(crate) const CACHE_ENV: &str = "FORMSHOT_CACHE"; +const PRODUCT: &str = "FormShot"; +const INDEX: &str = "index.json"; + +/// How the root was found. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum Origin { + Env, + Bundle, + Development, +} + +impl Origin { + pub(crate) fn as_str(self) -> &'static str { + match self { + Origin::Env => "env", + Origin::Bundle => "bundle", + Origin::Development => "development", + } + } +} + +fn var(k: &str) -> Option { + std::env::var_os(k).filter(|v| !v.is_empty()).map(PathBuf::from) +} + +fn home() -> Option { + var("HOME").or_else(|| var("USERPROFILE")) +} + +fn has_index(root: &Path) -> bool { + root.join("materials").join(INDEX).is_file() +} + +/// Places the desktop bundle puts resources, relative to the running program (Tauri's resource folder on each +/// platform: `Contents/Resources` on macOS, beside the program on Windows, `lib/` on Linux and AppImage). +fn bundle_places(exe_dir: &Path) -> Vec { + let mut places = vec![ + exe_dir.join("..").join("Resources").join("library"), + exe_dir.join("library"), + exe_dir.join("resources").join("library"), + exe_dir.join("..").join("lib").join(PRODUCT).join("library"), + exe_dir.join("..").join("lib").join(PRODUCT.to_lowercase()).join("library"), + ]; + if let Some(appdir) = var("APPDIR") { + places.push(appdir.join("usr").join("lib").join(PRODUCT).join("library")); + } + places.push(PathBuf::from("/usr/lib").join(PRODUCT).join("library")); + places +} + +/// The library root: `FORMSHOT_LIBRARY`, then the app's bundled resources, then `assets/library` in a folder above +/// the running program (development builds). The error names every place looked at. +pub(crate) fn root() -> Result<(PathBuf, Origin), String> { + if let Some(p) = var(LIBRARY_ENV) { + if has_index(&p) { + return Ok((p, Origin::Env)); + } + return Err(format!("{LIBRARY_ENV} names {}, which holds no materials/{INDEX}", p.display())); + } + let exe = std::env::current_exe().ok().map(|e| e.canonicalize().unwrap_or(e)); + let Some(dir) = exe.as_deref().and_then(Path::parent) else { + return Err(format!("no material library: {LIBRARY_ENV} is not set and the running program's folder is unknown")); + }; + if let Some(p) = bundle_places(dir).into_iter().find(|p| has_index(p)) { + return Ok((p.canonicalize().unwrap_or(p), Origin::Bundle)); + } + for up in dir.ancestors() { + let p = up.join("assets").join("library"); + if has_index(&p) { + return Ok((p, Origin::Development)); + } + } + Err(format!( + "no material library: {LIBRARY_ENV} is not set, the app bundle holds none beside {} and no assets/library was found above it", + dir.display() + )) +} + +/// The platform's user data folder (`FORMSHOT_USER_DATA` replaces it): `%APPDATA%` on Windows, +/// `~/Library/Application Support` on macOS, `$XDG_DATA_HOME` or `~/.local/share` elsewhere. +pub(crate) fn user_data_dir() -> Option { + if let Some(p) = var(USER_DATA_ENV) { + return Some(p); + } + if cfg!(windows) { + return var("APPDATA").or_else(|| home().map(|h| h.join("AppData").join("Roaming"))); + } + if cfg!(target_os = "macos") { + return home().map(|h| h.join("Library").join("Application Support")); + } + var("XDG_DATA_HOME").filter(|p| p.is_absolute()).or_else(|| home().map(|h| h.join(".local").join("share"))) +} + +/// The platform's user cache folder, by the same rules as the CAD worker cache (`FORMSHOT_CACHE` replaces it). +pub(crate) fn cache_dir() -> Option { + if let Some(p) = var(CACHE_ENV) { + return Some(p); + } + if cfg!(windows) { + return var("LOCALAPPDATA").or_else(|| home().map(|h| h.join("AppData").join("Local"))); + } + if cfg!(target_os = "macos") { + return home().map(|h| h.join("Library").join("Caches")); + } + var("XDG_CACHE_HOME").filter(|p| p.is_absolute()).or_else(|| home().map(|h| h.join(".cache"))) +} + +/// `/formshot/library`: the user's presets (`materials//`) and `state.json`. +pub(crate) fn user_library() -> Option { + user_data_dir().map(|d| d.join("formshot").join("library")) +} + +/// `/formshot/library/thumbs`. +pub(crate) fn thumbs_dir() -> Option { + cache_dir().map(|d| d.join("formshot").join("library").join("thumbs")) +} + +/// Writes a file through a temporary sibling and a rename, so readers never see half a file. +pub(crate) fn write_atomic(path: &Path, bytes: &[u8]) -> std::io::Result<()> { + if let Some(dir) = path.parent() { + std::fs::create_dir_all(dir)?; + } + let name = path.file_name().and_then(|n| n.to_str()).unwrap_or("file"); + static SERIAL: AtomicU64 = AtomicU64::new(0); + let n = SERIAL.fetch_add(1, Ordering::Relaxed); + let tmp = path.with_file_name(format!(".{name}.{}.{n}.tmp", std::process::id())); + std::fs::write(&tmp, bytes)?; + match std::fs::rename(&tmp, path) { + Ok(()) => Ok(()), + Err(e) => { + let _ = std::fs::remove_file(&tmp); + Err(e) + } + } +} From cbc266e1d8ffc3736a4ecf8fb9c4b699e452fdb2 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 289/494] feat(library): read presets strictly and build their materials Presets of format 1 are read with every key checked: unknown params keys and unknown top-level keys are refused with the preset id named. The material is SurfaceParams default, then the type's preset, then params, with the type's graph tuned to the preset's tone. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/preset.rs | 287 ++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/preset.rs diff --git a/native/crates/fsh-commands/src/ext/library/preset.rs b/native/crates/fsh-commands/src/ext/library/preset.rs new file mode 100644 index 00000000..8c3c74c5 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/preset.rs @@ -0,0 +1,287 @@ +//! One preset file (format 1 of LIBRARY_FORMAT.md): strict reading, and the material it builds. + +use super::sha256; +use fsh_core::Rgb; +use fsh_scene::{material_type, GraphOp, Material, MaterialGraph, MaterialInput, MathOp, SocketValue, SurfaceParams}; +use serde_json::{json, Map, Value}; +use std::path::PathBuf; + +pub(crate) const FORMAT: &str = "formshot-material-preset"; +pub(crate) const VERSION: u64 = 1; +const KEYS: [&str; 10] = ["format", "version", "id", "name", "category", "type", "params", "tags", "source", "licence"]; +const MAX_SLUG: usize = 48; +const MAX_TAGS: usize = 8; + +/// The window's twelve categories, in its order, with their folder names. +pub(crate) const CATEGORIES: [(&str, &str); 12] = [ + ("Metal", "metal"), + ("Plastic", "plastic"), + ("Glass", "glass"), + ("Paint", "paint"), + ("Rubber", "rubber"), + ("Fabric", "fabric"), + ("Wood", "wood"), + ("Stone", "stone"), + ("Ceramic", "ceramic"), + ("Liquid", "liquid"), + ("Gem", "gem"), + ("Emissive", "emissive"), +]; + +/// The category of a name or folder, any case: `(name, folder, order)`. +pub(crate) fn category(s: &str) -> Option<(&'static str, &'static str, usize)> { + let s = s.trim(); + CATEGORIES + .iter() + .enumerate() + .find(|(_, (n, f))| n.eq_ignore_ascii_case(s) || f.eq_ignore_ascii_case(s)) + .map(|(i, (n, f))| (*n, *f, i)) +} + +/// True for `[a-z0-9]+(-[a-z0-9]+)*` of at most 48 characters. +pub(crate) fn valid_slug(s: &str) -> bool { + !s.is_empty() + && s.len() <= MAX_SLUG + && !s.starts_with('-') + && !s.ends_with('-') + && !s.contains("--") + && s.bytes().all(|b| b.is_ascii_lowercase() || b.is_ascii_digit() || b == b'-') +} + +/// A preset as read from its file. +#[derive(Clone, Debug)] +pub(crate) struct Preset { + pub id: String, + pub name: String, + pub category: &'static str, + pub folder: &'static str, + pub order: usize, + pub type_id: String, + pub params: Map, + pub tags: Vec, + pub source: Value, + pub raw: Value, + pub sha256: String, + pub file: PathBuf, + pub user: bool, +} + +/// `SurfaceParams` field names with the JSON kind of each (`n` number, `b` bool, `c` colour). +pub(crate) fn param_fields() -> Vec<(String, char)> { + let Ok(Value::Object(m)) = serde_json::to_value(SurfaceParams::default()) else { return Vec::new() }; + m.into_iter() + .map(|(k, v)| { + let kind = match v { + Value::Bool(_) => 'b', + Value::Array(_) => 'c', + _ => 'n', + }; + (k, kind) + }) + .collect() +} + +fn check_params(id: &str, params: &Map) -> Result<(), String> { + let fields = param_fields(); + for (k, v) in params { + let Some((_, kind)) = fields.iter().find(|(f, _)| f == k) else { + return Err(format!("preset {id}: unknown params key \"{k}\" (not a SurfaceParams field)")); + }; + let ok = match kind { + 'b' => v.is_boolean(), + 'c' => v.as_array().is_some_and(|a| a.len() == 3 && a.iter().all(|x| x.as_f64().is_some_and(f64::is_finite))), + _ => v.as_f64().is_some_and(f64::is_finite), + }; + if !ok { + let want = match kind { + 'b' => "true or false", + 'c' => "an [r, g, b] array of numbers", + _ => "a number", + }; + return Err(format!("preset {id}: params.{k} must be {want}")); + } + } + Ok(()) +} + +/// The surface parameters a preset builds: `SurfaceParams::default()`, the type's defaults, then `params`. +pub(crate) fn build_params(id: &str, type_id: &str, params: &Map) -> Result { + let t = material_type(type_id).ok_or_else(|| format!("preset {id}: unknown material type \"{type_id}\""))?; + let mut base = serde_json::to_value(t.params).map_err(|e| e.to_string())?; + if let Value::Object(b) = &mut base { + for (k, v) in params { + b.insert(k.clone(), v.clone()); + } + } + let p: SurfaceParams = serde_json::from_value(base).map_err(|e| format!("preset {id}: params: {e}"))?; + p.validate().map_err(|e| format!("preset {id}: {e}"))?; + Ok(p) +} + +fn string(id: &str, v: &Value, k: &str) -> Result { + v.get(k).and_then(Value::as_str).map(str::to_string).ok_or_else(|| format!("preset {id}: \"{k}\" must be a string")) +} + +/// Reads a preset strictly. `expect_id` is the id its place gives it, `folder` the category folder it lies in. +pub(crate) fn parse(bytes: &[u8], expect_id: &str, folder: &str, file: PathBuf, user: bool) -> Result { + let id = expect_id; + let raw: Value = serde_json::from_slice(bytes).map_err(|e| format!("preset {id}: not JSON: {e}"))?; + let Value::Object(obj) = &raw else { return Err(format!("preset {id}: not a JSON object")) }; + if let Some(k) = obj.keys().find(|k| !KEYS.contains(&k.as_str())) { + return Err(format!("preset {id}: unknown key \"{k}\"")); + } + if raw.get("format").and_then(Value::as_str) != Some(FORMAT) { + return Err(format!("preset {id}: \"format\" must be \"{FORMAT}\"")); + } + match raw.get("version").and_then(Value::as_u64) { + Some(VERSION) => {} + Some(v) => return Err(format!("preset {id}: format version {v} is not known (this engine reads {VERSION})")), + None => return Err(format!("preset {id}: \"version\" must be an integer")), + } + let own = string(id, &raw, "id")?; + if own != id { + return Err(format!("preset {id}: its id \"{own}\" does not match its place")); + } + let slug = id.rsplit('/').next().unwrap_or(""); + if !valid_slug(slug) { + return Err(format!("preset {id}: \"{slug}\" is not a valid slug")); + } + let name = string(id, &raw, "name")?; + if name.trim().is_empty() { + return Err(format!("preset {id}: empty name")); + } + let cat = string(id, &raw, "category")?; + let (category, cat_folder, order) = category(&cat).filter(|c| c.0 == cat).ok_or_else(|| format!("preset {id}: unknown category \"{cat}\""))?; + if cat_folder != folder { + return Err(format!("preset {id}: category {category} does not belong in folder {folder}")); + } + let type_id = string(id, &raw, "type")?; + let Some(Value::Object(params)) = raw.get("params") else { return Err(format!("preset {id}: \"params\" must be an object")) }; + check_params(id, params)?; + build_params(id, &type_id, params)?; + let tags = match raw.get("tags") { + Some(Value::Array(a)) if a.len() <= MAX_TAGS && a.iter().all(Value::is_string) => { + a.iter().filter_map(Value::as_str).map(str::to_string).collect() + } + _ => return Err(format!("preset {id}: \"tags\" must be at most {MAX_TAGS} strings")), + }; + let source = match raw.get("source") { + Some(s @ Value::Object(_)) => s.clone(), + _ => return Err(format!("preset {id}: \"source\" must be an object")), + }; + string(id, &raw, "licence")?; + Ok(Preset { + id: id.to_string(), + name, + category, + folder: cat_folder, + order, + type_id, + params: params.clone(), + tags, + source, + sha256: sha256::hex(bytes), + raw, + file, + user, + }) +} + +/// Whether the procedural patterns are in the engine yet (the wave 1 stub answers one constant everywhere). +pub(crate) fn procedurals_live() -> bool { + use fsh_scene::fsh_materials::{procedural, ProcKind}; + let at = |x: f32| { + let mut args = vec![[0.0f32; 4]; 8]; + args[0] = [x, 0.37 * x, 0.11, 0.0]; + args[1] = [1.0, 0.0, 0.0, 0.0]; + args[2] = [20.0, 0.0, 0.0, 0.0]; + args[3] = [0.5, 0.0, 0.0, 0.0]; + args[4] = [0.45, 0.28, 0.14, 0.0]; + args[5] = [0.2, 0.1, 0.05, 0.0]; + procedural(ProcKind::Wood, 0, &args) + }; + [0.013f32, 0.29, 0.61].iter().any(|x| at(*x) != at(0.83)) +} + +/// How a preset's graph is handled when building its material. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum GraphMode { + /// The type's preset graph, its colour and finish inputs taken from the preset. + Type, + /// No graph: the preset's average tone and finish as constants. + Flat, +} + +fn scaled(c: Rgb, f: f32) -> [f32; 3] { + [(c.r * f).clamp(0.0, 1.0), (c.g * f).clamp(0.0, 1.0), (c.b * f).clamp(0.0, 1.0)] +} + +/// Fits the type's preset graph to a preset: wood and marble colours around the preset's average tone (light 1.3x, +/// dark 0.55x for wood; base 1.08x, vein 0.45x for marble), and the flake lerps around its roughness and metalness. +fn tune(graph: &mut MaterialGraph, p: &SurfaceParams) { + let outputs: Vec<(MaterialInput, u32)> = graph.outputs.iter().map(|(i, s)| (*i, s.0)).collect(); + for (input, node) in outputs { + let Some(n) = graph.nodes.get_mut(&node) else { continue }; + match (&n.op, input) { + (GraphOp::Wood { .. }, MaterialInput::BaseColor) => { + n.inputs.insert("colour1".into(), SocketValue::Colour(scaled(p.base_color, 1.3))); + n.inputs.insert("colour2".into(), SocketValue::Colour(scaled(p.base_color, 0.55))); + } + (GraphOp::Marble { .. }, MaterialInput::BaseColor) => { + n.inputs.insert("colour1".into(), SocketValue::Colour(scaled(p.base_color, 1.08))); + n.inputs.insert("colour2".into(), SocketValue::Colour(scaled(p.base_color, 0.45))); + } + (GraphOp::Math { op: MathOp::Lerp }, MaterialInput::SpecularRoughness) => { + let r = p.specular_roughness; + n.inputs.insert("a".into(), SocketValue::Float(r)); + n.inputs.insert("b".into(), SocketValue::Float(r * 0.35)); + } + (GraphOp::Math { op: MathOp::Lerp }, MaterialInput::BaseMetalness) => { + let m = p.base_metalness; + n.inputs.insert("a".into(), SocketValue::Float((m * 0.8).clamp(0.0, 1.0))); + n.inputs.insert("b".into(), SocketValue::Float((m * 1.3).clamp(0.0, 1.0))); + } + _ => {} + } + } +} + +impl Preset { + /// True when the look depends on the type's graph (`needs-graph` tag or a type with a preset graph). + pub(crate) fn needs_graph(&self) -> bool { + self.tags.iter().any(|t| t == "needs-graph") || material_type(&self.type_id).is_some_and(|t| t.graph.is_some()) + } + + /// The surface parameters (type defaults, then `params`). + pub(crate) fn params(&self) -> Result { + build_params(&self.id, &self.type_id, &self.params) + } + + /// The material applying this preset makes, named after it. + pub(crate) fn material(&self, mode: GraphMode) -> Result { + let params = self.params()?; + let mut m = Material::new(self.name.clone(), self.type_id.clone(), params); + if mode == GraphMode::Type { + if let Some(mut g) = material_type(&self.type_id).and_then(|t| t.graph.clone()) { + tune(&mut g, ¶ms); + m.graph = Some(Box::new(g)); + } + } + Ok(m) + } + + /// The summary entry the list, recent and get replies carry. + pub(crate) fn entry(&self, favorite: bool) -> Value { + json!({ + "id": self.id, + "name": self.name, + "category": self.category, + "type": self.type_id, + "tags": self.tags, + "sha256": self.sha256, + "user": self.user, + "favorite": favorite, + "needs_graph": self.needs_graph(), + }) + } +} From cac81a99cd4eda9c6fbcdc4a284f98f47af1f72c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 290/494] feat(library): load the index and check each preset file against it A missing file, a hash that differs from the index or a bad preset becomes a library warning instead of an error. The user's own presets are read from the user data folder as user/. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/store.rs | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/store.rs diff --git a/native/crates/fsh-commands/src/ext/library/store.rs b/native/crates/fsh-commands/src/ext/library/store.rs new file mode 100644 index 00000000..92f14bbd --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/store.rs @@ -0,0 +1,167 @@ +//! The built-in library (index plus preset files, checked against each other) and the user's own presets. + +use super::locate::{self, Origin}; +use super::preset::{self, Preset, CATEGORIES}; +use super::sha256; +use serde_json::Value; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex}; +use std::time::SystemTime; + +const INDEX_FORMAT: &str = "formshot-material-index"; +/// Id prefix of the user's own presets. +pub(crate) const USER_PREFIX: &str = "user/"; + +/// The built-in presets in index order, with what was wrong with the library. +#[derive(Debug)] +pub(crate) struct Library { + pub root: PathBuf, + pub origin: Origin, + pub presets: Vec, + pub warnings: Vec, + stamp: Option, +} + +fn index_stamp(root: &Path) -> Option { + std::fs::metadata(root.join("materials").join("index.json")).and_then(|m| m.modified()).ok() +} + +fn load(root: PathBuf, origin: Origin) -> Library { + let stamp = index_stamp(&root); + let mut lib = Library { root, origin, presets: Vec::new(), warnings: Vec::new(), stamp }; + let materials = lib.root.join("materials"); + let index: Value = match std::fs::read(materials.join("index.json")).map_err(|e| e.to_string()).and_then(|b| serde_json::from_slice(&b).map_err(|e| e.to_string())) { + Ok(v) => v, + Err(e) => { + lib.warnings.push(format!("the library index {} could not be read: {e}", materials.join("index.json").display())); + return lib; + } + }; + if index.get("format").and_then(Value::as_str) != Some(INDEX_FORMAT) || index.get("version").and_then(Value::as_u64) != Some(1) { + lib.warnings.push(format!("the library index is not a {INDEX_FORMAT} of version 1")); + return lib; + } + let listed = index.get("presets").and_then(Value::as_array).cloned().unwrap_or_default(); + for e in &listed { + let id = e.get("id").and_then(Value::as_str).unwrap_or(""); + let file = e.get("file").and_then(Value::as_str).unwrap_or(""); + let want = e.get("sha256").and_then(Value::as_str).unwrap_or(""); + let folder = file.split('/').next().unwrap_or(""); + if id.is_empty() || file.is_empty() || file.contains("..") || format!("{id}.json") != file { + lib.warnings.push(format!("index entry {id:?}: its file {file:?} does not match its id")); + continue; + } + let path = materials.join(file); + let bytes = match std::fs::read(&path) { + Ok(b) => b, + Err(_) => { + lib.warnings.push(format!("preset {id}: its file {file} is missing")); + continue; + } + }; + let got = sha256::hex(&bytes); + if !want.eq_ignore_ascii_case(&got) { + lib.warnings.push(format!("preset {id}: the file's SHA-256 {got} differs from the index ({want})")); + } + match preset::parse(&bytes, id, folder, path, false) { + Ok(p) => { + let indexed = [("name", p.name.as_str()), ("category", p.category), ("type", p.type_id.as_str())]; + for (k, v) in indexed { + if e.get(k).and_then(Value::as_str) != Some(v) { + lib.warnings.push(format!("preset {id}: the index gives a different {k}")); + } + } + lib.presets.push(p); + } + Err(msg) => lib.warnings.push(msg), + } + } + if let Some(n) = index.get("count").and_then(Value::as_u64) { + if n as usize != listed.len() { + lib.warnings.push(format!("the index says {n} presets but lists {}", listed.len())); + } + } + lib +} + +/// The built-in library, read once and again whenever its root or its index changes. +pub(crate) fn library() -> Result, String> { + static CACHE: Mutex>> = Mutex::new(None); + let (root, origin) = locate::root()?; + let mut cache = CACHE.lock().unwrap_or_else(|p| p.into_inner()); + if let Some(lib) = cache.as_ref() { + if lib.root == root && lib.stamp == index_stamp(&root) { + return Ok(Arc::clone(lib)); + } + } + let lib = Arc::new(load(root, origin)); + *cache = Some(Arc::clone(&lib)); + Ok(lib) +} + +/// `/formshot/library/materials`. +pub(crate) fn user_materials() -> Option { + locate::user_library().map(|d| d.join("materials")) +} + +/// The user's own presets (`user/`), category order then name, with problems found while reading them. +pub(crate) fn user_presets() -> (Vec, Vec) { + let mut out = Vec::new(); + let mut warnings = Vec::new(); + let Some(root) = user_materials() else { return (out, warnings) }; + for (_, folder) in CATEGORIES { + let Ok(entries) = std::fs::read_dir(root.join(folder)) else { continue }; + for e in entries.flatten() { + let path = e.path(); + let Some(slug) = path.file_name().and_then(|n| n.to_str()).and_then(|n| n.strip_suffix(".json")) else { continue }; + if slug.starts_with('.') { + continue; + } + let id = format!("{USER_PREFIX}{slug}"); + match std::fs::read(&path).map_err(|e| format!("preset {id}: {e}")).and_then(|b| preset::parse(&b, &id, folder, path.clone(), true)) { + Ok(p) => out.push(p), + Err(m) => warnings.push(m), + } + } + } + out.sort_by(|a, b| a.order.cmp(&b.order).then_with(|| a.name.cmp(&b.name)).then_with(|| a.id.cmp(&b.id))); + (out, warnings) +} + +/// Every preset (built-ins in index order, the user's after the built-ins of their category) and all warnings. +pub(crate) fn all() -> Result<(Arc, Vec, Vec), String> { + let lib = library()?; + let (user, user_warnings) = user_presets(); + let mut presets: Vec = Vec::with_capacity(lib.presets.len() + user.len()); + for (i, _) in CATEGORIES.iter().enumerate() { + presets.extend(lib.presets.iter().filter(|p| p.order == i).cloned()); + presets.extend(user.iter().filter(|p| p.order == i).cloned()); + } + let mut warnings = lib.warnings.clone(); + warnings.extend(user_warnings); + Ok((lib, presets, warnings)) +} + +/// One preset by id, read fresh from its file (so a corrupted file is reported, not served from memory). +pub(crate) fn find(id: &str) -> Result { + let id = id.trim(); + if let Some(slug) = id.strip_prefix(USER_PREFIX) { + let (user, warnings) = user_presets(); + if let Some(p) = user.into_iter().find(|p| p.id == id) { + return Ok(p); + } + if let Some(w) = warnings.into_iter().find(|w| w.starts_with(&format!("preset {id}:"))) { + return Err(w); + } + return Err(format!("no user preset \"{slug}\"")); + } + let lib = library()?; + let Some(p) = lib.presets.iter().find(|p| p.id == id) else { + if let Some(w) = lib.warnings.iter().find(|w| w.starts_with(&format!("preset {id}:"))) { + return Err(w.clone()); + } + return Err(format!("no preset \"{id}\" in the library")); + }; + let bytes = std::fs::read(&p.file).map_err(|_| format!("preset {id}: its file {} is missing", p.file.display()))?; + preset::parse(&bytes, id, p.folder, p.file.clone(), false) +} From 8a6aaa489cc6a2404aead8ba6a6ed159681d64e8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 291/494] feat(library): rank search words over name, tags, category and type Queries are folded to lower case without accents and every word must match; name starts rank above name words, tags and category. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/search.rs | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/search.rs diff --git a/native/crates/fsh-commands/src/ext/library/search.rs b/native/crates/fsh-commands/src/ext/library/search.rs new file mode 100644 index 00000000..44280cf5 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/search.rs @@ -0,0 +1,80 @@ +//! Library search: case- and accent-insensitive word matching over name, tags, category and type, ranked. + +use super::preset::Preset; + +const FOLDS: &[(char, &str)] = &[ + ('à', "a"), ('á', "a"), ('â', "a"), ('ã', "a"), ('ä', "a"), ('å', "a"), ('ā', "a"), ('ă', "a"), ('ą', "a"), + ('æ', "ae"), ('ç', "c"), ('ć', "c"), ('č', "c"), ('ď', "d"), ('đ', "d"), ('è', "e"), ('é', "e"), ('ê', "e"), + ('ë', "e"), ('ē', "e"), ('ė', "e"), ('ę', "e"), ('ě', "e"), ('ğ', "g"), ('ì', "i"), ('í', "i"), ('î', "i"), + ('ï', "i"), ('ī', "i"), ('į', "i"), ('ı', "i"), ('ł', "l"), ('ľ', "l"), ('ñ', "n"), ('ń', "n"), ('ň', "n"), + ('ò', "o"), ('ó', "o"), ('ô', "o"), ('õ', "o"), ('ö', "o"), ('ø', "o"), ('ō', "o"), ('ő', "o"), ('œ', "oe"), + ('ŕ', "r"), ('ř', "r"), ('ś', "s"), ('š', "s"), ('ş', "s"), ('ß', "ss"), ('ť', "t"), ('ţ', "t"), ('ù', "u"), + ('ú', "u"), ('û', "u"), ('ü', "u"), ('ū', "u"), ('ů', "u"), ('ű', "u"), ('ý', "y"), ('ÿ', "y"), ('ź', "z"), + ('ż', "z"), ('ž', "z"), ('þ', "th"), ('ð', "d"), +]; + +/// Lower case without accents; everything that is not a letter or digit becomes a space. +pub(crate) fn fold(s: &str) -> String { + let mut out = String::with_capacity(s.len()); + for c in s.chars().flat_map(char::to_lowercase) { + if let Some((_, r)) = FOLDS.iter().find(|(k, _)| *k == c) { + out.push_str(r); + } else if ('\u{300}'..='\u{36f}').contains(&c) { + continue; + } else if c.is_alphanumeric() { + out.push(c); + } else { + out.push(' '); + } + } + out +} + +/// The words of a query, folded. +pub(crate) fn words(query: &str) -> Vec { + fold(query).split_whitespace().map(str::to_string).collect() +} + +fn word_score(w: &str, name: &str, name_words: &[&str], tags: &[String], category: &str, type_id: &str) -> u32 { + let mut s = 0; + if name.starts_with(w) { + s = s.max(100); + } + if name_words.iter().any(|n| *n == w) { + s = s.max(80); + } else if name_words.iter().any(|n| n.starts_with(w)) { + s = s.max(60); + } else if name.contains(w) { + s = s.max(30); + } + if tags.iter().any(|t| t.split_whitespace().any(|p| p == w)) { + s = s.max(45); + } else if tags.iter().any(|t| t.split_whitespace().any(|p| p.starts_with(w))) { + s = s.max(25); + } + if category == w || type_id.split_whitespace().any(|p| p == w) { + s = s.max(40); + } else if category.starts_with(w) || type_id.split_whitespace().any(|p| p.starts_with(w)) { + s = s.max(20); + } + s +} + +/// The rank of a preset for the query words, or `None` when a word matches nothing. +pub(crate) fn score(p: &Preset, words: &[String]) -> Option { + let name = fold(&p.name); + let name_words: Vec<&str> = name.split_whitespace().collect(); + let name_joined = name_words.join(" "); + let tags: Vec = p.tags.iter().map(|t| fold(t)).collect(); + let category = fold(p.category); + let type_id = fold(&p.type_id); + let mut total = 0; + for w in words { + let s = word_score(w, &name_joined, &name_words, &tags, &category, &type_id); + if s == 0 { + return None; + } + total += s; + } + Some(total) +} From d48d72c8884f3a185de45990b33f2951ee61bd03 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:07 -0500 Subject: [PATCH 292/494] feat(library): keep favourites and recent presets in the user state file The engine writes /formshot/library/state.json atomically and reads it on every call, so several engine processes agree. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/state.rs | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/state.rs diff --git a/native/crates/fsh-commands/src/ext/library/state.rs b/native/crates/fsh-commands/src/ext/library/state.rs new file mode 100644 index 00000000..1c9e4315 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/state.rs @@ -0,0 +1,113 @@ +//! Favourites and recently applied presets, kept in `/formshot/library/state.json`. + +use super::locate; +use serde_json::{json, Value}; +use std::path::PathBuf; +use std::sync::Mutex; +use std::time::{SystemTime, UNIX_EPOCH}; + +const FORMAT: &str = "formshot-library-state"; +/// Most entries the recent list keeps. +pub(crate) const RECENT_MAX: usize = 24; +const FAVORITES_MAX: usize = 4096; + +static LOCK: Mutex<()> = Mutex::new(()); + +/// The stored state. +#[derive(Clone, Debug, Default, PartialEq)] +pub(crate) struct Shelves { + pub favorites: Vec, + pub recent: Vec<(String, u64)>, +} + +fn path() -> Option { + locate::user_library().map(|d| d.join("state.json")) +} + +fn now() -> u64 { + SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0) +} + +fn read_unlocked() -> Shelves { + let Some(p) = path() else { return Shelves::default() }; + let Ok(v) = std::fs::read(&p).map_err(|_| ()).and_then(|b| serde_json::from_slice::(&b).map_err(|_| ())) else { + return Shelves::default(); + }; + let favorites = v + .get("favorites") + .and_then(Value::as_array) + .map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect()) + .unwrap_or_default(); + let recent = v + .get("recent") + .and_then(Value::as_array) + .map(|a| { + a.iter() + .filter_map(|e| Some((e.get("id")?.as_str()?.to_string(), e.get("at").and_then(Value::as_u64).unwrap_or(0)))) + .take(RECENT_MAX) + .collect() + }) + .unwrap_or_default(); + Shelves { favorites, recent } +} + +fn write_unlocked(s: &Shelves) -> Result<(), String> { + let p = path().ok_or("no user data folder (set FORMSHOT_USER_DATA)")?; + let v = json!({ + "format": FORMAT, + "version": 1, + "favorites": s.favorites, + "recent": s.recent.iter().map(|(id, at)| json!({"id": id, "at": at})).collect::>(), + }); + let mut text = serde_json::to_string_pretty(&v).map_err(|e| e.to_string())?; + text.push('\n'); + locate::write_atomic(&p, text.as_bytes()).map_err(|e| format!("the library state {} could not be written: {e}", p.display())) +} + +/// The current state (read from disk each time, so several engine processes agree). +pub(crate) fn read() -> Shelves { + let _g = LOCK.lock().unwrap_or_else(|p| p.into_inner()); + read_unlocked() +} + +fn update(f: impl FnOnce(&mut Shelves)) -> Result { + let _g = LOCK.lock().unwrap_or_else(|p| p.into_inner()); + let mut s = read_unlocked(); + let before = s.clone(); + f(&mut s); + if s != before { + write_unlocked(&s)?; + } + Ok(s) +} + +/// Marks or unmarks a favourite. +pub(crate) fn set_favorite(id: &str, on: bool) -> Result { + update(|s| { + s.favorites.retain(|f| f != id); + if on { + s.favorites.push(id.to_string()); + if s.favorites.len() > FAVORITES_MAX { + s.favorites.remove(0); + } + } + }) +} + +/// Puts an id at the front of the recent list. +pub(crate) fn touch_recent(id: &str) -> Result { + let at = now(); + update(|s| { + s.recent.retain(|(r, _)| r != id); + s.recent.insert(0, (id.to_string(), at)); + s.recent.truncate(RECENT_MAX); + }) +} + +/// Forgets an id everywhere (after a user preset is removed). +pub(crate) fn forget(id: &str) -> Result { + update(|s| { + s.favorites.retain(|f| f != id); + s.recent.retain(|(r, _)| r != id); + }) +} From a635c4b636f08efc7d985d047b493f6f3688530c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:13 -0500 Subject: [PATCH 293/494] feat(library): model the material ball for thumbnails A tilted sphere with an inset band on a turned pedestal, built as lathe meshes with creased walls, smooth normals and UVs, about 21k triangles. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/ball.rs | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/ball.rs diff --git a/native/crates/fsh-commands/src/ext/library/ball.rs b/native/crates/fsh-commands/src/ext/library/ball.rs new file mode 100644 index 00000000..15ba6849 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/ball.rs @@ -0,0 +1,138 @@ +//! FormShot's material ball: a sphere with an inset band, tilted, on a turned pedestal. Lathe meshes with smooth +//! normals, creased walls and UVs (u around, v along the profile), about 21k triangles in all. + +use fsh_core::{Quat, Vec2, Vec3}; +use fsh_scene::Mesh; +use std::f32::consts::{PI, TAU}; + +/// Ball radius in metres. +pub(crate) const RADIUS: f32 = 0.5; +/// Height of the ball's centre above the floor. +pub(crate) const CENTRE_Y: f32 = 0.63; +const COLUMNS: usize = 160; +const BAND: (f32, f32) = (1.22, 1.46); +const BAND_DEPTH: f32 = 0.035; +const TILT: f32 = 0.42; +const TURN: f32 = -0.5; + +/// One ring of a lathe profile: radius and height, the profile normal (radial, axial), and v. +#[derive(Clone, Copy)] +struct Ring { + r: f32, + y: f32, + nr: f32, + ny: f32, + v: f32, +} + +fn sphere_ring(phi: f32, radius: f32, v: f32) -> Ring { + Ring { r: radius * phi.sin(), y: radius * phi.cos(), nr: phi.sin(), ny: phi.cos(), v } +} + +fn arc(from: f32, to: f32, steps: usize, radius: f32, v0: f32, v1: f32) -> Vec { + (0..=steps) + .map(|i| { + let t = i as f32 / steps as f32; + sphere_ring(from + (to - from) * t, radius, v0 + (v1 - v0) * t) + }) + .collect() +} + +/// Profile strips of the ball: cap, upper wall, groove, lower wall, bottom. Each strip is meshed on its own, so the +/// walls keep hard edges. +fn ball_strips() -> Vec> { + let (a, b) = BAND; + let inner = RADIUS - BAND_DEPTH; + let va = a / PI; + let vb = b / PI; + let wall = |phi: f32, sign: f32, v: f32| { + let (n_r, n_y) = (sign * phi.cos(), -sign * phi.sin()); + vec![ + Ring { r: RADIUS * phi.sin(), y: RADIUS * phi.cos(), nr: n_r, ny: n_y, v }, + Ring { r: inner * phi.sin(), y: inner * phi.cos(), nr: n_r, ny: n_y, v: v + 0.004 * sign }, + ] + }; + vec![ + arc(0.0, a, 38, RADIUS, 0.0, va), + wall(a, 1.0, va), + arc(a, b, 8, inner, va + 0.004, vb - 0.004), + wall(b, -1.0, vb), + arc(b, PI, 48, RADIUS, vb, 1.0), + ] +} + +fn pedestal_strips() -> Vec> { + let top = CENTRE_Y - RADIUS + 0.03; + let neck = 0.17; + let foot = 0.36; + let mut flank = Vec::new(); + for i in 0..=10 { + let t = i as f32 / 10.0; + let r = foot - 0.02 + (neck - foot + 0.02) * (t * t * (3.0 - 2.0 * t)); + let y = 0.05 + (top - 0.05) * t; + let dr = -(foot - 0.02 - neck) * 6.0 * t * (1.0 - t); + let dy = top - 0.05; + let len = (dr * dr + dy * dy).sqrt().max(1e-6); + flank.push(Ring { r, y, nr: dy / len, ny: -dr / len, v: 0.2 + 0.6 * t }); + } + vec![ + vec![Ring { r: 0.0, y: 0.0, nr: 0.0, ny: -1.0, v: 0.0 }, Ring { r: foot, y: 0.0, nr: 0.0, ny: -1.0, v: 0.1 }], + vec![Ring { r: foot, y: 0.0, nr: 1.0, ny: 0.0, v: 0.1 }, Ring { r: foot, y: 0.035, nr: 1.0, ny: 0.0, v: 0.14 }], + vec![Ring { r: foot, y: 0.035, nr: 0.0, ny: 1.0, v: 0.14 }, Ring { r: foot - 0.02, y: 0.05, nr: 0.0, ny: 1.0, v: 0.2 }], + flank, + vec![Ring { r: neck, y: top, nr: 0.0, ny: 1.0, v: 0.8 }, Ring { r: 0.0, y: top, nr: 0.0, ny: 1.0, v: 1.0 }], + ] +} + +fn lathe(name: &str, strips: &[Vec], place: impl Fn(Vec3) -> Vec3) -> Mesh { + let mut positions = Vec::new(); + let mut normals = Vec::new(); + let mut uvs = Vec::new(); + let mut indices = Vec::new(); + for strip in strips { + let base = positions.len() as u32; + for ring in strip { + for c in 0..=COLUMNS { + let u = c as f32 / COLUMNS as f32; + let (s, co) = (u * TAU).sin_cos(); + positions.push(place(Vec3::new(ring.r * co, ring.y, ring.r * s))); + normals.push(place(Vec3::new(ring.nr * co, ring.ny, ring.nr * s)) - place(Vec3::ZERO)); + uvs.push(Vec2::new(u, 1.0 - ring.v)); + } + } + let row = (COLUMNS + 1) as u32; + for k in 0..strip.len().saturating_sub(1) { + for c in 0..COLUMNS as u32 { + let a = base + k as u32 * row + c; + let (b, d, e) = (a + 1, a + row, a + row + 1); + for tri in [[a, d, b], [b, d, e]] { + let [p0, p1, p2] = tri.map(|i| positions[i as usize]); + let n = (p1 - p0).cross(p2 - p0); + if n.length() < 1e-12 { + continue; + } + let avg = normals[tri[0] as usize] + normals[tri[1] as usize] + normals[tri[2] as usize]; + if n.dot(avg) < 0.0 { + indices.extend_from_slice(&[tri[0], tri[2], tri[1]]); + } else { + indices.extend_from_slice(&tri); + } + } + } + } + } + let normals = normals.into_iter().map(|n| n.normalize()).collect(); + let mut m = Mesh::new(name, positions, indices).unwrap_or_default(); + m.normals = normals; + m.uvs = vec![uvs]; + let _ = m.validate(); + m +} + +/// The ball (wears the preset) and the pedestal (neutral), in metres, standing on y = 0. +pub(crate) fn meshes() -> (Mesh, Mesh) { + let spin = Quat::from_axis_angle(Vec3::Y, TURN) * Quat::from_axis_angle(Vec3::X, TILT); + let ball = lathe("Material ball", &ball_strips(), |p| spin.rotate(p) + Vec3::new(0.0, CENTRE_Y, 0.0)); + let pedestal = lathe("Pedestal", &pedestal_strips(), |p| p); + (ball, pedestal) +} From 26bb036af4dd0d3e71d66e6115d4068efeced685 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:13 -0500 Subject: [PATCH 294/494] feat(library): render thumbnails on a background worker Thumbnails are path traced by the CPU renderer off the live render on one worker thread fed by a queue, denoised and cached as -.png in the user cache. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/thumbs.rs | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/thumbs.rs diff --git a/native/crates/fsh-commands/src/ext/library/thumbs.rs b/native/crates/fsh-commands/src/ext/library/thumbs.rs new file mode 100644 index 00000000..afd61ae0 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/thumbs.rs @@ -0,0 +1,247 @@ +//! Preset thumbnails: the material ball under the built-in studio, rendered by the CPU tracer on a background +//! worker (never the live render), cached as `/formshot/library/thumbs/-.png`. + +use super::ball; +use super::locate; +use super::preset::{procedurals_live, GraphMode, Preset}; +use fsh_core::{Transform, Vec3}; +use fsh_render_cpu::Renderer; +use fsh_scene::{flatten, Command, Document, Editor, Material, MeshAdd, SurfaceParams, Trs}; +use serde_json::{json, Value}; +use std::collections::{HashMap, VecDeque}; +use std::path::PathBuf; +use std::sync::atomic::AtomicBool; +use std::sync::{Arc, Condvar, Mutex, OnceLock}; +use std::time::{Duration, Instant}; + +/// Smallest and largest thumbnail side in pixels, and the default. +pub(crate) const MIN_SIZE: u32 = 64; +pub(crate) const MAX_SIZE: u32 = 512; +pub(crate) const DEFAULT_SIZE: u32 = 128; +/// Samples per pixel of every thumbnail (then the denoiser). +pub(crate) const SAMPLES: u32 = 48; +const BOUNCES: u32 = 10; +const MARKER: &str = ".look"; + +/// Where a thumbnail is, or is being made. +#[derive(Clone, Debug, PartialEq)] +pub(crate) enum Status { + Ready, + Queued, + Rendering, + Failed(String), +} + +impl Status { + pub(crate) fn as_str(&self) -> &'static str { + match self { + Status::Ready => "ready", + Status::Queued => "queued", + Status::Rendering => "rendering", + Status::Failed(_) => "failed", + } + } +} + +type Key = (String, u32); + +struct Job { + key: Key, + preset: Preset, +} + +#[derive(Default)] +struct Queue { + jobs: VecDeque, + states: HashMap, + worker: bool, +} + +fn queue() -> &'static (Mutex, Condvar) { + static Q: OnceLock<(Mutex, Condvar)> = OnceLock::new(); + Q.get_or_init(|| (Mutex::new(Queue::default()), Condvar::new())) +} + +/// What the cached pictures were made with; when it changes (the procedurals arrive) the old pictures are dropped. +fn look() -> &'static str { + if procedurals_live() { + "ball-1 graph" + } else { + "ball-1 flat" + } +} + +/// The cache folder, emptied of pictures made with another look the first time it is asked for. +pub(crate) fn dir() -> Result { + static CHECKED: OnceLock<()> = OnceLock::new(); + let d = locate::thumbs_dir().ok_or("no user cache folder (set FORMSHOT_CACHE)")?; + CHECKED.get_or_init(|| { + let marker = d.join(MARKER); + if std::fs::read_to_string(&marker).ok().as_deref() != Some(look()) { + if let Ok(entries) = std::fs::read_dir(&d) { + for e in entries.flatten() { + if e.path().extension().is_some_and(|x| x == "png") { + let _ = std::fs::remove_file(e.path()); + } + } + } + let _ = locate::write_atomic(&marker, look().as_bytes()); + } + }); + Ok(d) +} + +/// `/-.png`. +pub(crate) fn path(sha256: &str, size: u32) -> Result { + Ok(dir()?.join(format!("{sha256}-{size}.png"))) +} + +fn run(ed: &mut Editor, name: &str, args: Value) -> Result, String> { + ed.dispatch(name, args).map(|o| o.created).map_err(|e| e.to_string()) +} + +fn first(created: Vec, what: &str) -> Result { + created.first().copied().ok_or_else(|| format!("{what} made nothing")) +} + +/// The thumbnail scene: the ball wearing `material`, a dark pedestal, the built-in studio, one soft key light. +pub(crate) fn scene(material: Material, size: u32) -> Result { + let mut ed = Editor::new(Document::new()); + run(&mut ed, "environment.set", json!({"values": {"source": {"kind": "studio"}, "background": "environment", "brightness": 1.0}}))?; + run(&mut ed, "ground.set", json!({"values": {"shadow_catcher": true, "reflection": 0.0}}))?; + run(&mut ed, "render.set_settings", json!({"values": {"width": size, "height": size, "samples": SAMPLES, "max_bounces": BOUNCES, "seed": 7, "denoise": true}}))?; + let pedestal = Material::new( + "Pedestal", + "plastic", + SurfaceParams { base_color: fsh_core::Rgb::splat(0.035), specular_roughness: 0.45, ..SurfaceParams::default() }, + ); + let wear = first(run(&mut ed, "material.create", json!({"material": material}))?, "material.create")?; + let stand = first(run(&mut ed, "material.create", json!({"material": pedestal}))?, "material.create")?; + let (ball_mesh, pedestal_mesh) = ball::meshes(); + for (mesh, mat, name) in [(ball_mesh, wear, "Ball"), (pedestal_mesh, stand, "Pedestal")] { + let out = ed.execute(Command::MeshAdd(MeshAdd { key: None, mesh: Arc::new(mesh) })).map_err(|e| e.to_string())?; + let key = first(out.created, "mesh.add")?; + run(&mut ed, "scene.add_part", json!({"name": name, "mesh": key, "material": mat}))?; + } + let key = Transform::look_at(Vec3::new(-1.6, 2.2, 1.9), Vec3::new(0.0, 0.6, 0.0), Vec3::Y).map_err(|e| e.to_string())?; + let trs = serde_json::to_value(Trs::from_matrix(&key.m).map_err(|e| e.to_string())?).map_err(|e| e.to_string())?; + run( + &mut ed, + "scene.add_light", + json!({"name": "Key", "transform": trs, "light": { + "shape": {"kind": "area_rect", "width": 1.4, "height": 1.0}, + "power": 1500.0, "unit": "lumen", "colour": {"mode": "kelvin", "kelvin": 5600.0} + }}), + )?; + run( + &mut ed, + "camera.set", + json!({"index": 0, "values": {"position": [0.0, 1.05, 2.55], "target": [0.0, 0.56, 0.0], "up": [0.0, 1.0, 0.0], "focal_length_mm": 50.0, "sensor_width_mm": 36.0}}), + )?; + Ok(ed.into_document()) +} + +/// Renders a preset's thumbnail to PNG bytes. +pub(crate) fn render(preset: &Preset, size: u32) -> Result, String> { + let mode = if procedurals_live() { GraphMode::Type } else { GraphMode::Flat }; + let material = preset.material(mode)?; + let doc = scene(material, size)?; + let snapshot = flatten(&doc); + let threads = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1); + let mut r = Renderer::with_threads(snapshot, threads).map_err(|e| e.to_string())?; + let never = AtomicBool::new(false); + while r.stats().samples < SAMPLES { + let n = (SAMPLES - r.stats().samples).min(8); + r.render_pass(n, &never); + } + let image = r.develop(Some(1.0)); + fsh_io::write_png_rgba8(image.width, image.height, &image.rgba8).map_err(|e| e.to_string()) +} + +fn work() { + let (lock, cv) = queue(); + loop { + let job = { + let mut q = lock.lock().unwrap_or_else(|p| p.into_inner()); + loop { + if let Some(j) = q.jobs.pop_front() { + q.states.insert(j.key.clone(), Status::Rendering); + break j; + } + q = cv.wait(q).unwrap_or_else(|p| p.into_inner()); + } + }; + let outcome = path(&job.key.0, job.key.1).and_then(|p| { + let png = render(&job.preset, job.key.1)?; + locate::write_atomic(&p, &png).map_err(|e| format!("the thumbnail {} could not be written: {e}", p.display())) + }); + let mut q = lock.lock().unwrap_or_else(|p| p.into_inner()); + match outcome { + Ok(()) => { + q.states.remove(&job.key); + } + Err(e) => { + q.states.insert(job.key, Status::Failed(e)); + } + } + cv.notify_all(); + } +} + +fn start_worker(q: &mut Queue) -> Result<(), String> { + if q.worker { + return Ok(()); + } + if cfg!(target_arch = "wasm32") { + return Err("thumbnails are rendered by the desktop engine".into()); + } + std::thread::Builder::new() + .name("formshot-thumbnails".into()) + .spawn(work) + .map_err(|e| format!("the thumbnail worker could not start: {e}"))?; + q.worker = true; + Ok(()) +} + +/// The thumbnail's status, queueing a render when it is missing (and, with `retry`, when it failed before). +pub(crate) fn request(preset: &Preset, size: u32, retry: bool) -> Result { + let file = path(&preset.sha256, size)?; + let key: Key = (preset.sha256.clone(), size); + let (lock, cv) = queue(); + let mut q = lock.lock().unwrap_or_else(|p| p.into_inner()); + match q.states.get(&key) { + Some(Status::Failed(_)) if !retry => return Ok(q.states[&key].clone()), + Some(s @ (Status::Queued | Status::Rendering)) => return Ok(s.clone()), + _ => {} + } + if file.is_file() { + return Ok(Status::Ready); + } + start_worker(&mut q)?; + q.jobs.push_back(Job { key: key.clone(), preset: preset.clone() }); + q.states.insert(key, Status::Queued); + cv.notify_all(); + Ok(Status::Queued) +} + +/// Waits up to `limit` for a queued thumbnail; answers its status then. +pub(crate) fn wait(preset: &Preset, size: u32, limit: Duration) -> Result { + let file = path(&preset.sha256, size)?; + let key: Key = (preset.sha256.clone(), size); + let end = Instant::now() + limit; + let (lock, cv) = queue(); + let mut q = lock.lock().unwrap_or_else(|p| p.into_inner()); + loop { + match q.states.get(&key) { + Some(s @ Status::Failed(_)) => return Ok(s.clone()), + Some(s @ (Status::Queued | Status::Rendering)) => { + let left = end.saturating_duration_since(Instant::now()); + if left.is_zero() { + return Ok(s.clone()); + } + q = cv.wait_timeout(q, left).unwrap_or_else(|p| p.into_inner()).0; + } + _ => return Ok(if file.is_file() { Status::Ready } else { Status::Failed("the thumbnail was not written".into()) }), + } + } +} From e3cd2963f2c140cf795b8a9eb9d931dde2c9793e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:13 -0500 Subject: [PATCH 295/494] feat(library): apply presets to parts and save user presets library.apply reaches parts by part, group or same_material scope, reuses an identical material and runs as one history group; save and remove handle the user's own presets. Compiled with cargo check -p fsh-commands. --- .../fsh-commands/src/ext/library/apply.rs | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 native/crates/fsh-commands/src/ext/library/apply.rs diff --git a/native/crates/fsh-commands/src/ext/library/apply.rs b/native/crates/fsh-commands/src/ext/library/apply.rs new file mode 100644 index 00000000..c1c1e9ab --- /dev/null +++ b/native/crates/fsh-commands/src/ext/library/apply.rs @@ -0,0 +1,262 @@ +//! Applying a preset to parts (one undo step), and the user's own presets: save and remove. + +use super::preset::{self, GraphMode, Preset}; +use super::search::fold; +use super::store::{self, USER_PREFIX}; +use super::{lib_err, locate, state}; +use crate::engine::{Engine, State}; +use crate::error::{EngineError, Result}; +use crate::util::{get_str, key_of}; +use fsh_core::{DocKey, MaterialKey, NodeId}; +use fsh_scene::{material_type, ChangeLevel, Command, Document, MaterialAssign, MaterialCreate, Outcome}; +use serde_json::{json, Map, Value}; +use std::collections::BTreeSet; + +/// The scopes `library.apply` takes. +pub(crate) const SCOPES: [&str; 3] = ["part", "group", "same_material"]; + +fn parts_under(doc: &Document, id: NodeId) -> Vec { + doc.subtree(id).into_iter().filter(|n| doc.node(*n).is_some_and(|n| n.mesh().is_some())).collect() +} + +/// The parts a scope reaches from the given nodes, in document order. +fn reach(doc: &Document, nodes: &[NodeId], scope: &str) -> Result> { + let mut found: BTreeSet = BTreeSet::new(); + for &n in nodes { + let node = doc.node(n).ok_or_else(|| EngineError::args(format!("no node with id {}", n.raw())))?; + match scope { + "group" => match node.parent { + Some(g) => found.extend(parts_under(doc, g)), + None => found.extend(parts_under(doc, n)), + }, + _ => found.extend(parts_under(doc, n)), + } + } + if scope == "same_material" { + let worn: BTreeSet> = found.iter().filter_map(|p| doc.node(*p)).map(|n| n.material()).collect(); + found = doc.nodes().iter().filter(|(_, n)| n.mesh().is_some() && worn.contains(&n.material())).map(|(id, _)| *id).collect(); + } + if found.is_empty() { + return Err(EngineError::args("the given nodes contain no parts")); + } + Ok(found.into_iter().collect()) +} + +fn node_ids(args: &Value) -> Result> { + let raw = args.get("nodes").or_else(|| args.get("ids")); + let list: Vec = match raw { + Some(Value::Array(a)) => a.iter().map(|v| key_of(v).ok_or_else(|| EngineError::args("nodes must be node ids"))).collect::>()?, + Some(v) => vec![key_of(v).ok_or_else(|| EngineError::args("nodes must be node ids"))?], + None => return Err(EngineError::args("needs nodes (the node ids to apply the preset to)")), + }; + if list.is_empty() { + return Err(EngineError::args("nodes is empty")); + } + Ok(list.into_iter().map(NodeId::from_raw).collect()) +} + +/// `library.apply`: builds the preset's material (or reuses an identical one) and assigns it, as one undo step. +pub(crate) fn apply(engine: &Engine, st: &mut State, args: &Value) -> Result { + let id = super::id_of(args)?; + let scope = get_str(args, "scope").unwrap_or("part"); + if !SCOPES.contains(&scope) { + return Err(EngineError::args(format!("scope must be one of {}", SCOPES.join(", ")))); + } + let nodes = node_ids(args)?; + let p = store::find(id).map_err(lib_err)?; + let material = p.material(GraphMode::Type).map_err(lib_err)?; + let parts = reach(st.editor.document(), &nodes, scope)?; + let existing = st.editor.document().materials().iter().find(|(_, m)| **m == material).map(|(k, _)| *k); + let label = format!("Apply {}", p.name); + st.editor.begin_group(&label); + st.note_begin(&label); + let result = (|| -> Result<(MaterialKey, Outcome)> { + let key = match existing { + Some(k) => k, + None => { + let out = st.editor.execute(Command::MaterialCreate(MaterialCreate { key: None, material, type_id: None, name: None }))?; + st.note(&out); + MaterialKey(*out.created.first().ok_or_else(|| EngineError::state("material.create made no material"))?) + } + }; + let out = st.editor.execute(Command::MaterialAssign(MaterialAssign { ids: parts.clone(), material: Some(key) }))?; + st.note(&out); + Ok((key, out)) + })(); + let (key, out) = match result { + Ok(done) => { + st.editor.end_group()?; + st.note_end(); + done + } + Err(e) => { + if let Ok(back) = st.editor.abandon_group() { + st.note(&back); + } + return Err(e); + } + }; + let mut reply = engine.changed(st, &Outcome { name: "library.apply".into(), level: ChangeLevel::Region, ..out }, false); + reply["id"] = json!(p.id); + reply["material"] = json!(key.raw()); + reply["reused"] = json!(existing.is_some()); + reply["parts"] = json!(parts.iter().map(|n| n.raw()).collect::>()); + reply["scope"] = json!(scope); + if let Err(e) = state::touch_recent(&p.id) { + reply["warnings"] = json!([e]); + } + Ok(reply) +} + +fn round4(x: f64) -> f64 { + (x * 1e4).round() / 1e4 +} + +fn rounded(v: &Value) -> Value { + match v { + Value::Number(n) => n.as_f64().map(|x| json!(round4(x))).unwrap_or_else(|| v.clone()), + Value::Array(a) => Value::Array(a.iter().map(rounded).collect()), + _ => v.clone(), + } +} + +/// A slug from a display name: folded to ASCII words joined by `-`, at most 40 characters. +fn slugify(name: &str) -> String { + let mut s = String::new(); + for w in fold(name).split_whitespace() { + let w: String = w.chars().filter(|c| c.is_ascii_lowercase() || c.is_ascii_digit()).collect(); + if w.is_empty() { + continue; + } + if !s.is_empty() && s.len() + 1 + w.len() > 40 { + break; + } + if !s.is_empty() { + s.push('-'); + } + s.push_str(&w[..w.len().min(40)]); + } + if s.is_empty() { + "preset".into() + } else { + s + } +} + +fn taken(slug: &str) -> bool { + let Some(root) = store::user_materials() else { return false }; + preset::CATEGORIES.iter().any(|(_, f)| root.join(f).join(format!("{slug}.json")).exists()) +} + +fn text(v: &Value) -> String { + serde_json::to_string(v).unwrap_or_else(|_| "null".into()) +} + +/// The preset file text, keys in the format's order, two-space indent, newline at the end. +fn preset_text(fields: &[(&str, Value)], params: &Map) -> String { + let mut out = String::from("{\n"); + for (i, (k, v)) in fields.iter().enumerate() { + out.push_str(&format!(" \"{k}\": ")); + if *k == "params" { + if params.is_empty() { + out.push_str("{}"); + } else { + out.push_str("{\n"); + let lines: Vec = params.iter().map(|(pk, pv)| format!(" \"{pk}\": {}", text(pv))).collect(); + out.push_str(&lines.join(",\n")); + out.push_str("\n }"); + } + } else if *k == "source" { + let lines: Vec = v.as_object().map(|o| o.iter().map(|(sk, sv)| format!(" \"{sk}\": {}", text(sv))).collect()).unwrap_or_default(); + out.push_str("{\n"); + out.push_str(&lines.join(",\n")); + out.push_str("\n }"); + } else { + out.push_str(&text(v)); + } + out.push_str(if i + 1 < fields.len() { ",\n" } else { "\n" }); + } + out.push_str("}\n"); + out +} + +/// `library.save`: writes a document material as one of the user's presets. +pub(crate) fn save(st: &State, args: &Value) -> Result { + let raw = args.get("material").or_else(|| args.get("key")).and_then(key_of).ok_or_else(|| EngineError::args("needs material (a material key)"))?; + let m = st.editor.document().material(MaterialKey(raw)).ok_or_else(|| EngineError::args(format!("no material with key {raw}")))?; + let name = get_str(args, "name").map(str::trim).filter(|s| !s.is_empty()).unwrap_or(m.name.as_str()).to_string(); + if name.chars().count() > 48 { + return Err(EngineError::args("name is longer than 48 characters")); + } + let cat = get_str(args, "category").ok_or_else(|| EngineError::args("needs category (Metal, Plastic, ...)"))?; + let (category, folder, _) = preset::category(cat).ok_or_else(|| EngineError::args(format!("unknown category \"{cat}\"")))?; + let t = material_type(&m.type_id).or_else(|| material_type("generic")).ok_or_else(|| EngineError::state("no generic material type"))?; + let now = serde_json::to_value(m.params).map_err(|e| EngineError::state(e.to_string()))?; + let defaults = serde_json::to_value(t.params).map_err(|e| EngineError::state(e.to_string()))?; + let mut params = Map::new(); + for (k, v) in now.as_object().into_iter().flatten() { + if defaults.get(k) != Some(v) { + params.insert(k.clone(), rounded(v)); + } + } + let base = slugify(&name); + let mut slug = base.clone(); + let mut n = 2; + while taken(&slug) { + slug = format!("{base}-{n}"); + n += 1; + } + let id = format!("{USER_PREFIX}{slug}"); + let mut notes = Vec::new(); + if !m.slots.is_empty() || !m.textures.is_empty() { + notes.push("texture slots and textures are not part of a preset file and were left out".to_string()); + } + if m.graph.is_some() { + notes.push("the material's node graph is not stored; applying the preset starts from its type's graph".to_string()); + } + let mut tags: Vec = Vec::new(); + if t.graph.is_some() { + tags.push("needs-graph".into()); + } + let authored: Vec = params.keys().cloned().collect(); + let fields = [ + ("format", json!(preset::FORMAT)), + ("version", json!(preset::VERSION)), + ("id", json!(id)), + ("name", json!(name)), + ("category", json!(category)), + ("type", json!(t.id)), + ("params", Value::Null), + ("tags", json!(tags)), + ("source", json!({"kind": "authored", "reference": "", "urls": [], "notes": format!("Saved from the material \"{}\" of a FormShot document.", m.name), "authored": authored})), + ("licence", json!("NOASSERTION")), + ]; + let body = preset_text(&fields, ¶ms); + let dir = store::user_materials().ok_or_else(|| EngineError::state("no user data folder (set FORMSHOT_USER_DATA)"))?.join(folder); + let file = dir.join(format!("{slug}.json")); + preset::parse(body.as_bytes(), &id, folder, file.clone(), true).map_err(lib_err)?; + locate::write_atomic(&file, body.as_bytes()).map_err(|e| EngineError::File(format!("the preset {} could not be written: {e}", file.display())))?; + let p: Preset = store::find(&id).map_err(lib_err)?; + Ok(json!({"id": id, "entry": p.entry(false), "file": file.to_string_lossy(), "notes": notes})) +} + +/// `library.remove`: deletes one of the user's presets (built-ins are refused). +pub(crate) fn remove(args: &Value) -> Result { + let id = super::id_of(args)?; + if !id.starts_with(USER_PREFIX) { + return Err(EngineError::args(format!("{id} is a built-in preset; only the user's own presets (user/...) can be removed"))); + } + let slug = &id[USER_PREFIX.len()..]; + let root = store::user_materials().ok_or_else(|| EngineError::state("no user data folder (set FORMSHOT_USER_DATA)"))?; + let file = preset::CATEGORIES + .iter() + .map(|(_, f)| root.join(f).join(format!("{slug}.json"))) + .find(|p| preset::valid_slug(slug) && p.is_file()) + .ok_or_else(|| EngineError::args(format!("no user preset \"{slug}\"")))?; + std::fs::remove_file(&file).map_err(|e| EngineError::File(format!("the preset {} could not be removed: {e}", file.display())))?; + let mut reply = json!({"id": id, "removed": true}); + if let Err(e) = state::forget(id) { + reply["warnings"] = json!([e]); + } + Ok(reply) +} From b81acb6e6c7325786a914f92654213c9c6d6f9eb Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:13 -0500 Subject: [PATCH 296/494] feat(library): add the library commands to the catalogue library.list, get, favorite, recent, apply, save, remove, thumbnail and thumbnails with schemas and descriptions. Checked with cargo check -p fsh-commands. --- native/crates/fsh-commands/src/ext/library.rs | 358 +++++++++++++++++- 1 file changed, 353 insertions(+), 5 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/library.rs b/native/crates/fsh-commands/src/ext/library.rs index 1c707219..bd6828eb 100644 --- a/native/crates/fsh-commands/src/ext/library.rs +++ b/native/crates/fsh-commands/src/ext/library.rs @@ -1,12 +1,360 @@ //! The material library: presets, search, thumbnails and drops (0.6.0). +mod apply; +mod ball; +mod locate; +mod preset; +mod search; +mod sha256; +mod state; +mod store; +mod thumbs; + use super::ExtCommand; use crate::engine::{Engine, State}; -use crate::error::Result; -use serde_json::Value; +use crate::error::{EngineError, Result}; +use crate::util::{base64, get_bool, get_str, get_u32}; +use fsh_scene::ChangeLevel; +use preset::{procedurals_live, GraphMode, Preset, CATEGORIES}; +use serde_json::{json, Value}; + +const SHELVES: [&str; 4] = ["all", "favorites", "recent", "user"]; + +fn id_arg(what: &str) -> Value { + json!({"type": "string", "minLength": 1, "description": what}) +} + +fn list_args() -> Value { + json!({"type": "object", "properties": { + "category": {"type": "string", "description": "Category name (Metal) or folder (metal), any case"}, + "query": {"type": "string", "description": "Words matched against name, tags, category and type, case- and accent-insensitive; results ranked"}, + "shelf": {"type": "string", "enum": SHELVES, "default": "all", "description": "all, favorites, recent (most recent first) or user (the user's own presets)"}, + "limit": {"type": "integer", "minimum": 1, "description": "At most this many presets"}, + "offset": {"type": "integer", "minimum": 0, "default": 0, "description": "Skip this many presets first"} + }, "additionalProperties": false}) +} + +fn get_args() -> Value { + json!({"type": "object", "properties": {"id": id_arg("Preset id (metal/gold-polished, user/my-red)")}, "required": ["id"], "additionalProperties": false}) +} + +fn favorite_args() -> Value { + json!({"type": "object", "properties": { + "id": id_arg("Preset id"), + "on": {"type": "boolean", "default": true, "description": "true marks it a favourite, false unmarks it"} + }, "required": ["id"], "additionalProperties": false}) +} + +fn no_args() -> Value { + json!({"type": "object", "properties": {}, "additionalProperties": false}) +} + +fn apply_args() -> Value { + json!({"type": "object", "properties": { + "id": id_arg("Preset id"), + "nodes": {"type": "array", "items": {"type": ["integer", "string"]}, "minItems": 1, "description": "Node ids the preset is dropped on (parts or groups)"}, + "scope": {"type": "string", "enum": apply::SCOPES, "default": "part", "description": "part: the parts in the given nodes; group: every part of their parent group; same_material: every part wearing the same material as a given part"} + }, "required": ["id", "nodes"], "additionalProperties": false}) +} + +fn save_args() -> Value { + json!({"type": "object", "properties": { + "material": {"type": "integer", "minimum": 1, "description": "Material key of the document material to save"}, + "name": {"type": "string", "maxLength": 48, "description": "Preset name (the material's name when absent)"}, + "category": {"type": "string", "enum": CATEGORIES.map(|c| c.0), "description": "Library category"} + }, "required": ["material", "category"], "additionalProperties": false}) +} + +fn remove_args() -> Value { + json!({"type": "object", "properties": {"id": id_arg("Id of one of the user's own presets (user/...)")}, "required": ["id"], "additionalProperties": false}) +} + +fn size_arg() -> Value { + json!({"type": "integer", "minimum": thumbs::MIN_SIZE, "maximum": thumbs::MAX_SIZE, "default": thumbs::DEFAULT_SIZE, "description": "Width and height in pixels"}) +} + +fn thumbnail_args() -> Value { + json!({"type": "object", "properties": { + "id": id_arg("Preset id"), + "size": size_arg(), + "wait": {"type": "boolean", "default": false, "description": "Wait for a missing thumbnail to be rendered (otherwise it is queued and the reply says queued)"}, + "timeout": {"type": "integer", "minimum": 1, "maximum": 600, "default": 120, "description": "Seconds to wait at most"}, + "inline": {"type": "boolean", "default": false, "description": "Add the PNG as base64 when it is ready"}, + "retry": {"type": "boolean", "default": false, "description": "Queue again a thumbnail whose render failed"} + }, "required": ["id"], "additionalProperties": false}) +} -pub(super) static COMMANDS: &[ExtCommand] = &[]; +fn thumbnails_args() -> Value { + json!({"type": "object", "properties": { + "ids": {"type": "array", "items": {"type": "string"}, "description": "Preset ids, most wanted first"}, + "size": size_arg() + }, "required": ["ids"], "additionalProperties": false}) +} + +pub(super) static COMMANDS: &[ExtCommand] = &[ + ExtCommand { + name: "library.list", + description: "List material library presets by shelf (all, favorites, recent, user), category and search words, ranked when searching, with category counts and library warnings.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: list_args, + }, + ExtCommand { + name: "library.get", + description: "One library preset: its file, its source and the material applying it would make.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: get_args, + }, + ExtCommand { + name: "library.favorite", + description: "Mark or unmark a library preset as a favourite (kept in the user's library state).", + level: ChangeLevel::None, + mutates: false, + read_only: false, + schema: favorite_args, + }, + ExtCommand { + name: "library.recent", + description: "The library presets applied most recently, newest first.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: no_args, + }, + ExtCommand { + name: "library.apply", + description: "Apply a library preset to parts as one undo step: builds its material (or reuses an identical one) and assigns it to the parts the scope reaches (part, group or same_material).", + level: ChangeLevel::Region, + mutates: true, + read_only: false, + schema: apply_args, + }, + ExtCommand { + name: "library.save", + description: "Save a document material as one of the user's own library presets (user/).", + level: ChangeLevel::None, + mutates: false, + read_only: false, + schema: save_args, + }, + ExtCommand { + name: "library.remove", + description: "Delete one of the user's own library presets; built-in presets cannot be removed.", + level: ChangeLevel::None, + mutates: false, + read_only: false, + schema: remove_args, + }, + ExtCommand { + name: "library.thumbnail", + description: "A preset's thumbnail (the material ball under the studio, CPU path traced, cached as PNG by preset hash and size); a missing one is queued on a background worker.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: thumbnail_args, + }, + ExtCommand { + name: "library.thumbnails", + description: "Queue the thumbnails of several presets on the background worker, in the order given, and report each one's state.", + level: ChangeLevel::None, + mutates: false, + read_only: true, + schema: thumbnails_args, + }, +]; + +fn lib_err(e: String) -> EngineError { + EngineError::state(e) +} + +fn id_of(args: &Value) -> Result<&str> { + get_str(args, "id").map(str::trim).filter(|s| !s.is_empty()).ok_or_else(|| EngineError::args("needs id (a preset id such as metal/gold-polished)")) +} + +fn list(args: &Value) -> Result { + let shelf = get_str(args, "shelf").unwrap_or("all"); + if !SHELVES.contains(&shelf) { + return Err(EngineError::args(format!("shelf must be one of {}", SHELVES.join(", ")))); + } + let category = match get_str(args, "category").map(str::trim).filter(|s| !s.is_empty()) { + Some(c) => Some(preset::category(c).ok_or_else(|| EngineError::args(format!("unknown category \"{c}\"")))?.0), + None => None, + }; + let words = search::words(get_str(args, "query").unwrap_or("")); + let limit = get_u32(args, "limit")?.map(|n| n as usize); + let offset = get_u32(args, "offset")?.unwrap_or(0) as usize; + let (lib, presets, warnings) = store::all().map_err(lib_err)?; + let shelves = state::read(); + let fav = |p: &Preset| shelves.favorites.iter().any(|f| *f == p.id); + let mut on_shelf: Vec<(Preset, u32)> = match shelf { + "favorites" => presets.into_iter().filter(|p| fav(p)).map(|p| (p, 0)).collect(), + "user" => presets.into_iter().filter(|p| p.user).map(|p| (p, 0)).collect(), + "recent" => shelves.recent.iter().filter_map(|(id, _)| presets.iter().find(|p| p.id == *id).cloned()).map(|p| (p, 0)).collect(), + _ => presets.into_iter().map(|p| (p, 0)).collect(), + }; + if !words.is_empty() { + on_shelf = on_shelf.into_iter().filter_map(|(p, _)| search::score(&p, &words).map(|s| (p, s))).collect(); + on_shelf.sort_by(|a, b| b.1.cmp(&a.1)); + } + let categories: Vec = CATEGORIES + .iter() + .map(|(name, folder)| json!({"name": name, "folder": folder, "count": on_shelf.iter().filter(|(p, _)| p.category == *name).count()})) + .collect(); + if let Some(c) = category { + on_shelf.retain(|(p, _)| p.category == c); + } + let total = on_shelf.len(); + let page: Vec = on_shelf + .iter() + .skip(offset) + .take(limit.unwrap_or(usize::MAX)) + .map(|(p, s)| { + let mut e = p.entry(fav(p)); + if !words.is_empty() { + e["score"] = json!(s); + } + e + }) + .collect(); + Ok(json!({ + "root": lib.root.to_string_lossy(), + "origin": lib.origin.as_str(), + "shelf": shelf, + "total": total, + "count": page.len(), + "offset": offset, + "categories": categories, + "presets": page, + "warnings": warnings, + })) +} + +fn get(args: &Value) -> Result { + let id = id_of(args)?; + let p = store::find(id).map_err(lib_err)?; + let favorite = state::read().favorites.iter().any(|f| f == id); + let material = p.material(GraphMode::Type).map_err(lib_err)?; + let mut notes = Vec::new(); + let graph = if material.graph.is_none() { + "none" + } else if procedurals_live() { + "type" + } else { + notes.push("the type's procedural graph is applied, but the engine's procedural patterns are not built yet, so it renders as a flat colour".to_string()); + "flat" + }; + Ok(json!({ + "entry": p.entry(favorite), + "preset": p.raw, + "source": p.source, + "material": serde_json::to_value(&material).map_err(|e| EngineError::state(e.to_string()))?, + "file": p.file.to_string_lossy(), + "graph": graph, + "notes": notes, + })) +} + +fn favorite(args: &Value) -> Result { + let id = id_of(args)?; + store::find(id).map_err(lib_err)?; + let on = get_bool(args, "on").unwrap_or(true); + let s = state::set_favorite(id, on).map_err(lib_err)?; + Ok(json!({"id": id, "favorite": on, "favorites": s.favorites})) +} + +fn recent() -> Result { + let (_, presets, _) = store::all().map_err(lib_err)?; + let s = state::read(); + let list: Vec = s + .recent + .iter() + .filter_map(|(id, at)| { + let p = presets.iter().find(|p| p.id == *id)?; + let mut e = p.entry(s.favorites.iter().any(|f| f == id)); + e["used_at"] = json!(at); + Some(e) + }) + .collect(); + Ok(json!({"recent": list})) +} + +fn size_of(args: &Value) -> Result { + let size = get_u32(args, "size")?.unwrap_or(thumbs::DEFAULT_SIZE); + if !(thumbs::MIN_SIZE..=thumbs::MAX_SIZE).contains(&size) { + return Err(EngineError::args(format!("size must be {} to {} pixels", thumbs::MIN_SIZE, thumbs::MAX_SIZE))); + } + Ok(size) +} + +fn thumb_json(p: &Preset, size: u32, status: &thumbs::Status) -> Value { + let mut v = json!({ + "id": p.id, + "size": size, + "sha256": p.sha256, + "path": thumbs::path(&p.sha256, size).map(|f| f.to_string_lossy().into_owned()).unwrap_or_default(), + "state": status.as_str(), + }); + if let thumbs::Status::Failed(e) = status { + v["error"] = json!(e); + } + v +} + +fn thumbnail(args: &Value) -> Result { + let id = id_of(args)?; + let size = size_of(args)?; + let p = store::find(id).map_err(lib_err)?; + let wait = get_bool(args, "wait").unwrap_or(false); + let mut status = thumbs::request(&p, size, get_bool(args, "retry").unwrap_or(false)).map_err(lib_err)?; + if wait && matches!(status, thumbs::Status::Queued | thumbs::Status::Rendering) { + let limit = get_u32(args, "timeout")?.unwrap_or(120).clamp(1, 600); + status = thumbs::wait(&p, size, std::time::Duration::from_secs(limit as u64)).map_err(lib_err)?; + } + let mut v = thumb_json(&p, size, &status); + if status == thumbs::Status::Ready && get_bool(args, "inline").unwrap_or(false) { + let file = thumbs::path(&p.sha256, size).map_err(lib_err)?; + let bytes = std::fs::read(&file).map_err(|e| EngineError::File(format!("{}: {e}", file.display())))?; + v["png_base64"] = json!(base64(&bytes)); + } + Ok(v) +} + +fn thumbnails(args: &Value) -> Result { + let size = size_of(args)?; + let ids: Vec<&str> = match args.get("ids") { + Some(Value::Array(a)) => a.iter().filter_map(Value::as_str).collect(), + _ => return Err(EngineError::args("needs ids (a list of preset ids)")), + }; + let mut queued = 0; + let mut items = Vec::with_capacity(ids.len()); + for id in ids { + match store::find(id).and_then(|p| thumbs::request(&p, size, false).map(|s| (p, s))) { + Ok((p, s)) => { + if s == thumbs::Status::Queued { + queued += 1; + } + items.push(thumb_json(&p, size, &s)); + } + Err(e) => items.push(json!({"id": id, "size": size, "state": "failed", "error": e})), + } + } + Ok(json!({"size": size, "items": items, "queued": queued})) +} -pub(super) fn dispatch(_engine: &Engine, _st: &mut State, _name: &str, _args: &Value) -> Option> { - None +pub(super) fn dispatch(engine: &Engine, st: &mut State, name: &str, args: &Value) -> Option> { + Some(match name { + "library.list" => list(args), + "library.get" => get(args), + "library.favorite" => favorite(args), + "library.recent" => recent(), + "library.apply" => apply::apply(engine, st, args), + "library.save" => apply::save(st, args), + "library.remove" => apply::remove(args), + "library.thumbnail" => thumbnail(args), + "library.thumbnails" => thumbnails(args), + _ => return None, + }) } From 0371c991836dc2015a72740c7225cf5246e6d5a8 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:28 -0500 Subject: [PATCH 297/494] feat(backend): serve library thumbnails and the preset index GET /api/library/thumbnail serves the cached PNG by preset hash with an ETag and long cache headers, and otherwise asks the engine and polls its background queue without holding the engine. GET /api/library/index passes library.list through; POST /api/library/thumbnails queues a batch behind the window key. Checked by importing app.main in the service venv. --- backend/app/routers/library.py | 128 ++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/library.py b/backend/app/routers/library.py index d046b625..e10f1cbd 100644 --- a/backend/app/routers/library.py +++ b/backend/app/routers/library.py @@ -1,5 +1,127 @@ -"""The material library: the user's own presets folder and thumbnails (0.6.0).""" +"""The material library: preset thumbnails from the user cache (rendered by the engine when missing) and the index.""" -from fastapi import APIRouter +import asyncio +import os +import re +import sys +import time +from pathlib import Path +from typing import Any -router = APIRouter() +from fastapi import APIRouter, HTTPException, Query, Request, Response +from fastapi.responses import FileResponse +from pydantic import BaseModel, Field +from starlette.concurrency import run_in_threadpool + +from app.engine import EngineError, EngineUnavailable, engine +from app.routers.cad import cache_dir + +router = APIRouter(prefix="/api/library", tags=["library"]) + +LIBRARY_ENV = "FORMSHOT_LIBRARY" +PRODUCT = "FormShot" +MIN_SIZE, MAX_SIZE, DEFAULT_SIZE = 64, 512, 128 +WAIT = 60.0 +POLL = 0.15 +HASH = re.compile(r"^[0-9a-f]{64}$") +IMMUTABLE = "public, max-age=31536000, immutable" +REVALIDATE = "no-cache" +BUSY = ("queued", "rendering") + + +def bundled_library() -> Path | None: + exe = Path(sys.executable).resolve().parent + places = [exe.parent / "Resources" / "library", exe / "library", exe / "resources" / "library", + exe.parent / "lib" / PRODUCT / "library", exe.parent / "lib" / PRODUCT.lower() / "library"] + appdir = os.environ.get("APPDIR", "").strip() + if appdir: + places.append(Path(appdir) / "usr" / "lib" / PRODUCT / "library") + places.append(Path("/usr/lib") / PRODUCT / "library") + return next((p for p in places if (p / "materials" / "index.json").is_file()), None) + + +def point_engine_at_bundle() -> None: + if os.environ.get(LIBRARY_ENV, "").strip() or not getattr(sys, "frozen", False): + return + found = bundled_library() + if found is not None: + os.environ[LIBRARY_ENV] = str(found) + + +point_engine_at_bundle() + + +def thumbs_dir() -> Path: + return cache_dir() / "formshot" / "library" / "thumbs" + + +class Batch(BaseModel): + ids: list[str] = Field(min_length=1, max_length=512) + size: int = Field(DEFAULT_SIZE, ge=MIN_SIZE, le=MAX_SIZE) + + +async def call(name: str, args: dict[str, Any]): + try: + return await run_in_threadpool(engine.dispatch, name, args) + except EngineUnavailable as error: + raise HTTPException(503, str(error)) from None + except EngineError as error: + status = 404 if error.status == 422 and str(error).startswith(("no preset", "no user preset")) else error.status + raise HTTPException(status, str(error)) from None + + +def etag(sha: str, size: int) -> str: + return f'"{sha}-{size}"' + + +def picture(path: Path, sha: str, size: int, request: Request, cache: str) -> Response: + tag = etag(sha, size) + headers = {"ETag": tag, "Cache-Control": cache} + if tag in [t.strip() for t in request.headers.get("if-none-match", "").split(",")]: + return Response(status_code=304, headers=headers) + return FileResponse(path, media_type="image/png", headers=headers) + + +@router.get("/thumbnail/{preset:path}") +async def thumbnail(preset: str, request: Request, size: int = Query(DEFAULT_SIZE, ge=MIN_SIZE, le=MAX_SIZE), + h: str = Query("", max_length=64)) -> Response: + wanted = h.lower() + if wanted and not HASH.match(wanted): + raise HTTPException(400, "h is the preset's SHA-256 in hex, as library.list gives it") + if wanted: + cached = thumbs_dir() / f"{wanted}-{size}.png" + if cached.is_file(): + return picture(cached, wanted, size, request, IMMUTABLE) + deadline = time.monotonic() + WAIT + reply = await call("library.thumbnail", {"id": preset, "size": size}) + while isinstance(reply, dict) and reply.get("state") in BUSY and time.monotonic() < deadline: + await asyncio.sleep(POLL) + reply = await call("library.thumbnail", {"id": preset, "size": size}) + if not isinstance(reply, dict): + raise HTTPException(502, "The engine answered library.thumbnail without a thumbnail") + state = reply.get("state") + if state in BUSY: + raise HTTPException(503, "The thumbnail is still being rendered", headers={"Retry-After": "2"}) + if state != "ready": + raise HTTPException(500, f"The thumbnail could not be rendered: {reply.get('error') or 'unknown reason'}") + sha = str(reply.get("sha256") or "") + path = Path(str(reply.get("path") or "")) + if not path.is_file(): + raise HTTPException(500, "The engine reported a thumbnail that is not in the cache") + return picture(path, sha, size, request, IMMUTABLE if wanted == sha else REVALIDATE) + + +@router.get("/index") +async def index(category: str = Query("", max_length=40), query: str = Query("", max_length=200), + shelf: str = Query("all", max_length=20)): + args: dict[str, Any] = {"shelf": shelf} + if category: + args["category"] = category + if query: + args["query"] = query + return await call("library.list", args) + + +@router.post("/thumbnails") +async def thumbnails(batch: Batch): + return await call("library.thumbnails", {"ids": batch.ids, "size": batch.size}) From 8a7a79aa57324d19e10e04e00e9355a93fd6f745 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:28:36 -0500 Subject: [PATCH 298/494] build(tauri): ship the material library as a bundle resource assets/library/materials is copied to the app's resource folder as library/materials, which the engine and the service look for beside the program on Windows, in Contents/Resources on macOS and in lib/FormShot on Linux and AppImage. Checked that the config parses; no bundle was built. --- src-tauri/tauri.conf.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index aa3bbf32..e2d61aaf 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -42,7 +42,8 @@ "resources": { "../LICENSE": "LICENSE", "../NOTICE.md": "NOTICE.md", - "../THIRD-PARTY-NOTICES.txt": "THIRD-PARTY-NOTICES.txt" + "../THIRD-PARTY-NOTICES.txt": "THIRD-PARTY-NOTICES.txt", + "../assets/library/materials": "library/materials" }, "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"], "macOS": { From 1841466412eb58f1e9dfa27131b13994203e7e20 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:41:05 -0500 Subject: [PATCH 299/494] fix(library): report every problem of a broken preset and unlisted files A preset that fails is now reported with all of its warnings joined, not only the first (a hash mismatch hid the real parse error), and preset files missing from the index are named. Ran a copied library with a bad key, broken JSON, a missing file and an unlisted file through the release CLI's dispatch: 247 presets, seven warnings, clean errors. --- .../fsh-commands/src/ext/library/store.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/library/store.rs b/native/crates/fsh-commands/src/ext/library/store.rs index 92f14bbd..96c7a40a 100644 --- a/native/crates/fsh-commands/src/ext/library/store.rs +++ b/native/crates/fsh-commands/src/ext/library/store.rs @@ -76,6 +76,18 @@ fn load(root: PathBuf, origin: Origin) -> Library { Err(msg) => lib.warnings.push(msg), } } + for (_, folder) in CATEGORIES { + let Ok(entries) = std::fs::read_dir(materials.join(folder)) else { continue }; + let mut unlisted: Vec = entries + .flatten() + .filter_map(|e| e.file_name().to_str().and_then(|n| n.strip_suffix(".json")).map(|s| format!("{folder}/{s}"))) + .filter(|id| !listed.iter().any(|e| e.get("id").and_then(Value::as_str) == Some(id.as_str()))) + .collect(); + unlisted.sort(); + for id in unlisted { + lib.warnings.push(format!("preset {id}: its file is not in the index, so it is not offered")); + } + } if let Some(n) = index.get("count").and_then(Value::as_u64) { if n as usize != listed.len() { lib.warnings.push(format!("the index says {n} presets but lists {}", listed.len())); @@ -157,8 +169,9 @@ pub(crate) fn find(id: &str) -> Result { } let lib = library()?; let Some(p) = lib.presets.iter().find(|p| p.id == id) else { - if let Some(w) = lib.warnings.iter().find(|w| w.starts_with(&format!("preset {id}:"))) { - return Err(w.clone()); + let said: Vec<&str> = lib.warnings.iter().filter(|w| w.starts_with(&format!("preset {id}:"))).map(String::as_str).collect(); + if !said.is_empty() { + return Err(said.join("; ")); } return Err(format!("no preset \"{id}\" in the library")); }; From 7fd0405e74a2b03646c0327a75e8c4fb0f87c164 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:41:05 -0500 Subject: [PATCH 300/494] fix(library): rank shorter names first and answer unknown ids as arguments Search ties now prefer the shorter name, and an unknown preset id is an invalid_arguments error so the service can answer 404. Checked with library.list queries and library.get on a missing id through the release CLI. --- native/crates/fsh-commands/src/ext/library.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/library.rs b/native/crates/fsh-commands/src/ext/library.rs index bd6828eb..312e3b16 100644 --- a/native/crates/fsh-commands/src/ext/library.rs +++ b/native/crates/fsh-commands/src/ext/library.rs @@ -167,6 +167,9 @@ pub(super) static COMMANDS: &[ExtCommand] = &[ ]; fn lib_err(e: String) -> EngineError { + if e.starts_with("no preset") || e.starts_with("no user preset") { + return EngineError::args(e); + } EngineError::state(e) } @@ -197,7 +200,7 @@ fn list(args: &Value) -> Result { }; if !words.is_empty() { on_shelf = on_shelf.into_iter().filter_map(|(p, _)| search::score(&p, &words).map(|s| (p, s))).collect(); - on_shelf.sort_by(|a, b| b.1.cmp(&a.1)); + on_shelf.sort_by(|a, b| b.1.cmp(&a.1).then_with(|| a.0.name.chars().count().cmp(&b.0.name.chars().count()))); } let categories: Vec = CATEGORIES .iter() From 3e45b03b10a4f99d9d9906550026aa8def3d7e4e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:41:05 -0500 Subject: [PATCH 301/494] fix(library): write saved presets in the format's key order Saved user presets now list source keys as the format does and separate array items with a space, matching the built-in files. Checked by saving a material through library.save and reading it back with library.list. --- native/crates/fsh-commands/src/ext/library/apply.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/library/apply.rs b/native/crates/fsh-commands/src/ext/library/apply.rs index c1c1e9ab..da0c02ad 100644 --- a/native/crates/fsh-commands/src/ext/library/apply.rs +++ b/native/crates/fsh-commands/src/ext/library/apply.rs @@ -149,9 +149,14 @@ fn taken(slug: &str) -> bool { } fn text(v: &Value) -> String { - serde_json::to_string(v).unwrap_or_else(|_| "null".into()) + match v { + Value::Array(a) => format!("[{}]", a.iter().map(text).collect::>().join(", ")), + _ => serde_json::to_string(v).unwrap_or_else(|_| "null".into()), + } } +const SOURCE_KEYS: [&str; 5] = ["kind", "reference", "urls", "notes", "authored"]; + /// The preset file text, keys in the format's order, two-space indent, newline at the end. fn preset_text(fields: &[(&str, Value)], params: &Map) -> String { let mut out = String::from("{\n"); @@ -167,7 +172,7 @@ fn preset_text(fields: &[(&str, Value)], params: &Map) -> String out.push_str("\n }"); } } else if *k == "source" { - let lines: Vec = v.as_object().map(|o| o.iter().map(|(sk, sv)| format!(" \"{sk}\": {}", text(sv))).collect()).unwrap_or_default(); + let lines: Vec = SOURCE_KEYS.iter().filter_map(|sk| v.get(*sk).map(|sv| format!(" \"{sk}\": {}", text(sv)))).collect(); out.push_str("{\n"); out.push_str(&lines.join(",\n")); out.push_str("\n }"); From 3c0d45513fa73f13c743602cf22e870f7bd8076e Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:43:37 -0500 Subject: [PATCH 302/494] fix(library): frame the ball closer and expose emitters for their colour The camera's longer lens fills more of the thumbnail, and an emitting preset lowers the exposure so the light shows its colour instead of clipping to white. The cache look is bumped so older pictures are dropped. Rendered one preset per category at 128 px through the release CLI and looked at each; ball-2 needs the next build to take effect. --- native/crates/fsh-commands/src/ext/library/thumbs.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/library/thumbs.rs b/native/crates/fsh-commands/src/ext/library/thumbs.rs index afd61ae0..d69ad1da 100644 --- a/native/crates/fsh-commands/src/ext/library/thumbs.rs +++ b/native/crates/fsh-commands/src/ext/library/thumbs.rs @@ -22,6 +22,7 @@ pub(crate) const DEFAULT_SIZE: u32 = 128; pub(crate) const SAMPLES: u32 = 48; const BOUNCES: u32 = 10; const MARKER: &str = ".look"; +const EMITTER_LEVEL: f32 = 1.5; /// Where a thumbnail is, or is being made. #[derive(Clone, Debug, PartialEq)] @@ -65,9 +66,9 @@ fn queue() -> &'static (Mutex, Condvar) { /// What the cached pictures were made with; when it changes (the procedurals arrive) the old pictures are dropped. fn look() -> &'static str { if procedurals_live() { - "ball-1 graph" + "ball-2 graph" } else { - "ball-1 flat" + "ball-2 flat" } } @@ -110,6 +111,11 @@ pub(crate) fn scene(material: Material, size: u32) -> Result { run(&mut ed, "environment.set", json!({"values": {"source": {"kind": "studio"}, "background": "environment", "brightness": 1.0}}))?; run(&mut ed, "ground.set", json!({"values": {"shadow_catcher": true, "reflection": 0.0}}))?; run(&mut ed, "render.set_settings", json!({"values": {"width": size, "height": size, "samples": SAMPLES, "max_bounces": BOUNCES, "seed": 7, "denoise": true}}))?; + let glow = material.params.emission_luminance * fsh_scene::SCENE_UNITS_PER_NIT; + if glow > EMITTER_LEVEL { + let stops = -(glow / EMITTER_LEVEL).log2(); + run(&mut ed, "image.set_style", json!({"values": {"exposure": stops.max(-20.0)}}))?; + } let pedestal = Material::new( "Pedestal", "plastic", @@ -136,7 +142,7 @@ pub(crate) fn scene(material: Material, size: u32) -> Result { run( &mut ed, "camera.set", - json!({"index": 0, "values": {"position": [0.0, 1.05, 2.55], "target": [0.0, 0.56, 0.0], "up": [0.0, 1.0, 0.0], "focal_length_mm": 50.0, "sensor_width_mm": 36.0}}), + json!({"index": 0, "values": {"position": [0.0, 1.0, 2.55], "target": [0.0, 0.57, 0.0], "up": [0.0, 1.0, 0.0], "focal_length_mm": 64.0, "sensor_width_mm": 36.0}}), )?; Ok(ed.into_document()) } From 7ee3e616cef89f3140ebeaa1eb4da463531fa847 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:51:19 -0500 Subject: [PATCH 303/494] fix(library): satisfy clippy in the digest, search and listing The digest walks fixed-size chunks with as_chunks, list membership uses contains, and the all() result has a named type. cargo clippy -p fsh-commands --all-targets -D warnings is clean; the rebuilt CLI still matches all 249 index hashes and dropped the old thumbnails for the new look. --- native/crates/fsh-commands/src/ext/library.rs | 2 +- .../fsh-commands/src/ext/library/search.rs | 2 +- .../fsh-commands/src/ext/library/sha256.rs | 17 ++++++++--------- .../fsh-commands/src/ext/library/store.rs | 5 ++++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/library.rs b/native/crates/fsh-commands/src/ext/library.rs index 312e3b16..2764d53f 100644 --- a/native/crates/fsh-commands/src/ext/library.rs +++ b/native/crates/fsh-commands/src/ext/library.rs @@ -191,7 +191,7 @@ fn list(args: &Value) -> Result { let offset = get_u32(args, "offset")?.unwrap_or(0) as usize; let (lib, presets, warnings) = store::all().map_err(lib_err)?; let shelves = state::read(); - let fav = |p: &Preset| shelves.favorites.iter().any(|f| *f == p.id); + let fav = |p: &Preset| shelves.favorites.contains(&p.id); let mut on_shelf: Vec<(Preset, u32)> = match shelf { "favorites" => presets.into_iter().filter(|p| fav(p)).map(|p| (p, 0)).collect(), "user" => presets.into_iter().filter(|p| p.user).map(|p| (p, 0)).collect(), diff --git a/native/crates/fsh-commands/src/ext/library/search.rs b/native/crates/fsh-commands/src/ext/library/search.rs index 44280cf5..9c1b2778 100644 --- a/native/crates/fsh-commands/src/ext/library/search.rs +++ b/native/crates/fsh-commands/src/ext/library/search.rs @@ -40,7 +40,7 @@ fn word_score(w: &str, name: &str, name_words: &[&str], tags: &[String], categor if name.starts_with(w) { s = s.max(100); } - if name_words.iter().any(|n| *n == w) { + if name_words.contains(&w) { s = s.max(80); } else if name_words.iter().any(|n| n.starts_with(w)) { s = s.max(60); diff --git a/native/crates/fsh-commands/src/ext/library/sha256.rs b/native/crates/fsh-commands/src/ext/library/sha256.rs index 88eb22d5..a4856d01 100644 --- a/native/crates/fsh-commands/src/ext/library/sha256.rs +++ b/native/crates/fsh-commands/src/ext/library/sha256.rs @@ -12,10 +12,10 @@ const K: [u32; 64] = [ const H0: [u32; 8] = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]; -fn block(h: &mut [u32; 8], chunk: &[u8]) { +fn block(h: &mut [u32; 8], chunk: &[u8; 64]) { let mut w = [0u32; 64]; - for (i, word) in chunk.chunks_exact(4).enumerate() { - w[i] = u32::from_be_bytes([word[0], word[1], word[2], word[3]]); + for (i, word) in chunk.as_chunks::<4>().0.iter().enumerate() { + w[i] = u32::from_be_bytes(*word); } for i in 16..64 { let s0 = w[i - 15].rotate_right(7) ^ w[i - 15].rotate_right(18) ^ (w[i - 15] >> 3); @@ -47,22 +47,21 @@ fn block(h: &mut [u32; 8], chunk: &[u8]) { /// The digest of `data` as 32 bytes. pub(crate) fn digest(data: &[u8]) -> [u8; 32] { let mut h = H0; - let mut chunks = data.chunks_exact(64); - for c in &mut chunks { + let (chunks, rest) = data.as_chunks::<64>(); + for c in chunks { block(&mut h, c); } - let rest = chunks.remainder(); let mut tail = [0u8; 128]; tail[..rest.len()].copy_from_slice(rest); tail[rest.len()] = 0x80; let n = if rest.len() < 56 { 64 } else { 128 }; tail[n - 8..n].copy_from_slice(&((data.len() as u64) * 8).to_be_bytes()); - for c in tail[..n].chunks_exact(64) { + for c in tail[..n].as_chunks::<64>().0 { block(&mut h, c); } let mut out = [0u8; 32]; - for (o, v) in out.chunks_exact_mut(4).zip(h) { - o.copy_from_slice(&v.to_be_bytes()); + for (o, v) in out.as_chunks_mut::<4>().0.iter_mut().zip(h) { + *o = v.to_be_bytes(); } out } diff --git a/native/crates/fsh-commands/src/ext/library/store.rs b/native/crates/fsh-commands/src/ext/library/store.rs index 96c7a40a..f7cac49a 100644 --- a/native/crates/fsh-commands/src/ext/library/store.rs +++ b/native/crates/fsh-commands/src/ext/library/store.rs @@ -140,8 +140,11 @@ pub(crate) fn user_presets() -> (Vec, Vec) { (out, warnings) } +/// The built-in library, every preset and every warning, as `all` answers them. +pub(crate) type Everything = (Arc, Vec, Vec); + /// Every preset (built-ins in index order, the user's after the built-ins of their category) and all warnings. -pub(crate) fn all() -> Result<(Arc, Vec, Vec), String> { +pub(crate) fn all() -> Result { let lib = library()?; let (user, user_warnings) = user_presets(); let mut presets: Vec = Vec::with_capacity(lib.presets.len() + user.len()); From 58dab7d04e3b80dc2a3798b2cf30cf1fac7031e7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:26:31 -0500 Subject: [PATCH 304/494] feat(format): add an in-house sha-256 for naming embedded textures SHA-256 per FIPS 180-4 with no new dependency, used to name texture members by content. Checked against sha256sum on 13 random files of 0 to 100000 bytes across the padding boundaries: all equal. --- native/crates/fsh-format/src/sha256.rs | 77 ++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 native/crates/fsh-format/src/sha256.rs diff --git a/native/crates/fsh-format/src/sha256.rs b/native/crates/fsh-format/src/sha256.rs new file mode 100644 index 00000000..841c964d --- /dev/null +++ b/native/crates/fsh-format/src/sha256.rs @@ -0,0 +1,77 @@ +//! SHA-256 (FIPS 180-4) for naming embedded texture members by content. + +const K: [u32; 64] = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, + 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, + 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2, +]; + +const H0: [u32; 8] = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]; + +fn compress(h: &mut [u32; 8], block: &[u8; 64]) { + let mut w = [0u32; 64]; + for (i, c) in block.as_chunks::<4>().0.iter().enumerate() { + w[i] = u32::from_be_bytes(*c); + } + for i in 16..64 { + let s0 = w[i - 15].rotate_right(7) ^ w[i - 15].rotate_right(18) ^ (w[i - 15] >> 3); + let s1 = w[i - 2].rotate_right(17) ^ w[i - 2].rotate_right(19) ^ (w[i - 2] >> 10); + w[i] = w[i - 16].wrapping_add(s0).wrapping_add(w[i - 7]).wrapping_add(s1); + } + let [mut a, mut b, mut c, mut d, mut e, mut f, mut g, mut hh] = *h; + for i in 0..64 { + let s1 = e.rotate_right(6) ^ e.rotate_right(11) ^ e.rotate_right(25); + let ch = (e & f) ^ (!e & g); + let t1 = hh.wrapping_add(s1).wrapping_add(ch).wrapping_add(K[i]).wrapping_add(w[i]); + let s0 = a.rotate_right(2) ^ a.rotate_right(13) ^ a.rotate_right(22); + let maj = (a & b) ^ (a & c) ^ (b & c); + let t2 = s0.wrapping_add(maj); + hh = g; + g = f; + f = e; + e = d.wrapping_add(t1); + d = c; + c = b; + b = a; + a = t1.wrapping_add(t2); + } + for (x, v) in h.iter_mut().zip([a, b, c, d, e, f, g, hh]) { + *x = x.wrapping_add(v); + } +} + +/// SHA-256 digest of `data`. +pub fn sha256(data: &[u8]) -> [u8; 32] { + let mut h = H0; + let (blocks, rest) = data.as_chunks::<64>(); + for b in blocks { + compress(&mut h, b); + } + let mut tail = [0u8; 128]; + tail[..rest.len()].copy_from_slice(rest); + tail[rest.len()] = 0x80; + let len = if rest.len() < 56 { 64 } else { 128 }; + tail[len - 8..len].copy_from_slice(&((data.len() as u64).wrapping_mul(8)).to_be_bytes()); + for b in tail[..len].as_chunks::<64>().0 { + compress(&mut h, b); + } + let mut out = [0u8; 32]; + for (o, v) in out.as_chunks_mut::<4>().0.iter_mut().zip(h) { + *o = v.to_be_bytes(); + } + out +} + +/// Lowercase hex of the digest's first `digits` hex digits (at most 64). +pub fn sha256_hex(data: &[u8], digits: usize) -> String { + let mut s = String::with_capacity(64); + for b in sha256(data) { + s.push_str(&format!("{b:02x}")); + } + s.truncate(digits.min(64)); + s +} From 669cb00c4c411b7146a60de7c184b67c93aea5a9 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:26:32 -0500 Subject: [PATCH 305/494] feat(format): name embedded textures by sha-256 and cap them at 256 mib New texture members are textures/<32 hex digits of SHA-256>. through texture_member and embed_texture, which refuses images above 256 MiB. Loading accepts both this form and the older - names, each checked against its content. cargo check -p fsh-format passes. --- native/crates/fsh-format/src/lib.rs | 6 ++-- native/crates/fsh-format/src/project.rs | 40 +++++++++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/native/crates/fsh-format/src/lib.rs b/native/crates/fsh-format/src/lib.rs index accc6a36..079877fc 100644 --- a/native/crates/fsh-format/src/lib.rs +++ b/native/crates/fsh-format/src/lib.rs @@ -8,6 +8,7 @@ pub mod meshbin; mod platform; mod project; pub mod session; +pub mod sha256; mod version; pub mod zip; @@ -16,8 +17,9 @@ pub use platform::{now_ms, process_id, set_wall_clock, HAS_FILE_SYSTEM}; pub use journal::{replay, replay_editor, Journal, JournalEntry, JournalHeader}; pub use project::{ atomic_write, fingerprint, load_bytes, load_file, material_member, mesh_member, save_bytes, save_file, source_member, - LoadReport, Preserved, Project, SaveOptions, EMBED_SCHEME, EXTENSION, FORMAT_NAME, MANIFEST_MEMBER, MAX_SOURCE_BYTES, - PREVIEW_MEMBER, PROJECT_FILE_NAME, SCENE_MEMBER, SOURCES_PREFIX, + texture_member, LoadReport, Preserved, Project, SaveOptions, EMBED_SCHEME, EXTENSION, FORMAT_NAME, MANIFEST_MEMBER, + MAX_EMBED_TEXTURE_BYTES, MAX_SOURCE_BYTES, PREVIEW_MEMBER, PROJECT_FILE_NAME, SCENE_MEMBER, SOURCES_PREFIX, + TEXTURES_PREFIX, }; pub use session::{recover, RecoverableSession, Recovered, RecoveryStrategy, Session, SnapshotDone, SnapshotJob}; pub use version::{Migration, MigrationInput, Version, FORMAT_VERSION, MIGRATIONS}; diff --git a/native/crates/fsh-format/src/project.rs b/native/crates/fsh-format/src/project.rs index 96a7b0f8..996899b7 100644 --- a/native/crates/fsh-format/src/project.rs +++ b/native/crates/fsh-format/src/project.rs @@ -94,7 +94,8 @@ pub struct Preserved { pub struct Project { /// The document. pub document: Document, - /// Embedded texture files by member path (`textures/-.`). + /// Embedded texture files by member path (`textures/.`, or the older + /// `textures/-.`). pub textures: BTreeMap>, /// Optional preview image (PNG bytes). pub preview_png: Option>, @@ -133,13 +134,36 @@ fn sanitize_ext(ext: &str) -> Option { (!e.is_empty() && e.len() <= 8 && e.bytes().all(|b| b.is_ascii_alphanumeric())).then_some(e) } +/// Folder of embedded textures inside a project. +pub const TEXTURES_PREFIX: &str = "textures/"; +/// Largest texture embedded in a project; larger images are referenced by path. +pub const MAX_EMBED_TEXTURE_BYTES: usize = 256 << 20; +const SHA_DIGITS: usize = 32; + +/// Member path of an embedded texture: `textures/.`; None for a bad +/// extension. +pub fn texture_member(bytes: &[u8], ext: &str) -> Option { + let ext = sanitize_ext(ext)?; + Some(format!("{TEXTURES_PREFIX}{}.{ext}", crate::sha256::sha256_hex(bytes, SHA_DIGITS))) +} + +fn is_lower_hex(s: &str, digits: usize) -> bool { + s.len() == digits && s.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()) +} + fn check_texture_member(name: &str, data: &[u8]) -> core::result::Result<(), String> { - let rest = name.strip_prefix("textures/").ok_or("is not under textures/")?; + let rest = name.strip_prefix(TEXTURES_PREFIX).ok_or("is not under textures/")?; let (stem, ext) = rest.rsplit_once('.').ok_or("has no extension")?; if sanitize_ext(ext).as_deref() != Some(ext) { return Err("has an invalid extension".into()); } - let (hash, len) = stem.split_once('-').ok_or("is not named -")?; + if is_lower_hex(stem, SHA_DIGITS) { + if crate::sha256::sha256_hex(data, SHA_DIGITS) != stem { + return Err("content does not match the SHA-256 in its name (the texture is damaged)".into()); + } + return Ok(()); + } + let (hash, len) = stem.split_once('-').ok_or("is not named or -")?; if hash.len() != 16 || !hash.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()) { return Err("is not named by a 16-digit lowercase hex hash".into()); } @@ -158,10 +182,14 @@ impl Project { Self { document, ..Default::default() } } - /// Stores texture bytes by content hash and returns the `TextureRef.path` that refers to them. + /// Stores texture bytes by content hash (`textures/.`) and returns the `TextureRef.path` + /// that refers to them; refuses images above [`MAX_EMBED_TEXTURE_BYTES`]. pub fn embed_texture(&mut self, bytes: Vec, ext: &str) -> Result { - let ext = sanitize_ext(ext).ok_or_else(|| FormatError::Document(format!("texture extension {ext:?} is not 1 to 8 letters or digits")))?; - let name = format!("textures/{:016x}-{}.{ext}", hash_bytes(&bytes), bytes.len()); + if bytes.len() > MAX_EMBED_TEXTURE_BYTES { + return Err(FormatError::Document(format!("an embedded texture may hold at most 256 MiB; this one has {} bytes", bytes.len()))); + } + let name = texture_member(&bytes, ext) + .ok_or_else(|| FormatError::Document(format!("texture extension {ext:?} is not 1 to 8 letters or digits")))?; self.textures.entry(name.clone()).or_insert(bytes); Ok(format!("{EMBED_SCHEME}{name}")) } From 8687ccebdafe224e3affafc01217613177ff3fe7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:26:37 -0500 Subject: [PATCH 306/494] feat(io): turn raw texture slots into material slots on import RawScene gains extras (slots and extension values per material) and embedded images beside the existing tables, so RawMaterial literals elsewhere keep compiling. The conversion builds TextureSlots, applies specular tint, sheen, volume, thin film, dispersion and anisotropy, and marks masked parts with material.alpha_cutoff. cargo check -p fsh-io passes. --- native/crates/fsh-io/src/clean.rs | 4 ++ native/crates/fsh-io/src/convert.rs | 74 ++++++++++++++++++++++++++--- native/crates/fsh-io/src/lib.rs | 9 +++- native/crates/fsh-io/src/raw.rs | 72 +++++++++++++++++++++++++++- 4 files changed, 149 insertions(+), 10 deletions(-) diff --git a/native/crates/fsh-io/src/clean.rs b/native/crates/fsh-io/src/clean.rs index caa1b1ca..65fd7f71 100644 --- a/native/crates/fsh-io/src/clean.rs +++ b/native/crates/fsh-io/src/clean.rs @@ -271,6 +271,10 @@ fn validate(scene: &mut RawScene, rep: &mut CleanReport, watch: &Watch) -> Resul for mat in &mut scene.materials { mat.textures.retain(|&t| t < ntex); } + scene.extras.truncate(nmat); + for x in &mut scene.extras { + x.slots.retain(|s| s.texture < ntex && s.input.slottable()); + } for (mi, m) in scene.meshes.iter_mut().enumerate() { watch.step(Stage::Validating, mi as f32 / nm.max(1) as f32)?; let n = m.positions.len(); diff --git a/native/crates/fsh-io/src/convert.rs b/native/crates/fsh-io/src/convert.rs index 2f5dc3ae..b6a584ef 100644 --- a/native/crates/fsh-io/src/convert.rs +++ b/native/crates/fsh-io/src/convert.rs @@ -1,10 +1,10 @@ use crate::error::Result; -use crate::raw::{RawMaterial, RawScene}; +use crate::raw::{RawMaterial, RawMaterialExtra, RawScene}; use crate::watch::{Stage, Watch}; use fsh_core::{DocKey, MaterialKey, Mat4, MeshKey, NodeId, Rgb, TextureKey, Vec3}; use fsh_scene::{ Command, Document, Import, ImportMaterial, ImportMesh, ImportNode, ImportPayload, ImportTexture, Material, Mesh, - Node, NodeKind, SceneError, SurfaceParams, TextureRef, Trs, + Node, NodeKind, SceneError, SurfaceParams, TextureRef, TextureSlot, Trs, }; use std::sync::Arc; @@ -17,10 +17,52 @@ pub const VERTEX_COLOURS_KEY: &str = "material.vertex_colours"; /// The value of [`VERTEX_COLOURS_KEY`]: the vertex colour multiplies the material's base colour. pub const VERTEX_COLOURS_MULTIPLY: &str = "multiply"; -fn flag_colours(node: &mut Node, mesh: &crate::raw::RawMesh) { - if !mesh.colours.is_empty() { +/// Node metadata key set on parts whose material is masked (glTF alphaMode MASK): the alpha cutoff, kept for a +/// later hard-cutoff opcode while coverage stays soft. +pub const ALPHA_CUTOFF_KEY: &str = "material.alpha_cutoff"; + +fn flag_colours(node: &mut Node, mi: usize, scene: &RawScene, source: usize) { + if !scene.meshes[source].colours.is_empty() { node.metadata.insert(VERTEX_COLOURS_KEY.to_string(), VERTEX_COLOURS_MULTIPLY.to_string()); } + if let Some(c) = scene.meshes[mi].material.and_then(|m| scene.extras.get(m)).and_then(|x| x.alpha_cutoff) { + node.metadata.insert(ALPHA_CUTOFF_KEY.to_string(), format!("{c}")); + } +} + +fn apply_extra(p: &mut SurfaceParams, x: &RawMaterialExtra) { + if let Some(c) = x.specular_colour { + p.specular_color = colour(c); + } + if let Some((c, r)) = x.sheen { + let peak = c.iter().copied().filter(|v| v.is_finite()).fold(0.0f32, f32::max); + if peak > 0.0 { + p.fuzz_weight = unit(peak, 0.0); + p.fuzz_color = colour(c.map(|v| v / peak)); + p.fuzz_roughness = unit(r, 0.5); + } + } + if let Some((c, d)) = x.attenuation { + if d.is_finite() && d > 0.0 { + p.transmission_color = colour(c); + p.transmission_depth = d; + } + } + if let Some(t) = x.thin_walled { + p.geometry_thin_walled = t; + } + if let Some([w, ior, thick]) = x.thin_film { + p.thin_film_weight = unit(w, 0.0); + p.thin_film_ior = if ior.is_finite() { ior.clamp(1.0, 3.0) } else { 1.3 }; + p.thin_film_thickness = if thick.is_finite() { thick.clamp(0.0, 10.0) } else { 0.4 }; + } + if let Some(v) = x.abbe.filter(|v| v.is_finite() && *v > 0.0) { + p.transmission_dispersion_scale = 1.0; + p.transmission_dispersion_abbe_number = v.clamp(1.0, 200.0); + } + if let Some(a) = x.anisotropy { + p.specular_roughness_anisotropy = unit(a, 0.0); + } } /// Where and how an import lands in the document. @@ -181,8 +223,26 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, } let key: MaterialKey = keys.next(); mat_key[i] = Some(key); - let mut material = Material::new(m.name.clone(), type_id(m), surface_params(m)); + let mut params = surface_params(m); + if let Some(x) = scene.extras.get(i) { + apply_extra(&mut params, x); + } + let mut material = Material::new(m.name.clone(), type_id(m), params); material.textures = m.textures.iter().filter_map(|&t| tex_key.get(t).copied().flatten()).collect(); + material.textures.dedup(); + for rs in scene.extras.get(i).map(|x| x.slots.as_slice()).unwrap_or(&[]) { + let Some(key) = tex_key.get(rs.texture).copied().flatten() else { continue }; + if material.slots.contains_key(&rs.input) { + continue; + } + let slot = TextureSlot { texture: key, ..rs.slot.clone() }; + if slot.validate(rs.input).is_ok() { + if !material.textures.contains(&key) { + material.textures.push(key); + } + material.slots.insert(rs.input, slot); + } + } payload.materials.push(ImportMaterial { key, material }); } @@ -225,7 +285,7 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, let (_, off) = source(mi); let (t, ok) = trs_or_hidden(&(n.transform * off)); let mut node = Node::new(n.name.clone(), part_of(mi)); - flag_colours(&mut node, &scene.meshes[source(mi).0]); + flag_colours(&mut node, mi, scene, source(mi).0); node.transform = t; node.visible = ok; node.parent = parent; @@ -245,7 +305,7 @@ pub fn to_import_command(scene: &RawScene, doc: &Document, opts: &ImportOptions, for mi in parts { let (_, off) = source(mi); let mut node = Node::new(scene.meshes[mi].name.clone(), part_of(mi)); - flag_colours(&mut node, &scene.meshes[source(mi).0]); + flag_colours(&mut node, mi, scene, source(mi).0); let (t, ok) = trs_or_hidden(&off); node.transform = t; node.visible = ok; diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index c7ff0ada..c3e83aa9 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -26,7 +26,10 @@ mod watch; mod zip; pub use clean::{clean, guess_unit, world_bounds, CleanOptions, CleanReport, UnitGuess}; -pub use convert::{surface_params, to_import_command, ImportOptions, EMISSIVE_NITS_PER_UNIT, VERTEX_COLOURS_KEY, VERTEX_COLOURS_MULTIPLY}; +pub use convert::{ + surface_params, to_import_command, ImportOptions, ALPHA_CUTOFF_KEY, EMISSIVE_NITS_PER_UNIT, VERTEX_COLOURS_KEY, + VERTEX_COLOURS_MULTIPLY, +}; pub use error::{IoError, Result}; pub use exr::write_exr; pub use glb_write::write_glb; @@ -37,7 +40,9 @@ pub use paths::Siblings; pub use picture::{FloatPicture, Picture, Samples}; pub use ply::read_ply; pub use png::{read_png, write_png, write_png_rgb16, write_png_rgba8}; -pub use raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +pub use raw::{ + RawImage, RawMaterial, RawMaterialExtra, RawMesh, RawNode, RawScene, RawSlot, RawTexture, UpAxis, EMBEDDED_PREFIX, +}; #[cfg(not(target_arch = "wasm32"))] pub use fbx::read_fbx; pub use stl::read_stl; diff --git a/native/crates/fsh-io/src/raw.rs b/native/crates/fsh-io/src/raw.rs index 6d41fe63..6bfa7b08 100644 --- a/native/crates/fsh-io/src/raw.rs +++ b/native/crates/fsh-io/src/raw.rs @@ -1,5 +1,5 @@ use fsh_core::{LengthUnit, Mat4, Vec2, Vec3, Vec4}; -use fsh_scene::TextureRole; +use fsh_scene::{MaterialInput, TextureRole, TextureSlot}; /// Which file axis points up. #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] @@ -182,6 +182,53 @@ impl Default for RawMaterial { } } +/// Prefix of a `RawTexture::uri` that names an image held in `RawScene::images` (`#embedded:`). +pub const EMBEDDED_PREFIX: &str = "#embedded:"; + +/// Image bytes stored inside the model file (GLB buffer views, data URIs, 3MF package parts, FBX content). +#[derive(Clone, Debug, Default, PartialEq)] +pub struct RawImage { + /// Name for reports (the image's name or path in the file). + pub name: String, + /// Encoded image file bytes. + pub bytes: Vec, +} + +/// A texture driving one material input; `slot.texture` is filled in when the scene is converted. +#[derive(Clone, Debug, PartialEq)] +pub struct RawSlot { + /// Material input driven. + pub input: MaterialInput, + /// Index into `RawScene::textures`. + pub texture: usize, + /// Mapping, channel, factor and filtering settings. + pub slot: TextureSlot, +} + +/// Material values beyond [`RawMaterial`], kept beside the materials (indexed like them) so older callers that +/// build `RawMaterial` literally keep compiling. Colours are linear sRGB. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct RawMaterialExtra { + /// Texture slots by input; the first slot of an input wins. + pub slots: Vec, + /// Specular tint (KHR_materials_specular). + pub specular_colour: Option<[f32; 3]>, + /// Sheen colour and roughness. + pub sheen: Option<([f32; 3], f32)>, + /// Volume attenuation colour and distance in metres (KHR_materials_volume). + pub attenuation: Option<([f32; 3], f32)>, + /// Thin walled surface (transmission without a volume). + pub thin_walled: Option, + /// Thin film weight, index of refraction and thickness in micrometres (KHR_materials_iridescence). + pub thin_film: Option<[f32; 3]>, + /// Abbe number (KHR_materials_dispersion). + pub abbe: Option, + /// Roughness anisotropy 0..1. + pub anisotropy: Option, + /// Alpha cutoff of a masked material (glTF alphaMode MASK); coverage is soft until a cutoff opcode exists. + pub alpha_cutoff: Option, +} + /// Everything a reader found, independent of any document. #[derive(Clone, Debug, Default, PartialEq)] pub struct RawScene { @@ -198,6 +245,10 @@ pub struct RawScene { /// Tangents per mesh, indexed like `meshes` (xyz plus handedness sign in w, one per vertex); a missing or /// empty entry means none. Kept beside the meshes so `RawMesh` stays constructible by older callers. pub tangents: Vec>, + /// Material values beyond `RawMaterial`, indexed like `materials`; a missing entry means none. + pub extras: Vec, + /// Images stored inside the file, named by `RawTexture::uri` `#embedded:`. + pub images: Vec, /// Unit the file declares, if it declares one. pub unit: Option, /// Up axis the file declares, if it declares one. @@ -212,6 +263,25 @@ impl RawScene { Self { name: name.into(), ..Default::default() } } + /// The extra values of a material, created on first use. + pub fn extra_mut(&mut self, material: usize) -> &mut RawMaterialExtra { + if self.extras.len() <= material { + self.extras.resize(material + 1, RawMaterialExtra::default()); + } + &mut self.extras[material] + } + + /// Adds an embedded image and returns the texture uri that names it. + pub fn add_image(&mut self, name: impl Into, bytes: Vec) -> String { + self.images.push(RawImage { name: name.into(), bytes }); + format!("{EMBEDDED_PREFIX}{}", self.images.len() - 1) + } + + /// Bytes of an embedded image by texture uri. + pub fn image_of(&self, uri: &str) -> Option<&RawImage> { + uri.strip_prefix(EMBEDDED_PREFIX).and_then(|i| i.parse::().ok()).and_then(|i| self.images.get(i)) + } + /// Total triangles over meshes that carry their own data. pub fn triangle_count(&self) -> usize { self.meshes.iter().map(|m| m.triangle_count()).sum() From db78f0122e727026d6f18852bcfcd56d5be1e19b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:30:54 -0500 Subject: [PATCH 307/494] feat(io): map gltf textures, samplers and material extensions to slots Base colour, metallic-roughness (g and b), normal with scale, emissive, clearcoat, clearcoat roughness and specular textures become slots with factors as multipliers; BLEND and MASK read alpha into opacity, texCoord, KHR_texture_transform and samplers give projection, transform, wrap and filter, and GLB and data URI images are kept as embedded bytes. Sheen, volume, iridescence, dispersion, anisotropy, specular colour and clearcoat IOR fill their parameters. A throwaway program read eleven Khronos sample models and the transform maths matched a direct evaluation within 5e-7. --- native/crates/fsh-io/src/convert.rs | 3 + native/crates/fsh-io/src/gltf.rs | 413 +++++++++++++++++++++------- native/crates/fsh-io/src/lib.rs | 2 +- native/crates/fsh-io/src/raw.rs | 2 + 4 files changed, 315 insertions(+), 105 deletions(-) diff --git a/native/crates/fsh-io/src/convert.rs b/native/crates/fsh-io/src/convert.rs index b6a584ef..d58640a4 100644 --- a/native/crates/fsh-io/src/convert.rs +++ b/native/crates/fsh-io/src/convert.rs @@ -34,6 +34,9 @@ fn apply_extra(p: &mut SurfaceParams, x: &RawMaterialExtra) { if let Some(c) = x.specular_colour { p.specular_color = colour(c); } + if let Some(v) = x.coat_ior.filter(|v| v.is_finite()) { + p.coat_ior = v.clamp(1.0, 3.0); + } if let Some((c, r)) = x.sheen { let peak = c.iter().copied().filter(|v| v.is_finite()).fold(0.0f32, f32::max); if peak > 0.0 { diff --git a/native/crates/fsh-io/src/gltf.rs b/native/crates/fsh-io/src/gltf.rs index 69c871e6..7e334a05 100644 --- a/native/crates/fsh-io/src/gltf.rs +++ b/native/crates/fsh-io/src/gltf.rs @@ -1,9 +1,10 @@ use crate::error::{malformed, IoError, Result}; use crate::paths::Siblings; -use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +use crate::raw::{RawMaterial, RawMaterialExtra, RawMesh, RawNode, RawScene, RawSlot, RawTexture, UpAxis}; use crate::watch::{Stage, Watch}; use fsh_core::{LengthUnit, Mat4, Quat, Vec2, Vec3, Vec4}; -use fsh_scene::TextureRole; +use fsh_scene::fsh_materials::{ColourSpace, Filter, Wrap}; +use fsh_scene::{Channel, MapProjection, MaterialInput, TextureRole, TextureSlot, UvTransform}; use serde_json::Value; use std::borrow::Cow; use std::collections::BTreeMap; @@ -19,6 +20,10 @@ const SUPPORTED_REQUIRED: &[&str] = &[ "KHR_materials_emissive_strength", "KHR_materials_specular", "KHR_materials_volume", + "KHR_materials_sheen", + "KHR_materials_iridescence", + "KHR_materials_dispersion", + "KHR_materials_anisotropy", "KHR_texture_transform", "KHR_mesh_quantization", "KHR_texture_basisu", @@ -447,109 +452,9 @@ pub fn read_gltf(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) - let total_bytes: usize = buffers.iter().map(|b| b.len()).sum::() + json_bytes.len(); let reader = Reader { json: &json, buffers, views, budget: total_bytes.saturating_mul(4).saturating_add(4096) }; - let images = arr(&json, "images"); - let textures_json = arr(&json, "textures"); - let mut tex_cache: BTreeMap<(usize, u8, u32), usize> = BTreeMap::new(); + let mut tex = Textures { json: &json, uris: BTreeMap::new(), cache: BTreeMap::new() }; for (mi, m) in arr(&json, "materials").iter().enumerate() { - let mut mat = RawMaterial { - name: m.get("name").and_then(Value::as_str).map(str::to_string).unwrap_or_else(|| format!("Material {mi}")), - roughness: 1.0, - metallic: 1.0, - base_colour: [1.0; 3], - ..Default::default() - }; - let mut tex_refs: Vec<(&Value, TextureRole, &'static str)> = Vec::new(); - if let Some(pbr) = m.get("pbrMetallicRoughness") { - if let Some(c) = floats::<4>(pbr, "baseColorFactor")? { - mat.base_colour = [c[0], c[1], c[2]]; - if m.get("alphaMode").and_then(Value::as_str) == Some("BLEND") { - mat.opacity = c[3]; - } - } - mat.metallic = num(pbr, "metallicFactor", 1.0); - mat.roughness = num(pbr, "roughnessFactor", 1.0); - if let Some(t) = pbr.get("baseColorTexture") { - tex_refs.push((t, TextureRole::BaseColour, "srgb")); - } - if let Some(t) = pbr.get("metallicRoughnessTexture") { - tex_refs.push((t, TextureRole::OcclusionRoughnessMetalness, "linear")); - } - } - if let Some(t) = m.get("normalTexture") { - tex_refs.push((t, TextureRole::Normal, "linear")); - } - if let Some(t) = m.get("emissiveTexture") { - tex_refs.push((t, TextureRole::Emission, "srgb")); - } - if let Some(t) = m.get("occlusionTexture") { - tex_refs.push((t, TextureRole::Other, "linear")); - } - if let Some(e) = floats::<3>(m, "emissiveFactor")? { - mat.emissive = e; - } - mat.double_sided = m.get("doubleSided").and_then(Value::as_bool).unwrap_or(false); - if let Some(ext) = m.get("extensions") { - if let Some(x) = ext.get("KHR_materials_transmission") { - mat.transmission = num(x, "transmissionFactor", 0.0); - } - if let Some(x) = ext.get("KHR_materials_ior") { - mat.ior = num(x, "ior", 1.5); - } - if let Some(x) = ext.get("KHR_materials_clearcoat") { - mat.clearcoat = num(x, "clearcoatFactor", 0.0); - mat.clearcoat_roughness = num(x, "clearcoatRoughnessFactor", 0.0); - } - if let Some(x) = ext.get("KHR_materials_emissive_strength") { - mat.emissive_strength = num(x, "emissiveStrength", 1.0); - } - if let Some(x) = ext.get("KHR_materials_specular") { - mat.specular = num(x, "specularFactor", 1.0); - } - } - for (info, role, space) in tex_refs { - let Some(ti) = idx(info, "index")? else { continue }; - let uv = idx(info, "texCoord")?.unwrap_or(0) as u32; - let Some(t) = textures_json.get(ti) else { - scene.warnings.push(format!("material {} names missing texture {ti}", mat.name)); - continue; - }; - let mut source = idx(t, "source")?; - if let Some(ext) = t.get("extensions").and_then(Value::as_object) { - for v in ext.values() { - if let Some(s) = idx(v, "source")? { - source.get_or_insert(s); - } - } - } - let Some(si) = source else { continue }; - let key = (si, role as u8, uv); - let slot = if let Some(&s) = tex_cache.get(&key) { - s - } else { - let Some(img) = images.get(si) else { - scene.warnings.push(format!("texture {ti} names missing image {si}")); - continue; - }; - let uri = match img.get("uri").and_then(Value::as_str) { - Some(u) if !u.starts_with("data:") => match siblings.resolve(u) { - Ok(p) => p.to_string_lossy().into_owned(), - Err(_) => { - scene.warnings.push(format!("texture file {u} was not found beside the model")); - u.to_string() - } - }, - _ => format!("#image{si}"), - }; - scene.textures.push(RawTexture { uri, role, uv_set: uv, colour_space: space }); - tex_cache.insert(key, scene.textures.len() - 1); - scene.textures.len() - 1 - }; - mat.textures.push(slot); - } - scene.materials.push(mat); - } - if scene.textures.iter().any(|t| t.uri.starts_with("#image")) { - scene.warnings.push("embedded images are recorded as references only (#image)".into()); + read_material(&reader, siblings, m, mi, &mut tex, &mut scene)?; } let meshes_json = arr(&json, "meshes"); @@ -737,3 +642,303 @@ fn read_mesh(r: &Reader, mj: &Value, mi: usize, scene: &mut RawScene, watch: &Wa } Ok(out) } + +struct Textures<'a> { + json: &'a Value, + uris: BTreeMap, + cache: BTreeMap<(usize, u8, u32), usize>, +} + +fn wrap_of(code: u64) -> Wrap { + match code { + 33071 => Wrap::Clamp, + 33648 => Wrap::Mirror, + _ => Wrap::Repeat, + } +} + +fn filter_of(mag: Option, min: Option) -> Filter { + match (mag, min) { + (Some(9728), None | Some(9728) | Some(9984) | Some(9986)) => Filter::Nearest, + (_, Some(9728) | Some(9729)) => Filter::Bilinear, + _ => Filter::Trilinear, + } +} + +/// glTF's `KHR_texture_transform` (`T * R(-r) * S` on uvs whose v grows downwards) as a slot transform on uvs whose +/// v grows upwards, the convention the texture sampler reads (row 0 at v = 1). +pub fn gltf_texture_transform(offset: [f32; 2], rotation: f32, scale: [f32; 2]) -> UvTransform { + let (s, c) = rotation.sin_cos(); + UvTransform { + offset: [offset[0] + scale[1] * s, 1.0 - offset[1] - scale[1] * c], + scale, + rotation, + ..UvTransform::default() + } +} + +fn image_uri(r: &Reader, siblings: &Siblings, si: usize, tex: &mut Textures, scene: &mut RawScene) -> Result> { + if let Some(u) = tex.uris.get(&si) { + return Ok(Some(u.clone())); + } + let Some(img) = arr(tex.json, "images").get(si) else { + scene.warnings.push(format!("a texture names missing image {si}")); + return Ok(None); + }; + let name = img.get("name").and_then(Value::as_str).map(str::to_string).unwrap_or_else(|| format!("image {si}")); + let uri = match (img.get("uri").and_then(Value::as_str), idx(img, "bufferView")?) { + (Some(u), _) if u.starts_with("data:") => match data_uri(u) { + Some(Ok(bytes)) => scene.add_image(name, bytes), + _ => { + scene.warnings.push(format!("{name}: its data URI could not be decoded; the texture was skipped")); + return Ok(None); + } + }, + (Some(u), _) => match siblings.resolve(u) { + Ok(p) => p.to_string_lossy().into_owned(), + Err(IoError::OutsideFolder(_)) => { + scene.warnings.push(format!("texture file {u} lies outside the model's folder and was not read")); + u.to_string() + } + Err(_) => { + scene.warnings.push(format!("texture file {u} was not found beside the model")); + u.to_string() + } + }, + (None, Some(bv)) => { + let v = r.views.get(bv).ok_or_else(|| IoError::Malformed(format!("image {si} names missing bufferView {bv}")))?; + let bytes = r.buffers[v.buffer][v.offset..v.offset + v.length].to_vec(); + scene.add_image(name, bytes) + } + (None, None) => { + scene.warnings.push(format!("{name} has neither a uri nor a bufferView; the texture was skipped")); + return Ok(None); + } + }; + tex.uris.insert(si, uri.clone()); + Ok(Some(uri)) +} + +fn texture_slot( + r: &Reader, + siblings: &Siblings, + info: &Value, + role: TextureRole, + space: &'static str, + tex: &mut Textures, + scene: &mut RawScene, +) -> Result> { + let Some(ti) = idx(info, "index")? else { return Ok(None) }; + let tt = info.get("extensions").and_then(|e| e.get("KHR_texture_transform")); + let uv = match tt.map(|t| idx(t, "texCoord")).transpose()?.flatten() { + Some(set) => set, + None => idx(info, "texCoord")?.unwrap_or(0), + } as u32; + let Some(t) = arr(tex.json, "textures").get(ti) else { + scene.warnings.push(format!("a material names missing texture {ti}")); + return Ok(None); + }; + let mut source = idx(t, "source")?; + if let Some(ext) = t.get("extensions").and_then(Value::as_object) { + for v in ext.values() { + if let Some(s) = idx(v, "source")? { + source.get_or_insert(s); + } + } + } + let Some(si) = source else { return Ok(None) }; + let key = (si, role as u8, uv); + let index = match tex.cache.get(&key) { + Some(&i) => i, + None => { + let Some(uri) = image_uri(r, siblings, si, tex, scene)? else { return Ok(None) }; + scene.textures.push(RawTexture { uri, role, uv_set: uv, colour_space: space }); + tex.cache.insert(key, scene.textures.len() - 1); + scene.textures.len() - 1 + } + }; + let mut slot = TextureSlot { projection: MapProjection::Uv { set: uv }, ..TextureSlot::default() }; + if let Some(t) = tt { + let offset = floats::<2>(t, "offset")?.unwrap_or([0.0, 0.0]); + let scale = floats::<2>(t, "scale")?.unwrap_or([1.0, 1.0]); + slot.transform = gltf_texture_transform(offset, num(t, "rotation", 0.0), scale); + } + if let Some(sampler) = idx(t, "sampler")?.and_then(|s| arr(tex.json, "samplers").get(s)) { + let code = |k: &str| sampler.get(k).and_then(Value::as_u64); + let (ws, wt) = (code("wrapS").unwrap_or(10497), code("wrapT").unwrap_or(10497)); + if ws != wt { + scene.warnings.push(format!("texture {ti} wraps differently along u and v; its u wrapping is used for both")); + } + slot.wrap = wrap_of(ws); + slot.filter = filter_of(code("magFilter"), code("minFilter")); + } + Ok(Some((index, slot))) +} + +struct Want<'a> { + info: &'a Value, + what: &'static str, + role: TextureRole, + space: &'static str, + inputs: &'a [(MaterialInput, Channel, Option)], + strength: f32, +} + +fn want<'a>( + parent: Option<&'a Value>, + key: &'static str, + role: TextureRole, + space: &'static str, + inputs: &'a [(MaterialInput, Channel, Option)], +) -> Option> { + let info = parent?.get(key)?; + let strength = info.get("scale").and_then(Value::as_f64).map(|v| v as f32).filter(|v| v.is_finite()).unwrap_or(1.0); + Some(Want { info, what: key, role, space, inputs, strength }) +} + +const BASE: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::BaseColor, Channel::Rgb, Some(ColourSpace::Srgb))]; +const BASE_ALPHA: &[(MaterialInput, Channel, Option)] = &[ + (MaterialInput::BaseColor, Channel::Rgb, Some(ColourSpace::Srgb)), + (MaterialInput::GeometryOpacity, Channel::A, Some(ColourSpace::Srgb)), +]; +const METAL_ROUGH: &[(MaterialInput, Channel, Option)] = &[ + (MaterialInput::SpecularRoughness, Channel::G, Some(ColourSpace::Data)), + (MaterialInput::BaseMetalness, Channel::B, Some(ColourSpace::Data)), +]; +const NORMAL: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::Normal, Channel::Rgb, Some(ColourSpace::Data))]; +const EMISSION: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::EmissionColor, Channel::Rgb, Some(ColourSpace::Srgb))]; +const COAT: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::CoatWeight, Channel::R, Some(ColourSpace::Data))]; +const COAT_ROUGH: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::CoatRoughness, Channel::G, Some(ColourSpace::Data))]; +const SPECULAR: &[(MaterialInput, Channel, Option)] = &[(MaterialInput::SpecularWeight, Channel::A, Some(ColourSpace::Data))]; +const NONE_INPUTS: &[(MaterialInput, Channel, Option)] = &[]; + +fn read_material(r: &Reader, siblings: &Siblings, m: &Value, mi: usize, tex: &mut Textures, scene: &mut RawScene) -> Result<()> { + let mut mat = RawMaterial { + name: m.get("name").and_then(Value::as_str).map(str::to_string).unwrap_or_else(|| format!("Material {mi}")), + roughness: 1.0, + metallic: 1.0, + base_colour: [1.0; 3], + ..Default::default() + }; + let mut extra = RawMaterialExtra::default(); + let alpha_mode = m.get("alphaMode").and_then(Value::as_str).unwrap_or("OPAQUE"); + let cutoff = num(m, "alphaCutoff", 0.5); + let pbr = m.get("pbrMetallicRoughness"); + let mut alpha = 1.0; + if let Some(pbr) = pbr { + if let Some(c) = floats::<4>(pbr, "baseColorFactor")? { + mat.base_colour = [c[0], c[1], c[2]]; + alpha = c[3]; + } + mat.metallic = num(pbr, "metallicFactor", 1.0); + mat.roughness = num(pbr, "roughnessFactor", 1.0); + } + let alpha_textured = pbr.and_then(|p| p.get("baseColorTexture")).is_some(); + match alpha_mode { + "BLEND" => mat.opacity = alpha, + "MASK" => { + mat.opacity = if alpha_textured { alpha } else if alpha >= cutoff { 1.0 } else { 0.0 }; + extra.alpha_cutoff = Some(cutoff); + } + _ => {} + } + if let Some(e) = floats::<3>(m, "emissiveFactor")? { + mat.emissive = e; + } + mat.double_sided = m.get("doubleSided").and_then(Value::as_bool).unwrap_or(false); + let ext = m.get("extensions"); + let x = |name: &str| ext.and_then(|e| e.get(name)); + let mut has_volume = false; + if let Some(v) = x("KHR_materials_volume") { + has_volume = num(v, "thicknessFactor", 0.0) > 0.0; + let c = floats::<3>(v, "attenuationColor")?.unwrap_or([1.0; 3]); + extra.attenuation = Some((c, num(v, "attenuationDistance", f32::INFINITY))); + } + if let Some(v) = x("KHR_materials_transmission") { + mat.transmission = num(v, "transmissionFactor", 0.0); + extra.thin_walled = Some(!has_volume && mat.transmission > 0.0); + } else if has_volume { + extra.thin_walled = Some(false); + } + if let Some(v) = x("KHR_materials_ior") { + mat.ior = num(v, "ior", 1.5); + } + if let Some(v) = x("KHR_materials_clearcoat") { + mat.clearcoat = num(v, "clearcoatFactor", 0.0); + mat.clearcoat_roughness = num(v, "clearcoatRoughnessFactor", 0.0); + extra.coat_ior = Some(1.5); + } + if let Some(v) = x("KHR_materials_emissive_strength") { + mat.emissive_strength = num(v, "emissiveStrength", 1.0); + } + if let Some(v) = x("KHR_materials_specular") { + mat.specular = num(v, "specularFactor", 1.0); + extra.specular_colour = floats::<3>(v, "specularColorFactor")?; + } + if let Some(v) = x("KHR_materials_sheen") { + let c = floats::<3>(v, "sheenColorFactor")?.unwrap_or([0.0; 3]); + extra.sheen = Some((c, num(v, "sheenRoughnessFactor", 0.0))); + } + if let Some(v) = x("KHR_materials_iridescence") { + let max = num(v, "iridescenceThicknessMaximum", 400.0); + let min = num(v, "iridescenceThicknessMinimum", 100.0); + let nm = if v.get("iridescenceThicknessTexture").is_some() { 0.5 * (min + max) } else { max }; + extra.thin_film = Some([num(v, "iridescenceFactor", 0.0), num(v, "iridescenceIor", 1.3), nm / 1000.0]); + } + if let Some(v) = x("KHR_materials_dispersion") { + let d = num(v, "dispersion", 0.0); + if d > 0.0 { + extra.abbe = Some(20.0 / d); + } + } + if let Some(v) = x("KHR_materials_anisotropy") { + extra.anisotropy = Some(num(v, "anisotropyStrength", 0.0)); + } + let base = if matches!(alpha_mode, "BLEND" | "MASK") { BASE_ALPHA } else { BASE }; + let wants: Vec = [ + want(pbr, "baseColorTexture", TextureRole::BaseColour, "srgb", base), + want(pbr, "metallicRoughnessTexture", TextureRole::OcclusionRoughnessMetalness, "linear", METAL_ROUGH), + want(Some(m), "normalTexture", TextureRole::Normal, "linear", NORMAL), + want(Some(m), "emissiveTexture", TextureRole::Emission, "srgb", EMISSION), + want(Some(m), "occlusionTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_clearcoat"), "clearcoatTexture", TextureRole::Other, "linear", COAT), + want(x("KHR_materials_clearcoat"), "clearcoatRoughnessTexture", TextureRole::Roughness, "linear", COAT_ROUGH), + want(x("KHR_materials_clearcoat"), "clearcoatNormalTexture", TextureRole::Normal, "linear", NONE_INPUTS), + want(x("KHR_materials_transmission"), "transmissionTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_specular"), "specularTexture", TextureRole::Other, "linear", SPECULAR), + want(x("KHR_materials_specular"), "specularColorTexture", TextureRole::Other, "srgb", NONE_INPUTS), + want(x("KHR_materials_sheen"), "sheenColorTexture", TextureRole::Other, "srgb", NONE_INPUTS), + want(x("KHR_materials_sheen"), "sheenRoughnessTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_volume"), "thicknessTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_iridescence"), "iridescenceTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_iridescence"), "iridescenceThicknessTexture", TextureRole::Other, "linear", NONE_INPUTS), + want(x("KHR_materials_anisotropy"), "anisotropyTexture", TextureRole::Other, "linear", NONE_INPUTS), + ] + .into_iter() + .flatten() + .collect(); + let mut unused = Vec::new(); + for w in wants { + let Some((index, slot)) = texture_slot(r, siblings, w.info, w.role, w.space, tex, scene)? else { continue }; + if !mat.textures.contains(&index) { + mat.textures.push(index); + } + if w.inputs.is_empty() && w.what != "occlusionTexture" { + unused.push(w.what); + } + for &(input, channel, colour_space) in w.inputs { + let mut s = TextureSlot { channel, colour_space, multiply: input != MaterialInput::Normal, ..slot.clone() }; + if input == MaterialInput::Normal { + s.strength = w.strength; + } + extra.slots.push(RawSlot { input, texture: index, slot: s }); + } + } + if !unused.is_empty() { + scene.warnings.push(format!("{}: {} kept with the material but drive no input yet", mat.name, unused.join(", "))); + } + scene.materials.push(mat); + let i = scene.materials.len() - 1; + *scene.extra_mut(i) = extra; + Ok(()) +} diff --git a/native/crates/fsh-io/src/lib.rs b/native/crates/fsh-io/src/lib.rs index c3e83aa9..8e4dae38 100644 --- a/native/crates/fsh-io/src/lib.rs +++ b/native/crates/fsh-io/src/lib.rs @@ -33,7 +33,7 @@ pub use convert::{ pub use error::{IoError, Result}; pub use exr::write_exr; pub use glb_write::write_glb; -pub use gltf::read_gltf; +pub use gltf::{gltf_texture_transform, read_gltf}; pub use hdr::{read_hdr, write_hdr}; pub use obj::{read_obj, roughness_from_phong}; pub use paths::Siblings; diff --git a/native/crates/fsh-io/src/raw.rs b/native/crates/fsh-io/src/raw.rs index 6bfa7b08..5ecf5dae 100644 --- a/native/crates/fsh-io/src/raw.rs +++ b/native/crates/fsh-io/src/raw.rs @@ -213,6 +213,8 @@ pub struct RawMaterialExtra { pub slots: Vec, /// Specular tint (KHR_materials_specular). pub specular_colour: Option<[f32; 3]>, + /// Clear coat index of refraction (1.5 for glTF clearcoat). + pub coat_ior: Option, /// Sheen colour and roughness. pub sheen: Option<([f32; 3], f32)>, /// Volume attenuation colour and distance in metres (KHR_materials_volume). From fc7215e0ffec9a5a77169092b3872f9fba0feae0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:22:57 -0500 Subject: [PATCH 308/494] feat(import): embed imported textures as project members Images inside the file and decodable image files beside it become fshot:textures/. members of the kept project, deduplicated by content; files over 256 MiB keep their path, unfound files stay as missing references and unreadable formats are skipped, all listed in the reply's textures report. The crash journal restarts after new members so a recovered session holds them (State.journal is now pub(crate)). Eleven Khronos models imported, saved and reopened from another folder with the release CLI: every texture present and re-saves identical. --- native/crates/fsh-commands/src/engine.rs | 2 +- native/crates/fsh-commands/src/ext/import.rs | 1 + .../crates/fsh-commands/src/ext/import/run.rs | 17 +- .../fsh-commands/src/ext/import/textures.rs | 171 ++++++++++++++++++ 4 files changed, 187 insertions(+), 4 deletions(-) create mode 100644 native/crates/fsh-commands/src/ext/import/textures.rs diff --git a/native/crates/fsh-commands/src/engine.rs b/native/crates/fsh-commands/src/engine.rs index 1dfbd8cf..38c06a74 100644 --- a/native/crates/fsh-commands/src/engine.rs +++ b/native/crates/fsh-commands/src/engine.rs @@ -103,7 +103,7 @@ pub(crate) struct State { device: String, last_reset: &'static str, last_region: Option, - journal: Option, + pub(crate) journal: Option, pub(crate) jobs: crate::ext::import::Jobs, } diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index 4dcc4a6f..a36a9a47 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -15,6 +15,7 @@ mod probe; mod reimport; mod run; mod source; +mod textures; use options::ImportArgs; diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index d24fab3e..b87bc2d4 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -1,5 +1,6 @@ use super::options::ImportArgs; use super::source; +use super::textures::Embeds; use crate::engine::{frame_values, has_parts, title_from, Engine, State}; use crate::error::Result; use fsh_core::{DocKey, NodeId}; @@ -13,13 +14,17 @@ pub(crate) struct Prepared { pub path: PathBuf, pub cmd: Command, pub report: CleanReport, + pub textures: Embeds, } /// Reads, cleans and converts `path`; touches no document (`doc` only seeds the payload's keys). pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch) -> Result { watch.set(Stage::Reading, 0.0); let mut raw = fsh_io::read_model(path, watch)?; - let report = fsh_io::clean(&mut raw, &a.clean, watch)?; + let mut report = fsh_io::clean(&mut raw, &a.clean, watch)?; + let textures = super::textures::embed(&mut raw, watch); + watch.poll(0)?; + report.warnings.extend(textures.warnings.iter().cloned()); let roots = raw.nodes.iter().filter(|n| n.parent.is_none()).count(); let mut cmd = fsh_io::to_import_command(&raw, doc, &a.place, watch)?; let mut whole = Vec::new(); @@ -35,7 +40,7 @@ pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch kept.insert("units".into(), json!(report.unit.as_str())); kept.insert("up_axis".into(), json!(report.up_axis.as_str())); source::annotate(&mut cmd, path, &whole, Some(&Value::Object(kept).to_string())); - Ok(Prepared { path: path.to_path_buf(), cmd, report }) + Ok(Prepared { path: path.to_path_buf(), cmd, report, textures }) } pub(crate) fn payload_max_key(p: &ImportPayload) -> u64 { @@ -78,8 +83,10 @@ pub(crate) fn report_json(report: &CleanReport) -> Value { } /// Applies a prepared import as one history group: the import, the root rename, framing. -pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, a: &ImportArgs) -> Result { +pub(crate) fn apply(engine: &Engine, st: &mut State, mut p: Prepared, a: &ImportArgs) -> Result { let path = p.path.as_path(); + let textures_json = p.textures.json(); + let new_textures = super::textures::keep(st, &mut p.textures.members); let was_empty = !has_parts(st.editor.document()); let label = format!("Import {}", a.name.clone().unwrap_or_else(|| title_from(path))); st.editor.begin_group(&label); @@ -123,9 +130,13 @@ pub(crate) fn apply(engine: &Engine, st: &mut State, p: Prepared, a: &ImportArgs return Err(e); } }; + if new_textures { + super::textures::rebase_journal(st); + } let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("file.import"); reply["report"] = report_json(&p.report); + reply["textures"] = textures_json; reply["options"] = a.json(); reply["source"] = json!(source::absolute(path).to_string_lossy()); Ok(reply) diff --git a/native/crates/fsh-commands/src/ext/import/textures.rs b/native/crates/fsh-commands/src/ext/import/textures.rs new file mode 100644 index 00000000..77b6d668 --- /dev/null +++ b/native/crates/fsh-commands/src/ext/import/textures.rs @@ -0,0 +1,171 @@ +use crate::engine::State; +use fsh_format::{texture_member, EMBED_SCHEME, MAX_EMBED_TEXTURE_BYTES}; +use fsh_io::{RawScene, Watch, EMBEDDED_PREFIX}; +use serde_json::{json, Value}; +use std::collections::BTreeMap; +use std::path::Path; + +/// Image bytes an import brings into the project, and what happened to each texture the file names. +#[derive(Default)] +pub(crate) struct Embeds { + pub members: BTreeMap>, + pub embedded: Vec, + pub referenced: Vec, + pub missing: Vec, + pub skipped: Vec, + pub warnings: Vec, +} + +impl Embeds { + pub(crate) fn json(&self) -> Value { + json!({ + "embedded": self.embedded, + "referenced": self.referenced, + "missing": self.missing, + "skipped": self.skipped, + "members": self.members.len(), + "bytes": self.members.values().map(Vec::len).sum::(), + }) + } +} + +/// Adds the members to the project kept beside the document; true when any was new. +pub(crate) fn keep(st: &mut State, members: &mut BTreeMap>) -> bool { + let mut added = false; + for (name, bytes) in std::mem::take(members) { + if !st.kept.textures.contains_key(&name) { + st.kept.textures.insert(name, bytes); + added = true; + } + } + added +} + +/// Starts the crash journal again on the current document so its origin carries newly kept textures (a recovered +/// session would otherwise name members it does not hold). +pub(crate) fn rebase_journal(st: &mut State) { + if st.editor.history().group_depth() > 0 { + return; + } + if let Some(j) = st.journal.as_mut() { + j.restart(&st.editor, &st.kept.textures, st.path.as_deref()); + } +} + +/// Picture formats the engine decodes, by content: the member extension. +fn sniff(b: &[u8]) -> Option<&'static str> { + if b.starts_with(&[0x89, b'P', b'N', b'G', 0x0D, 0x0A, 0x1A, 0x0A]) { + Some("png") + } else if b.starts_with(&[0xFF, 0xD8, 0xFF]) { + Some("jpg") + } else if b.starts_with(b"#?RADIANCE") || b.starts_with(b"#?RGBE") { + Some("hdr") + } else if b.starts_with(&[0x76, 0x2F, 0x31, 0x01]) { + Some("exr") + } else { + None + } +} + +fn kind_of(b: &[u8]) -> &'static str { + if b.len() >= 12 && &b[..4] == b"RIFF" && &b[8..12] == b"WEBP" { + "WebP" + } else if b.starts_with(&[0xAB, b'K', b'T', b'X', b' ', b'2', b'0']) { + "KTX2" + } else if b.starts_with(b"DDS ") { + "DDS" + } else if b.starts_with(b"GIF8") { + "GIF" + } else if b.starts_with(b"BM") { + "BMP" + } else if b.starts_with(b"II*\0") || b.starts_with(b"MM\0*") { + "TIFF" + } else { + "an unknown format" + } +} + +fn file_name(uri: &str) -> String { + uri.rsplit(['/', '\\']).next().filter(|s| !s.is_empty()).unwrap_or(uri).to_string() +} + +enum Outcome { + Embed(String), + Keep, + Drop, +} + +/// Turns every texture of `raw` into an embedded project member (`fshot:textures/.`) where it can: +/// images inside the file and image files beside it that the engine decodes and that hold at most 256 MiB. Larger +/// files keep their path, files that cannot be found keep their reference (the slot shows its fallback), and +/// images in formats the engine does not read are dropped with their slots. +pub(crate) fn embed(raw: &mut RawScene, watch: &Watch) -> Embeds { + let mut out = Embeds::default(); + let mut done: BTreeMap = BTreeMap::new(); + for i in 0..raw.textures.len() { + if watch.is_cancelled() { + break; + } + let uri = raw.textures[i].uri.clone(); + if uri.is_empty() || uri.starts_with(EMBED_SCHEME) { + continue; + } + if !done.contains_key(&uri) { + let outcome = resolve(raw, &uri, &mut out); + done.insert(uri.clone(), outcome); + } + match &done[&uri] { + Outcome::Embed(path) => raw.textures[i].uri = path.clone(), + Outcome::Keep => {} + Outcome::Drop => raw.textures[i].uri = String::new(), + } + } + raw.images.clear(); + out +} + +fn resolve(raw: &RawScene, uri: &str, out: &mut Embeds) -> Outcome { + let (name, bytes) = if uri.starts_with(EMBEDDED_PREFIX) { + let Some(img) = raw.image_of(uri) else { + out.skipped.push(json!({"name": uri, "reason": "the image is not in the file"})); + return Outcome::Drop; + }; + if img.bytes.len() > MAX_EMBED_TEXTURE_BYTES { + out.warnings.push(format!("{}: an image inside the file holds more than 256 MiB and was not kept", img.name)); + out.skipped.push(json!({"name": img.name, "reason": "larger than 256 MiB", "bytes": img.bytes.len()})); + return Outcome::Drop; + } + (img.name.clone(), std::borrow::Cow::Borrowed(img.bytes.as_slice())) + } else { + let path = Path::new(uri); + let len = match std::fs::metadata(path) { + Ok(m) if path.is_absolute() && m.is_file() => m.len(), + _ => { + out.missing.push(json!({"name": file_name(uri), "path": uri})); + return Outcome::Keep; + } + }; + if len > MAX_EMBED_TEXTURE_BYTES as u64 { + out.warnings.push(format!("{}: larger than 256 MiB, so it is referenced by its path and not kept in the project", file_name(uri))); + out.referenced.push(json!({"name": file_name(uri), "path": uri, "bytes": len})); + return Outcome::Keep; + } + match std::fs::read(path) { + Ok(b) => (file_name(uri), std::borrow::Cow::Owned(b)), + Err(e) => { + out.missing.push(json!({"name": file_name(uri), "path": uri, "reason": e.to_string()})); + return Outcome::Keep; + } + } + }; + let Some(ext) = sniff(&bytes) else { + let kind = kind_of(&bytes); + out.warnings.push(format!("{name}: {kind} images are not read by the engine; the texture was skipped")); + out.skipped.push(json!({"name": name, "reason": format!("{kind} is not a format the engine reads")})); + return Outcome::Drop; + }; + let Some(member) = texture_member(&bytes, ext) else { return Outcome::Drop }; + out.embedded.push(json!({"name": name, "member": member, "bytes": bytes.len(), "format": ext})); + out.members.entry(member.clone()).or_insert_with(|| bytes.into_owned()); + Outcome::Embed(format!("{EMBED_SCHEME}{member}")) +} From df86973b4ae53a3a69f2d5424a425e5055ae4308 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:23:01 -0500 Subject: [PATCH 309/494] feat(import): keep re-imported textures and report them per file file.reimport adds the re-read file's texture members to the project, restarts the journal when any are new, lists each file's textures report, and carries slot and graph textures of added parts. cargo check -p fsh-commands passes; the re-import run is in the next commits. --- .../fsh-commands/src/ext/import/reimport.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index 35863620..09e2df57 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -24,6 +24,8 @@ struct FileReport { warnings: Vec, error: Option, report: Option, + textures: Option, + new_textures: bool, } fn same_shape(a: &Mesh, b: &Mesh) -> bool { @@ -183,7 +185,7 @@ fn subset(p: &ImportPayload, nodes: Vec, reuse: &BTreeMap>(); - let textures: BTreeSet<_> = out.materials.iter().flat_map(|m| m.material.textures.iter().copied()).collect(); + let textures: BTreeSet<_> = out.materials.iter().flat_map(|m| m.material.texture_keys()).collect(); out.textures = p.textures.iter().filter(|t| textures.contains(&t.key)).cloned().collect::>(); out } @@ -258,17 +260,19 @@ fn reread(st: &mut State, top: NodeId, outs: &mut Vec, rep: &mut FileRe let stored: Value = top_node.metadata.get(source::OPTIONS).and_then(|s| serde_json::from_str(s).ok()).unwrap_or_else(|| json!({})); let a = ImportArgs::parse(&stored, Some(false))?; let mut cad_source = None; - let prepared = if crate::ext::cad::is_cad(Path::new(&file)) { + let mut prepared = if crate::ext::cad::is_cad(Path::new(&file)) { let (cmd, report, source) = crate::ext::cad::reread(Path::new(&file), &stored, doc, top)?; cad_source = Some(source); - run::Prepared { path: Path::new(&file).to_path_buf(), cmd, report } + run::Prepared { path: Path::new(&file).to_path_buf(), cmd, report, textures: Default::default() } } else { run::prepare(Path::new(&file), &a, doc, &Watch::new())? }; rep.warnings.extend(prepared.report.warnings.iter().cloned()); rep.report = Some(run::report_json(&prepared.report)); - let mut payload = payload_of(prepared.cmd)?; + rep.textures = Some(prepared.textures.json()); let top_is_part = part_of(top_node).is_some(); + rep.new_textures = super::textures::keep(st, &mut prepared.textures.members); + let mut payload = payload_of(prepared.cmd)?; let new_tops: Vec = payload.nodes.iter().enumerate().filter(|(_, n)| n.node.parent.is_none()).map(|(i, _)| i).collect(); let mut top = top; if let [i] = new_tops[..] { @@ -430,6 +434,9 @@ pub(crate) fn reimport(engine: &Engine, st: &mut State, nodes: Option usize| files.iter().map(|(_, r)| f(r)).sum::(); let files_json: Vec = files .iter() @@ -438,6 +445,9 @@ pub(crate) fn reimport(engine: &Engine, st: &mut State, nodes: Option Date: Wed, 2 Dec 2026 15:23:24 -0500 Subject: [PATCH 310/494] feat(io): map mtl texture maps and their options to slots map_Kd, map_Ks, map_Ns (inverted) or map_Pr, map_Pm, bump or map_bump with -bm, norm, map_d (alpha when the PNG has it) and map_Ke become slots, reading -o, -s, -clamp and -imfchan and file names with spaces. Checked on an own OBJ with eight maps through the release CLI: slots, offsets, scale, clamp and bump strength as written, a missing file kept as a missing reference and a WebP map skipped. --- native/crates/fsh-io/src/obj.rs | 134 +++++++++++++++++++++++++++++--- 1 file changed, 122 insertions(+), 12 deletions(-) diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index f59176a1..c803276c 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -1,10 +1,11 @@ use crate::error::{malformed, IoError, Result}; use crate::paths::Siblings; -use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture}; +use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawSlot, RawTexture}; use crate::triangulate::triangulate; use crate::watch::{Stage, Watch}; use fsh_core::{Vec2, Vec3, Vec4}; -use fsh_scene::TextureRole; +use fsh_scene::fsh_materials::Wrap; +use fsh_scene::{Channel, MaterialInput, TextureRole, TextureSlot, UvTransform}; use std::collections::HashMap; const NONE: u32 = u32::MAX; @@ -273,7 +274,7 @@ fn read_mtl(bytes: &[u8], siblings: &Siblings, scene: &mut RawScene, index: &mut let Some(ci) = cur else { continue }; let f1 = || rest.first().and_then(|t| t.parse::().ok()).filter(|v| v.is_finite()); let f3 = || nums::<3>(rest, kw, ln + 1).ok().filter(|v| v.iter().all(|x| x.is_finite())); - let mut texture: Option<(TextureRole, &'static str)> = None; + let mut texture: Option<(TextureRole, &'static str, MaterialInput)> = None; let m = &mut scene.materials[ci]; match kw { "Kd" => { @@ -333,27 +334,136 @@ fn read_mtl(bytes: &[u8], siblings: &Siblings, scene: &mut RawScene, index: &mut m.opacity = (1.0 - v).clamp(0.0, 1.0); } } - "map_Kd" => texture = Some((TextureRole::BaseColour, "srgb")), - "map_Pr" | "map_Ns" => texture = Some((TextureRole::Roughness, "linear")), - "map_Pm" => texture = Some((TextureRole::Metalness, "linear")), - "map_Bump" | "map_bump" | "bump" => texture = Some((TextureRole::Bump, "linear")), - "norm" | "map_Kn" => texture = Some((TextureRole::Normal, "linear")), - "map_d" => texture = Some((TextureRole::Opacity, "linear")), - "map_Ke" => texture = Some((TextureRole::Emission, "srgb")), + "map_Kd" => texture = Some((TextureRole::BaseColour, "srgb", MaterialInput::BaseColor)), + "map_Ks" => texture = Some((TextureRole::Other, "srgb", MaterialInput::SpecularWeight)), + "map_Pr" => texture = Some((TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness)), + "map_Ns" => texture = Some((TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness)), + "map_Pm" => texture = Some((TextureRole::Metalness, "linear", MaterialInput::BaseMetalness)), + "map_Bump" | "map_bump" | "bump" => texture = Some((TextureRole::Bump, "linear", MaterialInput::Bump)), + "norm" | "map_Kn" => texture = Some((TextureRole::Normal, "linear", MaterialInput::Normal)), + "map_d" => texture = Some((TextureRole::Opacity, "linear", MaterialInput::GeometryOpacity)), + "map_Ke" => texture = Some((TextureRole::Emission, "srgb", MaterialInput::EmissionColor)), _ => {} } - if let Some((role, space)) = texture { - let Some(file) = rest.last() else { continue }; + if let Some((role, space, input)) = texture { + let o = map_options(rest); + if o.file.is_empty() { + continue; + } + let file = o.file.as_str(); let uri = match siblings.resolve(file) { Ok(p) => p.to_string_lossy().into_owned(), + Err(IoError::OutsideFolder(_)) => { + scene.warnings.push(format!("texture file {file} lies outside the model's folder and was not read")); + file.to_string() + } Err(_) => { scene.warnings.push(format!("texture file {file} was not found beside the model")); file.to_string() } }; + let channel = match (o.channel, input) { + (Some(c), _) => c, + (None, MaterialInput::GeometryOpacity) if has_alpha(&uri) => Channel::A, + (None, MaterialInput::GeometryOpacity) => Channel::Luminance, + _ => Channel::Rgb, + }; + let mut slot = TextureSlot { + transform: UvTransform { offset: o.offset, scale: o.scale, ..UvTransform::default() }, + wrap: if o.clamp { Wrap::Clamp } else { Wrap::Repeat }, + channel, + invert: kw == "map_Ns", + ..TextureSlot::for_input(input, fsh_core::TextureKey::NONE) + }; + if input == MaterialInput::Bump { + slot.strength *= o.bump; + } + if input == MaterialInput::EmissionColor && scene.materials[ci].emissive.iter().all(|v| *v <= 0.0) { + scene.materials[ci].emissive = [1.0; 3]; + } scene.textures.push(RawTexture { uri, role, uv_set: 0, colour_space: space }); let t = scene.textures.len() - 1; scene.materials[ci].textures.push(t); + let x = scene.extra_mut(ci); + x.slots.retain(|s| s.input != input); + x.slots.push(RawSlot { input, texture: t, slot }); + } + } +} + +struct MapOptions { + file: String, + offset: [f32; 2], + scale: [f32; 2], + clamp: bool, + bump: f32, + channel: Option, +} + +/// Reads the options before a map's file name (`-o u v w`, `-s u v w`, `-clamp on`, `-bm m`, `-imfchan c`; others +/// are skipped with their arguments); the rest of the line is the file name, spaces included. +fn map_options(toks: &[&str]) -> MapOptions { + let mut o = MapOptions { file: String::new(), offset: [0.0; 2], scale: [1.0; 2], clamp: false, bump: 1.0, channel: None }; + let num = |t: Option<&&str>| t.and_then(|t| t.parse::().ok()).filter(|v| v.is_finite()); + let mut i = 0; + while i < toks.len() { + let t = toks[i]; + if !t.starts_with('-') || num(Some(&t)).is_some() { + break; + } + i += 1; + match t { + "-o" | "-s" | "-t" => { + let mut v = Vec::new(); + while v.len() < 3 && i + 1 < toks.len() { + match num(toks.get(i)) { + Some(x) => v.push(x), + None => break, + } + i += 1; + } + let d = if t == "-s" { 1.0 } else { 0.0 }; + let pair = [v.first().copied().unwrap_or(d), v.get(1).copied().unwrap_or(d)]; + match t { + "-o" => o.offset = pair, + "-s" => o.scale = pair, + _ => {} + } + } + "-mm" => i += 2, + "-clamp" => { + o.clamp = toks.get(i).is_some_and(|v| v.eq_ignore_ascii_case("on")); + i += 1; + } + "-bm" => { + o.bump = num(toks.get(i)).unwrap_or(1.0); + i += 1; + } + "-imfchan" => { + o.channel = match toks.get(i).copied() { + Some("r") => Some(Channel::R), + Some("g") => Some(Channel::G), + Some("b") => Some(Channel::B), + Some("m") | Some("l") | Some("z") => Some(Channel::Luminance), + _ => None, + }; + i += 1; + } + _ => i += 1, } } + o.file = toks[i.min(toks.len())..].join(" "); + o +} + +/// True when the bytes start a PNG whose colour type carries alpha (grey-alpha or RGBA). +pub(crate) fn png_has_alpha(head: &[u8]) -> bool { + head.len() >= 26 && head.starts_with(&[0x89, b'P', b'N', b'G']) && matches!(head[25], 4 | 6) +} + +/// True when the file at `path` is a PNG with alpha. +pub(crate) fn has_alpha(path: &str) -> bool { + use std::io::Read; + let mut head = [0u8; 26]; + std::fs::File::open(path).and_then(|mut f| f.read_exact(&mut head)).is_ok() && png_has_alpha(&head) } From 69bfe19ada902646c2480c2fc45b8f22cb5996f5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:23:24 -0500 Subject: [PATCH 311/494] feat(io): unpack 3mf package textures into base colour slots Texture2d parts are read from the package as embedded images, their tile styles and filter become the slot's wrap and filtering, and textured objects get a base_color slot over the tex2coord UVs. multipletextures.3mf and sphere_logo.3mf from the 3MF Consortium samples imported, saved and reopened from another folder with every texture present. --- native/crates/fsh-io/src/threemf.rs | 82 ++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index a804508c..a17666b6 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -1,15 +1,17 @@ use crate::error::{malformed, IoError, Result}; -use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawSlot, RawTexture, UpAxis}; use crate::watch::{Stage, Watch}; use crate::zip::{is_zip, Zip}; use fsh_core::{srgb_decode, srgb_encode, LengthUnit, Mat4, Vec2, Vec3, Vec4}; -use fsh_scene::TextureRole; +use fsh_scene::fsh_materials::{Filter, Wrap}; +use fsh_scene::{MaterialInput, TextureRole, TextureSlot}; use roxmltree::{Document, Node, ParsingOptions}; use std::collections::HashMap; const MAX_MODEL_XML: u64 = 1 << 31; const MAX_NODES: usize = 1 << 20; const MAX_DEPTH: usize = 64; +const MAX_IMAGE: u64 = 256 << 20; /// True for a ZIP package that holds a 3MF model part. pub fn is_3mf(bytes: &[u8]) -> bool { @@ -96,7 +98,21 @@ struct Model { build: Vec, groups: HashMap, displays: HashMap>, - textures: HashMap, + textures: HashMap, +} + +struct Tex2d { + path: String, + wrap: Wrap, + filter: Filter, +} + +fn tile(s: Option<&str>) -> Wrap { + match s.map(str::trim) { + Some("mirror") => Wrap::Mirror, + Some("clamp") | Some("none") => Wrap::Clamp, + _ => Wrap::Repeat, + } } fn colour(s: &str) -> Option<[f32; 4]> { @@ -142,7 +158,16 @@ fn read_group(r: Node, part: &str, model: &mut Model, scene: &mut RawScene) -> R } "texture2d" => { let p = attr(&r, "path").ok_or_else(|| bad("no path"))?; - model.textures.insert(id, p.trim().to_string()); + let (u, v) = (tile(attr(&r, "tilestyleu")), tile(attr(&r, "tilestylev"))); + if u != v { + scene.warnings.push(format!("{part}: texture {id} tiles differently along u and v; its u tiling is used for both")); + } + let filter = match attr(&r, "filter").map(str::trim) { + Some("nearest") => Filter::Nearest, + Some("linear") => Filter::Bilinear, + _ => Filter::Trilinear, + }; + model.textures.insert(id, Tex2d { path: p.trim().to_string(), wrap: u, filter }); return Ok(()); } "texture2dgroup" => { @@ -506,6 +531,7 @@ struct Reader<'z, 'w> { parts: Vec<(String, Model)>, meshes: HashMap<(usize, u32), Vec>, mats: HashMap, + images: HashMap, scale: f32, } @@ -554,6 +580,7 @@ impl Reader<'_, '_> { let slot = match self.mats.get(&k) { Some(&s) => s, None => { + let mut pending: Vec<(usize, TextureSlot)> = Vec::new(); let mat = match &k { MatKey::Base(_, g, i) => match model.groups.get(g) { Some(Group::Base(v)) => { @@ -577,15 +604,33 @@ impl Reader<'_, '_> { MatKey::Tex(_, t) => { let mut mat = flat_material("Textured".into(), [1.0; 4]); match model.textures.get(t) { - Some(path) => { + Some(tex) => { + let path = tex.path.trim_start_matches('/'); mat.name = path.rsplit('/').next().unwrap_or(path).to_string(); - scene.textures.push(RawTexture { - uri: format!("#3mf:{}", path.trim_start_matches('/')), - role: TextureRole::BaseColour, - uv_set: 0, - colour_space: "srgb", - }); - mat.textures.push(scene.textures.len() - 1); + let uri = match self.images.get(path) { + Some(u) => Some(u.clone()), + None => { + let read = self.zip.find(path).ok_or_else(|| IoError::Malformed(format!("the package has no part {path}"))).and_then(|e| self.zip.read(e, MAX_IMAGE)); + match read { + Ok(bytes) => { + let u = scene.add_image(path, bytes); + self.images.insert(path.to_string(), u.clone()); + Some(u) + } + Err(e) => { + scene.warnings.push(format!("texture {path}: {e}; the texture was skipped")); + None + } + } + } + }; + if let Some(uri) = uri { + scene.textures.push(RawTexture { uri, role: TextureRole::BaseColour, uv_set: 0, colour_space: "srgb" }); + let ti = scene.textures.len() - 1; + mat.textures.push(ti); + let slot = TextureSlot { wrap: tex.wrap, filter: tex.filter, ..TextureSlot::default() }; + pending.push((ti, slot)); + } } None => scene.warnings.push(format!("texture {t} is not defined")), } @@ -593,8 +638,12 @@ impl Reader<'_, '_> { } }; scene.materials.push(mat); - self.mats.insert(k, scene.materials.len() - 1); - scene.materials.len() - 1 + let mi = scene.materials.len() - 1; + for (texture, slot) in pending { + scene.extra_mut(mi).slots.push(RawSlot { input: MaterialInput::BaseColor, texture, slot }); + } + self.mats.insert(k, mi); + mi } }; m.material = Some(slot); @@ -654,7 +703,7 @@ pub fn read_3mf(bytes: &[u8], name: &str, watch: &Watch) -> Result { let root = root_part(&zip); let mut scene = RawScene::named(name); scene.up_axis = Some(UpAxis::Z); - let mut r = Reader { zip, watch, parts: Vec::new(), meshes: HashMap::new(), mats: HashMap::new(), scale: 1.0 }; + let mut r = Reader { zip, watch, parts: Vec::new(), meshes: HashMap::new(), mats: HashMap::new(), images: HashMap::new(), scale: 1.0 }; let main = r.part(Some(&root), 0, &mut scene)?; let (unit, scale) = r.parts[main].1.unit.unwrap_or((LengthUnit::Millimetre, 1.0)); scene.unit = Some(unit); @@ -667,9 +716,6 @@ pub fn read_3mf(bytes: &[u8], name: &str, watch: &Watch) -> Result { let p = r.part(path.as_deref(), main, &mut scene)?; r.emit(p, id, None, t, &mut Vec::new(), &mut scene)?; } - if scene.textures.iter().any(|t| t.uri.starts_with("#3mf:")) { - scene.warnings.push("textures inside the package are referenced as #3mf: and not unpacked".into()); - } watch.step(Stage::Reading, 1.0)?; Ok(scene) } From 87685a0129a6096eae34b385dab859bf76aa1f35 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:24:22 -0500 Subject: [PATCH 312/494] feat(io): map fbx texture properties to slots and unpack embedded media Diffuse or base colour, roughness or glossiness (inverted), metalness, normal, emission, specular, bump without a normal map and opacity or transparency textures become slots; UV set names resolve to the mesh's set index, wrap and the uv_to_texture matrix give wrap and transform, and embedded content is kept as images once per texture. Seven ufbx test files (MIT or Unlicense) and an own variant with a transform and an unknown UV set imported, saved and reopened from another folder with every texture present. --- native/crates/fsh-io/src/fbx.rs | 148 +++++++++++++++++++++++++------- 1 file changed, 118 insertions(+), 30 deletions(-) diff --git a/native/crates/fsh-io/src/fbx.rs b/native/crates/fsh-io/src/fbx.rs index acd563c0..00917a3f 100644 --- a/native/crates/fsh-io/src/fbx.rs +++ b/native/crates/fsh-io/src/fbx.rs @@ -1,10 +1,11 @@ use crate::error::{IoError, Result}; use crate::obj::roughness_from_phong; use crate::paths::Siblings; -use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawTexture, UpAxis}; +use crate::raw::{RawMaterial, RawMesh, RawNode, RawScene, RawSlot, RawTexture, UpAxis}; use crate::watch::{Stage, Watch}; use fsh_core::{srgb_decode, LengthUnit, Mat4, Vec2, Vec3, Vec4}; -use fsh_scene::TextureRole; +use fsh_scene::fsh_materials::Wrap; +use fsh_scene::{Channel, MapProjection, MaterialInput, TextureRole, TextureSlot, UvTransform}; use std::collections::HashMap; const MEMORY_LIMIT: usize = 3 << 30; @@ -73,7 +74,54 @@ fn texture_uri(t: &ufbx::Texture, siblings: &Siblings) -> Option { [rel, abs].into_iter().find(|s| !s.is_empty()).map(str::to_string) } -fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings) -> RawMaterial { +fn file_texture(t: &ufbx::Texture) -> &ufbx::Texture { + if t.has_file || t.content.size > 0 { + return t; + } + t.file_textures.iter().next().map(|f| &**f).unwrap_or(t) +} + +fn slot_of(t: &ufbx::Texture, sets: &[String], name: &str, warnings: &mut Vec) -> TextureSlot { + let set = if t.uv_set.is_empty() { + 0 + } else { + match sets.iter().position(|s| *s == *t.uv_set) { + Some(i) => i as u32, + None => { + warnings.push(format!("{name}: uv set {:?} is not on the mesh; the first set is used", &*t.uv_set)); + 0 + } + } + }; + let mut slot = TextureSlot { projection: MapProjection::Uv { set: set.min(3) }, ..TextureSlot::default() }; + if t.wrap_u != t.wrap_v { + warnings.push(format!("{name}: a texture wraps differently along u and v; its u wrapping is used for both")); + } + if t.wrap_u == ufbx::WrapMode::Clamp { + slot.wrap = Wrap::Clamp; + } + if t.has_uv_transform { + let m = &t.uv_to_texture; + let (a, b, c, d) = (m.m00 as f32, m.m01 as f32, m.m10 as f32, m.m11 as f32); + let rotation = c.atan2(a); + let (s, co) = rotation.sin_cos(); + let tr = UvTransform { + offset: [m.m03 as f32, m.m13 as f32], + scale: [(a * a + c * c).sqrt(), -s * b + co * d], + rotation, + ..UvTransform::default() + }; + if tr.validate("transform").is_ok() { + slot.transform = tr; + } + if (a * b + c * d).abs() > 1e-4 * ((a * a + c * c) * (b * b + d * d)).sqrt() { + warnings.push(format!("{name}: a texture transform rotates a non-uniform scale; its shear was dropped")); + } + } + slot +} + +fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: &[String], images: &mut HashMap) -> (RawMaterial, Vec) { let mut r = RawMaterial { name: m.element.name.to_string(), ..Default::default() }; if r.name.trim().is_empty() { r.name = "Material".into(); @@ -113,31 +161,70 @@ fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings) -> Ra } r.opacity = map_value(&p.opacity, 1.0).clamp(0.0, 1.0); r.double_sided = m.features.double_sided.enabled; - let slots: [(&ufbx::MaterialMap, &ufbx::MaterialMap, TextureRole, &'static str); 6] = [ - (&p.base_color, &m.fbx.diffuse_color, TextureRole::BaseColour, "srgb"), - (&p.roughness, &p.glossiness, TextureRole::Roughness, "linear"), - (&p.metalness, &p.metalness, TextureRole::Metalness, "linear"), - (&p.normal_map, &m.fbx.normal_map, TextureRole::Normal, "linear"), - (&p.emission_color, &m.fbx.emission_color, TextureRole::Emission, "srgb"), - (&p.opacity, &m.fbx.transparency_factor, TextureRole::Opacity, "linear"), + let glossy = m.features.roughness_as_glossiness.enabled; + let specular = p.specular_color.texture.as_ref().or(p.specular_factor.texture.as_ref()).or(m.fbx.specular_color.texture.as_ref()).or(m.fbx.specular_factor.texture.as_ref()); + let bump = m.fbx.bump.texture.as_ref().filter(|_| p.normal_map.texture.is_none() && m.fbx.normal_map.texture.is_none()); + let maps: [(Option<&ufbx::Ref>, bool, TextureRole, &'static str, MaterialInput); 8] = [ + (p.base_color.texture.as_ref().or(m.fbx.diffuse_color.texture.as_ref()), false, TextureRole::BaseColour, "srgb", MaterialInput::BaseColor), + (p.roughness.texture.as_ref(), glossy, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), + (p.glossiness.texture.as_ref().filter(|_| p.roughness.texture.is_none()), true, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), + (p.metalness.texture.as_ref(), false, TextureRole::Metalness, "linear", MaterialInput::BaseMetalness), + (p.normal_map.texture.as_ref().or(m.fbx.normal_map.texture.as_ref()), false, TextureRole::Normal, "linear", MaterialInput::Normal), + (p.emission_color.texture.as_ref().or(m.fbx.emission_color.texture.as_ref()), false, TextureRole::Emission, "srgb", MaterialInput::EmissionColor), + (specular, false, TextureRole::Other, "srgb", MaterialInput::SpecularWeight), + (bump, false, TextureRole::Bump, "linear", MaterialInput::Bump), ]; - for (a, b, role, space) in slots { - let Some(t) = a.texture.as_ref().or(b.texture.as_ref()) else { continue }; - match texture_uri(t, siblings) { - Some(uri) => { - scene.textures.push(RawTexture { uri, role, uv_set: 0, colour_space: space }); - r.textures.push(scene.textures.len() - 1); + let mut out = Vec::new(); + let opacity = match (p.opacity.texture.as_ref(), m.fbx.transparency_factor.texture.as_ref().or(m.fbx.transparency_color.texture.as_ref())) { + (Some(t), _) => Some((t, false)), + (None, Some(t)) => Some((t, true)), + _ => None, + }; + let all = maps.into_iter().chain(opacity.map(|(t, inv)| (Some(t), inv, TextureRole::Opacity, "linear", MaterialInput::GeometryOpacity))); + for (t, invert, role, space, input) in all { + let Some(t) = t else { continue }; + let t = file_texture(t); + let uri = if let Some(u) = images.get(&t.element.element_id) { + Some(u.clone()) + } else if t.content.size > 0 { + let name = [&*t.relative_filename, &*t.filename, &*t.element.name].into_iter().find(|s| !s.is_empty()).unwrap_or("embedded image").to_string(); + let u = scene.add_image(name, t.content.to_vec()); + images.insert(t.element.element_id, u.clone()); + Some(u) + } else { + texture_uri(t, siblings) + }; + let Some(uri) = uri else { + scene.warnings.push(format!("{}: a texture without a file name was skipped", r.name)); + continue; + }; + let mut slot = slot_of(t, sets, &r.name, &mut scene.warnings); + slot.invert = invert; + match input { + MaterialInput::Bump => slot.strength = 0.001 * map_value(&m.fbx.bump_factor, 1.0).clamp(0.0, 1000.0), + MaterialInput::GeometryOpacity => { + let alpha = scene.image_of(&uri).map(|i| crate::obj::png_has_alpha(&i.bytes)).unwrap_or_else(|| crate::obj::has_alpha(&uri)); + slot.channel = if alpha { Channel::A } else { Channel::Luminance }; + if invert && alpha { + slot.invert = false; + } } - None => scene.warnings.push(format!("{}: a texture without a file name was skipped", r.name)), + MaterialInput::EmissionColor if r.emissive.iter().all(|v| *v <= 0.0) => r.emissive = [1.0; 3], + _ => {} } + scene.textures.push(RawTexture { uri, role, uv_set: slot_uv(&slot), colour_space: space }); + let ti = scene.textures.len() - 1; + r.textures.push(ti); + out.push(RawSlot { input, texture: ti, slot }); } - if let Some(t) = m.fbx.bump.texture.as_ref().filter(|_| p.normal_map.texture.is_none() && m.fbx.normal_map.texture.is_none()) { - if let Some(uri) = texture_uri(t, siblings) { - scene.textures.push(RawTexture { uri, role: TextureRole::Bump, uv_set: 0, colour_space: "linear" }); - r.textures.push(scene.textures.len() - 1); - } + (r, out) +} + +fn slot_uv(s: &TextureSlot) -> u32 { + match s.projection { + MapProjection::Uv { set } => set, + _ => 0, } - r } struct Builder<'a> { @@ -146,20 +233,23 @@ struct Builder<'a> { watch: &'a Watch, scale: f32, materials: HashMap, + images: HashMap, meshes: HashMap<(u32, u32, Option), usize>, tris: usize, total_tris: usize, } impl Builder<'_> { - fn material_slot(&mut self, m: &ufbx::Material) -> usize { + fn material_slot(&mut self, m: &ufbx::Material, mesh: &ufbx::Mesh) -> usize { let id = m.element.element_id; if let Some(&s) = self.materials.get(&id) { return s; } - let r = material(m, &mut self.scene, self.siblings); + let sets: Vec = mesh.uv_sets.iter().filter(|s| s.vertex_uv.exists).map(|s| s.name.to_string()).collect(); + let (r, slots) = material(m, &mut self.scene, self.siblings, &sets, &mut self.images); self.scene.materials.push(r); let s = self.scene.materials.len() - 1; + self.scene.extra_mut(s).slots = slots; self.materials.insert(id, s); s } @@ -250,7 +340,7 @@ impl Builder<'_> { if let Some(mesh) = n.mesh.as_ref() { for part in mesh.material_parts.iter() { let m = n.materials.get(part.index as usize).or_else(|| mesh.materials.get(part.index as usize)); - let mat = m.map(|m| self.material_slot(m)); + let mat = m.map(|m| self.material_slot(m, mesh)); if let Some(i) = self.part(mesh, part, mat)? { meshes.push(i); } @@ -299,7 +389,7 @@ pub fn read_fbx(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> let mut refuse = |_: &str, _: &ufbx::OpenFileInfo| -> Option { None }; let mut opts = ufbx::LoadOpts { ignore_animation: true, - ignore_embedded: true, + ignore_embedded: false, load_external_files: false, target_axes: ufbx::CoordinateAxes::right_handed_y_up(), space_conversion: ufbx::SpaceConversion::ModifyGeometry, @@ -320,6 +410,7 @@ pub fn read_fbx(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> watch, scale, materials: HashMap::new(), + images: HashMap::new(), meshes: HashMap::new(), tris: 0, total_tris: fbx.meshes.iter().map(|m| m.num_triangles).sum(), @@ -345,9 +436,6 @@ pub fn read_fbx(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> b.scene.warnings.push(format!("{n} {what} ignored")); } } - if fbx.textures.iter().any(|t| t.content.size > 0) { - b.scene.warnings.push("textures embedded in the FBX file are not unpacked; their file names are used".into()); - } watch.step(Stage::Reading, 1.0)?; Ok(b.scene) } From c0cbea213df262dc8bfd063d50ee678abee76e50 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:36:58 -0500 Subject: [PATCH 313/494] fix(import): snapshot new textures into the crash journal Restarting the journal after an import left a session with no commands, which recovery deletes, so a crash lost the import; the session now takes the new members and writes a snapshot that carries them (CrashJournal.session is pub(crate)). The import reply also counts members before they move into the project. Killed engines after importing BoxTextured.glb and the own OBJ recovered by journal and saved with every embedded texture present. --- native/crates/fsh-commands/src/ext/import/reimport.rs | 2 +- native/crates/fsh-commands/src/ext/import/run.rs | 2 +- native/crates/fsh-commands/src/ext/import/textures.rs | 11 ++++++----- native/crates/fsh-commands/src/journal.rs | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/reimport.rs b/native/crates/fsh-commands/src/ext/import/reimport.rs index 09e2df57..3bd5085e 100644 --- a/native/crates/fsh-commands/src/ext/import/reimport.rs +++ b/native/crates/fsh-commands/src/ext/import/reimport.rs @@ -435,7 +435,7 @@ pub(crate) fn reimport(engine: &Engine, st: &mut State, nodes: Option usize| files.iter().map(|(_, r)| f(r)).sum::(); let files_json: Vec = files diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index b87bc2d4..d2555313 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -131,7 +131,7 @@ pub(crate) fn apply(engine: &Engine, st: &mut State, mut p: Prepared, a: &Import } }; if new_textures { - super::textures::rebase_journal(st); + super::textures::journal_textures(st); } let mut reply = engine.changed(st, &Outcome { level: ChangeLevel::Full, ..out }, false); reply["name"] = json!("file.import"); diff --git a/native/crates/fsh-commands/src/ext/import/textures.rs b/native/crates/fsh-commands/src/ext/import/textures.rs index 77b6d668..15d546ca 100644 --- a/native/crates/fsh-commands/src/ext/import/textures.rs +++ b/native/crates/fsh-commands/src/ext/import/textures.rs @@ -41,14 +41,15 @@ pub(crate) fn keep(st: &mut State, members: &mut BTreeMap>) -> b added } -/// Starts the crash journal again on the current document so its origin carries newly kept textures (a recovered -/// session would otherwise name members it does not hold). -pub(crate) fn rebase_journal(st: &mut State) { +/// Hands newly kept textures to the crash journal and writes a snapshot that carries them, so a recovered session +/// holds every member its replayed commands name (recovery gathers textures from origins and snapshots). +pub(crate) fn journal_textures(st: &mut State) { if st.editor.history().group_depth() > 0 { return; } - if let Some(j) = st.journal.as_mut() { - j.restart(&st.editor, &st.kept.textures, st.path.as_deref()); + if let Some(s) = st.journal.as_mut().and_then(|j| j.session.as_mut()) { + s.set_textures(&st.kept.textures); + let _ = s.snapshot(st.editor.document()); } } diff --git a/native/crates/fsh-commands/src/journal.rs b/native/crates/fsh-commands/src/journal.rs index 0f3f3fa0..9faf4c68 100644 --- a/native/crates/fsh-commands/src/journal.rs +++ b/native/crates/fsh-commands/src/journal.rs @@ -9,7 +9,7 @@ const SNAPSHOT_EVERY: u64 = 100; /// A write failure stops journalling for the rest of the document and is reported, never raised. pub(crate) struct CrashJournal { root: PathBuf, - session: Option, + pub(crate) session: Option, error: Option, last_snapshot: u64, } From 58eeca1781e4885f14465ff868cfed624cb168c4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:46:49 -0500 Subject: [PATCH 314/494] fix(import): point missing texture references at the model's folder A relative reference whose file is missing is stored as the absolute path inside the model's folder where it was expected, so it can be supplied later; references climbing out of the folder stay as written. The own OBJ's missing map now reads .../obj/maps/not_there.png, and an over-cap 257 MiB file was referenced by path with a warning. --- .../crates/fsh-commands/src/ext/import/run.rs | 3 +- .../fsh-commands/src/ext/import/textures.rs | 34 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/run.rs b/native/crates/fsh-commands/src/ext/import/run.rs index d2555313..5be5600b 100644 --- a/native/crates/fsh-commands/src/ext/import/run.rs +++ b/native/crates/fsh-commands/src/ext/import/run.rs @@ -22,7 +22,8 @@ pub(crate) fn prepare(path: &Path, a: &ImportArgs, doc: &Document, watch: &Watch watch.set(Stage::Reading, 0.0); let mut raw = fsh_io::read_model(path, watch)?; let mut report = fsh_io::clean(&mut raw, &a.clean, watch)?; - let textures = super::textures::embed(&mut raw, watch); + let folder = std::fs::canonicalize(path).ok().and_then(|p| p.parent().map(Path::to_path_buf)); + let textures = super::textures::embed(&mut raw, folder.as_deref(), watch); watch.poll(0)?; report.warnings.extend(textures.warnings.iter().cloned()); let roots = raw.nodes.iter().filter(|n| n.parent.is_none()).count(); diff --git a/native/crates/fsh-commands/src/ext/import/textures.rs b/native/crates/fsh-commands/src/ext/import/textures.rs index 15d546ca..1f37566d 100644 --- a/native/crates/fsh-commands/src/ext/import/textures.rs +++ b/native/crates/fsh-commands/src/ext/import/textures.rs @@ -93,14 +93,24 @@ fn file_name(uri: &str) -> String { enum Outcome { Embed(String), Keep, + Missing(String), Drop, } +/// Where a relative reference that could not be found was expected: inside `folder`, never above it. +fn expected_at(folder: Option<&Path>, uri: &str) -> Option { + let rel = uri.replace('\\', "/"); + let p = Path::new(&rel); + let plain = p.is_relative() && !rel.contains(':') && p.components().all(|c| matches!(c, std::path::Component::Normal(_) | std::path::Component::CurDir)); + plain.then(|| folder.map(|f| f.join(p).to_string_lossy().into_owned())).flatten() +} + /// Turns every texture of `raw` into an embedded project member (`fshot:textures/.`) where it can: /// images inside the file and image files beside it that the engine decodes and that hold at most 256 MiB. Larger -/// files keep their path, files that cannot be found keep their reference (the slot shows its fallback), and -/// images in formats the engine does not read are dropped with their slots. -pub(crate) fn embed(raw: &mut RawScene, watch: &Watch) -> Embeds { +/// files keep their path, files that cannot be found keep their reference (made absolute in `folder`, the model's +/// folder, so the slot can be pointed at the file later; the slot shows its fallback meanwhile), and images in +/// formats the engine does not read are dropped with their slots. +pub(crate) fn embed(raw: &mut RawScene, folder: Option<&Path>, watch: &Watch) -> Embeds { let mut out = Embeds::default(); let mut done: BTreeMap = BTreeMap::new(); for i in 0..raw.textures.len() { @@ -112,11 +122,11 @@ pub(crate) fn embed(raw: &mut RawScene, watch: &Watch) -> Embeds { continue; } if !done.contains_key(&uri) { - let outcome = resolve(raw, &uri, &mut out); + let outcome = resolve(raw, &uri, folder, &mut out); done.insert(uri.clone(), outcome); } match &done[&uri] { - Outcome::Embed(path) => raw.textures[i].uri = path.clone(), + Outcome::Embed(path) | Outcome::Missing(path) => raw.textures[i].uri = path.clone(), Outcome::Keep => {} Outcome::Drop => raw.textures[i].uri = String::new(), } @@ -125,7 +135,7 @@ pub(crate) fn embed(raw: &mut RawScene, watch: &Watch) -> Embeds { out } -fn resolve(raw: &RawScene, uri: &str, out: &mut Embeds) -> Outcome { +fn resolve(raw: &RawScene, uri: &str, folder: Option<&Path>, out: &mut Embeds) -> Outcome { let (name, bytes) = if uri.starts_with(EMBEDDED_PREFIX) { let Some(img) = raw.image_of(uri) else { out.skipped.push(json!({"name": uri, "reason": "the image is not in the file"})); @@ -142,8 +152,16 @@ fn resolve(raw: &RawScene, uri: &str, out: &mut Embeds) -> Outcome { let len = match std::fs::metadata(path) { Ok(m) if path.is_absolute() && m.is_file() => m.len(), _ => { - out.missing.push(json!({"name": file_name(uri), "path": uri})); - return Outcome::Keep; + return match expected_at(folder, uri) { + Some(abs) => { + out.missing.push(json!({"name": file_name(uri), "path": abs})); + Outcome::Missing(abs) + } + None => { + out.missing.push(json!({"name": file_name(uri), "path": uri})); + Outcome::Keep + } + }; } }; if len > MAX_EMBED_TEXTURE_BYTES as u64 { From 7df4f9ac68332dff75d2fdf9df81d555917ed197 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:46:49 -0500 Subject: [PATCH 315/494] feat(io): read displacement maps from mtl and fbx MTL disp and FBX displacement textures become displacement slots (0.01 m per unit, times the FBX displacement factor); the document stores them for when displacement is applied. An own OBJ with disp -s 4 4 gave a displacement slot with scale 4 and strength 0.01 through the release CLI. --- native/crates/fsh-io/src/fbx.rs | 4 +++- native/crates/fsh-io/src/obj.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-io/src/fbx.rs b/native/crates/fsh-io/src/fbx.rs index 00917a3f..52c9664a 100644 --- a/native/crates/fsh-io/src/fbx.rs +++ b/native/crates/fsh-io/src/fbx.rs @@ -164,7 +164,7 @@ fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: let glossy = m.features.roughness_as_glossiness.enabled; let specular = p.specular_color.texture.as_ref().or(p.specular_factor.texture.as_ref()).or(m.fbx.specular_color.texture.as_ref()).or(m.fbx.specular_factor.texture.as_ref()); let bump = m.fbx.bump.texture.as_ref().filter(|_| p.normal_map.texture.is_none() && m.fbx.normal_map.texture.is_none()); - let maps: [(Option<&ufbx::Ref>, bool, TextureRole, &'static str, MaterialInput); 8] = [ + let maps: [(Option<&ufbx::Ref>, bool, TextureRole, &'static str, MaterialInput); 9] = [ (p.base_color.texture.as_ref().or(m.fbx.diffuse_color.texture.as_ref()), false, TextureRole::BaseColour, "srgb", MaterialInput::BaseColor), (p.roughness.texture.as_ref(), glossy, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), (p.glossiness.texture.as_ref().filter(|_| p.roughness.texture.is_none()), true, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), @@ -173,6 +173,7 @@ fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: (p.emission_color.texture.as_ref().or(m.fbx.emission_color.texture.as_ref()), false, TextureRole::Emission, "srgb", MaterialInput::EmissionColor), (specular, false, TextureRole::Other, "srgb", MaterialInput::SpecularWeight), (bump, false, TextureRole::Bump, "linear", MaterialInput::Bump), + (m.fbx.displacement.texture.as_ref(), false, TextureRole::Other, "linear", MaterialInput::Displacement), ]; let mut out = Vec::new(); let opacity = match (p.opacity.texture.as_ref(), m.fbx.transparency_factor.texture.as_ref().or(m.fbx.transparency_color.texture.as_ref())) { @@ -202,6 +203,7 @@ fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: slot.invert = invert; match input { MaterialInput::Bump => slot.strength = 0.001 * map_value(&m.fbx.bump_factor, 1.0).clamp(0.0, 1000.0), + MaterialInput::Displacement => slot.strength = 0.01 * map_value(&m.fbx.displacement_factor, 1.0).clamp(0.0, 1000.0), MaterialInput::GeometryOpacity => { let alpha = scene.image_of(&uri).map(|i| crate::obj::png_has_alpha(&i.bytes)).unwrap_or_else(|| crate::obj::has_alpha(&uri)); slot.channel = if alpha { Channel::A } else { Channel::Luminance }; diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index c803276c..71d3416a 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -343,6 +343,7 @@ fn read_mtl(bytes: &[u8], siblings: &Siblings, scene: &mut RawScene, index: &mut "norm" | "map_Kn" => texture = Some((TextureRole::Normal, "linear", MaterialInput::Normal)), "map_d" => texture = Some((TextureRole::Opacity, "linear", MaterialInput::GeometryOpacity)), "map_Ke" => texture = Some((TextureRole::Emission, "srgb", MaterialInput::EmissionColor)), + "disp" => texture = Some((TextureRole::Other, "linear", MaterialInput::Displacement)), _ => {} } if let Some((role, space, input)) = texture { From cf40a80069e1ab150744b94911f4fa7dbacf3fc5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:46:49 -0500 Subject: [PATCH 316/494] feat(import): report images and texture slots in import.probe import.probe adds images_in_file (images stored inside the model) and texture_slots beside the texture count. ClearCoatTest.glb probed as 7 textures, 6 stored images and 13 slots. --- native/crates/fsh-commands/src/ext/import.rs | 2 +- native/crates/fsh-commands/src/ext/import/probe.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-commands/src/ext/import.rs b/native/crates/fsh-commands/src/ext/import.rs index a36a9a47..798917d4 100644 --- a/native/crates/fsh-commands/src/ext/import.rs +++ b/native/crates/fsh-commands/src/ext/import.rs @@ -22,7 +22,7 @@ use options::ImportArgs; pub(super) static COMMANDS: &[ExtCommand] = &[ ExtCommand { name: "import.probe", - description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units and size_m (the size in metres at units_guess), triangles, meshes, nodes, materials, warnings}.", + description: "Read a model file without changing the document: {format, units_declared, units_guess, unit_guessed, up_axis, bounds: {min, max, size} in file units and size_m (the size in metres at units_guess), triangles, meshes, nodes, materials, textures, images_in_file (images stored inside the model), texture_slots, warnings}.", level: ChangeLevel::None, mutates: false, read_only: true, diff --git a/native/crates/fsh-commands/src/ext/import/probe.rs b/native/crates/fsh-commands/src/ext/import/probe.rs index e6d9e45e..c6e85a4f 100644 --- a/native/crates/fsh-commands/src/ext/import/probe.rs +++ b/native/crates/fsh-commands/src/ext/import/probe.rs @@ -50,6 +50,8 @@ pub(crate) fn probe(path: &Path) -> Result { "nodes": raw.nodes.len(), "materials": raw.materials.len(), "textures": raw.textures.len(), + "images_in_file": raw.images.len(), + "texture_slots": raw.extras.iter().map(|x| x.slots.len()).sum::(), "warnings": raw.warnings, })) } From 260e88a325ca4e7aac789fd8eefd79c1464014dc Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:47:47 -0500 Subject: [PATCH 317/494] style(import): satisfy clippy in the fbx map table and member keeping A type alias for the FBX map rows and an entry insert for kept members. cargo clippy -p fsh-io -p fsh-format -p fsh-commands --all-targets -- -D warnings is clean on 1.99.1. --- native/crates/fsh-commands/src/ext/import/textures.rs | 4 ++-- native/crates/fsh-io/src/fbx.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/native/crates/fsh-commands/src/ext/import/textures.rs b/native/crates/fsh-commands/src/ext/import/textures.rs index 1f37566d..0a5cbf28 100644 --- a/native/crates/fsh-commands/src/ext/import/textures.rs +++ b/native/crates/fsh-commands/src/ext/import/textures.rs @@ -33,8 +33,8 @@ impl Embeds { pub(crate) fn keep(st: &mut State, members: &mut BTreeMap>) -> bool { let mut added = false; for (name, bytes) in std::mem::take(members) { - if !st.kept.textures.contains_key(&name) { - st.kept.textures.insert(name, bytes); + if let std::collections::btree_map::Entry::Vacant(v) = st.kept.textures.entry(name) { + v.insert(bytes); added = true; } } diff --git a/native/crates/fsh-io/src/fbx.rs b/native/crates/fsh-io/src/fbx.rs index 52c9664a..fadaa03b 100644 --- a/native/crates/fsh-io/src/fbx.rs +++ b/native/crates/fsh-io/src/fbx.rs @@ -121,6 +121,8 @@ fn slot_of(t: &ufbx::Texture, sets: &[String], name: &str, warnings: &mut Vec = (Option<&'a ufbx::Ref>, bool, TextureRole, &'static str, MaterialInput); + fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: &[String], images: &mut HashMap) -> (RawMaterial, Vec) { let mut r = RawMaterial { name: m.element.name.to_string(), ..Default::default() }; if r.name.trim().is_empty() { @@ -164,7 +166,7 @@ fn material(m: &ufbx::Material, scene: &mut RawScene, siblings: &Siblings, sets: let glossy = m.features.roughness_as_glossiness.enabled; let specular = p.specular_color.texture.as_ref().or(p.specular_factor.texture.as_ref()).or(m.fbx.specular_color.texture.as_ref()).or(m.fbx.specular_factor.texture.as_ref()); let bump = m.fbx.bump.texture.as_ref().filter(|_| p.normal_map.texture.is_none() && m.fbx.normal_map.texture.is_none()); - let maps: [(Option<&ufbx::Ref>, bool, TextureRole, &'static str, MaterialInput); 9] = [ + let maps: [MapUse; 9] = [ (p.base_color.texture.as_ref().or(m.fbx.diffuse_color.texture.as_ref()), false, TextureRole::BaseColour, "srgb", MaterialInput::BaseColor), (p.roughness.texture.as_ref(), glossy, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), (p.glossiness.texture.as_ref().filter(|_| p.roughness.texture.is_none()), true, TextureRole::Roughness, "linear", MaterialInput::SpecularRoughness), From cb327eadaf1ca648bfcfc52d90c982738d197ebe Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 15:53:23 -0500 Subject: [PATCH 318/494] fix(io): store uvs with v pointing up as the texture lookup reads them glTF texture coordinates are flipped on read (v' = 1 - v) and back on GLB write; OBJ, PLY, FBX and 3MF already use v up and are no longer flipped; MikkTSpace takes the stored uvs as they are. On NormalTangentMirrorTest and NormalTangentTest every corner's file tangent lies along dP/du and its bitangent (w times N x T) along dP/dv, the same for generated tangents; TextureTransformTest lookups match glTF's own within 6e-8 and GLB write and read back keeps every uv. --- native/crates/fsh-io/src/fbx.rs | 2 +- native/crates/fsh-io/src/glb_write.rs | 2 +- native/crates/fsh-io/src/gltf.rs | 2 +- native/crates/fsh-io/src/obj.rs | 2 +- native/crates/fsh-io/src/ply.rs | 2 +- native/crates/fsh-io/src/raw.rs | 3 ++- native/crates/fsh-io/src/tangents.rs | 2 +- native/crates/fsh-io/src/threemf.rs | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/native/crates/fsh-io/src/fbx.rs b/native/crates/fsh-io/src/fbx.rs index fadaa03b..e598c198 100644 --- a/native/crates/fsh-io/src/fbx.rs +++ b/native/crates/fsh-io/src/fbx.rs @@ -316,7 +316,7 @@ impl Builder<'_> { } for (k, s) in sets.iter().enumerate() { let t = s.vertex_uv[ix]; - out.uvs[k].push(Vec2::new(t.x as f32, 1.0 - t.y as f32)); + out.uvs[k].push(Vec2::new(t.x as f32, t.y as f32)); } if has_c { let c = mesh.vertex_color[ix]; diff --git a/native/crates/fsh-io/src/glb_write.rs b/native/crates/fsh-io/src/glb_write.rs index 68db470e..6a3b945f 100644 --- a/native/crates/fsh-io/src/glb_write.rs +++ b/native/crates/fsh-io/src/glb_write.rs @@ -98,7 +98,7 @@ pub fn write_glb(scene: &RawScene) -> Result> { attrs.insert("NORMAL".into(), json!(bin.floats(&f, "VEC3", n, None))); } for (s, set) in m.uvs.iter().enumerate() { - let f: Vec = set.iter().flat_map(|p| [p.x, p.y]).collect(); + let f: Vec = set.iter().flat_map(|p| [p.x, 1.0 - p.y]).collect(); attrs.insert(format!("TEXCOORD_{s}"), json!(bin.floats(&f, "VEC2", n, None))); } if !m.colours.is_empty() { diff --git a/native/crates/fsh-io/src/gltf.rs b/native/crates/fsh-io/src/gltf.rs index 7e334a05..0ad48366 100644 --- a/native/crates/fsh-io/src/gltf.rs +++ b/native/crates/fsh-io/src/gltf.rs @@ -582,7 +582,7 @@ fn read_mesh(r: &Reader, mj: &Value, mi: usize, scene: &mut RawScene, watch: &Wa if c != 2 || f.len() / 2 != n { return malformed(format!("{mesh_name}: TEXCOORD_{set} must be VEC2 with one entry per vertex")); } - m.uvs.push(f.as_chunks::<2>().0.iter().map(|c| Vec2::new(c[0], c[1])).collect()); + m.uvs.push(f.as_chunks::<2>().0.iter().map(|c| Vec2::new(c[0], 1.0 - c[1])).collect()); set += 1; } if let Some(ci) = idx(attrs, "COLOR_0")? { diff --git a/native/crates/fsh-io/src/obj.rs b/native/crates/fsh-io/src/obj.rs index 71d3416a..aa550bed 100644 --- a/native/crates/fsh-io/src/obj.rs +++ b/native/crates/fsh-io/src/obj.rs @@ -99,7 +99,7 @@ pub fn read_obj(bytes: &[u8], name: &str, siblings: &Siblings, watch: &Watch) -> "vt" => { let u = nums::<1>(rest, "vt", line)?[0]; let v = rest.get(1).and_then(|t| t.parse::().ok()).unwrap_or(0.0); - tex.push(Vec2::new(u, 1.0 - v)); + tex.push(Vec2::new(u, v)); } "vn" => nor.push(Vec3::from(nums::<3>(rest, "vn", line)?)), "f" | "fo" => { diff --git a/native/crates/fsh-io/src/ply.rs b/native/crates/fsh-io/src/ply.rs index 7c48fef3..91b1b67a 100644 --- a/native/crates/fsh-io/src/ply.rs +++ b/native/crates/fsh-io/src/ply.rs @@ -275,7 +275,7 @@ pub fn read_ply(bytes: &[u8], name: &str, watch: &Watch) -> Result { m.colours.push(Vec4::new(c(cr), c(cg), c(cb), a.unwrap_or(1.0))); } if want_uv { - uv.push(Vec2::new(g(tu), 1.0 - g(tv))); + uv.push(Vec2::new(g(tu), g(tv))); } } if is_face && list.len() >= 3 { diff --git a/native/crates/fsh-io/src/raw.rs b/native/crates/fsh-io/src/raw.rs index 5ecf5dae..c9b68899 100644 --- a/native/crates/fsh-io/src/raw.rs +++ b/native/crates/fsh-io/src/raw.rs @@ -75,7 +75,8 @@ pub struct RawMesh { pub positions: Vec, /// Authored normals; empty when the file had none. pub normals: Vec, - /// UV sets, each one entry per vertex (glTF convention: v grows downwards). + /// UV sets, each one entry per vertex, v growing upwards (origin at the image's bottom left, row 0 of an image at + /// v = 1); glTF's downward v is flipped on read and on write. pub uvs: Vec>, /// Linear RGBA vertex colours; empty when absent. pub colours: Vec, diff --git a/native/crates/fsh-io/src/tangents.rs b/native/crates/fsh-io/src/tangents.rs index a1c267ee..73c570ed 100644 --- a/native/crates/fsh-io/src/tangents.rs +++ b/native/crates/fsh-io/src/tangents.rs @@ -35,7 +35,7 @@ impl Geometry for Corners<'_> { fn tex_coord(&self, face: usize, vert: usize) -> [f32; 2] { let t = self.m.uvs[0][self.v(face, vert)]; - [t.x, 1.0 - t.y] + [t.x, t.y] } fn set_tangent(&mut self, t: Option, face: usize, vert: usize) { diff --git a/native/crates/fsh-io/src/threemf.rs b/native/crates/fsh-io/src/threemf.rs index a17666b6..d2ac10e3 100644 --- a/native/crates/fsh-io/src/threemf.rs +++ b/native/crates/fsh-io/src/threemf.rs @@ -172,7 +172,7 @@ fn read_group(r: Node, part: &str, model: &mut Model, scene: &mut RawScene) -> R } "texture2dgroup" => { let tex = index(&r, "texid")?.ok_or_else(|| bad("no texid"))?; - let uvs = children(r, "tex2coord").map(|c| Ok(Vec2::new(num(&c, "u")?, 1.0 - num(&c, "v")?))).collect::>()?; + let uvs = children(r, "tex2coord").map(|c| Ok(Vec2::new(num(&c, "u")?, num(&c, "v")?))).collect::>()?; Group::Tex { tex, uvs } } "compositematerials" => { From 47aa3392f64b1830e134a1666024b56d54c72063 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:23:40 -0500 Subject: [PATCH 319/494] feat(scene): add the label document type for projected images Label holds an image key, placement in object space, size, rotation, depth, opacity and optional roughness and metalness, with validation and the twelve constants the Label opcode reads. Verified by cargo check -p fsh-scene and a throwaway program checking defaults and refusals. --- native/crates/fsh-scene/src/labels.rs | 139 ++++++++++++++++++++++++++ native/crates/fsh-scene/src/lib.rs | 2 + 2 files changed, 141 insertions(+) create mode 100644 native/crates/fsh-scene/src/labels.rs diff --git a/native/crates/fsh-scene/src/labels.rs b/native/crates/fsh-scene/src/labels.rs new file mode 100644 index 00000000..0189ac7b --- /dev/null +++ b/native/crates/fsh-scene/src/labels.rs @@ -0,0 +1,139 @@ +use crate::error::{Result, SceneError}; +use crate::ser; +use fsh_core::{TextureKey, Vec3}; +use fsh_materials::ColourSpace; +use serde::{Deserialize, Serialize}; + +/// An image projected onto the parts wearing a material (a decal), placed in the object space of those parts. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(default)] +pub struct Label { + /// Id, unique within the material; allocated when 0. + pub id: u32, + /// Display name. + pub name: String, + /// Image; a label without one is kept but draws nothing. + #[serde(with = "ser::key_opt")] + pub texture: Option, + /// Colour space of the image; the texture's hint, else sRGB, when absent. + pub colour_space: Option, + /// Centre of the label on the surface, object space (metres). + pub origin: [f32; 3], + /// Direction the label faces (projection axis), object space. + pub normal: [f32; 3], + /// Direction of the image's top before rotation, object space; must not be parallel to the normal. + pub up: [f32; 3], + /// Width and height in metres. + pub size: [f32; 2], + /// Radians about the normal, counter-clockwise seen from the front. + pub rotation: f32, + /// Thickness of the projection volume in metres, centred on the origin. + pub depth: f32, + /// 0..1. + pub opacity: f32, + /// Also prints on surfaces facing away from the normal. + pub two_sided: bool, + /// Drawn at all. + pub visible: bool, + /// Specular roughness under the label (0..1); the surface's when absent. + pub roughness: Option, + /// Metalness under the label (0..1); the surface's when absent. + pub metalness: Option, +} + +impl Default for Label { + fn default() -> Self { + Self { + id: 0, + name: "Label".into(), + texture: None, + colour_space: None, + origin: [0.0, 0.0, 0.0], + normal: [0.0, 0.0, 1.0], + up: [0.0, 1.0, 0.0], + size: [0.1, 0.1], + rotation: 0.0, + depth: 0.01, + opacity: 1.0, + two_sided: false, + visible: true, + roughness: None, + metalness: None, + } + } +} + +fn v3(a: [f32; 3]) -> Vec3 { + Vec3::new(a[0], a[1], a[2]) +} + +impl Label { + /// True when the label draws: visible and with an image. + pub fn active(&self) -> bool { + self.visible && self.texture.is_some_and(|t| t.is_some()) && self.opacity > 0.0 + } + + /// Checks the values against their ranges. + pub fn validate(&self) -> Result<()> { + let f = |s: &str| format!("labels.{}.{s}", self.id); + let finite = |v: &[f32]| v.iter().all(|x| x.is_finite()); + if !finite(&self.origin) || !finite(&self.normal) || !finite(&self.up) || !self.rotation.is_finite() { + return Err(SceneError::value(f("origin"), "origin, normal, up and rotation must be finite")); + } + if !self.size.iter().all(|s| s.is_finite() && *s > 0.0) { + return Err(SceneError::value(f("size"), "width and height must be positive")); + } + if !(self.depth.is_finite() && self.depth > 0.0) { + return Err(SceneError::value(f("depth"), "must be positive")); + } + if !(self.opacity.is_finite() && (0.0..=1.0).contains(&self.opacity)) { + return Err(SceneError::value(f("opacity"), "must be within 0..1")); + } + for (name, v) in [("roughness", self.roughness), ("metalness", self.metalness)] { + if v.is_some_and(|v| !(v.is_finite() && (0.0..=1.0).contains(&v))) { + return Err(SceneError::value(f(name), "must be within 0..1")); + } + } + let (n, u) = (v3(self.normal), v3(self.up)); + if n.length() < 1.0e-6 || u.length() < 1.0e-6 { + return Err(SceneError::value(f("normal"), "normal and up must not be zero")); + } + if n.normalize().cross(u.normalize()).length() < 1.0e-4 { + return Err(SceneError::value(f("up"), "must not be parallel to the normal")); + } + if self.texture.is_some_and(|t| !t.is_some()) { + return Err(SceneError::value(f("texture"), "names the zero key")); + } + Ok(()) + } + + /// The unit frame (right, up, normal) after rotation; right = up x normal, so the image reads unmirrored from the + /// front. + pub fn frame(&self) -> (Vec3, Vec3, Vec3) { + let n = v3(self.normal).normalize(); + let u0 = (v3(self.up) - n * n.dot(v3(self.up))).normalize(); + let r0 = u0.cross(n); + let (s, c) = self.rotation.sin_cos(); + (r0 * c + u0 * s, u0 * c - r0 * s, n) + } + + /// The twelve constants of the `Label` opcode: origin, right / width, up / height, normal / (depth / 2). + pub fn consts(&self) -> [f32; 12] { + let (r, u, n) = self.frame(); + let (r, u, n) = (r / self.size[0], u / self.size[1], n / (0.5 * self.depth)); + let o = self.origin; + [o[0], o[1], o[2], r.x, r.y, r.z, u.x, u.y, u.z, n.x, n.y, n.z] + } +} + +/// Checks a material's label list: each label, and ids non-zero and unique. +pub fn validate_labels(labels: &[Label]) -> Result<()> { + let mut seen = std::collections::BTreeSet::new(); + for l in labels { + if l.id == 0 || !seen.insert(l.id) { + return Err(SceneError::value("labels", format!("label id {} is zero or appears twice", l.id))); + } + l.validate()?; + } + Ok(()) +} diff --git a/native/crates/fsh-scene/src/lib.rs b/native/crates/fsh-scene/src/lib.rs index 8ecbfb5f..c9e74bfd 100644 --- a/native/crates/fsh-scene/src/lib.rs +++ b/native/crates/fsh-scene/src/lib.rs @@ -9,6 +9,7 @@ mod editor; mod error; mod graph; mod history; +mod labels; mod material; mod mesh; mod node; @@ -40,6 +41,7 @@ pub use graph::{ VoronoiMetric, WaveKind, WaveProfile, MAX_GRAPH_NODES, MAX_RAMP_STOPS, }; pub use history::History; +pub use labels::{validate_labels, Label}; pub use material::{Material, SurfaceParams, TextureRef, TextureRole, MATERIAL_FIELDS}; pub use slots::{validate_projection, Channel, CoordSpace, MapProjection, MaterialInput, TextureSlot, UvTransform}; pub use mesh::Mesh; From 30d0d904792117639636e17bbf779587160c0528 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Wed, 2 Dec 2026 14:23:40 -0500 Subject: [PATCH 320/494] feat(scene): give materials an ordered label list Material.labels is left out of the JSON when empty, listed in MATERIAL_FIELDS, validated for unique ids, and its textures follow texture_keys and map_textures. A throwaway program saved and reloaded .fshot files: without labels byte-identical, with labels kept as a known field. --- native/crates/fsh-scene/src/material.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/native/crates/fsh-scene/src/material.rs b/native/crates/fsh-scene/src/material.rs index c93bfaac..2a2f80f1 100644 --- a/native/crates/fsh-scene/src/material.rs +++ b/native/crates/fsh-scene/src/material.rs @@ -1,5 +1,6 @@ use crate::error::{non_negative, range, Result, SceneError}; use crate::graph::MaterialGraph; +use crate::labels::{validate_labels, Label}; use crate::ser; use crate::slots::{MaterialInput, TextureSlot}; use fsh_core::{Rgb, TextureKey}; @@ -246,11 +247,14 @@ pub struct Material { /// Node graph whose outputs drive inputs over slots and constants (left out of the JSON when absent). #[serde(skip_serializing_if = "Option::is_none")] pub graph: Option>, + /// Images projected onto the parts, drawn in order over slots and graph (left out of the JSON when empty). + #[serde(skip_serializing_if = "Vec::is_empty")] + pub labels: Vec