Skip to content

Commit

Permalink
able to go to and from app settings to executor settings for cli (#2236)
Browse files Browse the repository at this point in the history
* settings from and into exefcutor settings

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

* settings

Signed-off-by: Jess Frazelle <[email protected]>

* ipdates

Signed-off-by: Jess Frazelle <[email protected]>

* ensure all have extrudes

Signed-off-by: Jess Frazelle <[email protected]>

* updates

Signed-off-by: Jess Frazelle <[email protected]>

---------

Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz authored Apr 25, 2024
1 parent c89780a commit b950cc0
Show file tree
Hide file tree
Showing 51 changed files with 150 additions and 144 deletions.
3 changes: 2 additions & 1 deletion docs/kcl/angleToMatchLengthX.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/kcl/angleToMatchLengthY.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/kcl/close.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/kcl/lineTo.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/kcl/patternCircular2d.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/kcl/patternLinear2d.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/kcl/startProfileAt.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/kcl/startSketchAt.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/kcl/startSketchOn.md

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions docs/kcl/std.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([1, 3.82], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthX('seg01', 10, %),\n 5\n ], %)\n |> close(%)"
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([1, 3.82], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthX('seg01', 10, %),\n 5\n ], %)\n |> close(%)\n |> extrude(5, %)"
]
},
{
Expand Down Expand Up @@ -2074,7 +2074,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([1, 3.82], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthY('seg01', 10, %),\n 5\n ], %)\n |> close(%)"
"const part001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([1, 3.82], %, 'seg01')\n |> angledLineToX([\n -angleToMatchLengthY('seg01', 10, %),\n 5\n ], %)\n |> close(%)\n |> extrude(5, %)"
]
},
{
Expand Down Expand Up @@ -22380,8 +22380,8 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%)",
"startSketchOn('YZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%, \"edge1\")"
"startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%)\n |> extrude(10, %)",
"startSketchOn('YZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%, \"edge1\")\n |> extrude(10, %)"
]
},
{
Expand Down Expand Up @@ -43695,7 +43695,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"fn rectShape = (pos, w, l) => {\n const rr = startSketchOn('YZ')\n |> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)\n |> lineTo([pos[0] + w / 2, pos[1] - (l / 2)], %, \"edge1\")\n |> lineTo([pos[0] + w / 2, pos[1] + l / 2], %, \"edge2\")\n |> lineTo([pos[0] - (w / 2), pos[1] + l / 2], %, \"edge3\")\n |> close(%, \"edge4\")\n return rr\n}\n\n// Create the mounting plate extrusion, holes, and fillets\nconst part = rectShape([0, 0], 20, 20)"
"fn rectShape = (pos, w, l) => {\n const rr = startSketchOn('YZ')\n |> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)\n |> lineTo([pos[0] + w / 2, pos[1] - (l / 2)], %, \"edge1\")\n |> lineTo([pos[0] + w / 2, pos[1] + l / 2], %, \"edge2\")\n |> lineTo([pos[0] - (w / 2), pos[1] + l / 2], %, \"edge3\")\n |> close(%, \"edge4\")\n return rr\n}\n\n// Create the mounting plate extrusion, holes, and fillets\nconst part = rectShape([0, 0], 20, 20)\n |> extrude(10, %)"
]
},
{
Expand Down Expand Up @@ -45900,7 +45900,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part = startSketchOn('XY')\n |> circle([0, 0], 2, %)\n |> patternCircular2d({\n center: [20, 20],\n repetitions: 12,\n arcDegrees: 210,\n rotateDuplicates: true\n }, %)"
"const part = startSketchOn('XY')\n |> circle([0, 0], 2, %)\n |> patternCircular2d({\n center: [20, 20],\n repetitions: 12,\n arcDegrees: 210,\n rotateDuplicates: true\n }, %)\n |> extrude(1, %)"
]
},
{
Expand Down Expand Up @@ -50459,7 +50459,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const part = startSketchOn('XY')\n |> circle([0, 0], 2, %)\n |> patternLinear2d({\n axis: [0, 1],\n repetitions: 12,\n distance: 2\n }, %)"
"const part = startSketchOn('XY')\n |> circle([0, 0], 2, %)\n |> patternLinear2d({\n axis: [0, 1],\n repetitions: 12,\n distance: 2\n }, %)\n |> extrude(1, %)"
]
},
{
Expand Down Expand Up @@ -59318,7 +59318,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)"
"startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([10, 0], %)\n |> close(%)\n |> extrude(10, %)"
]
},
{
Expand Down Expand Up @@ -60312,7 +60312,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchAt([0, 0])\n |> line([10, 10], %)"
"startSketchAt([0, 0])\n |> line([10, 10], %)\n |> line([20, 10], %, \"edge1\")\n |> close(%, \"edge2\")\n |> extrude(10, %)"
]
},
{
Expand Down Expand Up @@ -61585,7 +61585,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([20, 10], %, \"edge1\")\n |> close(%, \"edge2\")",
"startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([20, 10], %, \"edge1\")\n |> close(%, \"edge2\")\n |> extrude(10, %)",
"fn cube = (pos, scale) => {\n const sg = startSketchOn('XY')\n |> startProfileAt(pos, %)\n |> line([0, scale], %)\n |> line([scale, 0], %)\n |> line([0, -scale], %)\n |> close(%)\n |> extrude(scale, %)\n\n return sg\n}\n\nconst box = cube([0, 0], 20)\n\nconst part001 = startSketchOn(box, \"start\")\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %)\n |> line([20, 10], %, \"edge1\")\n |> close(%)\n |> extrude(20, %)"
]
},
Expand Down Expand Up @@ -65584,7 +65584,7 @@
"unpublished": false,
"deprecated": false,
"examples": [
"startSketchOn('-YZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %, \"edge0\")\n |> tangentialArcTo([10, 0], %)\n |> close(%)"
"startSketchOn('-YZ')\n |> startProfileAt([0, 0], %)\n |> line([10, 10], %, \"edge0\")\n |> tangentialArcTo([10, 0], %)\n |> close(%)\n |> extrude(10, %)"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion docs/kcl/tangentialArcTo.md

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/wasm-lib/derive-docs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,15 +775,11 @@ fn generate_code_block_test(
if let Ok(addr) = std::env::var("LOCAL_ENGINE_ADDR") {
client.set_base_url(addr);
}
let ws = client
.modeling()
.commands_ws(None, None, None, None, None,None, Some(false))
.await.unwrap();

let tokens = crate::token::lexer(#code_block).unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default()).await.unwrap();
let ctx = crate::executor::ExecutorContext::new(&client, Default::default()).await.unwrap();

ctx.run(program, None).await.unwrap();

Expand Down
14 changes: 2 additions & 12 deletions src/wasm-lib/derive-docs/tests/array.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_show {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is another code block.\nyes sirrr.\nshow").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down Expand Up @@ -96,15 +91,10 @@ mod test_examples_show {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nshow").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-lib/derive-docs/tests/box.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_show {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nshow").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
14 changes: 2 additions & 12 deletions src/wasm-lib/derive-docs/tests/doc_comment_with_code.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ mod test_examples_my_func {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens =
crate::token::lexer("This is another code block.\nyes sirrr.\nmyFunc").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down Expand Up @@ -97,15 +92,10 @@ mod test_examples_my_func {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nmyFunc").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ mod test_examples_import {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens =
crate::token::lexer("This is another code block.\nyes sirrr.\nimport").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down Expand Up @@ -99,15 +94,10 @@ mod test_examples_import {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nimport").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
14 changes: 2 additions & 12 deletions src/wasm-lib/derive-docs/tests/lineTo.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ mod test_examples_line_to {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens =
crate::token::lexer("This is another code block.\nyes sirrr.\nlineTo").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down Expand Up @@ -97,15 +92,10 @@ mod test_examples_line_to {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nlineTo").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
14 changes: 2 additions & 12 deletions src/wasm-lib/derive-docs/tests/min.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_min {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is another code block.\nyes sirrr.\nmin").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down Expand Up @@ -96,15 +91,10 @@ mod test_examples_min {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nmin").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-lib/derive-docs/tests/option.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_show {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nshow").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-lib/derive-docs/tests/option_input_format.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_import {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nimport").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_import {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nimport").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-lib/derive-docs/tests/return_vec_sketch_group.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_import {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nimport").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-lib/derive-docs/tests/show.gen
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ mod test_examples_show {
client.set_base_url(addr);
}

let ws = client
.modeling()
.commands_ws(None, None, None, None, None, None, Some(false))
.await
.unwrap();
let tokens = crate::token::lexer("This is code.\nIt does other shit.\nshow").unwrap();
let parser = crate::parser::Parser::new(tokens);
let program = parser.ast().unwrap();
let ctx = crate::executor::ExecutorContext::new(ws, Default::default())
let ctx = crate::executor::ExecutorContext::new(&client, Default::default())
.await
.unwrap();
ctx.run(program, None).await.unwrap();
Expand Down
Loading

0 comments on commit b950cc0

Please sign in to comment.