Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ PCB / Package, Render, Animation, Simulation, Manufacture/CAM, Drawings.

## Render foundation

- R2 adds bounded named render setups in document format 21 and the read/save
`render.settings.get/set` commands. Proven render-only changes preserve geometry
and prepared world data through undo/redo and checkpoint restore. This slice does
not add a Render workspace, PBR, environments or image jobs; see
[settings and refresh policy](docs/render-settings.md).
- Bounded PNG/JPEG texture admission (#900) validates in-memory sources and returns
completed RGBA8 pixels with explicit color/data roles. It is an input utility only:
ICC/16-bit normalization, local wood mapping, resource persistence and the renderer
Expand Down
4 changes: 3 additions & 1 deletion assets/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,5 +752,7 @@
"update.restart_later": "Später",
"update.installer_started": "Das Installationsprogramm startet, wenn SolidCraft geschlossen wird.",
"update.dmg_opened": "Das Disk-Image ist geöffnet und geprüft: SolidCraft in „Programme“ ziehen, die alte Version ersetzen und SolidCraft neu starten.",
"update.install_failed": "Das Update wurde nicht installiert: {error}. Es wurde nichts verändert; „Herunterladen“ holt das Paket."
"update.install_failed": "Das Update wurde nicht installiert: {error}. Es wurde nichts verändert; „Herunterladen“ holt das Paket.",
"cmd.render_settings_get": "Rendereinstellungen",
"cmd.render_settings_set": "Rendereinstellungen speichern"
}
4 changes: 3 additions & 1 deletion assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,5 +1011,7 @@
"update.restart_later": "Later",
"update.installer_started": "The installer starts when SolidCraft closes.",
"update.dmg_opened": "The disk image is open and verified: drag SolidCraft to Applications, replacing the old copy, then restart SolidCraft.",
"update.install_failed": "The update didn't install: {error}. Nothing was changed; Download gets the package instead."
"update.install_failed": "The update didn't install: {error}. Nothing was changed; Download gets the package instead.",
"cmd.render_settings_get": "Render Settings",
"cmd.render_settings_set": "Save Render Settings"
}
4 changes: 3 additions & 1 deletion assets/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,5 +1011,7 @@
"update.restart_later": "後で",
"update.installer_started": "SolidCraft の終了後にインストーラーが起動します。",
"update.dmg_opened": "ディスクイメージを検証して開きました: SolidCraft をアプリケーションフォルダにドラッグして古いものを置き換え、SolidCraft を再起動してください。",
"update.install_failed": "アップデートをインストールできませんでした: {error}。何も変更されていません。「ダウンロード」でパッケージを入手できます。"
"update.install_failed": "アップデートをインストールできませんでした: {error}。何も変更されていません。「ダウンロード」でパッケージを入手できます。",
"cmd.render_settings_get": "レンダリング設定",
"cmd.render_settings_set": "レンダリング設定を保存"
}
4 changes: 3 additions & 1 deletion assets/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,5 +752,7 @@
"update.restart_later": "나중에",
"update.installer_started": "SolidCraft가 종료되면 설치 프로그램이 시작됩니다.",
"update.dmg_opened": "디스크 이미지를 확인하고 열었습니다: SolidCraft를 응용 프로그램 폴더로 끌어 기존 버전을 바꾼 뒤 SolidCraft를 다시 시작하세요.",
"update.install_failed": "업데이트를 설치하지 못했습니다: {error}. 아무것도 변경되지 않았습니다. 다운로드로 패키지를 받을 수 있습니다."
"update.install_failed": "업데이트를 설치하지 못했습니다: {error}. 아무것도 변경되지 않았습니다. 다운로드로 패키지를 받을 수 있습니다.",
"cmd.render_settings_get": "렌더링 설정",
"cmd.render_settings_set": "렌더링 설정 저장"
}
4 changes: 3 additions & 1 deletion assets/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -957,5 +957,7 @@
"Line Spacing": "Межстрочный интервал",
"Path": "Траектория",
"sketch_text.on_path": "Текст следует по траектории: кривая задаёт его положение",
"cmd.material_properties_validate": "Проверить данные физического материала"
"cmd.material_properties_validate": "Проверить данные физического материала",
"cmd.render_settings_get": "Настройки рендеринга",
"cmd.render_settings_set": "Сохранить настройки рендеринга"
}
4 changes: 3 additions & 1 deletion assets/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,5 +1011,7 @@
"update.restart_later": "稍后",
"update.installer_started": "SolidCraft 关闭后将启动安装程序。",
"update.dmg_opened": "磁盘映像已校验并打开:将 SolidCraft 拖到“应用程序”替换旧版本,然后重启 SolidCraft。",
"update.install_failed": "更新未安装:{error}。未做任何更改;可用“下载”获取安装包。"
"update.install_failed": "更新未安装:{error}。未做任何更改;可用“下载”获取安装包。",
"cmd.render_settings_get": "渲染设置",
"cmd.render_settings_set": "保存渲染设置"
}
1 change: 1 addition & 0 deletions crates/doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ workspace = true
solidcraft-geom = { workspace = true }
solidcraft-sketch = { workspace = true }
solidcraft-kernel = { workspace = true }
solidcraft-render = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
Expand Down
16 changes: 16 additions & 0 deletions crates/doc/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,9 @@ pub struct DesignLink {
/// The document.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Document {
/// Named, renderer-independent setups. Device/job state is never saved here.
#[serde(default, skip_serializing_if = "crate::render_settings::RenderSettings::is_empty")]
pub render: std::sync::Arc<crate::render_settings::RenderSettings>,
#[serde(default = "default_format")]
pub format: String,
pub name: String,
Expand Down Expand Up @@ -1828,6 +1831,7 @@ impl Default for Document {
impl Document {
pub fn new(name: &str) -> Self {
Document {
render: Default::default(),
format: default_format(),
name: name.into(),
units: default_units(),
Expand Down Expand Up @@ -1859,6 +1863,18 @@ impl Document {
}
}

/// A complete structural proof: no non-render field is allowed to differ. Keeping this
/// comparison based on the whole Document also includes fields added in future versions.
/// The clone/comparison is only needed when render intent actually differs.
pub fn differs_only_in_render(&self, previous: &Document) -> bool {
if std::sync::Arc::ptr_eq(&self.render, &previous.render) || self.render == previous.render || self.render.validate().is_err() {
return false;
}
let mut normalized = previous.clone();
normalized.render = self.render.clone();
*self == normalized
}

/// The colour a body is shown and exported in (sRGB as 0–1 fractions): its appearance,
/// else its component's, else its material's look, else the colour it was imported with.
/// (Faces may have their own: `face_looks`.)
Expand Down
10 changes: 8 additions & 2 deletions crates/doc/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,18 @@
//! The saved visibility can also list hidden assembly joints (`visibility.hidden_joints`,
//! joint ids): their glyphs aren't drawn, but they still constrain and drive the parts. A
//! design without it shows every joint, as it always did; 0.10.0 would show them all.
//! - 21: named render setups (`render: {setups: {name: setup}}`): renderer-independent render
//! intent (camera, resolution, exposure, environment). Version 20 designs need no
//! transformation (an absent field means no setups, and empty render state is not saved); the
//! version stamp makes 0.11.0 (which reads up to 20) ask for an update instead of silently
//! dropping saved setups.

use serde_json::Value;

use crate::{DocError, Document, Result};

/// The format this build writes.
pub const FORMAT: u32 = 20;
pub const FORMAT: u32 = 21;

pub fn format_string(n: u32) -> String {
format!("solidcraft/{n}")
Expand All @@ -176,7 +181,7 @@ pub fn version_of(s: &str) -> Option<u32> {

/// JSON-level upgrades: entry `i` turns format `i + 1` into `i + 2`.
type JsonStep = fn(&mut Value) -> Result<()>;
const JSON_STEPS: [JsonStep; 19] = [
const JSON_STEPS: [JsonStep; 20] = [
|_| Ok(()),
v2_to_v3,
v3_to_v4,
Expand All @@ -196,6 +201,7 @@ const JSON_STEPS: [JsonStep; 19] = [
|_| Ok(()),
|_| Ok(()),
|_| Ok(()),
|_| Ok(()),
];

/// Stored face and edge names were worked out from geometry before format 14; they get the
Expand Down
1 change: 1 addition & 0 deletions crates/doc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub use profile_refs::{capture_profile_selection, profile_selection_indices};
pub mod plastic;
pub mod project;
mod project3d;
pub mod render_settings;
pub use project3d::iso_grid;
pub mod sheet;

Expand Down
Loading
Loading