Skip to content

Commit 3ec6888

Browse files
authored
New endpoint TwistExtrude
1 parent 2a94185 commit 3ec6888

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,38 @@ define_modeling_cmd_enum! {
125125
pub opposite: Opposite<LengthUnit>,
126126
}
127127

128+
fn default_twist_extrude_section_interval() -> Angle {
129+
Angle::from_degrees(15.0)
130+
}
131+
132+
/// Command for twist extruding a solid 2d.
133+
#[derive(
134+
Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
135+
)]
136+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
137+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
138+
pub struct TwistExtrude {
139+
/// Which sketch to extrude.
140+
/// Must be a closed 2D solid.
141+
pub target: ModelingCmdId,
142+
/// How far off the plane to extrude
143+
pub distance: LengthUnit,
144+
/// Which IDs should the new faces have?
145+
/// If this isn't given, the engine will generate IDs.
146+
#[serde(default)]
147+
pub faces: Option<ExtrudedFaceInfo>,
148+
/// Center to twist about (relative to 2D sketch)
149+
#[serde(default)]
150+
pub center_2d: Point2d<f64>,
151+
/// Total rotation of the section
152+
pub total_rotation_angle: Angle,
153+
///Angle step interval (converted to whole number degrees and bounded between 4° and 90°)
154+
#[serde(default = "default_twist_extrude_section_interval")]
155+
pub angle_step_size: Angle,
156+
///The twisted surface loft tolerance
157+
pub tolerance: LengthUnit,
158+
}
159+
128160
/// Extrude the object along a path.
129161
#[derive(
130162
Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant,

modeling-cmds/src/ok_response.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ define_ok_modeling_cmd_response_enum! {
4949
pub struct Extrude {
5050
}
5151

52+
/// The response from the `TwistExtrude` endpoint.
53+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
54+
pub struct TwistExtrude {
55+
}
56+
5257
/// The response from the `Sweep` endpoint.
5358
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
5459
pub struct Sweep {

0 commit comments

Comments
 (0)