From fdf99fd8d7a5fcde789dea225f6693ada8e7183f Mon Sep 17 00:00:00 2001 From: Katie Macaulay Date: Thu, 16 Jan 2025 10:37:14 +0000 Subject: [PATCH] Add input co-ordinates to STEP import options --- modeling-cmds/src/format/step.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modeling-cmds/src/format/step.rs b/modeling-cmds/src/format/step.rs index 1f6d61dc..ee7284c0 100644 --- a/modeling-cmds/src/format/step.rs +++ b/modeling-cmds/src/format/step.rs @@ -9,17 +9,33 @@ pub mod import { use super::*; /// Options for importing STEP format. - #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] - #[display("split_closed_faces: {split_closed_faces}")] + #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] + #[display("coords: {coords}, split_closed_faces: {split_closed_faces}")] #[serde(default, rename = "StepImportOptions")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { + /// Co-ordinate system of input data. + /// + /// Defaults to the [KittyCAD co-ordinate system]. + /// + /// [KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html + pub coords: coord::System, + /// Splits all closed faces into two open faces. /// /// Defaults to `false` but is implicitly `true` when importing into the engine. pub split_closed_faces: bool, } + + impl Default for Options { + fn default() -> Self { + Self { + coords: *coord::KITTYCAD, + split_closed_faces: false, + } + } + } } /// Export models in STEP format.