Skip to content

Commit 7b07b1d

Browse files
authored
Add SetGridScale endpoint (#891)
Part of KittyCAD/engine#3494
1 parent 3fda25b commit 7b07b1d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,23 @@ define_modeling_cmd_enum! {
16811681
pub reference_id: Uuid,
16821682
}
16831683

1684+
/// Set the scale of the grid lines in the video feed.
1685+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1686+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1687+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1688+
pub struct SetGridScale {
1689+
/// Distance between grid lines represents this much distance.
1690+
pub value: f32,
1691+
/// Which units the `value` field uses.
1692+
pub units: units::UnitLength,
1693+
}
1694+
/// Set the grid lines to auto scale. The grid will get larger the further you zoom out,
1695+
/// and smaller the more you zoom in.
1696+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
1697+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1698+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1699+
pub struct SetGridAutoScale {
1700+
}
16841701
}
16851702
}
16861703

modeling-cmds/src/ok_response.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,5 +940,12 @@ define_ok_modeling_cmd_response_enum! {
940940
pub extra_solid_ids: Vec<Uuid>,
941941
}
942942

943+
/// The response from the 'SetGridScale'.
944+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
945+
pub struct SetGridScale {}
946+
947+
/// The response from the 'SetGridScale'.
948+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
949+
pub struct SetGridAutoScale {}
943950
}
944951
}

0 commit comments

Comments
 (0)