Skip to content

Commit bb25784

Browse files
authored
Add coordinate flag for sweeps (#885)
* Add coordinate flag for sweeps Part of KittyCAD/engine#3115 * Rename XYPlane to SketchPlane
1 parent 8c9bf4a commit bb25784

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ define_modeling_cmd_enum! {
2424
shared::{
2525
Angle,
2626
ComponentTransform,
27+
RelativeTo,
2728
CutType,
2829
CutStrategy,
2930
CameraMovement,
@@ -140,6 +141,9 @@ define_modeling_cmd_enum! {
140141
pub sectional: bool,
141142
/// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero).
142143
pub tolerance: LengthUnit,
144+
/// What is this sweep relative to?
145+
#[serde(default)]
146+
pub relative_to: RelativeTo,
143147
}
144148

145149
/// Command for revolving a solid 2d.

modeling-cmds/src/shared.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,3 +1152,16 @@ pub enum CutStrategy {
11521152
#[default]
11531153
Automatic,
11541154
}
1155+
1156+
/// What is the given geometry relative to?
1157+
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)]
1158+
#[serde(rename_all = "snake_case")]
1159+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1160+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1161+
pub enum RelativeTo {
1162+
/// Local/relative to a position centered within the plane being sketched on
1163+
#[default]
1164+
SketchPlane,
1165+
/// Local/relative to the trajectory curve
1166+
TrajectoryCurve,
1167+
}

0 commit comments

Comments
 (0)