Skip to content

Commit

Permalink
add helix from params endpoint (#678)
Browse files Browse the repository at this point in the history
* add helix from params endpoint

* remove angle default

* remove extra newline

---------

Co-authored-by: gserena <[email protected]>
  • Loading branch information
gserena01 and gserena authored Dec 17, 2024
1 parent 9eec0dc commit 117ee9b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
23 changes: 22 additions & 1 deletion modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,35 @@ define_modeling_cmd_enum! {
pub cylinder_id: Uuid,
/// Number of revolutions.
pub revolutions: f64,
/// Start angle (in degrees).
/// Start angle.
#[serde(default)]
pub start_angle: Angle,
/// Is the helix rotation clockwise?
pub is_clockwise: bool,
/// Length of the helix.
pub length: LengthUnit,
}

/// Create a helix using the specified parameters.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
pub struct EntityMakeHelixFromParams {
/// Radius of the helix.
pub radius: f64,
/// Length of the helix.
pub length: LengthUnit,
/// Number of revolutions.
pub revolutions: f64,
/// Start angle.
#[serde(default)]
pub start_angle: Angle,
/// Is the helix rotation clockwise?
pub is_clockwise: bool,
/// Center of the helix at the base of the helix.
pub center: Point3d<LengthUnit>,
/// Axis of the helix. The helix will be created around and in the direction of this axis.
pub axis: Point3d<f64>,
}

/// Mirror the input entities over the specified axis. (Currently only supports sketches)
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
pub struct EntityMirror {
Expand Down
5 changes: 5 additions & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ define_ok_modeling_cmd_response_enum! {
pub struct EntityMakeHelix {
}

/// The response from the `EntityMakeHelixFromParams` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct EntityMakeHelixFromParams {
}

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

0 comments on commit 117ee9b

Please sign in to comment.