Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modeling-cmds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kittycad-modeling-cmds"
version = "0.2.153"
version = "0.2.154"
edition = "2021"
authors = ["KittyCAD, Inc."]
description = "Commands in the KittyCAD Modeling API"
Expand Down
18 changes: 18 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,24 @@
"description": "ISO 10303-21 (STEP) format.",
"type": "object",
"properties": {
"coords": {
"description": "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html",
"default": {
"forward": {
"axis": "y",
"direction": "negative"
},
"up": {
"axis": "z",
"direction": "positive"
}
},
"allOf": [
{
"$ref": "#/components/schemas/System"
}
]
},
"split_closed_faces": {
"description": "Splits all closed faces into two open faces.\n\nDefaults to `false` but is implicitly `true` when importing into the engine.",
"default": false,
Expand Down
9 changes: 5 additions & 4 deletions modeling-cmds/src/convert_client_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mod format {
InputFormat3d::Sldprt(sldprt::import::Options { split_closed_faces }) => {
kt::InputFormat3D::Sldprt { split_closed_faces }
}
InputFormat3d::Step(step::import::Options { split_closed_faces }) => {
InputFormat3d::Step(step::import::Options { split_closed_faces, .. }) => {
kt::InputFormat3D::Step { split_closed_faces }
}
InputFormat3d::Stl(stl::import::Options { coords, units }) => kt::InputFormat3D::Stl {
Expand All @@ -171,9 +171,10 @@ mod format {
kt::InputFormat3D::Sldprt { split_closed_faces } => {
Self::Sldprt(crate::format::sldprt::import::Options { split_closed_faces })
}
kt::InputFormat3D::Step { split_closed_faces } => {
Self::Step(crate::format::step::import::Options { split_closed_faces })
}
kt::InputFormat3D::Step { split_closed_faces } => Self::Step(crate::format::step::import::Options {
split_closed_faces,
..Default::default()
}),
kt::InputFormat3D::Stl { coords, units } => Self::Stl(crate::format::stl::import::Options {
coords: coords.into(),
units: units.into(),
Expand Down
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,8 +9,8 @@ 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"))]
Expand All @@ -20,6 +20,13 @@ pub mod import {
pyo3::pyclass(name = "StepImportOptions")
)]
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.
Expand All @@ -36,6 +43,15 @@ pub mod import {
Default::default()
}
}

impl Default for Options {
fn default() -> Self {
Self {
coords: *coord::KITTYCAD,
split_closed_faces: false,
}
}
}
}

/// Export models in STEP format.
Expand Down
Loading