Design properties: project, author and licence in the design, its exports and inspect_design (#1015) (#1189)

A design carries metadata (format 21): project, part number, revision, author, organization, description and license, plus other tools' data under reverse-DNS keys, kept as written. Edited in the Design Properties window (Document Settings), set by document.metadata.set, reported by inspect_design, and written into STEP, IGES and 3MF where the format has a place for them. Translated, with tests.
This commit is contained in:
Lasse Lian authored and GitHub committed 2026-10-14 18:25:35 -04:00
1 parent 78079587ad
commit a4a8b48567
33 files changed
+1106 -21

No files matched your search

+8 -1
View File
@@ -1130,8 +1130,15 @@ mod tests {
doc.param_comments.insert("test".into(), "metadata".into());
let setup = solidcraft_doc::render_settings::RenderSetup { exposure_ev: 1.5, ..Default::default() };
std::sync::Arc::make_mut(&mut doc.render).setups.insert("Studio".into(), setup);
// Design properties and other tools' data (#1015), kept as they are in both forms.
doc.metadata = serde_json::from_value(json!({
"author": 42,
"revision": "B",
"com.acme.description": {"shop_id": 88123, "list": [1, 2.5, null, true, "x", {"deep": []}]},
}))
.unwrap();
let expected = crate::read_design(&crate::write_design(&doc)).unwrap();
assert_eq!(expected.render, doc.render);
assert_eq!(expected, doc);
assert_eq!(crate::read_design(&write_design_container(&doc).unwrap()).unwrap(), expected);
}