diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index f0e76dc5..47510156 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -24,6 +24,7 @@ define_modeling_cmd_enum! { shared::{ Angle, ComponentTransform, + RelativeTo, CutType, CutStrategy, CameraMovement, @@ -140,6 +141,9 @@ define_modeling_cmd_enum! { pub sectional: bool, /// The maximum acceptable surface gap computed between the revolution surface joints. Must be positive (i.e. greater than zero). pub tolerance: LengthUnit, + /// What is this sweep relative to? + #[serde(default)] + pub relative_to: RelativeTo, } /// Command for revolving a solid 2d. diff --git a/modeling-cmds/src/shared.rs b/modeling-cmds/src/shared.rs index 14dd1484..ba82f5ff 100644 --- a/modeling-cmds/src/shared.rs +++ b/modeling-cmds/src/shared.rs @@ -1152,3 +1152,16 @@ pub enum CutStrategy { #[default] Automatic, } + +/// What is the given geometry relative to? +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] +#[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] +pub enum RelativeTo { + /// Local/relative to a position centered within the plane being sketched on + #[default] + SketchPlane, + /// Local/relative to the trajectory curve + TrajectoryCurve, +}