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:
@ -59,10 +59,7 @@ async fn inner_clone(
|
||||
let mut new_sketch = sketch.clone();
|
||||
new_sketch.id = new_id;
|
||||
new_sketch.original_id = new_id;
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
{
|
||||
new_sketch.artifact_id = new_id.into();
|
||||
}
|
||||
new_sketch.artifact_id = new_id.into();
|
||||
GeometryWithImportedGeometry::Sketch(new_sketch)
|
||||
}
|
||||
GeometryWithImportedGeometry::Solid(solid) => {
|
||||
@ -72,10 +69,7 @@ async fn inner_clone(
|
||||
let mut new_solid = solid.clone();
|
||||
new_solid.id = new_id;
|
||||
new_solid.sketch.original_id = new_id;
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
{
|
||||
new_solid.artifact_id = new_id.into();
|
||||
}
|
||||
new_solid.artifact_id = new_id.into();
|
||||
GeometryWithImportedGeometry::Solid(new_solid)
|
||||
}
|
||||
};
|
||||
@ -118,10 +112,7 @@ async fn fix_tags_and_references(
|
||||
// Make the sketch id the new geometry id.
|
||||
solid.sketch.id = new_geometry_id;
|
||||
solid.sketch.original_id = new_geometry_id;
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
{
|
||||
solid.sketch.artifact_id = new_geometry_id.into();
|
||||
}
|
||||
solid.sketch.artifact_id = new_geometry_id.into();
|
||||
|
||||
fix_sketch_tags_and_references(&mut solid.sketch, &entity_id_map, exec_state).await?;
|
||||
|
||||
@ -148,7 +139,6 @@ async fn fix_tags_and_references(
|
||||
// information.
|
||||
let new_solid = do_post_extrude(
|
||||
&solid.sketch,
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
new_geometry_id.into(),
|
||||
crate::std::args::TyF64::new(
|
||||
solid.height,
|
||||
@ -332,10 +322,8 @@ clonedCube = clone(cube)
|
||||
|
||||
assert_ne!(cube.id, cloned_cube.id);
|
||||
assert_ne!(cube.original_id, cloned_cube.original_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.artifact_id, cloned_cube.artifact_id);
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_eq!(cloned_cube.artifact_id, cloned_cube.id.into());
|
||||
assert_eq!(cloned_cube.original_id, cloned_cube.id);
|
||||
|
||||
@ -384,12 +372,9 @@ clonedCube = clone(cube)
|
||||
assert_ne!(cube.id, cloned_cube.id);
|
||||
assert_ne!(cube.sketch.id, cloned_cube.sketch.id);
|
||||
assert_ne!(cube.sketch.original_id, cloned_cube.sketch.original_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.artifact_id, cloned_cube.artifact_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.sketch.artifact_id, cloned_cube.sketch.artifact_id);
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_eq!(cloned_cube.artifact_id, cloned_cube.id.into());
|
||||
|
||||
for (path, cloned_path) in cube.sketch.paths.iter().zip(cloned_cube.sketch.paths.iter()) {
|
||||
@ -501,12 +486,9 @@ clonedCube = clone(cube)
|
||||
assert_ne!(cube.id, cloned_cube.id);
|
||||
assert_ne!(cube.sketch.id, cloned_cube.sketch.id);
|
||||
assert_ne!(cube.sketch.original_id, cloned_cube.sketch.original_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.artifact_id, cloned_cube.artifact_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.sketch.artifact_id, cloned_cube.sketch.artifact_id);
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_eq!(cloned_cube.artifact_id, cloned_cube.id.into());
|
||||
|
||||
for (path, cloned_path) in cube.sketch.paths.iter().zip(cloned_cube.sketch.paths.iter()) {
|
||||
@ -576,12 +558,9 @@ clonedCube = clone(cube)
|
||||
assert_ne!(cube.id, cloned_cube.id);
|
||||
assert_ne!(cube.sketch.id, cloned_cube.sketch.id);
|
||||
assert_ne!(cube.sketch.original_id, cloned_cube.sketch.original_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.artifact_id, cloned_cube.artifact_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.sketch.artifact_id, cloned_cube.sketch.artifact_id);
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_eq!(cloned_cube.artifact_id, cloned_cube.id.into());
|
||||
|
||||
for (path, cloned_path) in cube.sketch.paths.iter().zip(cloned_cube.sketch.paths.iter()) {
|
||||
@ -679,12 +658,9 @@ clonedCube = clone(cube)
|
||||
assert_ne!(cube.id, cloned_cube.id);
|
||||
assert_ne!(cube.sketch.id, cloned_cube.sketch.id);
|
||||
assert_ne!(cube.sketch.original_id, cloned_cube.sketch.original_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.artifact_id, cloned_cube.artifact_id);
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_ne!(cube.sketch.artifact_id, cloned_cube.sketch.artifact_id);
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
assert_eq!(cloned_cube.artifact_id, cloned_cube.id.into());
|
||||
|
||||
for (value, cloned_value) in cube.value.iter().zip(cloned_cube.value.iter()) {
|
||||
|
Reference in New Issue
Block a user