Import geometry work w transforms (#5757)
* make work with imported geometry Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * iupdates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * update known issues 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:
160050
rust/kcl-lib/tests/import_transform/2-5-long-m8-chc-screw.stl
Normal file
160050
rust/kcl-lib/tests/import_transform/2-5-long-m8-chc-screw.stl
Normal file
File diff suppressed because it is too large
Load Diff
5571206
rust/kcl-lib/tests/import_transform/artifact_commands.snap
Normal file
5571206
rust/kcl-lib/tests/import_transform/artifact_commands.snap
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Artifact graph flowchart import_transform.kcl
|
||||
extension: md
|
||||
snapshot_kind: binary
|
||||
---
|
||||
@ -0,0 +1,3 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
```
|
||||
287
rust/kcl-lib/tests/import_transform/ast.snap
Normal file
287
rust/kcl-lib/tests/import_transform/ast.snap
Normal file
@ -0,0 +1,287 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Result of parsing import_transform.kcl
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"end": 43,
|
||||
"path": {
|
||||
"type": "Foreign",
|
||||
"path": "2-5-long-m8-chc-screw.stl"
|
||||
},
|
||||
"selector": {
|
||||
"type": "None",
|
||||
"alias": {
|
||||
"end": 43,
|
||||
"name": "screw",
|
||||
"start": 38,
|
||||
"type": "Identifier"
|
||||
}
|
||||
},
|
||||
"start": 0,
|
||||
"type": "ImportStatement",
|
||||
"type": "ImportStatement"
|
||||
},
|
||||
{
|
||||
"end": 232,
|
||||
"expression": {
|
||||
"body": [
|
||||
{
|
||||
"end": 50,
|
||||
"name": "screw",
|
||||
"start": 45,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"end": 85,
|
||||
"name": "roll",
|
||||
"start": 81,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"end": 92,
|
||||
"raw": "3.14",
|
||||
"start": 88,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"end": 106,
|
||||
"name": "pitch",
|
||||
"start": 101,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"end": 113,
|
||||
"raw": "3.14",
|
||||
"start": 109,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"end": 125,
|
||||
"name": "yaw",
|
||||
"start": 122,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"end": 132,
|
||||
"raw": "3.14",
|
||||
"start": 128,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 62,
|
||||
"name": "rotate",
|
||||
"start": 56,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 140,
|
||||
"start": 56,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 72,
|
||||
"start": 71,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"end": 168,
|
||||
"name": "translate",
|
||||
"start": 159,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"elements": [
|
||||
{
|
||||
"end": 176,
|
||||
"raw": "3.14",
|
||||
"start": 172,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 182,
|
||||
"raw": "3.14",
|
||||
"start": 178,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 188,
|
||||
"raw": "3.14",
|
||||
"start": 184,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 189,
|
||||
"start": 171,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 155,
|
||||
"name": "translate",
|
||||
"start": 146,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 190,
|
||||
"start": 146,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 157,
|
||||
"start": 156,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"end": 210,
|
||||
"name": "scale",
|
||||
"start": 205,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"elements": [
|
||||
{
|
||||
"end": 218,
|
||||
"raw": "3.14",
|
||||
"start": 214,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 224,
|
||||
"raw": "3.14",
|
||||
"start": 220,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 230,
|
||||
"raw": "3.14",
|
||||
"start": 226,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 3.14,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 231,
|
||||
"start": 213,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 201,
|
||||
"name": "scale",
|
||||
"start": 196,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 232,
|
||||
"start": 196,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 203,
|
||||
"start": 202,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 232,
|
||||
"start": 45,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 45,
|
||||
"type": "ExpressionStatement",
|
||||
"type": "ExpressionStatement"
|
||||
}
|
||||
],
|
||||
"end": 233,
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"0": [
|
||||
{
|
||||
"end": 45,
|
||||
"start": 43,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "newLine"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"startNodes": []
|
||||
},
|
||||
"start": 0
|
||||
}
|
||||
}
|
||||
11
rust/kcl-lib/tests/import_transform/input.kcl
Normal file
11
rust/kcl-lib/tests/import_transform/input.kcl
Normal file
@ -0,0 +1,11 @@
|
||||
import "2-5-long-m8-chc-screw.stl" as screw
|
||||
|
||||
screw
|
||||
|> rotate(
|
||||
%,
|
||||
roll = 3.14,
|
||||
pitch = 3.14,
|
||||
yaw = 3.14,
|
||||
)
|
||||
|> translate(%, translate = [3.14, 3.14, 3.14])
|
||||
|> scale(%, scale = [3.14, 3.14, 3.14])
|
||||
5
rust/kcl-lib/tests/import_transform/ops.snap
Normal file
5
rust/kcl-lib/tests/import_transform/ops.snap
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Operations executed import_transform.kcl
|
||||
---
|
||||
[]
|
||||
19
rust/kcl-lib/tests/import_transform/program_memory.snap
Normal file
19
rust/kcl-lib/tests/import_transform/program_memory.snap
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
source: kcl-lib/src/simulation_tests.rs
|
||||
description: Variables in memory after executing import_transform.kcl
|
||||
---
|
||||
{
|
||||
"screw": {
|
||||
"type": "Module",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
0,
|
||||
43,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
rust/kcl-lib/tests/import_transform/rendered_model.png
Normal file
BIN
rust/kcl-lib/tests/import_transform/rendered_model.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
BIN
rust/kcl-lib/tests/outputs/serial_test_example_rotate2.png
Normal file
BIN
rust/kcl-lib/tests/outputs/serial_test_example_rotate2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
BIN
rust/kcl-lib/tests/outputs/serial_test_example_scale1.png
Normal file
BIN
rust/kcl-lib/tests/outputs/serial_test_example_scale1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
BIN
rust/kcl-lib/tests/outputs/serial_test_example_translate1.png
Normal file
BIN
rust/kcl-lib/tests/outputs/serial_test_example_translate1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
Reference in New Issue
Block a user