Skip to content

Commit

Permalink
Add ProjectPointsToPlane
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamaan476 committed Jan 20, 2025
1 parent 2c488e0 commit 4ded8b5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ define_modeling_cmd_enum! {
}

/// Project an entity on to a plane.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, PartialEq)]
#[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 {
Expand All @@ -1057,7 +1057,20 @@ define_modeling_cmd_enum! {
/// 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", th(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<Point3d<f64>>,
/// 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.
Expand Down
7 changes: 7 additions & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,13 @@ define_ok_modeling_cmd_response_enum! {
pub projected_points: Vec<Point3d<f64>>,
}

/// The response from the `ProjectPointsToPlane` command.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct ProjectPointsToPlane {
/// Projected points.
pub projected_points: Vec<Point3d<f64>>,
}

/// The response from the `CurveGetType` command.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, Eq, PartialEq, ModelingCmdOutput)]
pub struct CurveGetType {
Expand Down

0 comments on commit 4ded8b5

Please sign in to comment.