Skip to content

Commit 117ee9b

Browse files
gserena01gserena
andauthored
add helix from params endpoint (#678)
* add helix from params endpoint * remove angle default * remove extra newline --------- Co-authored-by: gserena <[email protected]>
1 parent 9eec0dc commit 117ee9b

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,35 @@ define_modeling_cmd_enum! {
403403
pub cylinder_id: Uuid,
404404
/// Number of revolutions.
405405
pub revolutions: f64,
406-
/// Start angle (in degrees).
406+
/// Start angle.
407+
#[serde(default)]
407408
pub start_angle: Angle,
408409
/// Is the helix rotation clockwise?
409410
pub is_clockwise: bool,
410411
/// Length of the helix.
411412
pub length: LengthUnit,
412413
}
413414

415+
/// Create a helix using the specified parameters.
416+
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
417+
pub struct EntityMakeHelixFromParams {
418+
/// Radius of the helix.
419+
pub radius: f64,
420+
/// Length of the helix.
421+
pub length: LengthUnit,
422+
/// Number of revolutions.
423+
pub revolutions: f64,
424+
/// Start angle.
425+
#[serde(default)]
426+
pub start_angle: Angle,
427+
/// Is the helix rotation clockwise?
428+
pub is_clockwise: bool,
429+
/// Center of the helix at the base of the helix.
430+
pub center: Point3d<LengthUnit>,
431+
/// Axis of the helix. The helix will be created around and in the direction of this axis.
432+
pub axis: Point3d<f64>,
433+
}
434+
414435
/// Mirror the input entities over the specified axis. (Currently only supports sketches)
415436
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
416437
pub struct EntityMirror {

modeling-cmds/src/ok_response.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ define_ok_modeling_cmd_response_enum! {
8989
pub struct EntityMakeHelix {
9090
}
9191

92+
/// The response from the `EntityMakeHelixFromParams` endpoint.
93+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
94+
pub struct EntityMakeHelixFromParams {
95+
}
96+
9297
/// The response from the `EntityMirror` endpoint.
9398
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
9499
pub struct EntityMirror {

0 commit comments

Comments
 (0)