From 89d8533424ecc0163c282e135214b11260240ebe Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Thu, 19 Sep 2024 17:04:45 -0700 Subject: [PATCH] updates Signed-off-by: Jess Frazelle --- Cargo.lock | 278 +++++++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 5 +- src/lib.rs | 125 ++++++++++++++---------- 3 files changed, 289 insertions(+), 119 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ed24c1..0eb3288 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,13 +73,19 @@ dependencies = [ "backtrace", ] +[[package]] +name = "approx" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" + [[package]] name = "approx" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -189,7 +195,7 @@ dependencies = [ "libm", "num-bigint", "num-integer", - "num-traits", + "num-traits 0.2.19", "serde", ] @@ -237,19 +243,19 @@ dependencies = [ [[package]] name = "bson" -version = "2.11.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a88e82b9106923b5c4d6edfca9e7db958d4e98a478ec115022e81b9b38e2c8" +checksum = "068208f2b6fcfa27a7f1ee37488d2bb8ba2640f68f5475d08e1d9130696aba59" dependencies = [ "ahash", "base64 0.13.1", "bitvec", "chrono", "hex", - "indexmap 2.2.6", + "indexmap 2.5.0", "js-sys", "once_cell", - "rand", + "rand 0.8.5", "serde", "serde_bytes", "serde_json", @@ -302,6 +308,18 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cgmath" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4b57c8f4e3a2e9ac07e0f6abc9c24b6fc9e1b54c3478cfb598f3d0023e51c" +dependencies = [ + "approx 0.1.1", + "mint", + "num-traits 0.1.43", + "rand 0.4.6", +] + [[package]] name = "chrono" version = "0.4.38" @@ -311,7 +329,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits", + "num-traits 0.2.19", "serde", "wasm-bindgen", "windows-targets 0.52.5", @@ -445,9 +463,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", "crossbeam-utils", @@ -497,9 +515,9 @@ dependencies = [ [[package]] name = "derive-docs" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6d3f12f7b5600d3ee788eccd1eff60af70b35ee8188146f6d9cdab27e39f87" +checksum = "0f01937b7b4c59463ee93c31ad1afcedfdd13783f3ee2f72cce5549f8fba790e" dependencies = [ "Inflector", "convert_case", @@ -565,6 +583,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-iterator" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c280b9e6b3ae19e152d8e31cf47f18389781e119d4013a2a2bb0180e5facc635" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -581,6 +619,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "euler" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f19d11568a4a46aee488bdab3a2963e5e2c3cfd6091aa0abceaddcea82c0bc1" +dependencies = [ + "approx 0.1.1", + "cgmath", +] + [[package]] name = "fastrand" version = "2.1.0" @@ -649,6 +697,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + [[package]] name = "funty" version = "2.0.0" @@ -815,7 +869,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -995,7 +1049,7 @@ checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", "byteorder-lite", - "num-traits", + "num-traits 0.2.19", "png", ] @@ -1011,12 +1065,13 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", + "serde", ] [[package]] @@ -1084,19 +1139,19 @@ dependencies = [ [[package]] name = "kcl-lib" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab16bfd2d240f1eb091af8e80ce018cfd379196c2fe6f16e161cec728559a4df" +checksum = "dd84b54a9e59fac58975dc5dfc49d112671dfba20f9f7898d4d249d70c0784a7" dependencies = [ "anyhow", - "approx", + "approx 0.5.1", "async-recursion", "async-trait", "base64 0.22.1", "bson", "chrono", "convert_case", - "dashmap 6.0.1", + "dashmap 6.1.0", "databake", "derive-docs", "form_urlencoded", @@ -1105,8 +1160,10 @@ dependencies = [ "gltf-json", "http 0.2.12", "image", + "indexmap 2.5.0", "js-sys", "kittycad", + "kittycad-modeling-cmds", "lazy_static", "measurements", "mime_guess", @@ -1131,15 +1188,15 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winnow 0.5.40", + "winnow", "zip", ] [[package]] name = "kittycad" -version = "0.3.18" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94feea5b1cf851b33dd108aa35aa01bde99772aa74d2ba1590295aac0b7ca33e" +checksum = "b6d94d74f88582f566f81fa443c638439f5d7b7eeb80d4c321f64703310a45da" dependencies = [ "anyhow", "async-trait", @@ -1156,7 +1213,7 @@ dependencies = [ "mime_guess", "parse-display", "phonenumber", - "rand", + "rand 0.8.5", "reqwest", "reqwest-conditional-middleware", "reqwest-middleware", @@ -1174,6 +1231,54 @@ dependencies = [ "uuid", ] +[[package]] +name = "kittycad-modeling-cmds" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee900033a5804ca2354f0760478e851a0ab04d32b38a9117d0bd4f87a8867110" +dependencies = [ + "anyhow", + "chrono", + "data-encoding", + "enum-iterator", + "enum-iterator-derive", + "euler", + "http 0.2.12", + "kittycad-modeling-cmds-macros", + "kittycad-unit-conversion-derive", + "measurements", + "parse-display", + "parse-display-derive", + "schemars", + "serde", + "serde_bytes", + "serde_json", + "uuid", +] + +[[package]] +name = "kittycad-modeling-cmds-macros" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cdc505a33bfffb87c317435ec41ced8f73474217cf30db685e479bf289757e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "kittycad-unit-conversion-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7001c46a92c1edce6722a3900539b198230980799035f02d92b4e7df3fc08738" +dependencies = [ + "inflections", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1307,6 +1412,12 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + [[package]] name = "mio" version = "1.0.1" @@ -1353,7 +1464,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ "num-integer", - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -1368,7 +1479,16 @@ version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits", + "num-traits 0.2.19", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.19", ] [[package]] @@ -1460,7 +1580,7 @@ dependencies = [ "lazy_static", "percent-encoding", "pin-project", - "rand", + "rand 0.8.5", "thiserror", ] @@ -1659,18 +1779,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433" +checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225" dependencies = [ "cfg-if", "indoc", @@ -1687,9 +1807,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8" +checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3" dependencies = [ "once_cell", "target-lexicon", @@ -1697,9 +1817,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6" +checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c" dependencies = [ "libc", "pyo3-build-config", @@ -1707,9 +1827,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206" +checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1719,9 +1839,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372" +checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1" dependencies = [ "heck", "proc-macro2", @@ -1754,6 +1874,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + [[package]] name = "rand" version = "0.8.5" @@ -1762,7 +1895,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1772,9 +1905,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -1784,6 +1932,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -1972,7 +2129,7 @@ checksum = "e09bbcb5003282bcb688f0bae741b278e9c7e8f378f561522c9806c58e075d9b" dependencies = [ "anyhow", "chrono", - "rand", + "rand 0.8.5", ] [[package]] @@ -2046,9 +2203,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.2", @@ -2203,9 +2360,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -2238,7 +2395,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", "memchr", "ryu", @@ -2448,6 +2605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", + "quote", "unicode-ident", ] @@ -2680,9 +2838,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", @@ -2734,11 +2892,11 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -2904,9 +3062,9 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -2914,7 +3072,7 @@ dependencies = [ "http 1.1.0", "httparse", "log", - "rand", + "rand 0.8.5", "rustls 0.23.10", "rustls-pki-types", "sha1", @@ -3363,15 +3521,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.18" @@ -3445,18 +3594,19 @@ dependencies = [ "crc32fast", "crossbeam-utils", "displaydoc", - "indexmap 2.2.6", + "indexmap 2.5.0", "memchr", "thiserror", ] [[package]] name = "zoo-kcl" -version = "0.1.32" +version = "0.1.33" dependencies = [ "anyhow", "kcl-lib", "kittycad", + "kittycad-modeling-cmds", "pyo3", "reqwest", "serde", diff --git a/Cargo.toml b/Cargo.toml index ea9b1a4..bed8f0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zoo-kcl" -version = "0.1.32" +version = "0.1.33" edition = "2021" repository = "https://github.com/kittycad/kcl.py" @@ -11,8 +11,9 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1.0.89" -kcl-lib = { version = "0.2.13", features = ["pyo3", "disable-println"] } +kcl-lib = { version = "0.2.16", features = ["pyo3", "disable-println"] } kittycad = "0.3.18" +kittycad-modeling-cmds = "0.2.59" pyo3 = { version = "0.22.2", features = ["serde", "experimental-async"] } reqwest = "0.11.0" serde = "1.0.210" diff --git a/src/lib.rs b/src/lib.rs index d5d8715..4da8238 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,11 +27,11 @@ pub enum ImageFormat { Jpeg, } -impl From for kittycad::types::ImageFormat { +impl From for kittycad_modeling_cmds::ImageFormat { fn from(format: ImageFormat) -> Self { match format { - ImageFormat::Png => kittycad::types::ImageFormat::Png, - ImageFormat::Jpeg => kittycad::types::ImageFormat::Jpeg, + ImageFormat::Png => kittycad_modeling_cmds::ImageFormat::Png, + ImageFormat::Jpeg => kittycad_modeling_cmds::ImageFormat::Jpeg, } } } @@ -46,8 +46,8 @@ pub struct ExportFile { pub name: String, } -impl From for ExportFile { - fn from(file: kittycad::types::ExportFile) -> Self { +impl From for ExportFile { + fn from(file: kittycad_modeling_cmds::shared::ExportFile) -> Self { ExportFile { contents: file.contents.0, name: file.name, @@ -55,8 +55,8 @@ impl From for ExportFile { } } -impl From for ExportFile { - fn from(file: kittycad::types::RawFile) -> Self { +impl From for ExportFile { + fn from(file: kittycad_modeling_cmds::websocket::RawFile) -> Self { ExportFile { contents: file.contents, name: file.name, @@ -114,53 +114,71 @@ pub enum FileExportFormat { fn get_output_format( format: &FileExportFormat, - src_unit: kittycad::types::UnitLength, -) -> kittycad::types::OutputFormat { + src_unit: kittycad_modeling_cmds::units::UnitLength, +) -> kittycad_modeling_cmds::format::OutputFormat { // Zoo co-ordinate system. // // * Forward: -Y // * Up: +Z // * Handedness: Right - let coords = kittycad::types::System { - forward: kittycad::types::AxisDirectionPair { - axis: kittycad::types::Axis::Y, - direction: kittycad::types::Direction::Negative, + let coords = kittycad_modeling_cmds::coord::System { + forward: kittycad_modeling_cmds::coord::AxisDirectionPair { + axis: kittycad_modeling_cmds::coord::Axis::Y, + direction: kittycad_modeling_cmds::coord::Direction::Negative, }, - up: kittycad::types::AxisDirectionPair { - axis: kittycad::types::Axis::Z, - direction: kittycad::types::Direction::Positive, + up: kittycad_modeling_cmds::coord::AxisDirectionPair { + axis: kittycad_modeling_cmds::coord::Axis::Z, + direction: kittycad_modeling_cmds::coord::Direction::Positive, }, }; match format { - FileExportFormat::Fbx => kittycad::types::OutputFormat::Fbx { - storage: kittycad::types::FbxStorage::Binary, - }, - FileExportFormat::Glb => kittycad::types::OutputFormat::Gltf { - storage: kittycad::types::GltfStorage::Binary, - presentation: kittycad::types::GltfPresentation::Compact, - }, - FileExportFormat::Gltf => kittycad::types::OutputFormat::Gltf { - storage: kittycad::types::GltfStorage::Embedded, - presentation: kittycad::types::GltfPresentation::Pretty, - }, - FileExportFormat::Obj => kittycad::types::OutputFormat::Obj { - coords, - units: src_unit, - }, - FileExportFormat::Ply => kittycad::types::OutputFormat::Ply { - storage: kittycad::types::PlyStorage::Ascii, - coords, - selection: kittycad::types::Selection::DefaultScene {}, - units: src_unit, - }, - FileExportFormat::Step => kittycad::types::OutputFormat::Step { coords }, - FileExportFormat::Stl => kittycad::types::OutputFormat::Stl { - storage: kittycad::types::StlStorage::Ascii, - coords, - units: src_unit, - selection: kittycad::types::Selection::DefaultScene {}, - }, + FileExportFormat::Fbx => { + kittycad_modeling_cmds::format::OutputFormat::Fbx(kittycad_modeling_cmds::format::fbx::export::Options { + storage: kittycad_modeling_cmds::format::fbx::export::Storage::Binary, + created: None, + }) + } + FileExportFormat::Glb => { + kittycad_modeling_cmds::format::OutputFormat::Gltf(kittycad_modeling_cmds::format::gltf::export::Options { + storage: kittycad_modeling_cmds::format::gltf::export::Storage::Binary, + presentation: kittycad_modeling_cmds::format::gltf::export::Presentation::Compact, + }) + } + FileExportFormat::Gltf => { + kittycad_modeling_cmds::format::OutputFormat::Gltf(kittycad_modeling_cmds::format::gltf::export::Options { + storage: kittycad_modeling_cmds::format::gltf::export::Storage::Embedded, + presentation: kittycad_modeling_cmds::format::gltf::export::Presentation::Pretty, + }) + } + FileExportFormat::Obj => { + kittycad_modeling_cmds::format::OutputFormat::Obj(kittycad_modeling_cmds::format::obj::export::Options { + coords, + units: src_unit, + }) + } + FileExportFormat::Ply => { + kittycad_modeling_cmds::format::OutputFormat::Ply(kittycad_modeling_cmds::format::ply::export::Options { + storage: kittycad_modeling_cmds::format::ply::export::Storage::Ascii, + coords, + selection: kittycad_modeling_cmds::format::Selection::DefaultScene, + units: src_unit, + }) + } + FileExportFormat::Step => { + kittycad_modeling_cmds::format::OutputFormat::Step(kittycad_modeling_cmds::format::step::export::Options { + coords, + created: None, + }) + } + FileExportFormat::Stl => { + kittycad_modeling_cmds::format::OutputFormat::Stl(kittycad_modeling_cmds::format::stl::export::Options { + storage: kittycad_modeling_cmds::format::stl::export::Storage::Ascii, + coords, + units: src_unit, + selection: kittycad_modeling_cmds::format::Selection::DefaultScene, + }) + } } } @@ -242,10 +260,11 @@ async fn execute_and_snapshot(code: String, units: UnitLength, image_format: Ima .send_modeling_cmd( uuid::Uuid::new_v4(), kcl_lib::executor::SourceRange::default(), - kittycad::types::ModelingCmd::ZoomToFit { + kittycad_modeling_cmds::ModelingCmd::ZoomToFit(kittycad_modeling_cmds::ZoomToFit { object_ids: Default::default(), padding: 0.1, - }, + animated: false, + }), ) .await?; @@ -255,14 +274,14 @@ async fn execute_and_snapshot(code: String, units: UnitLength, image_format: Ima .send_modeling_cmd( uuid::Uuid::new_v4(), kcl_lib::executor::SourceRange::default(), - kittycad::types::ModelingCmd::TakeSnapshot { + kittycad_modeling_cmds::ModelingCmd::TakeSnapshot(kittycad_modeling_cmds::TakeSnapshot { format: image_format.into(), - }, + }), ) .await?; - let kittycad::types::OkWebSocketResponseData::Modeling { - modeling_response: kittycad::types::OkModelingCmdResponse::TakeSnapshot { data }, + let kittycad_modeling_cmds::websocket::OkWebSocketResponseData::Modeling { + modeling_response: kittycad_modeling_cmds::ok_response::OkModelingCmdResponse::TakeSnapshot(data), } = resp else { return Err(pyo3::exceptions::PyException::new_err(format!( @@ -301,14 +320,14 @@ async fn execute_and_export( .send_modeling_cmd( uuid::Uuid::new_v4(), kcl_lib::executor::SourceRange::default(), - kittycad::types::ModelingCmd::Export { + kittycad_modeling_cmds::ModelingCmd::Export(kittycad_modeling_cmds::Export { entity_ids: vec![], format: get_output_format(&export_format, units.into()), - }, + }), ) .await?; - let kittycad::types::OkWebSocketResponseData::Export { files } = resp else { + let kittycad_modeling_cmds::websocket::OkWebSocketResponseData::Export { files } = resp else { return Err(pyo3::exceptions::PyException::new_err(format!( "Unexpected response from engine: {:?}", resp