diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 9da7e7ff..5796fbee 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1045,6 +1045,34 @@ define_modeling_cmd_enum! { pub curve_id: Uuid, } + /// Project an entity on to a plane. + #[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 ProjectEntityToPlane { + /// Which entity to project (vertex or edge). + pub entity_id: Uuid, + /// Which plane to project entity_id onto. + pub plane_id: Uuid, + /// If true: the projected points are returned in the plane_id's coordinate system, + /// else: the projected points are returned in the world coordinate system. + pub use_plane_coords: bool, + } + + /// Project a list of points on to a plane. + #[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 ProjectPointsToPlane { + /// The id of the plane used for the projection. + pub plane_id: Uuid, + /// The list of points that will be projected. + pub points: Vec>, + /// If true: the projected points are returned in the plane_id's coordinate sysetm. + /// else: the projected points are returned in the world coordinate system. + pub use_plane_coords: bool, + } + /// Enum containing the variety of image formats snapshots may be exported to. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)] #[serde(rename_all = "snake_case")] diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 5b95d450..b51d1096 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -500,6 +500,20 @@ define_ok_modeling_cmd_response_enum! { pub control_points: Vec>, } + /// The response from the `ProjectEntityToPlane` command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct ProjectEntityToPlane { + /// Projected points. + pub projected_points: Vec>, + } + + /// The response from the `ProjectPointsToPlane` command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct ProjectPointsToPlane { + /// Projected points. + pub projected_points: Vec>, + } + /// The response from the `CurveGetType` command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, Eq, PartialEq, ModelingCmdOutput)] pub struct CurveGetType {