Skip to content

Commit 98be4bc

Browse files
gserena01gserena
andauthored
Serena/edge helix (#720)
* add helix from edge command * make length optional * remove response for helix functions --------- Co-authored-by: gserena <serena@zoo.dev>
1 parent 97cf326 commit 98be4bc

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,26 @@ define_modeling_cmd_enum! {
493493
pub axis: Point3d<f64>,
494494
}
495495

496+
/// Create a helix using the specified parameters.
497+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
498+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
499+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
500+
pub struct EntityMakeHelixFromEdge {
501+
/// Radius of the helix.
502+
pub radius: f64,
503+
/// Length of the helix. If None, the length of the edge will be used instead.
504+
pub length: Option<LengthUnit>,
505+
/// Number of revolutions.
506+
pub revolutions: f64,
507+
/// Start angle.
508+
#[serde(default)]
509+
pub start_angle: Angle,
510+
/// Is the helix rotation clockwise?
511+
pub is_clockwise: bool,
512+
/// Edge about which to make the helix.
513+
pub edge_id: Uuid,
514+
}
515+
496516
/// Mirror the input entities over the specified axis. (Currently only supports sketches)
497517
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
498518
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]

modeling-cmds/src/ok_response.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,16 @@ define_ok_modeling_cmd_response_enum! {
756756
/// The response from the `EntityMakeHelix` endpoint.
757757
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
758758
pub struct EntityMakeHelix {
759-
/// The UUID of the helix that was created.
760-
pub helix_id: Uuid
761759
}
762760

763761
/// The response from the `EntityMakeHelixFromParams` endpoint.
764762
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
765763
pub struct EntityMakeHelixFromParams {
766-
/// The UUID of the helix that was created.
767-
pub helix_id: Uuid
764+
}
765+
766+
/// The response from the `EntityMakeHelixFromEdge` endpoint.
767+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
768+
pub struct EntityMakeHelixFromEdge {
768769
}
769770

770771
/// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)

0 commit comments

Comments
 (0)