Skip to content

Commit f3f831a

Browse files
zoo-github-actions-auth[bot]github-actions[bot]
andauthoredFeb 8, 2025··
Update api spec (#682)
* YOYO NEW API SPEC! * I have generated the library! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1bb63a1 commit f3f831a

File tree

4 files changed

+348
-26
lines changed

4 files changed

+348
-26
lines changed
 

‎kittycad/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async-trait = { version = "^0.1.53", optional = true }
1414
base64 = "0.22"
1515
bigdecimal = { version = "0.4", features = ["serde"] }
1616
bytes = { version = "1", features = ["serde"] }
17-
clap = { version = "4.5.27", features = ["cargo", "derive", "env", "unicode"], optional = true }
17+
clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true }
1818
data-encoding = "^2.3.2"
1919
dirs = { version = "^5.0.1", optional = true }
2020
format_serde_error = { version = "^0.3.0", optional = true }
@@ -24,7 +24,7 @@ itertools = "0.13.0"
2424
log = { version = "^0.4", features = ["serde"], optional = true }
2525
mime_guess = "2.0.4"
2626
parse-display = "0.10.0"
27-
phonenumber = "0.3.7"
27+
phonenumber = "0.3.5"
2828
rand = { version = "0.8", optional = true }
2929
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
3030
reqwest-conditional-middleware = { version = "0.4", optional = true }

‎kittycad/src/types.rs

+106-10
Original file line numberDiff line numberDiff line change
@@ -7801,8 +7801,8 @@ pub enum InputFormat {
78017801
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
78027802
system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
78037803
coords: System,
7804-
#[doc = "The units of the input data. This is very important for correct scaling and when \
7805-
calculating physics properties like mass, etc.\n\nDefaults to meters."]
7804+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
7805+
when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
78067806
units: UnitLength,
78077807
},
78087808
#[doc = "The PLY Polygon File Format."]
@@ -7811,8 +7811,8 @@ pub enum InputFormat {
78117811
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
78127812
system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
78137813
coords: System,
7814-
#[doc = "The units of the input data. This is very important for correct scaling and when \
7815-
calculating physics properties like mass, etc."]
7814+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
7815+
when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
78167816
units: UnitLength,
78177817
},
78187818
#[doc = "SolidWorks part (SLDPRT) format."]
@@ -7837,8 +7837,8 @@ pub enum InputFormat {
78377837
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
78387838
system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
78397839
coords: System,
7840-
#[doc = "The units of the input data. This is very important for correct scaling and when \
7841-
calculating physics properties like mass, etc."]
7840+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
7841+
when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
78427842
units: UnitLength,
78437843
},
78447844
}
@@ -10605,6 +10605,28 @@ pub enum ModelingCmd {
1060510605
#[doc = "Which curve to query."]
1060610606
curve_id: uuid::Uuid,
1060710607
},
10608+
#[doc = "Project an entity on to a plane."]
10609+
#[serde(rename = "project_entity_to_plane")]
10610+
ProjectEntityToPlane {
10611+
#[doc = "Which entity to project (vertex or edge)."]
10612+
entity_id: uuid::Uuid,
10613+
#[doc = "Which plane to project entity_id onto."]
10614+
plane_id: uuid::Uuid,
10615+
#[doc = "If true: the projected points are returned in the plane_id's coordinate system, \
10616+
else: the projected points are returned in the world coordinate system."]
10617+
use_plane_coords: bool,
10618+
},
10619+
#[doc = "Project a list of points on to a plane."]
10620+
#[serde(rename = "project_points_to_plane")]
10621+
ProjectPointsToPlane {
10622+
#[doc = "The id of the plane used for the projection."]
10623+
plane_id: uuid::Uuid,
10624+
#[doc = "The list of points that will be projected."]
10625+
points: Vec<Point3D>,
10626+
#[doc = "If true: the projected points are returned in the plane_id's coordinate sysetm. \
10627+
else: the projected points are returned in the world coordinate system."]
10628+
use_plane_coords: bool,
10629+
},
1060810630
#[doc = "Take a snapshot of the current view."]
1060910631
#[serde(rename = "take_snapshot")]
1061010632
TakeSnapshot {
@@ -10721,7 +10743,9 @@ pub enum ModelingCmd {
1072110743
format: InputFormat,
1072210744
},
1072310745
#[doc = "Set the units of the scene. For all following commands, the units will be \
10724-
interpreted as the given units."]
10746+
interpreted as the given units. Any previously executed commands will not be \
10747+
affected or have their units changed. They will remain in the units they were \
10748+
originally executed in."]
1072510749
#[serde(rename = "set_scene_units")]
1072610750
SetSceneUnits {
1072710751
#[doc = "Which units the scene uses."]
@@ -11696,6 +11720,16 @@ pub enum OkModelingCmdResponse {
1169611720
#[doc = "The response from the `CurveGetControlPoints` command."]
1169711721
data: CurveGetControlPoints,
1169811722
},
11723+
#[serde(rename = "project_entity_to_plane")]
11724+
ProjectEntityToPlane {
11725+
#[doc = "The response from the `ProjectEntityToPlane` command."]
11726+
data: ProjectEntityToPlane,
11727+
},
11728+
#[serde(rename = "project_points_to_plane")]
11729+
ProjectPointsToPlane {
11730+
#[doc = "The response from the `ProjectPointsToPlane` command."]
11731+
data: ProjectPointsToPlane,
11732+
},
1169911733
#[serde(rename = "curve_get_type")]
1170011734
CurveGetType {
1170111735
#[doc = "The response from the `CurveGetType` command."]
@@ -12601,7 +12635,7 @@ pub enum OutputFormat {
1260112635
#[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate \
1260212636
system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
1260312637
coords: System,
12604-
#[doc = "Export length unit.\n\nDefaults to meters."]
12638+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1260512639
units: UnitLength,
1260612640
},
1260712641
#[doc = "The PLY Polygon File Format."]
@@ -12614,7 +12648,7 @@ pub enum OutputFormat {
1261412648
selection: Selection,
1261512649
#[doc = "The storage for the output PLY file."]
1261612650
storage: PlyStorage,
12617-
#[doc = "Export length unit.\n\nDefaults to meters."]
12651+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1261812652
units: UnitLength,
1261912653
},
1262012654
#[doc = "ISO 10303-21 (STEP) format."]
@@ -12634,7 +12668,7 @@ pub enum OutputFormat {
1263412668
selection: Selection,
1263512669
#[doc = "Export storage."]
1263612670
storage: StlStorage,
12637-
#[doc = "Export length unit.\n\nDefaults to meters."]
12671+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1263812672
units: UnitLength,
1263912673
},
1264012674
}
@@ -13586,6 +13620,68 @@ impl tabled::Tabled for PrivacySettings {
1358613620
}
1358713621
}
1358813622

13623+
#[doc = "The response from the `ProjectEntityToPlane` command."]
13624+
#[derive(
13625+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13626+
)]
13627+
pub struct ProjectEntityToPlane {
13628+
#[doc = "Projected points."]
13629+
pub projected_points: Vec<Point3D>,
13630+
}
13631+
13632+
impl std::fmt::Display for ProjectEntityToPlane {
13633+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13634+
write!(
13635+
f,
13636+
"{}",
13637+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13638+
)
13639+
}
13640+
}
13641+
13642+
#[cfg(feature = "tabled")]
13643+
impl tabled::Tabled for ProjectEntityToPlane {
13644+
const LENGTH: usize = 1;
13645+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13646+
vec![format!("{:?}", self.projected_points).into()]
13647+
}
13648+
13649+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13650+
vec!["projected_points".into()]
13651+
}
13652+
}
13653+
13654+
#[doc = "The response from the `ProjectPointsToPlane` command."]
13655+
#[derive(
13656+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13657+
)]
13658+
pub struct ProjectPointsToPlane {
13659+
#[doc = "Projected points."]
13660+
pub projected_points: Vec<Point3D>,
13661+
}
13662+
13663+
impl std::fmt::Display for ProjectPointsToPlane {
13664+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13665+
write!(
13666+
f,
13667+
"{}",
13668+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13669+
)
13670+
}
13671+
}
13672+
13673+
#[cfg(feature = "tabled")]
13674+
impl tabled::Tabled for ProjectPointsToPlane {
13675+
const LENGTH: usize = 1;
13676+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13677+
vec![format!("{:?}", self.projected_points).into()]
13678+
}
13679+
13680+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13681+
vec!["projected_points".into()]
13682+
}
13683+
}
13684+
1358913685
#[doc = "A raw file with unencoded contents to be passed over binary websockets. When raw files \
1359013686
come back for exports it is sent as binary/bson, not text/json."]
1359113687
#[derive(

‎openapitor/tests/types/kittycad.rs.gen

+99-7
Original file line numberDiff line numberDiff line change
@@ -7685,15 +7685,15 @@ pub enum InputFormat {
76857685
Obj {
76867686
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
76877687
coords: System,
7688-
#[doc = "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to meters."]
7688+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
76897689
units: UnitLength,
76907690
},
76917691
#[doc = "The PLY Polygon File Format."]
76927692
#[serde(rename = "ply")]
76937693
Ply {
76947694
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
76957695
coords: System,
7696-
#[doc = "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc."]
7696+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
76977697
units: UnitLength,
76987698
},
76997699
#[doc = "SolidWorks part (SLDPRT) format."]
@@ -7715,7 +7715,7 @@ pub enum InputFormat {
77157715
Stl {
77167716
#[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
77177717
coords: System,
7718-
#[doc = "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc."]
7718+
#[doc = "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
77197719
units: UnitLength,
77207720
},
77217721
}
@@ -10389,6 +10389,26 @@ pub enum ModelingCmd {
1038910389
#[doc = "Which curve to query."]
1039010390
curve_id: uuid::Uuid,
1039110391
},
10392+
#[doc = "Project an entity on to a plane."]
10393+
#[serde(rename = "project_entity_to_plane")]
10394+
ProjectEntityToPlane {
10395+
#[doc = "Which entity to project (vertex or edge)."]
10396+
entity_id: uuid::Uuid,
10397+
#[doc = "Which plane to project entity_id onto."]
10398+
plane_id: uuid::Uuid,
10399+
#[doc = "If true: the projected points are returned in the plane_id's coordinate system, else: the projected points are returned in the world coordinate system."]
10400+
use_plane_coords: bool,
10401+
},
10402+
#[doc = "Project a list of points on to a plane."]
10403+
#[serde(rename = "project_points_to_plane")]
10404+
ProjectPointsToPlane {
10405+
#[doc = "The id of the plane used for the projection."]
10406+
plane_id: uuid::Uuid,
10407+
#[doc = "The list of points that will be projected."]
10408+
points: Vec<Point3D>,
10409+
#[doc = "If true: the projected points are returned in the plane_id's coordinate sysetm. else: the projected points are returned in the world coordinate system."]
10410+
use_plane_coords: bool,
10411+
},
1039210412
#[doc = "Take a snapshot of the current view."]
1039310413
#[serde(rename = "take_snapshot")]
1039410414
TakeSnapshot {
@@ -10499,7 +10519,7 @@ pub enum ModelingCmd {
1049910519
#[doc = "Input file format."]
1050010520
format: InputFormat,
1050110521
},
10502-
#[doc = "Set the units of the scene. For all following commands, the units will be interpreted as the given units."]
10522+
#[doc = "Set the units of the scene. For all following commands, the units will be interpreted as the given units. Any previously executed commands will not be affected or have their units changed. They will remain in the units they were originally executed in."]
1050310523
#[serde(rename = "set_scene_units")]
1050410524
SetSceneUnits {
1050510525
#[doc = "Which units the scene uses."]
@@ -11447,6 +11467,16 @@ pub enum OkModelingCmdResponse {
1144711467
#[doc = "The response from the `CurveGetControlPoints` command."]
1144811468
data: CurveGetControlPoints,
1144911469
},
11470+
#[serde(rename = "project_entity_to_plane")]
11471+
ProjectEntityToPlane {
11472+
#[doc = "The response from the `ProjectEntityToPlane` command."]
11473+
data: ProjectEntityToPlane,
11474+
},
11475+
#[serde(rename = "project_points_to_plane")]
11476+
ProjectPointsToPlane {
11477+
#[doc = "The response from the `ProjectPointsToPlane` command."]
11478+
data: ProjectPointsToPlane,
11479+
},
1145011480
#[serde(rename = "curve_get_type")]
1145111481
CurveGetType {
1145211482
#[doc = "The response from the `CurveGetType` command."]
@@ -12336,7 +12366,7 @@ pub enum OutputFormat {
1233612366
Obj {
1233712367
#[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
1233812368
coords: System,
12339-
#[doc = "Export length unit.\n\nDefaults to meters."]
12369+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1234012370
units: UnitLength,
1234112371
},
1234212372
#[doc = "The PLY Polygon File Format."]
@@ -12348,7 +12378,7 @@ pub enum OutputFormat {
1234812378
selection: Selection,
1234912379
#[doc = "The storage for the output PLY file."]
1235012380
storage: PlyStorage,
12351-
#[doc = "Export length unit.\n\nDefaults to meters."]
12381+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1235212382
units: UnitLength,
1235312383
},
1235412384
#[doc = "ISO 10303-21 (STEP) format."]
@@ -12366,7 +12396,7 @@ pub enum OutputFormat {
1236612396
selection: Selection,
1236712397
#[doc = "Export storage."]
1236812398
storage: StlStorage,
12369-
#[doc = "Export length unit.\n\nDefaults to meters."]
12399+
#[doc = "Export length unit.\n\nDefaults to millimeters."]
1237012400
units: UnitLength,
1237112401
},
1237212402
}
@@ -13307,6 +13337,68 @@ impl tabled::Tabled for PrivacySettings {
1330713337
}
1330813338
}
1330913339

13340+
#[doc = "The response from the `ProjectEntityToPlane` command."]
13341+
#[derive(
13342+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13343+
)]
13344+
pub struct ProjectEntityToPlane {
13345+
#[doc = "Projected points."]
13346+
pub projected_points: Vec<Point3D>,
13347+
}
13348+
13349+
impl std::fmt::Display for ProjectEntityToPlane {
13350+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13351+
write!(
13352+
f,
13353+
"{}",
13354+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13355+
)
13356+
}
13357+
}
13358+
13359+
#[cfg(feature = "tabled")]
13360+
impl tabled::Tabled for ProjectEntityToPlane {
13361+
const LENGTH: usize = 1;
13362+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13363+
vec![format!("{:?}", self.projected_points).into()]
13364+
}
13365+
13366+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13367+
vec!["projected_points".into()]
13368+
}
13369+
}
13370+
13371+
#[doc = "The response from the `ProjectPointsToPlane` command."]
13372+
#[derive(
13373+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13374+
)]
13375+
pub struct ProjectPointsToPlane {
13376+
#[doc = "Projected points."]
13377+
pub projected_points: Vec<Point3D>,
13378+
}
13379+
13380+
impl std::fmt::Display for ProjectPointsToPlane {
13381+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13382+
write!(
13383+
f,
13384+
"{}",
13385+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13386+
)
13387+
}
13388+
}
13389+
13390+
#[cfg(feature = "tabled")]
13391+
impl tabled::Tabled for ProjectPointsToPlane {
13392+
const LENGTH: usize = 1;
13393+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13394+
vec![format!("{:?}", self.projected_points).into()]
13395+
}
13396+
13397+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13398+
vec!["projected_points".into()]
13399+
}
13400+
}
13401+
1331013402
#[doc = "A raw file with unencoded contents to be passed over binary websockets. When raw files come back for exports it is sent as binary/bson, not text/json."]
1331113403
#[derive(
1331213404
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,

0 commit comments

Comments
 (0)
Please sign in to comment.