kittycad_modeling_cmds/format/
obj.rs1use bon::Builder;
2use schemars::JsonSchema;
3use serde::{Deserialize, Serialize};
4
5use crate::{coord, units::UnitLength};
6
7pub mod import {
9 use super::*;
10
11 #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)]
13 #[serde(rename = "ObjImportOptions")]
14 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
15 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
16 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
17 #[cfg_attr(
18 feature = "python",
19 pyo3_stub_gen::derive::gen_stub_pyclass,
20 pyo3::pyclass(name = "ObjImportOptions")
21 )]
22 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
23 pub struct Options {
24 #[builder(default = *coord::KITTYCAD)]
30 pub coords: coord::System,
31
32 #[builder(default = UnitLength::Millimeters)]
39 pub units: UnitLength,
40 }
41
42 #[cfg(feature = "python")]
43 #[pyo3_stub_gen::derive::gen_stub_pymethods]
44 #[pyo3::pymethods]
45 impl Options {
46 #[new]
47 pub fn new() -> Self {
49 Default::default()
50 }
51 }
52
53 impl Default for Options {
54 fn default() -> Self {
55 Self {
56 coords: *coord::KITTYCAD,
57 units: UnitLength::Millimeters,
58 }
59 }
60 }
61}
62
63pub mod export {
65 use super::*;
66
67 #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Builder)]
69 #[serde(rename = "ObjExportOptions")]
70 #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
71 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
72 #[cfg_attr(
73 feature = "python",
74 pyo3_stub_gen::derive::gen_stub_pyclass,
75 pyo3::pyclass(name = "ObjExportOptions")
76 )]
77 #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
78 #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
79 pub struct Options {
80 #[builder(default = *coord::KITTYCAD)]
86 pub coords: coord::System,
87
88 #[builder(default = UnitLength::Millimeters)]
92 pub units: UnitLength,
93 }
94
95 #[cfg(feature = "python")]
96 #[pyo3_stub_gen::derive::gen_stub_pymethods]
97 #[pyo3::pymethods]
98 impl Options {
99 #[new]
100 pub fn new() -> Self {
102 Default::default()
103 }
104 }
105
106 impl Default for Options {
107 fn default() -> Self {
108 Self {
109 coords: *coord::KITTYCAD,
110 units: UnitLength::Millimeters,
111 }
112 }
113 }
114}