Skip to content

Commit

Permalink
Turn SetObjectTransform into list of transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamaan476 committed Jan 7, 2025
2 parents 88c7b23 + d87e394 commit 1d8682e
Show file tree
Hide file tree
Showing 27 changed files with 780 additions and 258 deletions.
188 changes: 118 additions & 70 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ kittycad-modeling-cmds-macros = { path = "modeling-cmds-macros", version = "0.1.
kittycad-modeling-cmds-macros-impl = { path = "modeling-cmds-macros-impl", version = "0.1.12" }
kittycad-modeling-session = { path = "modeling-session", version = "0.1.2" }
proc-macro2 = "1.0.92"
quote = "1.0.37"
syn = "2.0.90"
quote = "1.0.38"
syn = "2.0.95"

[profile.bench]
debug = true
4 changes: 2 additions & 2 deletions bumper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.94"
anyhow = "1.0.95"
clap = { version = "4.5.23", features = ["derive"] }
semver = "1.0.24"
serde = "1.0.216"
serde = "1.0.217"
toml_edit = "0.22.16"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion modeling-cmds-macros-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ quote = { workspace = true }
syn = { workspace = true, features = ["extra-traits", "full"] }

[dev-dependencies]
anyhow = "1.0.94"
anyhow = "1.0.95"
criterion = { version = "0.5", features = ["html_reports"] }
insta = "1.41.1"
regex = "1.11.1"
Expand Down
4 changes: 3 additions & 1 deletion modeling-cmds-macros-impl/src/modeling_cmd_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ pub fn generate(input: ItemMod) -> TokenStream {
/// Definition of each modeling command.
#input
/// Commands that the KittyCAD engine can execute.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "derive-jsonschema-on-enums", derive(schemars::JsonSchema))]
#[serde(rename_all = "snake_case", tag = "type")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub enum ModelingCmd {#(
#[doc = #docs]
Expand Down
2 changes: 1 addition & 1 deletion modeling-cmds-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ syn = { workspace = true, features = ["extra-traits", "full"] }
proc-macro = true

[dev-dependencies]
anyhow = "1.0.94"
anyhow = "1.0.95"
insta = "1.41.1"
regex = "1.11.1"
rustfmt-wrapper = "0.2.1"
Expand Down
14 changes: 10 additions & 4 deletions 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.83"
version = "0.2.86"
edition = "2021"
authors = ["KittyCAD, Inc."]
description = "Commands in the KittyCAD Modeling API"
Expand All @@ -11,7 +11,7 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.94"
anyhow = "1.0.95"
chrono = "0.4.39"
cxx = { version = "1.0", optional = true }
data-encoding = "2.5.0"
Expand All @@ -31,11 +31,16 @@ schemars = { version = "0.8.16", features = [
"url",
"uuid1",
] }
serde = { version = "1.0.216", features = ["derive"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_bytes = "0.11.15"
serde_json = { version = "1.0.133", optional = true }
serde_json = { version = "1.0.134", optional = true }
slog = { version = "2.7.0", optional = true }
tabled = { version = "0.17", optional = true }
ts-rs = { version = "10.1.0", optional = true, features = [
"uuid-impl",
"no-serde-warnings",
"serde-json-impl",
] }
uuid = { version = "1.11.0", features = ["serde", "v4", "js"] }
webrtc = { version = "0.11", optional = true }

Expand All @@ -46,6 +51,7 @@ workspace = true
default = []
derive-jsonschema-on-enums = []
tabled = ["dep:tabled"]
ts-rs = ["dep:ts-rs"]
slog = ["dep:slog"]
cxx = ["dep:cxx"]
convert_client_crate = ["dep:kittycad"]
Expand Down
8 changes: 8 additions & 0 deletions modeling-cmds/src/coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
#[serde(rename_all = "snake_case")]
#[display(style = "snake_case")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub enum Axis {
/// 'Y' axis.
Y = 1,
Expand All @@ -21,6 +23,8 @@ pub enum Axis {
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
#[serde(rename_all = "snake_case")]
#[display(style = "snake_case")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub enum Direction {
/// Increasing numbers.
Positive = 1,
Expand All @@ -42,6 +46,8 @@ impl std::ops::Mul for Direction {
/// An [`Axis`] paired with a [`Direction`].
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
#[display("({axis}, {direction})")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub struct AxisDirectionPair {
/// Axis specifier.
pub axis: Axis,
Expand All @@ -59,6 +65,8 @@ pub struct AxisDirectionPair {
/// [cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1)
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)]
#[display("forward: {forward}, up: {up}")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub struct System {
/// Axis the front face of a model looks along.
pub forward: AxisDirectionPair,
Expand Down
Loading

0 comments on commit 1d8682e

Please sign in to comment.