kittycad_modeling_cmds/format/
sldprt.rs

1/// Import functionality.
2pub mod import {
3
4    use parse_display::{Display, FromStr};
5    use schemars::JsonSchema;
6    use serde::{Deserialize, Serialize};
7
8    /// Options for importing SolidWorks parts.
9    #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
10    #[display("split_closed_faces: {split_closed_faces}")]
11    #[serde(default, rename = "SldprtImportOptions")]
12    #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
13    #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
14    #[cfg_attr(
15        feature = "python",
16        pyo3_stub_gen::derive::gen_stub_pyclass,
17        pyo3::pyclass(name = "SldprtImportOptions")
18    )]
19    pub struct Options {
20        /// Splits all closed faces into two open faces.
21        ///
22        /// Defaults to `false` but is implicitly `true` when importing into the engine.
23        pub split_closed_faces: bool,
24    }
25
26    #[cfg(feature = "python")]
27    #[pyo3_stub_gen::derive::gen_stub_pymethods]
28    #[pyo3::pymethods]
29    impl Options {
30        #[new]
31        /// Set the options to their defaults.
32        pub fn new() -> Self {
33            Default::default()
34        }
35    }
36}