Type check and coerce arguments to user functions and return values from std Rust functions (#6958)

* Shuffle around function call code

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Refactor function calls to share more code

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Hack to leave the result of revolve as a singleton rather than array

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-19 16:50:15 +12:00
committed by GitHub
parent f3e9d110c0
commit b19acd550d
197 changed files with 13837 additions and 14317 deletions

View File

@ -17,11 +17,12 @@ use kittycad_modeling_cmds::{self as kcmc};
use uuid::Uuid;
use super::args::TyF64;
#[cfg(feature = "artifact-graph")]
use crate::execution::ArtifactId;
use crate::{
errors::{KclError, KclErrorDetails},
execution::{types::RuntimeType, ExecState, ExtrudeSurface, GeoMeta, KclValue, Path, Sketch, SketchSurface, Solid},
execution::{
types::RuntimeType, ArtifactId, ExecState, ExtrudeSurface, GeoMeta, KclValue, Path, Sketch, SketchSurface,
Solid,
},
parsing::ast::types::TagNode,
std::Args,
};
@ -210,7 +211,6 @@ async fn inner_extrude(
solids.push(
do_post_extrude(
sketch,
#[cfg(feature = "artifact-graph")]
id.into(),
length.clone(),
false,
@ -238,7 +238,7 @@ pub(crate) struct NamedCapTags<'a> {
#[allow(clippy::too_many_arguments)]
pub(crate) async fn do_post_extrude<'a>(
sketch: &Sketch,
#[cfg(feature = "artifact-graph")] solid_id: ArtifactId,
solid_id: ArtifactId,
length: TyF64,
sectional: bool,
named_cap_tags: &'a NamedCapTags<'a>,
@ -431,7 +431,6 @@ pub(crate) async fn do_post_extrude<'a>(
// that we passed in to the function, but it's actually the id of the
// sketch.
id: sketch.id,
#[cfg(feature = "artifact-graph")]
artifact_id: solid_id,
value: new_value,
meta: sketch.meta.clone(),