From 1c0fea9da643333c2d003d9a4ea819c929385555 Mon Sep 17 00:00:00 2001 From: Adam Chalmers Date: Sat, 26 Jul 2025 11:52:51 -0500 Subject: [PATCH] New wireframe modeling command Part of https://github.com/KittyCAD/modeling-app/issues/7907 --- modeling-cmds/src/def_enum.rs | 16 ++++++++++++++++ modeling-cmds/src/ok_response.rs | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 381891ea..57996773 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1726,6 +1726,7 @@ define_modeling_cmd_enum! { /// Which units the `value` field uses. pub units: units::UnitLength, } + /// Set the grid lines to auto scale. The grid will get larger the further you zoom out, /// and smaller the more you zoom in. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] @@ -1733,6 +1734,21 @@ define_modeling_cmd_enum! { #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct SetGridAutoScale { } + + /// Set the grid lines to auto scale. The grid will get larger the further you zoom out, + /// and smaller the more you zoom in. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct Wireframe { + /// Which object to render in wireframe. + pub object_id: Uuid, + /// Enable wireframe or not + pub wireframe: bool, + /// Show the mesh wires too + pub mesh_wires: bool, + } + } } diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 90bdba92..b585ca2b 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -952,5 +952,9 @@ define_ok_modeling_cmd_response_enum! { /// The response from the 'SetGridScale'. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct SetGridAutoScale {} + + /// The response from the 'Wireframe'. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct Wireframe {} } }