renames sketch group/extrude group (#4016)
* renames Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> udpates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix parse Signed-off-by: Jess Frazelle <github@jessfraz.com> fix typos Signed-off-by: Jess Frazelle <github@jessfraz.com> docs Signed-off-by: Jess Frazelle <github@jessfraz.com> update tests Signed-off-by: Jess Frazelle <github@jessfraz.com> empty * fix; Signed-off-by: Jess Frazelle <github@jessfraz.com> * new Signed-off-by: Jess Frazelle <github@jessfraz.com> * add the types pages Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * Look at this (photo)Graph *in the voice of Nickelback* * empty * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -56,16 +56,16 @@ const bracketBody = bs
|
||||
|> fillet({
|
||||
radius: radius,
|
||||
tags: [
|
||||
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge7),
|
||||
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge2),
|
||||
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge3),
|
||||
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge6)
|
||||
getPreviousAdjacentEdge(bs.sketch.tags.edge7),
|
||||
getPreviousAdjacentEdge(bs.sketch.tags.edge2),
|
||||
getPreviousAdjacentEdge(bs.sketch.tags.edge3),
|
||||
getPreviousAdjacentEdge(bs.sketch.tags.edge6)
|
||||
]
|
||||
}, %)
|
||||
|
||||
|
||||
// sketch on the face
|
||||
const retBack = startSketchOn(bs, bs.sketchGroup.tags.edge4)
|
||||
const retBack = startSketchOn(bs, bs.sketch.tags.edge4)
|
||||
|> startProfileAt([length / 2 + thk, 0], %)
|
||||
|> line([0, thk], %)
|
||||
|> line([-thk, 0], %)
|
||||
|
@ -119,11 +119,11 @@ async fn kcl_test_execute_kittycad_svg() {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_member_expression_sketch_group() {
|
||||
let code = kcl_input!("member_expression_sketch_group");
|
||||
async fn kcl_test_member_expression_sketch() {
|
||||
let code = kcl_input!("member_expression_sketch");
|
||||
|
||||
let result = execute_and_snapshot(code, UnitLength::Mm).await.unwrap();
|
||||
assert_out("member_expression_sketch_group", &result);
|
||||
assert_out("member_expression_sketch", &result);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
@ -331,8 +331,8 @@ const thing = other_circle([2, 2], 20)
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_rounded_with_holes() {
|
||||
let code = r#"fn tarc = (to, sketchGroup, tag?) => {
|
||||
return tangentialArcTo(to, sketchGroup, tag)
|
||||
let code = r#"fn tarc = (to, sktch, tag?) => {
|
||||
return tangentialArcTo(to, sktch, tag)
|
||||
}
|
||||
|
||||
fn roundedRectangle = (pos, w, l, cornerRadius) => {
|
||||
@ -725,7 +725,7 @@ const part001 = cube([0, 0], 20)
|
||||
|> close(%)
|
||||
|> extrude(20, %)
|
||||
|
||||
const part002 = startSketchOn(part001, part001.sketchGroup.tags.here)
|
||||
const part002 = startSketchOn(part001, part001.sketch.tags.here)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([5, 0], %)
|
||||
|> line([5, 5], %)
|
||||
@ -1227,7 +1227,7 @@ fn pentagon = (len) => {
|
||||
const p = pentagon(32)
|
||||
|> extrude(10, %)
|
||||
|
||||
const circle0 = make_circle(p, p.sketchGroup.tags.a, [0, 0], 2.5)
|
||||
const circle0 = make_circle(p, p.sketch.tags.a, [0, 0], 2.5)
|
||||
const plumbus0 = circle0
|
||||
|> extrude(10, %)
|
||||
|> fillet({
|
||||
@ -1235,7 +1235,7 @@ const plumbus0 = circle0
|
||||
tags: [circle0.tags.arc1, getOppositeEdge(circle0.tags.arc1)]
|
||||
}, %)
|
||||
|
||||
const circle1 = make_circle(p, p.sketchGroup.tags.b, [0, 0], 2.5)
|
||||
const circle1 = make_circle(p, p.sketch.tags.b, [0, 0], 2.5)
|
||||
const plumbus1 = circle1
|
||||
|> extrude(10, %)
|
||||
|> fillet({
|
||||
|
@ -89,5 +89,5 @@ gen_test_fail!(
|
||||
pipe_substitution_inside_function_called_from_pipeline,
|
||||
"semantic: cannot use % outside a pipe expression"
|
||||
);
|
||||
gen_test!(sketch_group_in_object);
|
||||
gen_test!(sketch_in_object);
|
||||
gen_test!(add_lots);
|
||||
|
BIN
src/wasm-lib/tests/executor/outputs/member_expression_sketch.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/member_expression_sketch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
@ -1,7 +1,7 @@
|
||||
use anyhow::Result;
|
||||
use kcl_lib::{
|
||||
ast::{modify::modify_ast_for_sketch, types::Program},
|
||||
executor::{ExecutorContext, KclValue, PlaneType, SketchGroup, SourceRange},
|
||||
executor::{ExecutorContext, KclValue, PlaneType, Sketch, SourceRange},
|
||||
};
|
||||
use kittycad_modeling_cmds::{each_cmd as mcmd, length_unit::LengthUnit, shared::Point3d, ModelingCmd};
|
||||
use pretty_assertions::assert_eq;
|
||||
@ -38,14 +38,14 @@ async fn setup(code: &str, name: &str) -> Result<(ExecutorContext, Program, uuid
|
||||
let exec_state = ctx.run(&program, None).await?;
|
||||
|
||||
// We need to get the sketch ID.
|
||||
// Get the sketch group ID from memory.
|
||||
// Get the sketch ID from memory.
|
||||
let KclValue::UserVal(user_val) = exec_state.memory.get(name, SourceRange::default()).unwrap() else {
|
||||
anyhow::bail!("part001 not found in memory: {:?}", exec_state.memory);
|
||||
};
|
||||
let Some((sketch_group, _meta)) = user_val.get::<SketchGroup>() else {
|
||||
anyhow::bail!("part001 was not a SketchGroup");
|
||||
let Some((sketch, _meta)) = user_val.get::<Sketch>() else {
|
||||
anyhow::bail!("part001 was not a Sketch");
|
||||
};
|
||||
let sketch_id = sketch_group.id;
|
||||
let sketch_id = sketch.id;
|
||||
|
||||
let plane_id = uuid::Uuid::new_v4();
|
||||
ctx.engine
|
||||
|
Reference in New Issue
Block a user