Skip to content

Commit

Permalink
Add input co-ordinates to STEP import options
Browse files Browse the repository at this point in the history
  • Loading branch information
alteous committed Jan 23, 2025
1 parent e4a7772 commit fdf99fd
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions modeling-cmds/src/format/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fdf99fd

Please sign in to comment.