diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index a346ee1b..1db50248 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -8804,6 +8804,15 @@ } ] }, + "schema": { + "description": "STEP application protocol schema. Defaults to AP242.", + "default": "ap242", + "allOf": [ + { + "$ref": "#/components/schemas/StepSchema" + } + ] + }, "type": { "type": "string", "enum": [ @@ -9807,6 +9816,32 @@ } ] }, + "StepSchema": { + "description": "Specifies the STEP application protocol schema for export.", + "oneOf": [ + { + "description": "AP203 edition 2.", + "type": "string", + "enum": [ + "ap203" + ] + }, + { + "description": "AP214.", + "type": "string", + "enum": [ + "ap214" + ] + }, + { + "description": "AP242.\n\nThis is the default setting.", + "type": "string", + "enum": [ + "ap242" + ] + } + ] + }, "StlStorage": { "description": "Export storage.", "oneOf": [ diff --git a/modeling-cmds/src/format/mod.rs b/modeling-cmds/src/format/mod.rs index db3d575c..21fcec7d 100644 --- a/modeling-cmds/src/format/mod.rs +++ b/modeling-cmds/src/format/mod.rs @@ -362,6 +362,7 @@ impl OutputFormat3d { created: None, units: src_unit, presentation: step::export::Presentation::Pretty, + ..Default::default() }), FileExportFormat::Stl => Self::Stl(stl::export::Options { storage: stl::export::Storage::Ascii, diff --git a/modeling-cmds/src/format/step.rs b/modeling-cmds/src/format/step.rs index c0804c14..d642ebe5 100644 --- a/modeling-cmds/src/format/step.rs +++ b/modeling-cmds/src/format/step.rs @@ -89,6 +89,35 @@ pub mod export { use super::*; use crate::units::UnitLength; + /// Specifies the STEP application protocol schema for export. + #[derive( + Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, + )] + #[display(style = "snake_case")] + #[serde(rename = "StepSchema", rename_all = "snake_case")] + #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + #[cfg_attr( + feature = "python", + pyo3_stub_gen::derive::gen_stub_pyclass_enum, + pyo3::pyclass(name = "StepSchema", from_py_object) + )] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub enum Schema { + /// AP203 edition 2. + Ap203, + + /// AP214. + Ap214, + + /// AP242. + /// + /// This is the default setting. + #[default] + Ap242, + } + /// Describes the presentation style of the EXPRESS exchange format. #[derive( Default, Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, @@ -148,6 +177,10 @@ pub mod export { /// Presentation style. #[builder(default = default_presentation())] pub presentation: Presentation, + + /// STEP application protocol schema. Defaults to AP242. + #[builder(default)] + pub schema: Schema, } #[cfg(feature = "python")] @@ -168,6 +201,7 @@ pub mod export { created: None, units: default_units(), presentation: default_presentation(), + schema: Schema::default(), } } }