Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Mesh leftovers from the ribbon redesign (#133) (#4471)

gsrunion4b42ef50c718
diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs
index d306870dce..ce03a9d1e5 100644
--- a/crates/engine/src/cmd/file.rs
+++ b/crates/engine/src/cmd/file.rs
@@ -50,7 +50,7 @@ pub static COMMANDS: &[CommandSpec] = &[
.noundo()
.params("path; format?: stl|stla|obj|step|3mf|3mf-tagged|urdf|json (default from extension; 3mf-tagged: 3MF whose triangles carry their B-rep face, at full precision, for meshing and analysis tools; docs/formats/3mf-face-tags.md; urdf: the whole assembly as a robot, with STL meshes written next to it; docs/urdf.md); bodies?: [names] (JSON and URDF export the complete design); urdf only: mesh_prefix? (before each mesh file name, e.g. package://robot/meshes/), effort? (default 1000), velocity? (default 10)"),
CommandSpec::new("file.save_mesh", "Save As Mesh", save_mesh)
- .at("MESH", "MODIFY")
+ .at("INSERT", "FILES")
.icon("mesh_export")
.noundo()
.params("path; format?: stl|3mf|3mf-tagged (default from the extension, else stl; 3mf-tagged: docs/formats/3mf-face-tags.md); bodies?: [names] (default: all); ascii?: bool (STL); slicer?: id, name or program path from file.slicers (open the saved file there)"),
diff --git a/crates/ui-egui/src/workspace.rs b/crates/ui-egui/src/workspace.rs
index 52ddc0e915..a2a4ae0465 100644
--- a/crates/ui-egui/src/workspace.rs
+++ b/crates/ui-egui/src/workspace.rs
@@ -643,6 +643,19 @@ mod tests {
}
}
+ /// The ribbon redesign (#2176) removed the MESH and UTILITIES tabs. A command that still
+ /// declares one is advertised at a place the ribbon cannot show, because the generated command
+ /// inventory prints the placement a spec declares (#133).
+ #[test]
+ fn no_command_is_advertised_at_a_tab_the_ribbon_removed() {
+ for c in solidcraft_engine::command_specs() {
+ assert!(!matches!(c.tab, "MESH" | "UTILITIES"), "{} declares the removed {} tab", c.id, c.tab);
+ }
+ let spec = solidcraft_engine::find_command("file.save_mesh").expect("file.save_mesh is registered");
+ assert_eq!((spec.tab, spec.panel), ("INSERT", "FILES"), "Save As Mesh declares the panel that shows it");
+ assert_eq!(destination(spec), Some(("INSERT", "FILES")));
+ }
+
#[test]
fn contextual_tabs_follow_the_active_body_and_allow_other_tabs() {
let mut h = crate::scenario::Harness::new();
diff --git a/docs/book/src/guide/files.md b/docs/book/src/guide/files.md
index 87b25f4dfd..093f53b59e 100644
--- a/docs/book/src/guide/files.md
+++ b/docs/book/src/guide/files.md
@@ -41,8 +41,8 @@ one mesh body, with all its volumes merged where the slicer placed them. Slicer-
slicer's metadata) is not read: modifier and negative volumes come in as ordinary solid geometry,
and objects without a name in the model itself are called Mesh1, Mesh2, …
-**File → Export STL…** and **File → Export 3MF…** (also on the Mesh tab under Modify as Save as
-mesh, and in the right-click menu of a body) open the same dialog with that format chosen; it saves
+**File → Export STL…** and **File → Export 3MF…** (also **Save As Mesh** on the Insert tab's Files
+panel, and in the right-click menu of a body) open the same dialog with that format chosen; it saves
the selected bodies as STL, 3MF or 3MF with face tags (below), and you can change the format there. With **Send to slicer** ticked, it writes the file to
a temporary folder and opens it in the chosen slicer instead of asking for a file name. The slicer
list shows the slicers found on the computer with their icons; **Custom…** adds any other program