change to index map, re-fmt, and fillet face id (#3926)
* change to index map, re-fmt, and fillet face id Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
16
src/wasm-lib/Cargo.lock
generated
16
src/wasm-lib/Cargo.lock
generated
@ -264,7 +264,7 @@ dependencies = [
|
|||||||
"bitvec",
|
"bitvec",
|
||||||
"chrono",
|
"chrono",
|
||||||
"hex",
|
"hex",
|
||||||
"indexmap 2.2.5",
|
"indexmap 2.5.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
@ -1067,7 +1067,7 @@ dependencies = [
|
|||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"indexmap 2.2.5",
|
"indexmap 2.5.0",
|
||||||
"slab",
|
"slab",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
@ -1293,12 +1293,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.2.5"
|
version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4"
|
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.14.3",
|
"hashbrown 0.14.3",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1422,6 +1423,7 @@ dependencies = [
|
|||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
"iai",
|
"iai",
|
||||||
"image",
|
"image",
|
||||||
|
"indexmap 2.5.0",
|
||||||
"insta",
|
"insta",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
@ -2740,7 +2742,7 @@ version = "1.0.128"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
|
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.2.5",
|
"indexmap 2.5.0",
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
"ryu",
|
"ryu",
|
||||||
@ -3268,7 +3270,7 @@ version = "0.22.20"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
|
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.2.5",
|
"indexmap 2.5.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_spanned",
|
"serde_spanned",
|
||||||
"toml_datetime",
|
"toml_datetime",
|
||||||
@ -4035,6 +4037,6 @@ dependencies = [
|
|||||||
"crc32fast",
|
"crc32fast",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"indexmap 2.2.5",
|
"indexmap 2.5.0",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
@ -27,6 +27,7 @@ git_rev = "0.1.0"
|
|||||||
gltf-json = "1.4.1"
|
gltf-json = "1.4.1"
|
||||||
http = { workspace = true }
|
http = { workspace = true }
|
||||||
image = { version = "0.25.1", default-features = false, features = ["png"] }
|
image = { version = "0.25.1", default-features = false, features = ["png"] }
|
||||||
|
indexmap = { version = "2.5.0", features = ["serde"] }
|
||||||
kittycad = { workspace = true }
|
kittycad = { workspace = true }
|
||||||
kittycad-modeling-cmds = { workspace = true }
|
kittycad-modeling-cmds = { workspace = true }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
each_cmd as mcmd, ok_response::OkModelingCmdResponse, shared::PathCommand, websocket::OkWebSocketResponseData,
|
||||||
use kcmc::shared::PathCommand;
|
ModelingCmd,
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
};
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
//! Functions for setting up our WebSocket and WebRTC connections for communications with the
|
//! Functions for setting up our WebSocket and WebRTC connections for communications with the
|
||||||
//! engine.
|
//! engine.
|
||||||
|
|
||||||
use std::{
|
use std::sync::{Arc, Mutex};
|
||||||
collections::HashMap,
|
|
||||||
sync::{Arc, Mutex},
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use futures::{SinkExt, StreamExt};
|
use futures::{SinkExt, StreamExt};
|
||||||
use kcmc::websocket::{
|
use indexmap::IndexMap;
|
||||||
|
use kcmc::{
|
||||||
|
websocket::{
|
||||||
BatchResponse, FailureWebSocketResponse, ModelingCmdReq, ModelingSessionData, OkWebSocketResponseData,
|
BatchResponse, FailureWebSocketResponse, ModelingCmdReq, ModelingSessionData, OkWebSocketResponseData,
|
||||||
SuccessWebSocketResponse, WebSocketRequest, WebSocketResponse,
|
SuccessWebSocketResponse, WebSocketRequest, WebSocketResponse,
|
||||||
|
},
|
||||||
|
ModelingCmd,
|
||||||
};
|
};
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use tokio::sync::{mpsc, oneshot, RwLock};
|
use tokio::sync::{mpsc, oneshot, RwLock};
|
||||||
use tokio_tungstenite::tungstenite::Message as WsMsg;
|
use tokio_tungstenite::tungstenite::Message as WsMsg;
|
||||||
@ -39,7 +39,7 @@ pub struct EngineConnection {
|
|||||||
tcp_read_handle: Arc<TcpReadHandle>,
|
tcp_read_handle: Arc<TcpReadHandle>,
|
||||||
socket_health: Arc<Mutex<SocketHealth>>,
|
socket_health: Arc<Mutex<SocketHealth>>,
|
||||||
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
batch_end: Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch_end: Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
|
|
||||||
/// The default planes for the scene.
|
/// The default planes for the scene.
|
||||||
default_planes: Arc<RwLock<Option<DefaultPlanes>>>,
|
default_planes: Arc<RwLock<Option<DefaultPlanes>>>,
|
||||||
@ -269,7 +269,7 @@ impl EngineConnection {
|
|||||||
responses,
|
responses,
|
||||||
socket_health,
|
socket_health,
|
||||||
batch: Arc::new(Mutex::new(Vec::new())),
|
batch: Arc::new(Mutex::new(Vec::new())),
|
||||||
batch_end: Arc::new(Mutex::new(HashMap::new())),
|
batch_end: Arc::new(Mutex::new(IndexMap::new())),
|
||||||
default_planes: Default::default(),
|
default_planes: Default::default(),
|
||||||
session_data,
|
session_data,
|
||||||
})
|
})
|
||||||
@ -282,7 +282,7 @@ impl EngineManager for EngineConnection {
|
|||||||
self.batch.clone()
|
self.batch.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn batch_end(&self) -> Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
fn batch_end(&self) -> Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
||||||
self.batch_end.clone()
|
self.batch_end.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,10 +7,13 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
use indexmap::IndexMap;
|
||||||
use kcmc::websocket::{
|
use kcmc::{
|
||||||
|
ok_response::OkModelingCmdResponse,
|
||||||
|
websocket::{
|
||||||
BatchResponse, ModelingBatch, OkWebSocketResponseData, SuccessWebSocketResponse, WebSocketRequest,
|
BatchResponse, ModelingBatch, OkWebSocketResponseData, SuccessWebSocketResponse, WebSocketRequest,
|
||||||
WebSocketResponse,
|
WebSocketResponse,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use kittycad_modeling_cmds::{self as kcmc};
|
use kittycad_modeling_cmds::{self as kcmc};
|
||||||
|
|
||||||
@ -19,14 +22,14 @@ use crate::{errors::KclError, executor::DefaultPlanes};
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct EngineConnection {
|
pub struct EngineConnection {
|
||||||
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
batch_end: Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch_end: Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EngineConnection {
|
impl EngineConnection {
|
||||||
pub async fn new() -> Result<EngineConnection> {
|
pub async fn new() -> Result<EngineConnection> {
|
||||||
Ok(EngineConnection {
|
Ok(EngineConnection {
|
||||||
batch: Arc::new(Mutex::new(Vec::new())),
|
batch: Arc::new(Mutex::new(Vec::new())),
|
||||||
batch_end: Arc::new(Mutex::new(HashMap::new())),
|
batch_end: Arc::new(Mutex::new(IndexMap::new())),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +40,7 @@ impl crate::engine::EngineManager for EngineConnection {
|
|||||||
self.batch.clone()
|
self.batch.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn batch_end(&self) -> Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
fn batch_end(&self) -> Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
||||||
self.batch_end.clone()
|
self.batch_end.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use indexmap::IndexMap;
|
||||||
use kcmc::websocket::{WebSocketRequest, WebSocketResponse};
|
use kcmc::websocket::{WebSocketRequest, WebSocketResponse};
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
@ -43,7 +44,7 @@ extern "C" {
|
|||||||
pub struct EngineConnection {
|
pub struct EngineConnection {
|
||||||
manager: Arc<EngineCommandManager>,
|
manager: Arc<EngineCommandManager>,
|
||||||
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch: Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
batch_end: Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
batch_end: Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Safety: WebAssembly will only ever run in a single-threaded context.
|
// Safety: WebAssembly will only ever run in a single-threaded context.
|
||||||
@ -55,7 +56,7 @@ impl EngineConnection {
|
|||||||
Ok(EngineConnection {
|
Ok(EngineConnection {
|
||||||
manager: Arc::new(manager),
|
manager: Arc::new(manager),
|
||||||
batch: Arc::new(Mutex::new(Vec::new())),
|
batch: Arc::new(Mutex::new(Vec::new())),
|
||||||
batch_end: Arc::new(Mutex::new(HashMap::new())),
|
batch_end: Arc::new(Mutex::new(IndexMap::new())),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +67,7 @@ impl crate::engine::EngineManager for EngineConnection {
|
|||||||
self.batch.clone()
|
self.batch.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn batch_end(&self) -> Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
fn batch_end(&self) -> Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>> {
|
||||||
self.batch_end.clone()
|
self.batch_end.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,15 +13,18 @@ use std::{
|
|||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
use kcmc::each_cmd as mcmd;
|
use indexmap::IndexMap;
|
||||||
use kcmc::length_unit::LengthUnit;
|
use kcmc::{
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
each_cmd as mcmd,
|
||||||
use kcmc::shared::Color;
|
length_unit::LengthUnit,
|
||||||
use kcmc::websocket::ModelingBatch;
|
ok_response::OkModelingCmdResponse,
|
||||||
use kcmc::websocket::{
|
shared::Color,
|
||||||
BatchResponse, ModelingCmdReq, ModelingSessionData, OkWebSocketResponseData, WebSocketRequest, WebSocketResponse,
|
websocket::{
|
||||||
|
BatchResponse, ModelingBatch, ModelingCmdReq, ModelingSessionData, OkWebSocketResponseData, WebSocketRequest,
|
||||||
|
WebSocketResponse,
|
||||||
|
},
|
||||||
|
ModelingCmd,
|
||||||
};
|
};
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -44,7 +47,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
|
|||||||
fn batch(&self) -> Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>;
|
fn batch(&self) -> Arc<Mutex<Vec<(WebSocketRequest, crate::executor::SourceRange)>>>;
|
||||||
|
|
||||||
/// Get the batch of end commands to be sent to the engine.
|
/// Get the batch of end commands to be sent to the engine.
|
||||||
fn batch_end(&self) -> Arc<Mutex<HashMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>;
|
fn batch_end(&self) -> Arc<Mutex<IndexMap<uuid::Uuid, (WebSocketRequest, crate::executor::SourceRange)>>>;
|
||||||
|
|
||||||
/// Get the default planes.
|
/// Get the default planes.
|
||||||
async fn default_planes(
|
async fn default_planes(
|
||||||
|
@ -4,10 +4,12 @@ use std::{collections::HashMap, sync::Arc};
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use async_recursion::async_recursion;
|
use async_recursion::async_recursion;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{
|
||||||
use kcmc::ok_response::{output::TakeSnapshot, OkModelingCmdResponse};
|
each_cmd as mcmd,
|
||||||
use kcmc::websocket::{ModelingSessionData, OkWebSocketResponseData};
|
ok_response::{output::TakeSnapshot, OkModelingCmdResponse},
|
||||||
use kcmc::{ImageFormat, ModelingCmd};
|
websocket::{ModelingSessionData, OkWebSocketResponseData},
|
||||||
|
ImageFormat, ModelingCmd,
|
||||||
|
};
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use kittycad_modeling_cmds::length_unit::LengthUnit;
|
use kittycad_modeling_cmds::length_unit::LengthUnit;
|
||||||
use parse_display::{Display, FromStr};
|
use parse_display::{Display, FromStr};
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
use std::any::type_name;
|
use std::any::type_name;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
use kcmc::{websocket::OkWebSocketResponseData, ModelingCmd};
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
||||||
@ -166,7 +165,7 @@ impl Args {
|
|||||||
// before what ever we call next.
|
// before what ever we call next.
|
||||||
for id in ids {
|
for id in ids {
|
||||||
// Pop it off the batch_end and add it to the batch.
|
// Pop it off the batch_end and add it to the batch.
|
||||||
let Some(item) = self.ctx.engine.batch_end().lock().unwrap().remove(&id) else {
|
let Some(item) = self.ctx.engine.batch_end().lock().unwrap().shift_remove(&id) else {
|
||||||
// It might be in the batch already.
|
// It might be in the batch already.
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
|
|
||||||
|
use super::{args::FromArgs, Args, FnAsArg};
|
||||||
use crate::{
|
use crate::{
|
||||||
errors::{KclError, KclErrorDetails},
|
errors::{KclError, KclErrorDetails},
|
||||||
executor::{ExecState, KclValue, SketchGroup, SourceRange, UserVal},
|
executor::{ExecState, KclValue, SketchGroup, SourceRange, UserVal},
|
||||||
function_param::FunctionParam,
|
function_param::FunctionParam,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{args::FromArgs, Args, FnAsArg};
|
|
||||||
|
|
||||||
/// For each item in an array, update a value.
|
/// For each item in an array, update a value.
|
||||||
pub async fn array_reduce(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
pub async fn array_reduce(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||||
let (array, start, f): (Vec<u64>, SketchGroup, FnAsArg<'_>) = FromArgs::from_args(&args, 0)?;
|
let (array, start, f): (Vec<u64>, SketchGroup, FnAsArg<'_>) = FromArgs::from_args(&args, 0)?;
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::CutType, ModelingCmd};
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::{shared::CutType, ModelingCmd};
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -146,6 +144,9 @@ async fn inner_chamfer(
|
|||||||
radius: LengthUnit(data.length),
|
radius: LengthUnit(data.length),
|
||||||
tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future.
|
tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future.
|
||||||
cut_type: CutType::Chamfer,
|
cut_type: CutType::Chamfer,
|
||||||
|
// We pass in the command id as the face id.
|
||||||
|
// So the resulting face of the fillet will be the same.
|
||||||
|
// This is because that's how most other endpoints work.
|
||||||
face_id: Some(id),
|
face_id: Some(id),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
@ -4,11 +4,10 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{
|
||||||
use kcmc::length_unit::LengthUnit;
|
each_cmd as mcmd, length_unit::LengthUnit, ok_response::OkModelingCmdResponse, output::ExtrusionFaceInfo,
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
shared::ExtrusionFaceCapType, websocket::OkWebSocketResponseData, ModelingCmd,
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
};
|
||||||
use kcmc::{output::ExtrusionFaceInfo, shared::ExtrusionFaceCapType, ModelingCmd};
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{
|
||||||
use kcmc::length_unit::LengthUnit;
|
each_cmd as mcmd, length_unit::LengthUnit, ok_response::OkModelingCmdResponse, shared::CutType,
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
websocket::OkWebSocketResponseData, ModelingCmd,
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
};
|
||||||
use kcmc::{shared::CutType, ModelingCmd};
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@ -150,7 +149,10 @@ async fn inner_fillet(
|
|||||||
radius: LengthUnit(data.radius),
|
radius: LengthUnit(data.radius),
|
||||||
tolerance: LengthUnit(data.tolerance.unwrap_or(default_tolerance(&args.ctx.settings.units))),
|
tolerance: LengthUnit(data.tolerance.unwrap_or(default_tolerance(&args.ctx.settings.units))),
|
||||||
cut_type: CutType::Fillet,
|
cut_type: CutType::Fillet,
|
||||||
face_id: None,
|
// We pass in the command id as the face id.
|
||||||
|
// So the resulting face of the fillet will be the same.
|
||||||
|
// This is because that's how most other endpoints work.
|
||||||
|
face_id: Some(id),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@ -164,7 +166,7 @@ async fn inner_fillet(
|
|||||||
|
|
||||||
if let Some(ref tag) = tag {
|
if let Some(ref tag) = tag {
|
||||||
extrude_group.value.push(ExtrudeSurface::Fillet(FilletSurface {
|
extrude_group.value.push(ExtrudeSurface::Fillet(FilletSurface {
|
||||||
face_id: edge_id,
|
face_id: id,
|
||||||
tag: Some(tag.clone()),
|
tag: Some(tag.clone()),
|
||||||
geo_meta: GeoMeta {
|
geo_meta: GeoMeta {
|
||||||
id,
|
id,
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Angle, ModelingCmd};
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::shared::Angle;
|
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -4,14 +4,16 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::coord::{Axis, AxisDirectionPair, Direction, System};
|
use kcmc::{
|
||||||
use kcmc::each_cmd as mcmd;
|
coord::{Axis, AxisDirectionPair, Direction, System},
|
||||||
use kcmc::format::InputFormat;
|
each_cmd as mcmd,
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
format::InputFormat,
|
||||||
use kcmc::shared::FileImportFormat;
|
ok_response::OkModelingCmdResponse,
|
||||||
use kcmc::units::UnitLength;
|
shared::FileImportFormat,
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
units::UnitLength,
|
||||||
use kcmc::{ImportFile, ModelingCmd};
|
websocket::OkWebSocketResponseData,
|
||||||
|
ImportFile, ModelingCmd,
|
||||||
|
};
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, ModelingCmd};
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{
|
||||||
use kcmc::length_unit::LengthUnit;
|
each_cmd as mcmd, length_unit::LengthUnit, ok_response::OkModelingCmdResponse, shared::Transform,
|
||||||
use kcmc::ok_response::OkModelingCmdResponse;
|
websocket::OkWebSocketResponseData, ModelingCmd,
|
||||||
use kcmc::shared::Transform;
|
};
|
||||||
use kcmc::websocket::OkWebSocketResponseData;
|
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds::{self as kcmc};
|
use kittycad_modeling_cmds::{self as kcmc};
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Angle, ModelingCmd};
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::shared::Angle;
|
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds::{self as kcmc};
|
use kittycad_modeling_cmds::{self as kcmc};
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, ModelingCmd};
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -4,11 +4,8 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use derive_docs::stdlib;
|
use derive_docs::stdlib;
|
||||||
use kcmc::each_cmd as mcmd;
|
|
||||||
use kcmc::length_unit::LengthUnit;
|
|
||||||
use kcmc::shared::Angle;
|
|
||||||
use kcmc::shared::Point2d as KPoint2d; // Point2d is already defined in this pkg, to impl ts_rs traits.
|
use kcmc::shared::Point2d as KPoint2d; // Point2d is already defined in this pkg, to impl ts_rs traits.
|
||||||
use kcmc::ModelingCmd;
|
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Angle, ModelingCmd};
|
||||||
use kittycad_modeling_cmds as kcmc;
|
use kittycad_modeling_cmds as kcmc;
|
||||||
use kittycad_modeling_cmds::shared::PathSegment;
|
use kittycad_modeling_cmds::shared::PathSegment;
|
||||||
use parse_display::{Display, FromStr};
|
use parse_display::{Display, FromStr};
|
||||||
|
@ -3,9 +3,7 @@ use kcl_lib::{
|
|||||||
ast::{modify::modify_ast_for_sketch, types::Program},
|
ast::{modify::modify_ast_for_sketch, types::Program},
|
||||||
executor::{ExecutorContext, KclValue, PlaneType, SketchGroup, SourceRange},
|
executor::{ExecutorContext, KclValue, PlaneType, SketchGroup, SourceRange},
|
||||||
};
|
};
|
||||||
use kittycad_modeling_cmds::shared::Point3d;
|
use kittycad_modeling_cmds::{each_cmd as mcmd, length_unit::LengthUnit, shared::Point3d, ModelingCmd};
|
||||||
use kittycad_modeling_cmds::ModelingCmd;
|
|
||||||
use kittycad_modeling_cmds::{each_cmd as mcmd, length_unit::LengthUnit};
|
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
/// Setup the engine and parse code for an ast.
|
/// Setup the engine and parse code for an ast.
|
||||||
|
Reference in New Issue
Block a user