Compare commits
128 Commits
v0.43.0
...
franknoiro
Author | SHA1 | Date | |
---|---|---|---|
df8977407c | |||
42016b7335 | |||
09f3e6e170 | |||
3747db01b8 | |||
bf1a42f6c0 | |||
b4d1a36bd9 | |||
b937934834 | |||
0208eecefa | |||
9999e4e62f | |||
b390e3e083 | |||
9a89926749 | |||
d7f834f23d | |||
500d92d1fc | |||
bd10c65bdb | |||
039092ec24 | |||
8a920b6cb7 | |||
c1db093e0f | |||
5f8ae22b04 | |||
dc7b901eb9 | |||
60dcf9d79e | |||
520f899ad4 | |||
41340c8bf0 | |||
a78ec6cd17 | |||
de526ae36e | |||
4a8e582865 | |||
1854064274 | |||
4a8897be4b | |||
83f458fc36 | |||
a686fe914b | |||
cba2349064 | |||
5ae92bcf5c | |||
ad8e306bdb | |||
508e1c919c | |||
58ec6100c4 | |||
11eceefedf | |||
11a678df5b | |||
22c0003eb1 | |||
8f0a40ba6e | |||
89b0ccb090 | |||
5d22308ad2 | |||
5580631c8f | |||
e1494c9f16 | |||
4a0d852a3c | |||
b213834316 | |||
1d8348c2cf | |||
2227287c9d | |||
680fc30682 | |||
40fb6a44d3 | |||
5713bfd9fa | |||
77902d550f | |||
db895d6801 | |||
3e1f8584ea | |||
2501a98cd9 | |||
e60b0e64ba | |||
3379cc489a | |||
a8b7328f65 | |||
ab6995bde3 | |||
6df5e70186 | |||
6b1cc36911 | |||
6a16e47491 | |||
f4f0533179 | |||
6360b8acac | |||
064a41d675 | |||
e075622a7f | |||
7a7929211a | |||
1f5f42963d | |||
235e6a1056 | |||
09cfbc1837 | |||
319029235c | |||
a7f4b0f037 | |||
d3afa38bd5 | |||
45416df215 | |||
ee54cdd27a | |||
84ae567f37 | |||
f94671f1bb | |||
bcf3790266 | |||
d70ebca165 | |||
d8a9abba69 | |||
0fd18c14ef | |||
36d4830c34 | |||
4ce6054e64 | |||
ced49f8ddc | |||
e063622139 | |||
42178fa649 | |||
4bb23bc917 | |||
72272d5d98 | |||
5ef0a1e75f | |||
d8dc49b08a | |||
87eabef450 | |||
40e4f2236f | |||
663076f790 | |||
f2c76b0509 | |||
481bef859a | |||
1a67d344ee | |||
774e3efcb7 | |||
4ec44690bf | |||
d2f0865f95 | |||
84d17454e9 | |||
5a5138a703 | |||
33468c4c96 | |||
b3467bbe5a | |||
90086488b5 | |||
32e8975799 | |||
648616c667 | |||
482487cf57 | |||
5fe3023be9 | |||
30397ba7ab | |||
3344208c63 | |||
fcf3272ad2 | |||
d3e4b123d0 | |||
2bb548c000 | |||
b09c240e36 | |||
6c9d14af93 | |||
0642e49189 | |||
6add1d73ad | |||
68c89746c7 | |||
9f323c207c | |||
7197b6c85d | |||
913f2641c3 | |||
e9086c54ba | |||
9f93346dc6 | |||
1b9f5f20f5 | |||
3865637c61 | |||
2c40e8a97c | |||
c696f0837a | |||
30edf2ad56 | |||
e60cabb193 | |||
1e9cf6f256 |
@ -40,7 +40,7 @@ squareSketch = startSketchOn('XY')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
triangleSketch = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
triangleSketch = startSketchOn(offsetPlane('XY', 75))
|
||||
|> startProfileAt([0, 125], %)
|
||||
|> line(end = [-15, -30])
|
||||
|> line(end = [30, 0])
|
||||
@ -62,10 +62,10 @@ squareSketch = startSketchOn('XY')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|
||||
|> circle({ center = [0, 100], radius = 20 }, %)
|
||||
|
||||
loft([
|
||||
@ -87,10 +87,10 @@ squareSketch = startSketchOn('XY')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|
||||
|> circle({ center = [0, 100], radius = 20 }, %)
|
||||
|
||||
loft(
|
||||
|
@ -17,8 +17,8 @@ offsetPlane(std_plane: StandardPlane, offset: number) -> Plane
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `std_plane` | [`StandardPlane`](/docs/kcl/types/StandardPlane) | Which standard plane (e.g. XY) should this new plane be created from? | Yes |
|
||||
| `offset` | `number` | Distance from the standard plane this new plane will be created at. | Yes |
|
||||
| `std_plane` | [`StandardPlane`](/docs/kcl/types/StandardPlane) | One of the standard planes. | Yes |
|
||||
| `offset` | `number` | | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -37,7 +37,7 @@ squareSketch = startSketchOn('XY')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
circleSketch = startSketchOn(offsetPlane('XY', 150))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
loft([squareSketch, circleSketch])
|
||||
@ -55,7 +55,7 @@ squareSketch = startSketchOn('XZ')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch = startSketchOn(offsetPlane('XZ', offset = 150))
|
||||
circleSketch = startSketchOn(offsetPlane('XZ', 150))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
loft([squareSketch, circleSketch])
|
||||
@ -73,7 +73,7 @@ squareSketch = startSketchOn('YZ')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch = startSketchOn(offsetPlane('YZ', offset = 150))
|
||||
circleSketch = startSketchOn(offsetPlane('YZ', 150))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
loft([squareSketch, circleSketch])
|
||||
@ -91,7 +91,7 @@ squareSketch = startSketchOn('-XZ')
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
|
||||
circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))
|
||||
circleSketch = startSketchOn(offsetPlane('-XZ', -150))
|
||||
|> circle({ center = [0, 100], radius = 50 }, %)
|
||||
|
||||
loft([squareSketch, circleSketch])
|
||||
@ -106,7 +106,7 @@ startSketchOn("XY")
|
||||
|> circle({ radius = 10, center = [0, 0] }, %)
|
||||
|
||||
// Triangle on the plane 4 units above
|
||||
startSketchOn(offsetPlane("XY", offset = 4))
|
||||
startSketchOn(offsetPlane("XY", 4))
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, 10])
|
||||
|
7746
docs/kcl/std.json
7746
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
@ -59,7 +59,23 @@ Any KCL value.
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Number`| | No |
|
||||
| `value` |`number`| | No |
|
||||
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| Any KCL value. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Int`| | No |
|
||||
| `value` |`integer`| | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
|
@ -1,250 +0,0 @@
|
||||
---
|
||||
title: "NumericType"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Count`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Mm`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Cm`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `M`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Inches`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Feet`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Yards`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Length`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Degrees`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Radians`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Angle`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Known`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Default`| | No |
|
||||
| `len` |[`UnitLen`](/docs/kcl/types/UnitLen)| | No |
|
||||
| `angle` |[`UnitAngle`](/docs/kcl/types/UnitAngle)| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Unknown`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Any`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
@ -1,47 +0,0 @@
|
||||
---
|
||||
title: "UnitAngle"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Degrees`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Radians`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
@ -1,186 +0,0 @@
|
||||
---
|
||||
title: "UnitType"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Count`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Mm`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Cm`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `M`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Inches`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Feet`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Yards`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Length`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
**This schema accepts exactly one of the following:**
|
||||
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Degrees`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Radians`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Angle`| | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ sketch001 = startSketchOn('XZ')
|
||||
revolve001 = revolve({ axis = "X" }, sketch001)
|
||||
triangle()
|
||||
|> extrude(length = 30)
|
||||
plane001 = offsetPlane('XY', offset = 10)
|
||||
plane001 = offsetPlane('XY', 10)
|
||||
sketch002 = startSketchOn(plane001)
|
||||
|> startProfileAt([-20, 0], %)
|
||||
|> line(end = [5, -15])
|
||||
@ -35,7 +35,7 @@ sketch002 = startSketchOn(plane001)
|
||||
extrude001 = extrude(sketch002, length = 10)
|
||||
`
|
||||
|
||||
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ')
|
||||
const FEAUTRE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> angledLine([0, 4], %, $rectangleSegmentA001)
|
||||
|> angledLine([
|
||||
@ -54,7 +54,7 @@ sketch002 = startSketchOn(extrude001, rectangleSegmentB001)
|
||||
center = [-1, 2],
|
||||
radius = .5
|
||||
}, %)
|
||||
plane001 = offsetPlane('XZ', offset = -5)
|
||||
plane001 = offsetPlane('XZ', -5)
|
||||
sketch003 = startSketchOn(plane001)
|
||||
|> circle({ center = [0, 0], radius = 5 }, %)
|
||||
`
|
||||
@ -116,7 +116,7 @@ test.describe('Feature Tree pane', () => {
|
||||
await testViewSource({
|
||||
operationName: 'Offset Plane',
|
||||
operationIndex: 0,
|
||||
expectedActiveLine: "plane001 = offsetPlane('XY', offset = 10)",
|
||||
expectedActiveLine: "plane001 = offsetPlane('XY', 10)",
|
||||
})
|
||||
await testViewSource({
|
||||
operationName: 'Extrude',
|
||||
@ -153,16 +153,33 @@ test.describe('Feature Tree pane', () => {
|
||||
`User can edit sketch (but not on offset plane yet) from the feature tree`,
|
||||
{ tag: '@electron' },
|
||||
async ({ context, homePage, scene, editor, toolbar, page }) => {
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
}, FEATURE_TREE_SKETCH_CODE)
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
const unavailableToastMessage = page.getByText(
|
||||
'Editing sketches on faces or offset planes through the feature tree is not yet supported'
|
||||
)
|
||||
|
||||
await test.step('force re-exe', async () => {
|
||||
await page.waitForTimeout(1000)
|
||||
await editor.replaceCode('90', '91')
|
||||
await page.waitForTimeout(1500)
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const bracketDir = join(dir, 'test-sample')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.writeFile(
|
||||
join(bracketDir, 'main.kcl'),
|
||||
FEAUTRE_TREE_SKETCH_CODE,
|
||||
'utf-8'
|
||||
)
|
||||
})
|
||||
|
||||
await test.step('setup test', async () => {
|
||||
await homePage.expectState({
|
||||
projectCards: [
|
||||
{
|
||||
title: 'test-sample',
|
||||
fileCount: 1,
|
||||
},
|
||||
],
|
||||
sortBy: 'last-modified-desc',
|
||||
})
|
||||
await homePage.openProject('test-sample')
|
||||
await scene.waitForExecutionDone()
|
||||
await toolbar.openFeatureTreePane()
|
||||
})
|
||||
|
||||
await test.step('On a default plane should work', async () => {
|
||||
@ -182,23 +199,24 @@ test.describe('Feature Tree pane', () => {
|
||||
await test.step('On an extrude face should *not* work', async () => {
|
||||
// Tooltip is getting in the way of clicking, so I'm first closing the pane
|
||||
await toolbar.closeFeatureTreePane()
|
||||
await page.waitForTimeout(1000)
|
||||
await editor.replaceCode('91', '90')
|
||||
await page.waitForTimeout(2000)
|
||||
await (await toolbar.getFeatureTreeOperation('Sketch', 1)).dblclick()
|
||||
|
||||
await expect(
|
||||
toolbar.exitSketchBtn,
|
||||
'We should be in sketch mode now'
|
||||
unavailableToastMessage,
|
||||
'We should see a toast message about this'
|
||||
).toBeVisible()
|
||||
await editor.expectState({
|
||||
highlightedCode: '',
|
||||
diagnostics: [],
|
||||
activeLines: [
|
||||
'sketch002=startSketchOn(extrude001,rectangleSegmentB001)',
|
||||
],
|
||||
})
|
||||
await toolbar.exitSketchBtn.click()
|
||||
await unavailableToastMessage.waitFor({ state: 'detached' })
|
||||
// TODO - turn on once we update the artifactGraph in Rust
|
||||
// to include the proper source location for the extrude face
|
||||
// await expect(
|
||||
// toolbar.exitSketchBtn,
|
||||
// 'We should be in sketch mode now'
|
||||
// ).toBeVisible()
|
||||
// await editor.expectState({
|
||||
// highlightedCode: '',
|
||||
// diagnostics: [],
|
||||
// activeLines: ['|>circle({center=[-1,2],radius=.5},%)'],
|
||||
// })
|
||||
// await toolbar.exitSketchBtn.click()
|
||||
})
|
||||
|
||||
await test.step('On an offset plane should *not* work', async () => {
|
||||
@ -208,7 +226,7 @@ test.describe('Feature Tree pane', () => {
|
||||
await editor.expectState({
|
||||
highlightedCode: '',
|
||||
diagnostics: [],
|
||||
activeLines: ['sketch003=startSketchOn(plane001)'],
|
||||
activeLines: ['|>circle({center=[0,0],radius=5},%)'],
|
||||
})
|
||||
await expect(
|
||||
toolbar.exitSketchBtn,
|
||||
@ -324,8 +342,7 @@ test.describe('Feature Tree pane', () => {
|
||||
toolbar,
|
||||
cmdBar,
|
||||
}) => {
|
||||
const testCode = (value: string) =>
|
||||
`p = offsetPlane('XY', offset = ${value})`
|
||||
const testCode = (value: string) => `p = offsetPlane('XY', ${value})`
|
||||
const initialInput = '10'
|
||||
const initialCode = testCode(initialInput)
|
||||
const newInput = '5 + 10'
|
||||
|
@ -1028,7 +1028,7 @@ openSketch = startSketchOn('XY')
|
||||
// One dumb hardcoded screen pixel value
|
||||
const testPoint = { x: 700, y: 150 }
|
||||
const [clickOnXzPlane] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
||||
const expectedOutput = `plane001 = offsetPlane('XZ', offset = 5)`
|
||||
const expectedOutput = `plane001 = offsetPlane('XZ', 5)`
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
// FIXME: Since there is no KCL code loaded. We need to wait for the scene to load before we continue.
|
||||
@ -1164,7 +1164,7 @@ openSketch = startSketchOn('XY')
|
||||
}) => {
|
||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
||||
plane001 = offsetPlane('XZ', offset = 50)
|
||||
plane001 = offsetPlane('XZ', 50)
|
||||
sketch002 = startSketchOn(plane001)
|
||||
|> circle({ center = [0, 0], radius = 20 }, %)
|
||||
`
|
||||
@ -1250,7 +1250,7 @@ openSketch = startSketchOn('XY')
|
||||
}) => {
|
||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
||||
plane001 = offsetPlane('XZ', offset = 50)
|
||||
plane001 = offsetPlane('XZ', 50)
|
||||
sketch002 = startSketchOn(plane001)
|
||||
|> circle({ center = [0, 0], radius = 20 }, %)
|
||||
loft001 = loft([sketch001, sketch002])
|
||||
@ -1297,7 +1297,7 @@ loft001 = loft([sketch001, sketch002])
|
||||
await page.waitForTimeout(1000)
|
||||
await clickOnSketch2()
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(`
|
||||
plane001 = offsetPlane('XZ', offset = 50)
|
||||
plane001 = offsetPlane('XZ', 50)
|
||||
`)
|
||||
await page.keyboard.press('Backspace')
|
||||
// Check for sketch 1
|
||||
@ -2448,18 +2448,19 @@ extrude002 = extrude(sketch002, length = 50)
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
}, initialCode)
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
await scene.waitForExecutionDone()
|
||||
|
||||
// One dumb hardcoded screen pixel value
|
||||
const testPoint = { x: 580, y: 320 }
|
||||
const testPoint = { x: 550, y: 295 }
|
||||
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
|
||||
const shellTarget = hasExtrudesInPipe ? 'sketch002' : 'extrude002'
|
||||
const shellDeclaration = `shell001 = shell(${shellTarget}, faces = ['end'], thickness = 5)`
|
||||
|
||||
await test.step(`Look for the grey of the shape`, async () => {
|
||||
await scene.expectPixelColor([113, 113, 113], testPoint, 15)
|
||||
await toolbar.closePane('code')
|
||||
await scene.expectPixelColor([128, 128, 128], testPoint, 15)
|
||||
})
|
||||
|
||||
await test.step(`Go through the command bar flow, selecting a cap and keeping default thickness`, async () => {
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Binary file not shown.
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
@ -390,47 +390,43 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
|
||||
`rev = revolve({ axis: 'y' }, part009)`
|
||||
)
|
||||
|
||||
// FIXME (commented section below), this test would select a wall that had a sketch on it, and delete the underlying extrude
|
||||
// and replace the sketch on face with a hard coded custom plane, but since there was a sketch on that plane maybe it
|
||||
// should have delete the sketch? it's broken atm, but not sure if worth fixing since desired behaviour is a little
|
||||
// vague
|
||||
// // DELETE PARENT EXTRUDE
|
||||
// await page.mouse.click(parentExtrude.x, parentExtrude.y)
|
||||
// await page.waitForTimeout(100)
|
||||
// await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
// '|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
// )
|
||||
// await u.clearCommandLogs()
|
||||
// await page.keyboard.press('Backspace')
|
||||
// await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
|
||||
// await page.waitForTimeout(200)
|
||||
// await expect(u.codeLocator).not.toContainText(
|
||||
// `extrude001 = extrude(sketch001, length = 50)`
|
||||
// )
|
||||
// await expect(u.codeLocator).toContainText(`sketch005 = startSketchOn({
|
||||
// plane = {
|
||||
// origin = { x = 0, y = -50, z = 0 },
|
||||
// xAxis = { x = 1, y = 0, z = 0 },
|
||||
// yAxis = { x = 0, y = 0, z = 1 },
|
||||
// zAxis = { x = 0, y = -1, z = 0 }
|
||||
// }
|
||||
// })`)
|
||||
// await expect(u.codeLocator).toContainText(`sketch003 = startSketchOn({
|
||||
// plane = {
|
||||
// origin = { x = 116.53, y = 0, z = 163.25 },
|
||||
// xAxis = { x = -0.81, y = 0, z = 0.58 },
|
||||
// yAxis = { x = 0, y = -1, z = 0 },
|
||||
// zAxis = { x = 0.58, y = 0, z = 0.81 }
|
||||
// }
|
||||
// })`)
|
||||
// await expect(u.codeLocator).toContainText(`sketch002 = startSketchOn({
|
||||
// plane = {
|
||||
// origin = { x = -91.74, y = 0, z = 80.89 },
|
||||
// xAxis = { x = -0.66, y = 0, z = -0.75 },
|
||||
// yAxis = { x = 0, y = -1, z = 0 },
|
||||
// zAxis = { x = -0.75, y = 0, z = 0.66 }
|
||||
// }
|
||||
// })`)
|
||||
// DELETE PARENT EXTRUDE
|
||||
await page.mouse.click(parentExtrude.x, parentExtrude.y)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
|
||||
await page.waitForTimeout(200)
|
||||
await expect(u.codeLocator).not.toContainText(
|
||||
`extrude001 = extrude(sketch001, length = 50)`
|
||||
)
|
||||
await expect(u.codeLocator).toContainText(`sketch005 = startSketchOn({
|
||||
plane = {
|
||||
origin = { x = 0, y = -50, z = 0 },
|
||||
xAxis = { x = 1, y = 0, z = 0 },
|
||||
yAxis = { x = 0, y = 0, z = 1 },
|
||||
zAxis = { x = 0, y = -1, z = 0 }
|
||||
}
|
||||
})`)
|
||||
await expect(u.codeLocator).toContainText(`sketch003 = startSketchOn({
|
||||
plane = {
|
||||
origin = { x = 116.53, y = 0, z = 163.25 },
|
||||
xAxis = { x = -0.81, y = 0, z = 0.58 },
|
||||
yAxis = { x = 0, y = -1, z = 0 },
|
||||
zAxis = { x = 0.58, y = 0, z = 0.81 }
|
||||
}
|
||||
})`)
|
||||
await expect(u.codeLocator).toContainText(`sketch002 = startSketchOn({
|
||||
plane = {
|
||||
origin = { x = -91.74, y = 0, z = 80.89 },
|
||||
xAxis = { x = -0.66, y = 0, z = -0.75 },
|
||||
yAxis = { x = 0, y = -1, z = 0 },
|
||||
zAxis = { x = -0.75, y = 0, z = 0.66 }
|
||||
}
|
||||
})`)
|
||||
|
||||
// DELETE SOLID 2D
|
||||
await page.mouse.click(solid2d.x, solid2d.y)
|
||||
@ -458,14 +454,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
|
||||
await page.waitForTimeout(200)
|
||||
await expect(u.codeLocator).not.toContainText(codeToBeDeletedSnippet)
|
||||
})
|
||||
test.fixme(
|
||||
"Deleting solid that the AST mod can't handle results in a toast message",
|
||||
async ({ page, homePage }) => {
|
||||
const u = await getUtils(page)
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
test("Deleting solid that the AST mod can't handle results in a toast message", async ({
|
||||
page,
|
||||
homePage,
|
||||
}) => {
|
||||
const u = await getUtils(page)
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-79.26, 95.04], %)
|
||||
|> line(end = [112.54, 127.64], tag = $seg02)
|
||||
|> line(end = [170.36, -121.61], tag = $seg01)
|
||||
@ -480,49 +477,48 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
`
|
||||
)
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
await u.openDebugPanel()
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
|
||||
await u.closeDebugPanel()
|
||||
|
||||
await u.openAndClearDebugPanel()
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_look_at',
|
||||
vantage: { x: 1139.49, y: -7053, z: 8597.31 },
|
||||
center: { x: -2206.68, y: -1298.36, z: 60 },
|
||||
up: { x: 0, y: 0, z: 1 },
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_get_settings',
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
// attempt delete
|
||||
await page.mouse.click(930, 139)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
|
||||
await expect(page.getByText('Unable to delete selection')).toBeVisible()
|
||||
}
|
||||
)
|
||||
await homePage.goToModelingScene()
|
||||
|
||||
await u.openDebugPanel()
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
|
||||
await u.closeDebugPanel()
|
||||
|
||||
await u.openAndClearDebugPanel()
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_look_at',
|
||||
vantage: { x: 1139.49, y: -7053, z: 8597.31 },
|
||||
center: { x: -2206.68, y: -1298.36, z: 60 },
|
||||
up: { x: 0, y: 0, z: 1 },
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
await u.sendCustomCmd({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: {
|
||||
type: 'default_camera_get_settings',
|
||||
},
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
// attempt delete
|
||||
await page.mouse.click(930, 139)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
|
||||
await expect(page.getByText('Unable to delete selection')).toBeVisible()
|
||||
})
|
||||
test('Hovering over 3d features highlights code, clicking puts the cursor in the right place and sends selection id to engine', async ({
|
||||
page,
|
||||
homePage,
|
||||
|
@ -16,7 +16,8 @@ mac:
|
||||
arch:
|
||||
- x64
|
||||
- arm64
|
||||
notarize: true
|
||||
notarize:
|
||||
teamId: 92H8YB3B95
|
||||
fileAssociations:
|
||||
- ext: kcl
|
||||
name: kcl
|
||||
@ -31,11 +32,10 @@ win:
|
||||
arch:
|
||||
- x64
|
||||
- arm64
|
||||
signtoolOptions:
|
||||
sign: "./scripts/sign-win.js"
|
||||
signingHashAlgorithms:
|
||||
- sha256
|
||||
publisherName: "KittyCAD Inc" # needs to be exactly like on Digicert
|
||||
signingHashAlgorithms:
|
||||
- sha256
|
||||
sign: "./scripts/sign-win.js"
|
||||
publisherName: "KittyCAD Inc" # needs to be exactly like on Digicert
|
||||
icon: "assets/icon.ico"
|
||||
fileAssociations:
|
||||
- ext: kcl
|
||||
|
18
package.json
18
package.json
@ -40,7 +40,7 @@
|
||||
"codemirror": "^6.0.1",
|
||||
"decamelize": "^6.0.0",
|
||||
"diff": "^7.0.0",
|
||||
"electron-updater": "^6.5.0",
|
||||
"electron-updater": "6.3.0",
|
||||
"fuse.js": "^7.0.0",
|
||||
"html2canvas-pro": "^1.5.8",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
@ -85,7 +85,7 @@
|
||||
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
|
||||
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
|
||||
"fetch:wasm": "./get-latest-wasm-bundle.sh",
|
||||
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/achalmers/offset-plane-kwargs/manifest.json",
|
||||
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/achalmers/kw-pattern-transform2/manifest.json",
|
||||
"isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)",
|
||||
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
|
||||
"build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt",
|
||||
@ -145,11 +145,10 @@
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||
"@babel/preset-env": "^7.25.4",
|
||||
"@electron-forge/cli": "^7.6.1",
|
||||
"@electron-forge/plugin-fuses": "^7.6.1",
|
||||
"@electron-forge/plugin-vite": "^7.6.1",
|
||||
"@electron/fuses": "^1.8.0",
|
||||
"@electron/notarize": "^2.5.0",
|
||||
"@electron-forge/cli": "7.4.0",
|
||||
"@electron-forge/plugin-fuses": "7.4.0",
|
||||
"@electron-forge/plugin-vite": "7.4.0",
|
||||
"@electron/fuses": "1.8.0",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@lezer/generator": "^1.7.2",
|
||||
"@nabla/vite-plugin-eslint": "^2.0.5",
|
||||
@ -176,8 +175,9 @@
|
||||
"@vitest/web-worker": "^1.5.0",
|
||||
"@xstate/cli": "^0.5.17",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"electron": "^34.1.1",
|
||||
"electron-builder": "^26.0.6",
|
||||
"electron": "32.1.2",
|
||||
"electron-builder": "24.13.3",
|
||||
"electron-notarize": "1.2.2",
|
||||
"eslint": "^8.0.1",
|
||||
"eslint-plugin-css-modules": "^2.12.0",
|
||||
"eslint-plugin-import": "^2.30.0",
|
||||
|
@ -1,5 +1,4 @@
|
||||
@precedence {
|
||||
annotation
|
||||
member
|
||||
call
|
||||
exp @left
|
||||
@ -21,12 +20,9 @@ statement[@isGroup=Statement] {
|
||||
FunctionDeclaration { kw<"export">? kw<"fn"> VariableDefinition Equals? ParamList Arrow? Body } |
|
||||
VariableDeclaration { kw<"export">? (kw<"var"> | kw<"let"> | kw<"const">)? VariableDefinition Equals expression } |
|
||||
ReturnStatement { kw<"return"> expression } |
|
||||
ExpressionStatement { expression } |
|
||||
Annotation { AnnotationName AnnotationList? }
|
||||
ExpressionStatement { expression }
|
||||
}
|
||||
|
||||
AnnotationList { !annotation "(" commaSep<AnnotationProperty> ")" }
|
||||
|
||||
ParamList { "(" commaSep<Parameter { VariableDefinition "?"? (":" type)? }> ")" }
|
||||
|
||||
Body { "{" statement* "}" }
|
||||
@ -63,12 +59,6 @@ UnaryOp { AddOp | BangOp }
|
||||
|
||||
ObjectProperty { PropertyName (":" | Equals) expression }
|
||||
|
||||
AnnotationProperty {
|
||||
PropertyName
|
||||
( AddOp | MultOp | ExpOp | LogicOp | BangOp | CompOp | Equals | Arrow | PipeOperator | PipeSubstitution )
|
||||
expression
|
||||
}
|
||||
|
||||
LabeledArgument { ArgumentLabel Equals expression }
|
||||
|
||||
ArgumentList { "(" commaSep<LabeledArgument | expression> ")" }
|
||||
@ -115,7 +105,6 @@ commaSep1NoTrailingComma<term> { term ("," term)* }
|
||||
PipeSubstitution { "%" }
|
||||
|
||||
identifier { (@asciiLetter | "_") (@asciiLetter | @digit | "_")* }
|
||||
AnnotationName { "@" identifier? }
|
||||
PropertyName { identifier }
|
||||
TagDeclarator { "$" identifier }
|
||||
|
||||
|
@ -1,153 +0,0 @@
|
||||
# alone
|
||||
|
||||
@a
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName))
|
||||
|
||||
# alone and anonymous
|
||||
|
||||
@
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName))
|
||||
|
||||
# empty
|
||||
|
||||
@ann()
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList))
|
||||
|
||||
# empty and anonymous
|
||||
|
||||
@()
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList))
|
||||
|
||||
# equals
|
||||
|
||||
@setting(a=1)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))
|
||||
|
||||
# operator
|
||||
|
||||
@ann(a*1)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
MultOp,
|
||||
Number))))
|
||||
|
||||
# anonymous
|
||||
|
||||
@(a=1)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))
|
||||
|
||||
# complex expr
|
||||
|
||||
@ann(a=(1+2+f('yes')))
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
ParenthesizedExpression(BinaryExpression(BinaryExpression(Number,
|
||||
AddOp,
|
||||
Number),
|
||||
AddOp,
|
||||
CallExpression(VariableName,
|
||||
ArgumentList(String))))))))
|
||||
|
||||
# many args
|
||||
|
||||
@ann(a=1, b=2)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number),
|
||||
AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))
|
||||
|
||||
# space around op
|
||||
|
||||
@ann(a / 1)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
MultOp,
|
||||
Number))))
|
||||
|
||||
# space around sep
|
||||
|
||||
@ann(a/1 , b/2)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
MultOp,
|
||||
Number),
|
||||
AnnotationProperty(PropertyName,
|
||||
MultOp,
|
||||
Number))))
|
||||
|
||||
# trailing sep
|
||||
|
||||
@ann(a=1,)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))
|
||||
|
||||
# lone sep
|
||||
|
||||
@ann(,)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList))
|
||||
|
||||
# inside fn
|
||||
|
||||
fn f() {
|
||||
@anno(b=2)
|
||||
}
|
||||
|
||||
==>
|
||||
Program(FunctionDeclaration(fn,
|
||||
VariableDefinition,
|
||||
ParamList,
|
||||
Body(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))))
|
||||
|
||||
# laxer with space than the language parser is
|
||||
|
||||
@anno (b=2)
|
||||
|
||||
==>
|
||||
Program(Annotation(AnnotationName,
|
||||
AnnotationList(AnnotationProperty(PropertyName,
|
||||
Equals,
|
||||
Number))))
|
@ -69,7 +69,6 @@ import {
|
||||
startSketchOnDefault,
|
||||
} from 'lang/modifyAst'
|
||||
import {
|
||||
KclValue,
|
||||
PathToNode,
|
||||
Program,
|
||||
VariableDeclaration,
|
||||
@ -805,33 +804,12 @@ export const ModelingMachineProvider = ({
|
||||
engineCommandManager.artifactGraph
|
||||
)
|
||||
if (err(plane)) return Promise.reject(plane)
|
||||
let sketch: KclValue | null = null
|
||||
for (const variable of Object.values(
|
||||
kclManager.execState.variables
|
||||
)) {
|
||||
// find programMemory that matches path artifact
|
||||
if (
|
||||
|
||||
const sketch = Object.values(kclManager.execState.variables).find(
|
||||
(variable) =>
|
||||
variable?.type === 'Sketch' &&
|
||||
variable.value.artifactId === plane.pathIds[0]
|
||||
) {
|
||||
sketch = variable
|
||||
break
|
||||
}
|
||||
if (
|
||||
// if the variable is an sweep, check if the underlying sketch matches the artifact
|
||||
variable?.type === 'Solid' &&
|
||||
variable.value.sketch.on.type === 'plane' &&
|
||||
variable.value.sketch.artifactId === plane.pathIds[0]
|
||||
) {
|
||||
sketch = {
|
||||
type: 'Sketch',
|
||||
value: variable.value.sketch,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!sketch || sketch.type !== 'Sketch')
|
||||
return Promise.reject(new Error('No sketch'))
|
||||
)
|
||||
if (!sketch || sketch.type !== 'Sketch')
|
||||
return Promise.reject(new Error('No sketch'))
|
||||
const info = await getSketchOrientationDetails(sketch.value)
|
||||
@ -1573,11 +1551,8 @@ export const ModelingMachineProvider = ({
|
||||
? pathToProfile
|
||||
: updatedSketchNodePaths[0]
|
||||
}
|
||||
|
||||
if (doesNeedSplitting) {
|
||||
await kclManager.executeAstMock(moddedAst)
|
||||
await codeManager.updateEditorWithAstAndWriteToFile(moddedAst)
|
||||
}
|
||||
await kclManager.executeAstMock(moddedAst)
|
||||
await codeManager.updateEditorWithAstAndWriteToFile(moddedAst)
|
||||
return {
|
||||
updatedEntryNodePath: pathToProfile,
|
||||
updatedSketchNodePaths: updatedSketchNodePaths,
|
||||
|
@ -8,7 +8,7 @@ import { editorManager } from 'lib/singletons'
|
||||
import { Annotation, Transaction } from '@codemirror/state'
|
||||
import { EditorView, KeyBinding } from '@codemirror/view'
|
||||
import { recast, Program } from 'lang/wasm'
|
||||
import { err, reportRejection } from 'lib/trap'
|
||||
import { err } from 'lib/trap'
|
||||
import { Compartment } from '@codemirror/state'
|
||||
import { history } from '@codemirror/commands'
|
||||
|
||||
@ -168,7 +168,7 @@ export default class CodeManager {
|
||||
const newCode = recast(ast)
|
||||
if (err(newCode)) return
|
||||
this.updateCodeStateEditor(newCode)
|
||||
this.writeToFile().catch(reportRejection)
|
||||
await this.writeToFile()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,6 @@ const newVar = myVar + 1`
|
||||
expect(mem['three']).toEqual({
|
||||
type: 'Number',
|
||||
value: 3,
|
||||
ty: expect.any(Object),
|
||||
__meta: [
|
||||
{
|
||||
sourceRange: [14, 15, 0],
|
||||
@ -249,23 +248,12 @@ const newVar = myVar + 1`
|
||||
expect(mem['yo']).toEqual({
|
||||
type: 'Array',
|
||||
value: [
|
||||
{
|
||||
type: 'Number',
|
||||
value: 1,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [28, 29, 0] }],
|
||||
},
|
||||
{ type: 'Number', value: 1, __meta: [{ sourceRange: [28, 29, 0] }] },
|
||||
{ type: 'String', value: '2', __meta: [{ sourceRange: [31, 34, 0] }] },
|
||||
{
|
||||
type: 'Number',
|
||||
value: 3,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [14, 15, 0] }],
|
||||
},
|
||||
{ type: 'Number', value: 3, __meta: [{ sourceRange: [14, 15, 0] }] },
|
||||
{
|
||||
type: 'Number',
|
||||
value: 9,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [43, 44, 0] }, { sourceRange: [47, 48, 0] }],
|
||||
},
|
||||
],
|
||||
@ -293,19 +281,16 @@ const newVar = myVar + 1`
|
||||
anum: {
|
||||
type: 'Number',
|
||||
value: 2,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [47, 48, 0] }],
|
||||
},
|
||||
identifier: {
|
||||
type: 'Number',
|
||||
value: 3,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [14, 15, 0] }],
|
||||
},
|
||||
binExp: {
|
||||
type: 'Number',
|
||||
value: 9,
|
||||
ty: expect.any(Object),
|
||||
__meta: [{ sourceRange: [77, 78, 0] }, { sourceRange: [81, 82, 0] }],
|
||||
},
|
||||
},
|
||||
@ -419,7 +404,6 @@ describe('testing math operators', () => {
|
||||
],
|
||||
type: 'Number',
|
||||
value: 1,
|
||||
ty: expect.any(Object),
|
||||
},
|
||||
{
|
||||
__meta: [
|
||||
@ -429,7 +413,6 @@ describe('testing math operators', () => {
|
||||
],
|
||||
type: 'Number',
|
||||
value: -3,
|
||||
ty: expect.any(Object),
|
||||
},
|
||||
])
|
||||
})
|
||||
|
@ -32,7 +32,7 @@ child_process.spawnSync('git', [
|
||||
'clone',
|
||||
'--single-branch',
|
||||
'--branch',
|
||||
'achalmers/offset-plane-kwargs',
|
||||
'achalmers/kw-pattern-transform2',
|
||||
URL_GIT_KCL_SAMPLES,
|
||||
DIR_KCL_SAMPLES,
|
||||
])
|
||||
|
@ -821,146 +821,144 @@ sketch003 = startSketchOn('XZ')
|
||||
type: 'segment',
|
||||
},
|
||||
],
|
||||
// TODO FIXME, similar to fix me in e2e/playwright/testing-selections.spec.ts
|
||||
// also related to deleting, deleting in general probably is due for a refactor
|
||||
// [
|
||||
// 'delete extrude',
|
||||
// {
|
||||
// codeBefore: `sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([3.29, 7.86], %)
|
||||
// |> line(end = [2.48, 2.44])
|
||||
// |> line(end = [2.66, 1.17])
|
||||
// |> line(end = [3.75, 0.46])
|
||||
// |> line(end = [4.99, -0.46], tag = $seg01)
|
||||
// |> line(end = [-3.86, -2.73])
|
||||
// |> line(end = [-17.67, 0.85])
|
||||
// |> close()
|
||||
// const extrude001 = extrude(sketch001, length = 10)`,
|
||||
// codeAfter: `sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([3.29, 7.86], %)
|
||||
// |> line(end = [2.48, 2.44])
|
||||
// |> line(end = [2.66, 1.17])
|
||||
// |> line(end = [3.75, 0.46])
|
||||
// |> line(end = [4.99, -0.46], tag = $seg01)
|
||||
// |> line(end = [-3.86, -2.73])
|
||||
// |> line(end = [-17.67, 0.85])
|
||||
// |> close()\n`,
|
||||
// lineOfInterest: 'line(end = [2.66, 1.17])',
|
||||
// type: 'wall',
|
||||
// },
|
||||
// ],
|
||||
// [
|
||||
// 'delete extrude with sketch on it',
|
||||
// {
|
||||
// codeBefore: `myVar = 5
|
||||
// sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([4.46, 5.12], %, $tag)
|
||||
// |> line(end = [0.08, myVar])
|
||||
// |> line(end = [13.03, 2.02], tag = $seg01)
|
||||
// |> line(end = [3.9, -7.6])
|
||||
// |> line(end = [-11.18, -2.15])
|
||||
// |> line(end = [5.41, -9.61])
|
||||
// |> line(end = [-8.54, -2.51])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// const extrude001 = extrude(sketch001, length = 5)
|
||||
// sketch002 = startSketchOn(extrude001, seg01)
|
||||
// |> startProfileAt([-12.55, 2.89], %)
|
||||
// |> line(end = [3.02, 1.9])
|
||||
// |> line(end = [1.82, -1.49], tag = $seg02)
|
||||
// |> angledLine([-86, segLen(seg02)], %)
|
||||
// |> line(end = [-3.97, -0.53])
|
||||
// |> line(end = [0.3, 0.84])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()`,
|
||||
// codeAfter: `myVar = 5
|
||||
// sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([4.46, 5.12], %, $tag)
|
||||
// |> line(end = [0.08, myVar])
|
||||
// |> line(end = [13.03, 2.02], tag = $seg01)
|
||||
// |> line(end = [3.9, -7.6])
|
||||
// |> line(end = [-11.18, -2.15])
|
||||
// |> line(end = [5.41, -9.61])
|
||||
// |> line(end = [-8.54, -2.51])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// sketch002 = startSketchOn({
|
||||
// plane = {
|
||||
// origin = { x = 1, y = 2, z = 3 },
|
||||
// xAxis = { x = 4, y = 5, z = 6 },
|
||||
// yAxis = { x = 7, y = 8, z = 9 },
|
||||
// zAxis = { x = 10, y = 11, z = 12 }
|
||||
// }
|
||||
// })
|
||||
// |> startProfileAt([-12.55, 2.89], %)
|
||||
// |> line(end = [3.02, 1.9])
|
||||
// |> line(end = [1.82, -1.49], tag = $seg02)
|
||||
// |> angledLine([-86, segLen(seg02)], %)
|
||||
// |> line(end = [-3.97, -0.53])
|
||||
// |> line(end = [0.3, 0.84])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// `,
|
||||
// lineOfInterest: 'line(end = [-11.18, -2.15])',
|
||||
// type: 'wall',
|
||||
// },
|
||||
// ],
|
||||
// [
|
||||
// 'delete extrude with sketch on it 2',
|
||||
// {
|
||||
// codeBefore: `myVar = 5
|
||||
// sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([4.46, 5.12], %, $tag)
|
||||
// |> line(end = [0.08, myVar])
|
||||
// |> line(end = [13.03, 2.02], tag = $seg01)
|
||||
// |> line(end = [3.9, -7.6])
|
||||
// |> line(end = [-11.18, -2.15])
|
||||
// |> line(end = [5.41, -9.61])
|
||||
// |> line(end = [-8.54, -2.51])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// const extrude001 = extrude(sketch001, length = 5)
|
||||
// sketch002 = startSketchOn(extrude001, seg01)
|
||||
// |> startProfileAt([-12.55, 2.89], %)
|
||||
// |> line(end = [3.02, 1.9])
|
||||
// |> line(end = [1.82, -1.49], tag = $seg02)
|
||||
// |> angledLine([-86, segLen(seg02)], %)
|
||||
// |> line(end = [-3.97, -0.53])
|
||||
// |> line(end = [0.3, 0.84])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()`,
|
||||
// codeAfter: `myVar = 5
|
||||
// sketch001 = startSketchOn('XZ')
|
||||
// |> startProfileAt([4.46, 5.12], %, $tag)
|
||||
// |> line(end = [0.08, myVar])
|
||||
// |> line(end = [13.03, 2.02], tag = $seg01)
|
||||
// |> line(end = [3.9, -7.6])
|
||||
// |> line(end = [-11.18, -2.15])
|
||||
// |> line(end = [5.41, -9.61])
|
||||
// |> line(end = [-8.54, -2.51])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// sketch002 = startSketchOn({
|
||||
// plane = {
|
||||
// origin = { x = 1, y = 2, z = 3 },
|
||||
// xAxis = { x = 4, y = 5, z = 6 },
|
||||
// yAxis = { x = 7, y = 8, z = 9 },
|
||||
// zAxis = { x = 10, y = 11, z = 12 }
|
||||
// }
|
||||
// })
|
||||
// |> startProfileAt([-12.55, 2.89], %)
|
||||
// |> line(end = [3.02, 1.9])
|
||||
// |> line(end = [1.82, -1.49], tag = $seg02)
|
||||
// |> angledLine([-86, segLen(seg02)], %)
|
||||
// |> line(end = [-3.97, -0.53])
|
||||
// |> line(end = [0.3, 0.84])
|
||||
// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
// |> close()
|
||||
// `,
|
||||
// lineOfInterest: 'startProfileAt([4.46, 5.12], %, $tag)',
|
||||
// type: 'cap',
|
||||
// },
|
||||
// ],
|
||||
[
|
||||
'delete extrude',
|
||||
{
|
||||
codeBefore: `sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> line(end = [3.75, 0.46])
|
||||
|> line(end = [4.99, -0.46], tag = $seg01)
|
||||
|> line(end = [-3.86, -2.73])
|
||||
|> line(end = [-17.67, 0.85])
|
||||
|> close()
|
||||
const extrude001 = extrude(sketch001, length = 10)`,
|
||||
codeAfter: `sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> line(end = [3.75, 0.46])
|
||||
|> line(end = [4.99, -0.46], tag = $seg01)
|
||||
|> line(end = [-3.86, -2.73])
|
||||
|> line(end = [-17.67, 0.85])
|
||||
|> close()\n`,
|
||||
lineOfInterest: 'line(end = [2.66, 1.17])',
|
||||
type: 'wall',
|
||||
},
|
||||
],
|
||||
[
|
||||
'delete extrude with sketch on it',
|
||||
{
|
||||
codeBefore: `myVar = 5
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.46, 5.12], %, $tag)
|
||||
|> line(end = [0.08, myVar])
|
||||
|> line(end = [13.03, 2.02], tag = $seg01)
|
||||
|> line(end = [3.9, -7.6])
|
||||
|> line(end = [-11.18, -2.15])
|
||||
|> line(end = [5.41, -9.61])
|
||||
|> line(end = [-8.54, -2.51])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
const extrude001 = extrude(sketch001, length = 5)
|
||||
sketch002 = startSketchOn(extrude001, seg01)
|
||||
|> startProfileAt([-12.55, 2.89], %)
|
||||
|> line(end = [3.02, 1.9])
|
||||
|> line(end = [1.82, -1.49], tag = $seg02)
|
||||
|> angledLine([-86, segLen(seg02)], %)
|
||||
|> line(end = [-3.97, -0.53])
|
||||
|> line(end = [0.3, 0.84])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()`,
|
||||
codeAfter: `myVar = 5
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.46, 5.12], %, $tag)
|
||||
|> line(end = [0.08, myVar])
|
||||
|> line(end = [13.03, 2.02], tag = $seg01)
|
||||
|> line(end = [3.9, -7.6])
|
||||
|> line(end = [-11.18, -2.15])
|
||||
|> line(end = [5.41, -9.61])
|
||||
|> line(end = [-8.54, -2.51])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
sketch002 = startSketchOn({
|
||||
plane = {
|
||||
origin = { x = 1, y = 2, z = 3 },
|
||||
xAxis = { x = 4, y = 5, z = 6 },
|
||||
yAxis = { x = 7, y = 8, z = 9 },
|
||||
zAxis = { x = 10, y = 11, z = 12 }
|
||||
}
|
||||
})
|
||||
|> startProfileAt([-12.55, 2.89], %)
|
||||
|> line(end = [3.02, 1.9])
|
||||
|> line(end = [1.82, -1.49], tag = $seg02)
|
||||
|> angledLine([-86, segLen(seg02)], %)
|
||||
|> line(end = [-3.97, -0.53])
|
||||
|> line(end = [0.3, 0.84])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
`,
|
||||
lineOfInterest: 'line(end = [-11.18, -2.15])',
|
||||
type: 'wall',
|
||||
},
|
||||
],
|
||||
[
|
||||
'delete extrude with sketch on it 2',
|
||||
{
|
||||
codeBefore: `myVar = 5
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.46, 5.12], %, $tag)
|
||||
|> line(end = [0.08, myVar])
|
||||
|> line(end = [13.03, 2.02], tag = $seg01)
|
||||
|> line(end = [3.9, -7.6])
|
||||
|> line(end = [-11.18, -2.15])
|
||||
|> line(end = [5.41, -9.61])
|
||||
|> line(end = [-8.54, -2.51])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
const extrude001 = extrude(sketch001, length = 5)
|
||||
sketch002 = startSketchOn(extrude001, seg01)
|
||||
|> startProfileAt([-12.55, 2.89], %)
|
||||
|> line(end = [3.02, 1.9])
|
||||
|> line(end = [1.82, -1.49], tag = $seg02)
|
||||
|> angledLine([-86, segLen(seg02)], %)
|
||||
|> line(end = [-3.97, -0.53])
|
||||
|> line(end = [0.3, 0.84])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()`,
|
||||
codeAfter: `myVar = 5
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.46, 5.12], %, $tag)
|
||||
|> line(end = [0.08, myVar])
|
||||
|> line(end = [13.03, 2.02], tag = $seg01)
|
||||
|> line(end = [3.9, -7.6])
|
||||
|> line(end = [-11.18, -2.15])
|
||||
|> line(end = [5.41, -9.61])
|
||||
|> line(end = [-8.54, -2.51])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
sketch002 = startSketchOn({
|
||||
plane = {
|
||||
origin = { x = 1, y = 2, z = 3 },
|
||||
xAxis = { x = 4, y = 5, z = 6 },
|
||||
yAxis = { x = 7, y = 8, z = 9 },
|
||||
zAxis = { x = 10, y = 11, z = 12 }
|
||||
}
|
||||
})
|
||||
|> startProfileAt([-12.55, 2.89], %)
|
||||
|> line(end = [3.02, 1.9])
|
||||
|> line(end = [1.82, -1.49], tag = $seg02)
|
||||
|> angledLine([-86, segLen(seg02)], %)
|
||||
|> line(end = [-3.97, -0.53])
|
||||
|> line(end = [0.3, 0.84])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
`,
|
||||
lineOfInterest: 'startProfileAt([4.46, 5.12], %, $tag)',
|
||||
type: 'cap',
|
||||
},
|
||||
],
|
||||
] as const
|
||||
test.each(cases)(
|
||||
'%s',
|
||||
@ -982,7 +980,6 @@ sketch003 = startSketchOn('XZ')
|
||||
artifact,
|
||||
},
|
||||
execState.variables,
|
||||
execState.artifactGraph,
|
||||
async () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100))
|
||||
return {
|
||||
|
@ -38,7 +38,6 @@ import {
|
||||
isCallExprWithName,
|
||||
ARG_INDEX_FIELD,
|
||||
LABELED_ARG_FIELD,
|
||||
UNLABELED_ARG,
|
||||
} from './queryAst'
|
||||
import {
|
||||
addTagForSketchOnFace,
|
||||
@ -69,12 +68,12 @@ import {
|
||||
expandWall,
|
||||
getArtifactOfTypes,
|
||||
getArtifactsOfTypes,
|
||||
getFaceCodeRef,
|
||||
getPathsFromArtifact,
|
||||
} from './std/artifactGraph'
|
||||
import { BodyItem } from 'wasm-lib/kcl/bindings/BodyItem'
|
||||
import { findKwArg } from './util'
|
||||
import { deleteEdgeTreatment } from './modifyAst/addEdgeTreatment'
|
||||
import { engineCommandManager } from 'lib/singletons'
|
||||
|
||||
export function startSketchOnDefault(
|
||||
node: Node<Program>,
|
||||
@ -677,11 +676,10 @@ export function addOffsetPlane({
|
||||
|
||||
const newPlane = createVariableDeclaration(
|
||||
newPlaneName,
|
||||
createCallExpressionStdLibKw(
|
||||
'offsetPlane',
|
||||
createCallExpressionStdLib('offsetPlane', [
|
||||
createLiteral(defaultPlane.toUpperCase()),
|
||||
[createLabeledArg('offset', offset)]
|
||||
)
|
||||
offset,
|
||||
])
|
||||
)
|
||||
|
||||
const insertAt =
|
||||
@ -699,7 +697,8 @@ export function addOffsetPlane({
|
||||
[insertAt, 'index'],
|
||||
['declaration', 'VariableDeclaration'],
|
||||
['init', 'VariableDeclarator'],
|
||||
['unlabeled', UNLABELED_ARG],
|
||||
['arguments', 'CallExpression'],
|
||||
[0, 'index'],
|
||||
]
|
||||
return {
|
||||
modifiedAst,
|
||||
@ -984,7 +983,6 @@ export function createCallExpressionStdLibKw(
|
||||
end: 0,
|
||||
moduleId: 0,
|
||||
outerAttrs: [],
|
||||
nonCodeMeta: nonCodeMetaEmpty(),
|
||||
callee: {
|
||||
type: 'Identifier',
|
||||
start: 0,
|
||||
@ -1392,7 +1390,6 @@ export async function deleteFromSelection(
|
||||
ast: Node<Program>,
|
||||
selection: Selection,
|
||||
variables: VariableMap,
|
||||
artifactGraph: ArtifactGraph,
|
||||
getFaceDetails: (id: string) => Promise<Models['FaceIsPlanar_type']> = () =>
|
||||
({} as any)
|
||||
): Promise<Node<Program> | Error> {
|
||||
@ -1405,12 +1402,12 @@ export async function deleteFromSelection(
|
||||
) {
|
||||
const plane =
|
||||
selection.artifact.type === 'plane'
|
||||
? expandPlane(selection.artifact, artifactGraph)
|
||||
? expandPlane(selection.artifact, engineCommandManager.artifactGraph)
|
||||
: selection.artifact.type === 'wall'
|
||||
? expandWall(selection.artifact, artifactGraph)
|
||||
: expandCap(selection.artifact, artifactGraph)
|
||||
? expandWall(selection.artifact, engineCommandManager.artifactGraph)
|
||||
: expandCap(selection.artifact, engineCommandManager.artifactGraph)
|
||||
for (const path of plane.paths.sort(
|
||||
(a, b) => b.codeRef.range?.[0] - a.codeRef.range?.[0]
|
||||
(a, b) => b.codeRef.range[0] - a.codeRef.range[0]
|
||||
)) {
|
||||
const varDec = getNodeFromPath<VariableDeclarator>(
|
||||
ast,
|
||||
@ -1427,15 +1424,6 @@ export async function deleteFromSelection(
|
||||
selection.artifact.type === 'cap' ||
|
||||
selection.artifact.type === 'wall'
|
||||
) {
|
||||
// Delete the sketch node, which would not work if
|
||||
// we continued down the traditional code path below.
|
||||
// faceCodeRef's pathToNode is empty for some reason
|
||||
// so using source range instead
|
||||
const codeRef = getFaceCodeRef(selection.artifact)
|
||||
if (!codeRef) return new Error('Could not find face code ref')
|
||||
const sketchVarDec = getNodePathFromSourceRange(astClone, codeRef.range)
|
||||
const sketchBodyIndex = Number(sketchVarDec[1][0])
|
||||
astClone.body.splice(sketchBodyIndex, 1)
|
||||
return astClone
|
||||
}
|
||||
}
|
||||
@ -1535,20 +1523,20 @@ export async function deleteFromSelection(
|
||||
selection.artifact.surfaceId
|
||||
? getArtifactOfTypes(
|
||||
{ key: selection.artifact.surfaceId, types: ['wall'] },
|
||||
artifactGraph
|
||||
engineCommandManager.artifactGraph
|
||||
)
|
||||
: null
|
||||
if (err(wallArtifact)) return
|
||||
if (wallArtifact) {
|
||||
const sweep = getArtifactOfTypes(
|
||||
{ key: wallArtifact.sweepId, types: ['sweep'] },
|
||||
artifactGraph
|
||||
engineCommandManager.artifactGraph
|
||||
)
|
||||
if (err(sweep)) return
|
||||
const wallsWithDependencies = Array.from(
|
||||
getArtifactsOfTypes(
|
||||
{ keys: sweep.surfaceIds, types: ['wall', 'cap'] },
|
||||
artifactGraph
|
||||
engineCommandManager.artifactGraph
|
||||
).values()
|
||||
).filter((wall) => wall?.pathIds?.length)
|
||||
const wallIds = wallsWithDependencies.map((wall) => wall.id)
|
||||
@ -1726,7 +1714,7 @@ export async function deleteFromSelection(
|
||||
return new Error('Selection not recognised, could not delete')
|
||||
}
|
||||
|
||||
export const nonCodeMetaEmpty = () => {
|
||||
const nonCodeMetaEmpty = () => {
|
||||
return { nonCodeNodes: {}, startNodes: [], start: 0, end: 0 }
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@ sketch002 = startSketchOn(extrude001, $seg01)
|
||||
it('finds sketch001 and sketch002 pipes to be lofted', async () => {
|
||||
const exampleCode = `sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 1 }, %)
|
||||
plane001 = offsetPlane('XZ', offset = 2)
|
||||
plane001 = offsetPlane('XZ', 2)
|
||||
sketch002 = startSketchOn(plane001)
|
||||
|> circle({ center = [0, 0], radius = 3 }, %)
|
||||
`
|
||||
|
@ -45,7 +45,6 @@ import { ImportStatement } from 'wasm-lib/kcl/bindings/ImportStatement'
|
||||
import { KclSettingsAnnotation } from 'lib/settings/settingsTypes'
|
||||
|
||||
export const LABELED_ARG_FIELD = 'LabeledArg -> Arg'
|
||||
export const UNLABELED_ARG = 'unlabeled first arg'
|
||||
export const ARG_INDEX_FIELD = 'arg index'
|
||||
|
||||
/**
|
||||
|
@ -532,32 +532,6 @@ function getPlaneFromSolid2D(
|
||||
if (err(path)) return path
|
||||
return getPlaneFromPath(path, graph)
|
||||
}
|
||||
function getPlaneFromCap(
|
||||
cap: CapArtifact,
|
||||
graph: ArtifactGraph
|
||||
): PlaneArtifact | WallArtifact | CapArtifact | Error {
|
||||
const sweep = getArtifactOfTypes(
|
||||
{ key: cap.sweepId, types: ['sweep'] },
|
||||
graph
|
||||
)
|
||||
if (err(sweep)) return sweep
|
||||
const path = getArtifactOfTypes({ key: sweep.pathId, types: ['path'] }, graph)
|
||||
if (err(path)) return path
|
||||
return getPlaneFromPath(path, graph)
|
||||
}
|
||||
function getPlaneFromWall(
|
||||
wall: WallArtifact,
|
||||
graph: ArtifactGraph
|
||||
): PlaneArtifact | WallArtifact | CapArtifact | Error {
|
||||
const sweep = getArtifactOfTypes(
|
||||
{ key: wall.sweepId, types: ['sweep'] },
|
||||
graph
|
||||
)
|
||||
if (err(sweep)) return sweep
|
||||
const path = getArtifactOfTypes({ key: sweep.pathId, types: ['path'] }, graph)
|
||||
if (err(path)) return path
|
||||
return getPlaneFromPath(path, graph)
|
||||
}
|
||||
function getPlaneFromSweepEdge(edge: SweepEdge, graph: ArtifactGraph) {
|
||||
const sweep = getArtifactOfTypes(
|
||||
{ key: edge.sweepId, types: ['sweep'] },
|
||||
@ -578,15 +552,7 @@ export function getPlaneFromArtifact(
|
||||
if (artifact.type === 'path') return getPlaneFromPath(artifact, graph)
|
||||
if (artifact.type === 'segment') return getPlaneFromSegment(artifact, graph)
|
||||
if (artifact.type === 'solid2d') return getPlaneFromSolid2D(artifact, graph)
|
||||
if (
|
||||
// if the user selects a face with sketch on it (pathIds.length), they probably wanted to edit that sketch,
|
||||
// not the sketch for the underlying sweep sketch
|
||||
(artifact.type === 'wall' || artifact.type === 'cap') &&
|
||||
artifact?.pathIds?.length
|
||||
)
|
||||
return artifact
|
||||
if (artifact.type === 'cap') return getPlaneFromCap(artifact, graph)
|
||||
if (artifact.type === 'wall') return getPlaneFromWall(artifact, graph)
|
||||
if (artifact.type === 'wall' || artifact.type === 'cap') return artifact
|
||||
if (artifact.type === 'sweepEdge')
|
||||
return getPlaneFromSweepEdge(artifact, graph)
|
||||
return new Error(`Artifact type ${artifact.type} does not have a plane`)
|
||||
|
@ -30,7 +30,6 @@ import { toolTips, ToolTip } from 'lang/langHelpers'
|
||||
import {
|
||||
createPipeExpression,
|
||||
mutateKwArg,
|
||||
nonCodeMetaEmpty,
|
||||
splitPathAtPipeExpression,
|
||||
} from '../modifyAst'
|
||||
|
||||
@ -2830,7 +2829,6 @@ function addTagKw(): addTagFn {
|
||||
unlabeled: callExpr.node.arguments.length
|
||||
? callExpr.node.arguments[0]
|
||||
: null,
|
||||
nonCodeMeta: nonCodeMetaEmpty(),
|
||||
arguments: [],
|
||||
}
|
||||
const tagArg = findKwArg(ARG_TAG, primaryCallExp)
|
||||
|
@ -14,7 +14,6 @@ describe('KCL expression calculations', () => {
|
||||
variables['x'] = {
|
||||
type: 'Number',
|
||||
value: 2,
|
||||
ty: { type: 'Any' },
|
||||
__meta: [],
|
||||
}
|
||||
const actual = await getCalculatedKclExpressionValue('1 + x', variables)
|
||||
@ -33,7 +32,6 @@ describe('KCL expression calculations', () => {
|
||||
variables['y'] = {
|
||||
type: 'Number',
|
||||
value: 2,
|
||||
ty: { type: 'Any' },
|
||||
__meta: [],
|
||||
}
|
||||
const actual = await getCalculatedKclExpressionValue('1 + x', variables)
|
||||
@ -46,7 +44,6 @@ describe('KCL expression calculations', () => {
|
||||
variables['x'] = {
|
||||
type: 'Number',
|
||||
value: 2,
|
||||
ty: { type: 'Any' },
|
||||
__meta: [],
|
||||
}
|
||||
const actual = await getCalculatedKclExpressionValue(
|
||||
|
@ -126,7 +126,8 @@ const prepareToEditOffsetPlane: PrepareToEditCallback = async ({
|
||||
if (
|
||||
operation.type !== 'StdLibCall' ||
|
||||
!operation.labeledArgs ||
|
||||
!operation.unlabeledArg ||
|
||||
!('std_plane' in operation.labeledArgs) ||
|
||||
!operation.labeledArgs.std_plane ||
|
||||
!('offset' in operation.labeledArgs) ||
|
||||
!operation.labeledArgs.offset
|
||||
) {
|
||||
@ -134,9 +135,11 @@ const prepareToEditOffsetPlane: PrepareToEditCallback = async ({
|
||||
}
|
||||
// TODO: Implement conversion to arbitrary plane selection
|
||||
// once the Offset Plane command supports it.
|
||||
const stdPlane = operation.unlabeledArg
|
||||
const planeName = codeManager.code
|
||||
.slice(stdPlane.sourceRange[0], stdPlane.sourceRange[1])
|
||||
.slice(
|
||||
operation.labeledArgs.std_plane.sourceRange[0],
|
||||
operation.labeledArgs.std_plane.sourceRange[1]
|
||||
)
|
||||
.replaceAll(`'`, ``)
|
||||
|
||||
if (!isDefaultPlaneStr(planeName)) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -53,7 +53,6 @@ process.env.VITE_KC_CONNECTION_TIMEOUT_MS ??=
|
||||
console.log('process.env', process.env)
|
||||
|
||||
/// Register our application to handle all "zoo-studio:" protocols.
|
||||
const singleInstanceLock = app.requestSingleInstanceLock()
|
||||
if (process.defaultApp) {
|
||||
if (process.argv.length >= 2) {
|
||||
app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [
|
||||
@ -66,13 +65,7 @@ if (process.defaultApp) {
|
||||
|
||||
// Global app listeners
|
||||
// Must be done before ready event.
|
||||
// Checking against this lock is needed for Windows and Linux, see
|
||||
// https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app#windows-and-linux-code
|
||||
if (!singleInstanceLock && !process.env.IS_PLAYWRIGHT) {
|
||||
app.quit()
|
||||
} else {
|
||||
registerStartupListeners()
|
||||
}
|
||||
registerStartupListeners()
|
||||
|
||||
const createWindow = (pathToOpen?: string, reuse?: boolean): BrowserWindow => {
|
||||
let newWindow
|
||||
|
@ -9,8 +9,8 @@ use crate::{
|
||||
execution::{
|
||||
annotations,
|
||||
cad_op::{OpArg, Operation},
|
||||
kcl_value::NumericType,
|
||||
memory,
|
||||
memory::ProgramMemory,
|
||||
state::ModuleState,
|
||||
BodyType, EnvironmentRef, ExecState, ExecutorContext, KclValue, MemoryFunction, Metadata, TagEngineInfo,
|
||||
TagIdentifier,
|
||||
@ -437,7 +437,7 @@ impl ExecutorContext {
|
||||
) -> Result<KclValue, KclError> {
|
||||
let item = match init {
|
||||
Expr::None(none) => KclValue::from(none),
|
||||
Expr::Literal(literal) => KclValue::from_literal((**literal).clone(), &exec_state.mod_local.settings),
|
||||
Expr::Literal(literal) => KclValue::from(literal),
|
||||
Expr::TagDeclarator(tag) => tag.execute(exec_state).await?,
|
||||
Expr::Identifier(identifier) => {
|
||||
let value = exec_state.memory().get(&identifier.name, identifier.into())?.clone();
|
||||
@ -518,10 +518,7 @@ impl BinaryPart {
|
||||
#[async_recursion]
|
||||
pub async fn get_result(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> {
|
||||
match self {
|
||||
BinaryPart::Literal(literal) => Ok(KclValue::from_literal(
|
||||
(**literal).clone(),
|
||||
&exec_state.mod_local.settings,
|
||||
)),
|
||||
BinaryPart::Literal(literal) => Ok(literal.into()),
|
||||
BinaryPart::Identifier(identifier) => {
|
||||
let value = exec_state.memory().get(&identifier.name, identifier.into())?;
|
||||
Ok(value.clone())
|
||||
@ -707,32 +704,26 @@ impl Node<BinaryExpression> {
|
||||
BinaryOperator::Add => KclValue::Number {
|
||||
value: left + right,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Sub => KclValue::Number {
|
||||
value: left - right,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Mul => KclValue::Number {
|
||||
value: left * right,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Div => KclValue::Number {
|
||||
value: left / right,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Mod => KclValue::Number {
|
||||
value: left % right,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Pow => KclValue::Number {
|
||||
value: left.powf(right),
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
BinaryOperator::Neq => KclValue::Bool {
|
||||
value: left != right,
|
||||
@ -795,14 +786,19 @@ impl Node<UnaryExpression> {
|
||||
|
||||
let value = &self.argument.get_result(exec_state, ctx).await?;
|
||||
match value {
|
||||
KclValue::Number { value, ty, .. } => {
|
||||
KclValue::Number { value, meta: _ } => {
|
||||
let meta = vec![Metadata {
|
||||
source_range: self.into(),
|
||||
}];
|
||||
Ok(KclValue::Number { value: -value, meta })
|
||||
}
|
||||
KclValue::Int { value, meta: _ } => {
|
||||
let meta = vec![Metadata {
|
||||
source_range: self.into(),
|
||||
}];
|
||||
Ok(KclValue::Number {
|
||||
value: -value,
|
||||
value: (-value) as f64,
|
||||
meta,
|
||||
ty: ty.clone(),
|
||||
})
|
||||
}
|
||||
_ => Err(KclError::Semantic(KclErrorDetails {
|
||||
@ -1303,9 +1299,8 @@ impl Node<ArrayRangeExpression> {
|
||||
Ok(KclValue::Array {
|
||||
value: range
|
||||
.into_iter()
|
||||
.map(|num| KclValue::Number {
|
||||
value: num as f64,
|
||||
ty: NumericType::Unknown,
|
||||
.map(|num| KclValue::Int {
|
||||
value: num,
|
||||
meta: meta.clone(),
|
||||
})
|
||||
.collect(),
|
||||
@ -1347,6 +1342,8 @@ fn article_for(s: &str) -> &'static str {
|
||||
pub fn parse_number_as_f64(v: &KclValue, source_range: SourceRange) -> Result<f64, KclError> {
|
||||
if let KclValue::Number { value: n, .. } = &v {
|
||||
Ok(*n)
|
||||
} else if let KclValue::Int { value: n, .. } = &v {
|
||||
Ok(*n as f64)
|
||||
} else {
|
||||
let actual_type = v.human_friendly_type();
|
||||
let article = if actual_type.starts_with(['a', 'e', 'i', 'o', 'u']) {
|
||||
@ -1463,7 +1460,16 @@ fn jvalue_to_prop(value: &KclValue, property_sr: Vec<SourceRange>, name: &str) -
|
||||
}))
|
||||
};
|
||||
match value {
|
||||
KclValue::Number{value: num, .. } => {
|
||||
KclValue::Int { value:num, meta: _ } => {
|
||||
let maybe_int: Result<usize, _> = (*num).try_into();
|
||||
if let Ok(uint) = maybe_int {
|
||||
Ok(Property::UInt(uint))
|
||||
}
|
||||
else {
|
||||
make_err(format!("'{num}' is negative, so you can't index an array with it"))
|
||||
}
|
||||
}
|
||||
KclValue::Number{value: num, meta:_} => {
|
||||
let num = *num;
|
||||
if num < 0.0 {
|
||||
return make_err(format!("'{num}' is negative, so you can't index an array with it"))
|
||||
@ -1504,7 +1510,7 @@ impl Node<PipeExpression> {
|
||||
fn assign_args_to_params(
|
||||
function_expression: NodeRef<'_, FunctionExpression>,
|
||||
args: Vec<Arg>,
|
||||
exec_state: &mut ExecState,
|
||||
fn_memory: &mut ProgramMemory,
|
||||
) -> Result<(), KclError> {
|
||||
let num_args = function_expression.number_of_args();
|
||||
let (min_params, max_params) = num_args.into_inner();
|
||||
@ -1524,15 +1530,12 @@ fn assign_args_to_params(
|
||||
return Err(err_wrong_number_args);
|
||||
}
|
||||
|
||||
let mem = &mut exec_state.global.memory;
|
||||
let settings = &exec_state.mod_local.settings;
|
||||
|
||||
// Add the arguments to the memory. A new call frame should have already
|
||||
// been created.
|
||||
for (index, param) in function_expression.params.iter().enumerate() {
|
||||
if let Some(arg) = args.get(index) {
|
||||
// Argument was provided.
|
||||
mem.add(
|
||||
fn_memory.add(
|
||||
param.identifier.name.clone(),
|
||||
arg.value.clone(),
|
||||
(¶m.identifier).into(),
|
||||
@ -1542,9 +1545,9 @@ fn assign_args_to_params(
|
||||
if let Some(ref default_val) = param.default_value {
|
||||
// If the corresponding parameter is optional,
|
||||
// then it's fine, the user doesn't need to supply it.
|
||||
mem.add(
|
||||
fn_memory.add(
|
||||
param.identifier.name.clone(),
|
||||
KclValue::from_default_param(default_val.clone(), settings),
|
||||
default_val.clone().into(),
|
||||
(¶m.identifier).into(),
|
||||
)?;
|
||||
} else {
|
||||
@ -1560,21 +1563,18 @@ fn assign_args_to_params(
|
||||
fn assign_args_to_params_kw(
|
||||
function_expression: NodeRef<'_, FunctionExpression>,
|
||||
mut args: crate::std::args::KwArgs,
|
||||
exec_state: &mut ExecState,
|
||||
fn_memory: &mut ProgramMemory,
|
||||
) -> Result<(), KclError> {
|
||||
// Add the arguments to the memory. A new call frame should have already
|
||||
// been created.
|
||||
let source_ranges = vec![function_expression.into()];
|
||||
let mem = &mut exec_state.global.memory;
|
||||
let settings = &exec_state.mod_local.settings;
|
||||
|
||||
for param in function_expression.params.iter() {
|
||||
if param.labeled {
|
||||
let arg = args.labeled.get(¶m.identifier.name);
|
||||
let arg_val = match arg {
|
||||
Some(arg) => arg.value.clone(),
|
||||
None => match param.default_value {
|
||||
Some(ref default_val) => KclValue::from_default_param(default_val.clone(), settings),
|
||||
Some(ref default_val) => KclValue::from(default_val.clone()),
|
||||
None => {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
source_ranges,
|
||||
@ -1586,7 +1586,7 @@ fn assign_args_to_params_kw(
|
||||
}
|
||||
},
|
||||
};
|
||||
mem.add(param.identifier.name.clone(), arg_val, (¶m.identifier).into())?;
|
||||
fn_memory.add(param.identifier.name.clone(), arg_val, (¶m.identifier).into())?;
|
||||
} else {
|
||||
let Some(unlabeled) = args.unlabeled.take() else {
|
||||
let param_name = ¶m.identifier.name;
|
||||
@ -1603,7 +1603,7 @@ fn assign_args_to_params_kw(
|
||||
})
|
||||
});
|
||||
};
|
||||
mem.add(
|
||||
fn_memory.add(
|
||||
param.identifier.name.clone(),
|
||||
unlabeled.value.clone(),
|
||||
(¶m.identifier).into(),
|
||||
@ -1624,7 +1624,7 @@ pub(crate) async fn call_user_defined_function(
|
||||
// variables shadow variables in the parent scope. The new environment's
|
||||
// parent should be the environment of the closure.
|
||||
exec_state.mut_memory().push_new_env_for_call(memory);
|
||||
if let Err(e) = assign_args_to_params(function_expression, args, exec_state) {
|
||||
if let Err(e) = assign_args_to_params(function_expression, args, exec_state.mut_memory()) {
|
||||
exec_state.mut_memory().pop_env();
|
||||
return Err(e);
|
||||
}
|
||||
@ -1657,7 +1657,7 @@ pub(crate) async fn call_user_defined_function_kw(
|
||||
// variables shadow variables in the parent scope. The new environment's
|
||||
// parent should be the environment of the closure.
|
||||
exec_state.mut_memory().push_new_env_for_call(memory);
|
||||
if let Err(e) = assign_args_to_params_kw(function_expression, args, exec_state) {
|
||||
if let Err(e) = assign_args_to_params_kw(function_expression, args, exec_state.mut_memory()) {
|
||||
exec_state.mut_memory().pop_env();
|
||||
return Err(e);
|
||||
}
|
||||
@ -1721,7 +1721,7 @@ impl JsonSchema for FunctionParam<'_> {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{
|
||||
execution::{memory::ProgramMemory, parse_execute},
|
||||
execution::parse_execute,
|
||||
parsing::ast::types::{DefaultParamVal, Identifier, Parameter},
|
||||
};
|
||||
|
||||
@ -1731,9 +1731,8 @@ mod test {
|
||||
fn test_assign_args_to_params() {
|
||||
// Set up a little framework for this test.
|
||||
fn mem(number: usize) -> KclValue {
|
||||
KclValue::Number {
|
||||
value: number as f64,
|
||||
ty: NumericType::count(),
|
||||
KclValue::Int {
|
||||
value: number as i64,
|
||||
meta: Default::default(),
|
||||
}
|
||||
}
|
||||
@ -1839,8 +1838,8 @@ mod test {
|
||||
digest: None,
|
||||
});
|
||||
let args = args.into_iter().map(Arg::synthetic).collect();
|
||||
let mut exec_state = ExecState::new(&Default::default());
|
||||
let actual = assign_args_to_params(func_expr, args, &mut exec_state).map(|_| exec_state.global.memory);
|
||||
let mut actual = ProgramMemory::new();
|
||||
let actual = assign_args_to_params(func_expr, args, &mut actual).map(|_| actual);
|
||||
assert_eq!(
|
||||
actual, expected,
|
||||
"failed test '{test_name}':\ngot {actual:?}\nbut expected\n{expected:?}"
|
||||
|
@ -12,16 +12,14 @@ use crate::{
|
||||
TagIdentifier,
|
||||
},
|
||||
parsing::{
|
||||
ast::types::{
|
||||
DefaultParamVal, FunctionExpression, KclNone, Literal, LiteralValue, Node, TagDeclarator, TagNode,
|
||||
},
|
||||
ast::types::{FunctionExpression, KclNone, LiteralValue, TagDeclarator, TagNode},
|
||||
token::NumericSuffix,
|
||||
},
|
||||
std::{args::Arg, FnAsArg},
|
||||
ExecutorContext, KclError, ModuleId, SourceRange,
|
||||
};
|
||||
|
||||
use super::{memory::EnvironmentRef, MetaSettings};
|
||||
use super::memory::EnvironmentRef;
|
||||
|
||||
pub type KclObjectFields = HashMap<String, KclValue>;
|
||||
|
||||
@ -42,7 +40,11 @@ pub enum KclValue {
|
||||
},
|
||||
Number {
|
||||
value: f64,
|
||||
ty: NumericType,
|
||||
#[serde(rename = "__meta")]
|
||||
meta: Vec<Metadata>,
|
||||
},
|
||||
Int {
|
||||
value: i64,
|
||||
#[serde(rename = "__meta")]
|
||||
meta: Vec<Metadata>,
|
||||
},
|
||||
@ -166,6 +168,7 @@ impl From<KclValue> for Vec<SourceRange> {
|
||||
KclValue::Face { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Bool { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::Number { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::Int { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::String { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::Array { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::Object { meta, .. } => to_vec_sr(&meta),
|
||||
@ -197,6 +200,7 @@ impl From<&KclValue> for Vec<SourceRange> {
|
||||
KclValue::Face { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Bool { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::Number { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::Int { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::String { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::Uuid { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::Array { meta, .. } => to_vec_sr(meta),
|
||||
@ -213,7 +217,8 @@ impl KclValue {
|
||||
match self {
|
||||
KclValue::Uuid { value: _, meta } => meta.clone(),
|
||||
KclValue::Bool { value: _, meta } => meta.clone(),
|
||||
KclValue::Number { meta, .. } => meta.clone(),
|
||||
KclValue::Number { value: _, meta } => meta.clone(),
|
||||
KclValue::Int { value: _, meta } => meta.clone(),
|
||||
KclValue::String { value: _, meta } => meta.clone(),
|
||||
KclValue::Array { value: _, meta } => meta.clone(),
|
||||
KclValue::Object { value: _, meta } => meta.clone(),
|
||||
@ -292,6 +297,7 @@ impl KclValue {
|
||||
KclValue::Face { .. } => "Face",
|
||||
KclValue::Bool { .. } => "boolean (true/false value)",
|
||||
KclValue::Number { .. } => "number",
|
||||
KclValue::Int { .. } => "integer",
|
||||
KclValue::String { .. } => "string (text)",
|
||||
KclValue::Array { .. } => "array (list)",
|
||||
KclValue::Object { .. } => "object",
|
||||
@ -301,29 +307,14 @@ impl KclValue {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_literal(literal: Node<Literal>, settings: &MetaSettings) -> Self {
|
||||
let meta = vec![literal.metadata()];
|
||||
match literal.inner.value {
|
||||
LiteralValue::Number { value, suffix } => KclValue::Number {
|
||||
value,
|
||||
meta,
|
||||
ty: NumericType::from_parsed(suffix, settings),
|
||||
},
|
||||
pub(crate) fn from_literal(literal: LiteralValue, meta: Vec<Metadata>) -> Self {
|
||||
match literal {
|
||||
LiteralValue::Number { value, .. } => KclValue::Number { value, meta },
|
||||
LiteralValue::String(value) => KclValue::String { value, meta },
|
||||
LiteralValue::Bool(value) => KclValue::Bool { value, meta },
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_default_param(param: DefaultParamVal, settings: &MetaSettings) -> Self {
|
||||
match param {
|
||||
DefaultParamVal::Literal(lit) => Self::from_literal(lit, settings),
|
||||
DefaultParamVal::KclNone(none) => KclValue::KclNone {
|
||||
value: none,
|
||||
meta: Default::default(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_env_ref(&self, env_map: &HashMap<EnvironmentRef, EnvironmentRef>) -> Self {
|
||||
let mut result = self.clone();
|
||||
if let KclValue::Function { ref mut memory, .. } = result {
|
||||
@ -336,30 +327,20 @@ impl KclValue {
|
||||
|
||||
/// Put the number into a KCL value.
|
||||
pub const fn from_number(f: f64, meta: Vec<Metadata>) -> Self {
|
||||
Self::Number {
|
||||
value: f,
|
||||
meta,
|
||||
ty: NumericType::Unknown,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn from_number_with_type(f: f64, ty: NumericType, meta: Vec<Metadata>) -> Self {
|
||||
Self::Number { value: f, meta, ty }
|
||||
Self::Number { value: f, meta }
|
||||
}
|
||||
|
||||
/// Put the point into a KCL value.
|
||||
pub fn from_point2d(p: [f64; 2], ty: NumericType, meta: Vec<Metadata>) -> Self {
|
||||
pub fn from_point2d(p: [f64; 2], meta: Vec<Metadata>) -> Self {
|
||||
Self::Array {
|
||||
value: vec![
|
||||
Self::Number {
|
||||
value: p[0],
|
||||
meta: meta.clone(),
|
||||
ty: ty.clone(),
|
||||
},
|
||||
Self::Number {
|
||||
value: p[1],
|
||||
meta: meta.clone(),
|
||||
ty,
|
||||
},
|
||||
],
|
||||
meta,
|
||||
@ -368,6 +349,7 @@ impl KclValue {
|
||||
|
||||
pub(crate) fn as_usize(&self) -> Option<usize> {
|
||||
match self {
|
||||
KclValue::Int { value, .. } if *value > 0 => Some(*value as usize),
|
||||
KclValue::Number { value, .. } => crate::try_f64_to_usize(*value),
|
||||
_ => None,
|
||||
}
|
||||
@ -375,6 +357,7 @@ impl KclValue {
|
||||
|
||||
pub fn as_int(&self) -> Option<i64> {
|
||||
match self {
|
||||
KclValue::Int { value, .. } => Some(*value),
|
||||
KclValue::Number { value, .. } => crate::try_f64_to_i64(*value),
|
||||
_ => None,
|
||||
}
|
||||
@ -455,8 +438,10 @@ impl KclValue {
|
||||
}
|
||||
|
||||
pub fn as_f64(&self) -> Option<f64> {
|
||||
if let KclValue::Number { value, .. } = &self {
|
||||
if let KclValue::Number { value, meta: _ } = &self {
|
||||
Some(*value)
|
||||
} else if let KclValue::Int { value, meta: _ } = &self {
|
||||
Some(*value as f64)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@ -621,73 +606,6 @@ impl KclValue {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum NumericType {
|
||||
// Specified by the user (directly or indirectly)
|
||||
Known(UnitType),
|
||||
// Unspecified, using defaults
|
||||
Default { len: UnitLen, angle: UnitAngle },
|
||||
// Exceeded the ability of the type system to track.
|
||||
Unknown,
|
||||
// Type info has been explicitly cast away.
|
||||
Any,
|
||||
}
|
||||
|
||||
impl NumericType {
|
||||
pub fn count() -> Self {
|
||||
NumericType::Known(UnitType::Count)
|
||||
}
|
||||
|
||||
pub fn combine(self, other: &NumericType) -> NumericType {
|
||||
if &self == other {
|
||||
self
|
||||
} else {
|
||||
NumericType::Unknown
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_parsed(suffix: NumericSuffix, settings: &super::MetaSettings) -> Self {
|
||||
match suffix {
|
||||
NumericSuffix::None => NumericType::Default {
|
||||
len: settings.default_length_units,
|
||||
angle: settings.default_angle_units,
|
||||
},
|
||||
NumericSuffix::Count => NumericType::Known(UnitType::Count),
|
||||
NumericSuffix::Mm => NumericType::Known(UnitType::Length(UnitLen::Mm)),
|
||||
NumericSuffix::Cm => NumericType::Known(UnitType::Length(UnitLen::Cm)),
|
||||
NumericSuffix::M => NumericType::Known(UnitType::Length(UnitLen::M)),
|
||||
NumericSuffix::Inch => NumericType::Known(UnitType::Length(UnitLen::Inches)),
|
||||
NumericSuffix::Ft => NumericType::Known(UnitType::Length(UnitLen::Feet)),
|
||||
NumericSuffix::Yd => NumericType::Known(UnitType::Length(UnitLen::Yards)),
|
||||
NumericSuffix::Deg => NumericType::Known(UnitType::Angle(UnitAngle::Degrees)),
|
||||
NumericSuffix::Rad => NumericType::Known(UnitType::Angle(UnitAngle::Radians)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<UnitLen> for NumericType {
|
||||
fn from(value: UnitLen) -> Self {
|
||||
NumericType::Known(UnitType::Length(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<UnitAngle> for NumericType {
|
||||
fn from(value: UnitAngle) -> Self {
|
||||
NumericType::Known(UnitType::Angle(value))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum UnitType {
|
||||
Count,
|
||||
Length(UnitLen),
|
||||
Angle(UnitAngle),
|
||||
}
|
||||
|
||||
// TODO called UnitLen so as not to clash with UnitLength in settings)
|
||||
#[derive(Debug, Default, Clone, Copy, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq)]
|
||||
#[ts(export)]
|
||||
|
@ -845,8 +845,6 @@ mod env {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::execution::kcl_value::NumericType;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn sr() -> SourceRange {
|
||||
@ -854,9 +852,8 @@ mod test {
|
||||
}
|
||||
|
||||
fn val(value: i64) -> KclValue {
|
||||
KclValue::Number {
|
||||
value: value as f64,
|
||||
ty: NumericType::count(),
|
||||
KclValue::Int {
|
||||
value,
|
||||
meta: Vec::new(),
|
||||
}
|
||||
}
|
||||
@ -864,14 +861,14 @@ mod test {
|
||||
#[track_caller]
|
||||
fn assert_get(mem: &ProgramMemory, key: &str, n: i64) {
|
||||
match mem.get(key, sr()).unwrap() {
|
||||
KclValue::Number { value, .. } => assert_eq!(*value as i64, n),
|
||||
KclValue::Int { value, .. } => assert_eq!(*value, n),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
fn expect_small_number(value: &KclValue) -> Option<i64> {
|
||||
fn expect_int(value: &KclValue) -> Option<i64> {
|
||||
match value {
|
||||
KclValue::Number { value, .. } if value > &0.0 && value < &10.0 => Some(*value as i64),
|
||||
KclValue::Int { value, .. } => Some(*value),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -879,7 +876,7 @@ mod test {
|
||||
#[track_caller]
|
||||
fn assert_get_from(mem: &ProgramMemory, key: &str, n: i64, snapshot: EnvironmentRef) {
|
||||
match mem.get_from(key, snapshot, sr()).unwrap() {
|
||||
KclValue::Number { value, .. } => assert_eq!(*value as i64, n),
|
||||
KclValue::Int { value, .. } => assert_eq!(*value, n),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
@ -1130,7 +1127,7 @@ mod test {
|
||||
assert_get_from(mem, "b", 3, sn3);
|
||||
assert_get_from(mem, "b", 4, sn4);
|
||||
|
||||
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_small_number).collect();
|
||||
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_int).collect();
|
||||
let expected = [6, 1, 3, 1, 7];
|
||||
assert_eq!(vals, expected);
|
||||
|
||||
@ -1139,7 +1136,7 @@ mod test {
|
||||
mem.get_from("b", sn1, sr()).unwrap_err();
|
||||
assert_get_from(mem, "b", 3, sn2);
|
||||
|
||||
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_small_number).collect();
|
||||
let vals: Vec<_> = mem.walk_call_stack().filter_map(expect_int).collect();
|
||||
let expected = [1, 7];
|
||||
assert_eq!(vals, expected);
|
||||
|
||||
|
@ -1581,7 +1581,7 @@ pub struct CallExpression {
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
#[serde(tag = "type")]
|
||||
pub struct CallExpressionKw {
|
||||
pub callee: Node<Identifier>,
|
||||
pub unlabeled: Option<Expr>,
|
||||
@ -1591,9 +1591,6 @@ pub struct CallExpressionKw {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub digest: Option<Digest>,
|
||||
|
||||
#[serde(default, skip_serializing_if = "NonCodeMeta::is_empty")]
|
||||
pub non_code_meta: NonCodeMeta,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
@ -1717,7 +1714,6 @@ impl CallExpressionKw {
|
||||
unlabeled,
|
||||
arguments,
|
||||
digest: None,
|
||||
non_code_meta: Default::default(),
|
||||
}))
|
||||
}
|
||||
|
||||
@ -2084,6 +2080,30 @@ impl Literal {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Node<Literal>> for KclValue {
|
||||
fn from(literal: Node<Literal>) -> Self {
|
||||
let meta = vec![literal.metadata()];
|
||||
match literal.inner.value {
|
||||
LiteralValue::Number { value, .. } => KclValue::Number { value, meta },
|
||||
LiteralValue::String(value) => KclValue::String { value, meta },
|
||||
LiteralValue::Bool(value) => KclValue::Bool { value, meta },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Node<Literal>> for KclValue {
|
||||
fn from(literal: &Node<Literal>) -> Self {
|
||||
Self::from(literal.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&BoxNode<Literal>> for KclValue {
|
||||
fn from(literal: &BoxNode<Literal>) -> Self {
|
||||
let b: &Node<Literal> = literal;
|
||||
Self::from(b)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
@ -3068,7 +3088,20 @@ pub enum FnArgType {
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum DefaultParamVal {
|
||||
KclNone(KclNone),
|
||||
Literal(Node<Literal>),
|
||||
Literal(Literal),
|
||||
}
|
||||
|
||||
// TODO: This should actually take metadata.
|
||||
impl From<DefaultParamVal> for KclValue {
|
||||
fn from(v: DefaultParamVal) -> Self {
|
||||
match v {
|
||||
DefaultParamVal::KclNone(kcl_none) => Self::KclNone {
|
||||
value: kcl_none,
|
||||
meta: Default::default(),
|
||||
},
|
||||
DefaultParamVal::Literal(literal) => Self::from_literal(literal.value, Vec::new()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl DefaultParamVal {
|
||||
|
@ -882,17 +882,6 @@ fn property_separator(i: &mut TokenSlice) -> PResult<()> {
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
/// Match something that separates the labeled arguments of a fn call.
|
||||
fn labeled_arg_separator(i: &mut TokenSlice) -> PResult<()> {
|
||||
alt((
|
||||
// Normally you need a comma.
|
||||
comma_sep,
|
||||
// But, if the argument list is ending, no need for a comma.
|
||||
peek(preceded(opt(whitespace), close_paren)).void(),
|
||||
))
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
/// Parse a KCL object value.
|
||||
pub(crate) fn object(i: &mut TokenSlice) -> PResult<Node<ObjectExpression>> {
|
||||
let open = open_brace(i)?;
|
||||
@ -2507,6 +2496,14 @@ fn labeled_argument(i: &mut TokenSlice) -> PResult<LabeledArg> {
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
/// Arguments are passed into a function,
|
||||
/// preceded by the name of the parameter (the label).
|
||||
fn labeled_arguments(i: &mut TokenSlice) -> PResult<Vec<LabeledArg>> {
|
||||
separated(0.., labeled_argument, comma_sep)
|
||||
.context(expected("function arguments"))
|
||||
.parse_next(i)
|
||||
}
|
||||
|
||||
/// A type of a function argument.
|
||||
/// This can be:
|
||||
/// - a primitive type, e.g. 'number' or 'string' or 'bool'
|
||||
@ -2582,7 +2579,7 @@ fn parameter(i: &mut TokenSlice) -> PResult<ParamDescription> {
|
||||
arg_name,
|
||||
type_,
|
||||
default_value: match (question_mark.is_some(), default_literal) {
|
||||
(true, Some(lit)) => Some(DefaultParamVal::Literal(*lit)),
|
||||
(true, Some(lit)) => Some(DefaultParamVal::Literal(lit.inner)),
|
||||
(true, None) => Some(DefaultParamVal::none()),
|
||||
(false, None) => None,
|
||||
(false, Some(lit)) => {
|
||||
@ -2786,28 +2783,7 @@ fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
||||
ignore_whitespace(i);
|
||||
|
||||
let initial_unlabeled_arg = opt((expression, comma, opt(whitespace)).map(|(arg, _, _)| arg)).parse_next(i)?;
|
||||
let args: Vec<_> = repeat(
|
||||
0..,
|
||||
alt((
|
||||
terminated(non_code_node.map(NonCodeOr::NonCode), whitespace),
|
||||
terminated(labeled_argument, labeled_arg_separator).map(NonCodeOr::Code),
|
||||
)),
|
||||
)
|
||||
.parse_next(i)?;
|
||||
let (args, non_code_nodes): (Vec<_>, BTreeMap<usize, _>) = args.into_iter().enumerate().fold(
|
||||
(Vec::new(), BTreeMap::new()),
|
||||
|(mut args, mut non_code_nodes), (i, e)| {
|
||||
match e {
|
||||
NonCodeOr::NonCode(x) => {
|
||||
non_code_nodes.insert(i, vec![x]);
|
||||
}
|
||||
NonCodeOr::Code(x) => {
|
||||
args.push(x);
|
||||
}
|
||||
}
|
||||
(args, non_code_nodes)
|
||||
},
|
||||
);
|
||||
let args = labeled_arguments(i)?;
|
||||
if let Some(std_fn) = crate::std::get_stdlib_fn(&fn_name.name) {
|
||||
let just_args: Vec<_> = args.iter().collect();
|
||||
typecheck_all_kw(std_fn, &just_args)?;
|
||||
@ -2816,10 +2792,6 @@ fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
||||
opt(comma_sep).parse_next(i)?;
|
||||
let end = close_paren.parse_next(i)?.end;
|
||||
|
||||
let non_code_meta = NonCodeMeta {
|
||||
non_code_nodes,
|
||||
..Default::default()
|
||||
};
|
||||
Ok(Node {
|
||||
start: fn_name.start,
|
||||
end,
|
||||
@ -2829,7 +2801,6 @@ fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
||||
unlabeled: initial_unlabeled_arg,
|
||||
arguments: args,
|
||||
digest: None,
|
||||
non_code_meta,
|
||||
},
|
||||
outer_attrs: Vec::new(),
|
||||
})
|
||||
@ -4419,6 +4390,14 @@ let myBox = box([0,0], -3, -16, -10)
|
||||
crate::parsing::top_level_parse(some_program_string).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arg_labels() {
|
||||
let input = r#"length: 3"#;
|
||||
let module_id = ModuleId::default();
|
||||
let tokens = crate::parsing::token::lex(input, module_id).unwrap();
|
||||
super::labeled_arguments(&mut tokens.as_slice()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn kw_fn() {
|
||||
for input in ["val = foo(x, y = z)", "val = foo(y = z)"] {
|
||||
@ -4900,22 +4879,6 @@ my14 = 4 ^ 2 - 3 ^ 2 * 2
|
||||
r#"fn foo(x?: number = 2) { return 1 }"#
|
||||
);
|
||||
snapshot_test!(kw_function_call_in_pipe, r#"val = 1 |> f(arg = x)"#);
|
||||
snapshot_test!(
|
||||
kw_function_call_multiline,
|
||||
r#"val = f(
|
||||
arg = x,
|
||||
foo = x,
|
||||
bar = x,
|
||||
)"#
|
||||
);
|
||||
snapshot_test!(
|
||||
kw_function_call_multiline_with_comments,
|
||||
r#"val = f(
|
||||
arg = x,
|
||||
// foo = x,
|
||||
bar = x,
|
||||
)"#
|
||||
);
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
|
@ -1,86 +0,0 @@
|
||||
---
|
||||
source: kcl/src/parsing/parser.rs
|
||||
expression: actual
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"body": [
|
||||
{
|
||||
"declaration": {
|
||||
"end": 87,
|
||||
"id": {
|
||||
"end": 3,
|
||||
"name": "val",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "arg"
|
||||
},
|
||||
"arg": {
|
||||
"end": 29,
|
||||
"name": "x",
|
||||
"start": 28,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "foo"
|
||||
},
|
||||
"arg": {
|
||||
"end": 51,
|
||||
"name": "x",
|
||||
"start": 50,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "bar"
|
||||
},
|
||||
"arg": {
|
||||
"end": 73,
|
||||
"name": "x",
|
||||
"start": 72,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 7,
|
||||
"name": "f",
|
||||
"start": 6,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 87,
|
||||
"start": 6,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 87,
|
||||
"kind": "const",
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"end": 87,
|
||||
"start": 0
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
---
|
||||
source: kcl/src/parsing/parser.rs
|
||||
expression: actual
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"body": [
|
||||
{
|
||||
"declaration": {
|
||||
"end": 90,
|
||||
"id": {
|
||||
"end": 3,
|
||||
"name": "val",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "arg"
|
||||
},
|
||||
"arg": {
|
||||
"end": 29,
|
||||
"name": "x",
|
||||
"start": 28,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "bar"
|
||||
},
|
||||
"arg": {
|
||||
"end": 76,
|
||||
"name": "x",
|
||||
"start": 75,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 7,
|
||||
"name": "f",
|
||||
"start": 6,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 90,
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"1": [
|
||||
{
|
||||
"end": 55,
|
||||
"start": 44,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "blockComment",
|
||||
"value": "foo = x,",
|
||||
"style": "line"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"startNodes": []
|
||||
},
|
||||
"start": 6,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
},
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 90,
|
||||
"kind": "const",
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"end": 90,
|
||||
"start": 0
|
||||
}
|
@ -48,15 +48,13 @@ expression: actual
|
||||
"type": "Identifier"
|
||||
},
|
||||
"default_value": {
|
||||
"end": 21,
|
||||
"raw": "2",
|
||||
"start": 20,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"raw": "2"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -48,15 +48,13 @@ expression: actual
|
||||
"type": "Identifier"
|
||||
},
|
||||
"default_value": {
|
||||
"end": 13,
|
||||
"raw": "2",
|
||||
"start": 12,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 2.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"raw": "2"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1600,27 +1600,6 @@ mod parametric {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod ssi_pattern {
|
||||
const TEST_NAME: &str = "ssi_pattern";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[test]
|
||||
fn unparse() {
|
||||
super::unparse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod angled_line {
|
||||
const TEST_NAME: &str = "angled_line";
|
||||
|
||||
|
@ -8,8 +8,8 @@ use super::shapes::PolygonType;
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::{
|
||||
kcl_value::NumericType, ExecState, ExecutorContext, ExtrudeSurface, Helix, KclObjectFields, KclValue, Metadata,
|
||||
Sketch, SketchSet, SketchSurface, Solid, SolidSet, TagIdentifier,
|
||||
ExecState, ExecutorContext, ExtrudeSurface, Helix, KclObjectFields, KclValue, Metadata, Sketch, SketchSet,
|
||||
SketchSurface, Solid, SolidSet, TagIdentifier,
|
||||
},
|
||||
parsing::ast::types::TagNode,
|
||||
source_range::SourceRange,
|
||||
@ -299,12 +299,10 @@ impl Args {
|
||||
let x = KclValue::Number {
|
||||
value: p[0],
|
||||
meta: vec![meta],
|
||||
ty: NumericType::Unknown,
|
||||
};
|
||||
let y = KclValue::Number {
|
||||
value: p[1],
|
||||
meta: vec![meta],
|
||||
ty: NumericType::Unknown,
|
||||
};
|
||||
Ok(KclValue::Array {
|
||||
value: vec![x, y],
|
||||
@ -321,16 +319,6 @@ impl Args {
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn make_user_val_from_f64_with_type(&self, f: f64, ty: NumericType) -> KclValue {
|
||||
KclValue::from_number_with_type(
|
||||
f,
|
||||
ty,
|
||||
vec![Metadata {
|
||||
source_range: self.source_range,
|
||||
}],
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn make_user_val_from_f64_array(&self, f: Vec<f64>) -> Result<KclValue, KclError> {
|
||||
let array = f
|
||||
.into_iter()
|
||||
@ -339,7 +327,6 @@ impl Args {
|
||||
meta: vec![Metadata {
|
||||
source_range: self.source_range,
|
||||
}],
|
||||
ty: NumericType::Unknown,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
Ok(KclValue::Array {
|
||||
@ -354,10 +341,6 @@ impl Args {
|
||||
FromArgs::from_args(self, 0)
|
||||
}
|
||||
|
||||
pub(crate) fn get_number_with_type(&self) -> Result<(f64, NumericType), KclError> {
|
||||
FromArgs::from_args(self, 0)
|
||||
}
|
||||
|
||||
pub(crate) fn get_number_array(&self) -> Result<Vec<f64>, KclError> {
|
||||
let numbers = self
|
||||
.args
|
||||
@ -375,25 +358,8 @@ impl Args {
|
||||
Ok(numbers)
|
||||
}
|
||||
|
||||
pub(crate) fn get_number_array_with_types(&self) -> Result<Vec<(f64, NumericType)>, KclError> {
|
||||
let numbers = self
|
||||
.args
|
||||
.iter()
|
||||
.map(|arg| {
|
||||
let Some(num) = <(f64, NumericType)>::from_kcl_val(&arg.value) else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
source_ranges: arg.source_ranges(),
|
||||
message: format!("Expected a number but found {}", arg.value.human_friendly_type()),
|
||||
}));
|
||||
};
|
||||
Ok(num)
|
||||
})
|
||||
.collect::<Result<_, _>>()?;
|
||||
Ok(numbers)
|
||||
}
|
||||
|
||||
pub(crate) fn get_hypotenuse_leg(&self) -> Result<(f64, f64, NumericType), KclError> {
|
||||
let numbers = self.get_number_array_with_types()?;
|
||||
pub(crate) fn get_hypotenuse_leg(&self) -> Result<(f64, f64), KclError> {
|
||||
let numbers = self.get_number_array()?;
|
||||
|
||||
if numbers.len() != 2 {
|
||||
return Err(KclError::Type(KclErrorDetails {
|
||||
@ -402,11 +368,7 @@ impl Args {
|
||||
}));
|
||||
}
|
||||
|
||||
let mut numbers = numbers.into_iter();
|
||||
let (a, ta) = numbers.next().unwrap();
|
||||
let (b, tb) = numbers.next().unwrap();
|
||||
let ty = ta.combine(&tb);
|
||||
Ok((a, b, ty))
|
||||
Ok((numbers[0], numbers[1]))
|
||||
}
|
||||
|
||||
pub(crate) fn get_circle_args(
|
||||
@ -494,6 +456,13 @@ impl Args {
|
||||
FromArgs::from_args(self, 0)
|
||||
}
|
||||
|
||||
pub(crate) fn get_data_and_float<'a, T>(&'a self) -> Result<(T, f64), KclError>
|
||||
where
|
||||
T: serde::de::DeserializeOwned + FromKclValue<'a> + Sized,
|
||||
{
|
||||
FromArgs::from_args(self, 0)
|
||||
}
|
||||
|
||||
pub(crate) async fn get_adjacent_face_to_tag(
|
||||
&self,
|
||||
exec_state: &mut ExecState,
|
||||
@ -1421,7 +1390,8 @@ impl<'a> FromKclValue<'a> for super::sketch::AngledLineData {
|
||||
impl<'a> FromKclValue<'a> for i64 {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Number { value, .. } => crate::try_f64_to_i64(*value),
|
||||
KclValue::Number { value, meta: _ } => crate::try_f64_to_i64(*value),
|
||||
KclValue::Int { value, meta: _ } => Some(*value),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1457,7 +1427,8 @@ impl<'a> FromKclValue<'a> for uuid::Uuid {
|
||||
impl<'a> FromKclValue<'a> for u32 {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Number { value, .. } => crate::try_f64_to_u32(*value),
|
||||
KclValue::Number { value, meta: _ } => crate::try_f64_to_u32(*value),
|
||||
KclValue::Int { value, meta: _ } => Some(*value as u32),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1472,7 +1443,8 @@ impl<'a> FromKclValue<'a> for NonZeroU32 {
|
||||
impl<'a> FromKclValue<'a> for u64 {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Number { value, .. } => crate::try_f64_to_u64(*value),
|
||||
KclValue::Number { value, meta: _ } => crate::try_f64_to_u64(*value),
|
||||
KclValue::Int { value, meta: _ } => Some(*value as u64),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1480,15 +1452,8 @@ impl<'a> FromKclValue<'a> for u64 {
|
||||
impl<'a> FromKclValue<'a> for f64 {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Number { value, .. } => Some(*value),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<'a> FromKclValue<'a> for (f64, NumericType) {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Number { value, ty, .. } => Some((*value, ty.clone())),
|
||||
KclValue::Number { value, meta: _ } => Some(*value),
|
||||
KclValue::Int { value, meta: _ } => Some(*value as f64),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ use derive_docs::stdlib;
|
||||
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::{kcl_value::NumericType, ExecState, KclValue},
|
||||
execution::{ExecState, KclValue},
|
||||
std::Args,
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ async fn _assert(value: bool, message: &str, args: &Args) -> Result<(), KclError
|
||||
pub async fn assert(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, description): (bool, String) = args.get_data()?;
|
||||
inner_assert(data, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check a value at runtime, and raise an error if the argument provided
|
||||
@ -44,7 +44,7 @@ async fn inner_assert(data: bool, message: &str, args: &Args) -> Result<(), KclE
|
||||
pub async fn assert_lt(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (left, right, description): (f64, f64, String) = args.get_data()?;
|
||||
inner_assert_lt(left, right, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check that a numerical value is less than to another at runtime,
|
||||
@ -63,7 +63,7 @@ async fn inner_assert_lt(left: f64, right: f64, message: &str, args: &Args) -> R
|
||||
pub async fn assert_gt(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (left, right, description): (f64, f64, String) = args.get_data()?;
|
||||
inner_assert_gt(left, right, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check that a numerical value equals another at runtime,
|
||||
@ -96,7 +96,7 @@ async fn inner_assert_equal(left: f64, right: f64, epsilon: f64, message: &str,
|
||||
pub async fn assert_equal(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (left, right, epsilon, description): (f64, f64, f64, String) = args.get_data()?;
|
||||
inner_assert_equal(left, right, epsilon, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check that a numerical value is greater than another at runtime,
|
||||
@ -115,7 +115,7 @@ async fn inner_assert_gt(left: f64, right: f64, message: &str, args: &Args) -> R
|
||||
pub async fn assert_lte(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (left, right, description): (f64, f64, String) = args.get_data()?;
|
||||
inner_assert_lte(left, right, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check that a numerical value is less than or equal to another at runtime,
|
||||
@ -135,7 +135,7 @@ async fn inner_assert_lte(left: f64, right: f64, message: &str, args: &Args) ->
|
||||
pub async fn assert_gte(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (left, right, description): (f64, f64, String) = args.get_data()?;
|
||||
inner_assert_gte(left, right, &description, &args).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(0.0, NumericType::count())) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
Ok(args.make_user_val_from_f64(0.0)) // TODO: Add a new Void enum for fns that don't return anything.
|
||||
}
|
||||
|
||||
/// Check that a numerical value is greater than or equal to another at runtime,
|
||||
|
@ -10,10 +10,10 @@ use crate::{
|
||||
|
||||
/// Converts a number to integer.
|
||||
pub async fn int(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (num, ty) = args.get_number_with_type()?;
|
||||
let num = args.get_number()?;
|
||||
let converted = inner_int(num)?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(converted, ty))
|
||||
Ok(args.make_user_val_from_f64(converted))
|
||||
}
|
||||
|
||||
/// Convert a number to an integer.
|
||||
|
@ -57,7 +57,7 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// triangleSketch = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
/// triangleSketch = startSketchOn(offsetPlane('XY', 75))
|
||||
/// |> startProfileAt([0, 125], %)
|
||||
/// |> line(end = [-15, -30])
|
||||
/// |> line(end = [30, 0])
|
||||
@ -77,10 +77,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
/// circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
/// circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|
||||
/// |> circle({ center = [0, 100], radius = 20 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch0, circleSketch1])
|
||||
@ -96,10 +96,10 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch0 = startSketchOn(offsetPlane('XY', offset = 75))
|
||||
/// circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// circleSketch1 = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
/// circleSketch1 = startSketchOn(offsetPlane('XY', 150))
|
||||
/// |> circle({ center = [0, 100], radius = 20 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch0, circleSketch1],
|
||||
|
@ -6,7 +6,7 @@ use derive_docs::stdlib;
|
||||
use super::args::FromArgs;
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::{kcl_value::NumericType, ExecState, KclValue},
|
||||
execution::{ExecState, KclValue},
|
||||
std::Args,
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ pub async fn cos(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
let num = args.get_number()?;
|
||||
let result = inner_cos(num)?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result, NumericType::count()))
|
||||
Ok(args.make_user_val_from_f64(result))
|
||||
}
|
||||
|
||||
/// Compute the cosine of a number (in radians).
|
||||
@ -80,7 +80,7 @@ pub async fn sin(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
let num = args.get_number()?;
|
||||
let result = inner_sin(num)?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result, NumericType::count()))
|
||||
Ok(args.make_user_val_from_f64(result))
|
||||
}
|
||||
|
||||
/// Compute the sine of a number (in radians).
|
||||
@ -110,7 +110,7 @@ pub async fn tan(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
let num = args.get_number()?;
|
||||
let result = inner_tan(num)?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result, NumericType::count()))
|
||||
Ok(args.make_user_val_from_f64(result))
|
||||
}
|
||||
|
||||
/// Compute the tangent of a number (in radians).
|
||||
|
@ -228,9 +228,9 @@ pub enum FunctionKind {
|
||||
|
||||
/// Compute the length of the given leg.
|
||||
pub async fn leg_length(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (hypotenuse, leg, ty) = args.get_hypotenuse_leg()?;
|
||||
let (hypotenuse, leg) = args.get_hypotenuse_leg()?;
|
||||
let result = inner_leg_length(hypotenuse, leg);
|
||||
Ok(KclValue::from_number_with_type(result, ty, vec![args.into()]))
|
||||
Ok(KclValue::from_number(result, vec![args.into()]))
|
||||
}
|
||||
|
||||
/// Compute the length of the given leg.
|
||||
@ -248,9 +248,9 @@ fn inner_leg_length(hypotenuse: f64, leg: f64) -> f64 {
|
||||
|
||||
/// Compute the angle of the given leg for x.
|
||||
pub async fn leg_angle_x(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (hypotenuse, leg, ty) = args.get_hypotenuse_leg()?;
|
||||
let (hypotenuse, leg) = args.get_hypotenuse_leg()?;
|
||||
let result = inner_leg_angle_x(hypotenuse, leg);
|
||||
Ok(KclValue::from_number_with_type(result, ty, vec![args.into()]))
|
||||
Ok(KclValue::from_number(result, vec![args.into()]))
|
||||
}
|
||||
|
||||
/// Compute the angle of the given leg for x.
|
||||
@ -268,9 +268,9 @@ fn inner_leg_angle_x(hypotenuse: f64, leg: f64) -> f64 {
|
||||
|
||||
/// Compute the angle of the given leg for y.
|
||||
pub async fn leg_angle_y(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (hypotenuse, leg, ty) = args.get_hypotenuse_leg()?;
|
||||
let (hypotenuse, leg) = args.get_hypotenuse_leg()?;
|
||||
let result = inner_leg_angle_y(hypotenuse, leg);
|
||||
Ok(KclValue::from_number_with_type(result, ty, vec![args.into()]))
|
||||
Ok(KclValue::from_number(result, vec![args.into()]))
|
||||
}
|
||||
|
||||
/// Compute the angle of the given leg for y.
|
||||
|
@ -20,8 +20,8 @@ use super::{args::Arg, FnAsArg};
|
||||
use crate::{
|
||||
errors::{KclError, KclErrorDetails},
|
||||
execution::{
|
||||
kcl_value::NumericType, ExecState, FunctionParam, Geometries, Geometry, KclObjectFields, KclValue, Point2d,
|
||||
Point3d, Sketch, SketchSet, Solid, SolidSet,
|
||||
ExecState, FunctionParam, Geometries, Geometry, KclObjectFields, KclValue, Point2d, Point3d, Sketch, SketchSet,
|
||||
Solid, SolidSet,
|
||||
},
|
||||
std::Args,
|
||||
SourceRange,
|
||||
@ -446,9 +446,8 @@ async fn make_transform<T: GeometryTrait>(
|
||||
exec_state: &mut ExecState,
|
||||
) -> Result<Vec<Transform>, KclError> {
|
||||
// Call the transform fn for this repetition.
|
||||
let repetition_num = KclValue::Number {
|
||||
let repetition_num = KclValue::Int {
|
||||
value: i.into(),
|
||||
ty: NumericType::count(),
|
||||
meta: vec![source_range.into()],
|
||||
};
|
||||
let transform_fn_args = vec![Arg::synthetic(repetition_num)];
|
||||
@ -531,7 +530,7 @@ fn transform_from_obj_fields<T: GeometryTrait>(
|
||||
}
|
||||
if let Some(angle) = rot.get("angle") {
|
||||
match angle {
|
||||
KclValue::Number { value: number, .. } => {
|
||||
KclValue::Number { value: number, meta: _ } => {
|
||||
rotation.angle = Angle::from_degrees(*number);
|
||||
}
|
||||
_ => {
|
||||
@ -680,8 +679,6 @@ impl GeometryTrait for Box<Solid> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::execution::kcl_value::NumericType;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@ -691,17 +688,14 @@ mod tests {
|
||||
KclValue::Number {
|
||||
value: 1.1,
|
||||
meta: Default::default(),
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
KclValue::Number {
|
||||
value: 2.2,
|
||||
meta: Default::default(),
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
KclValue::Number {
|
||||
value: 3.3,
|
||||
meta: Default::default(),
|
||||
ty: NumericType::Unknown,
|
||||
},
|
||||
],
|
||||
meta: Default::default(),
|
||||
|
@ -52,9 +52,7 @@ impl From<StandardPlane> for PlaneData {
|
||||
|
||||
/// Offset a plane by a distance along its normal.
|
||||
pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
// let (std_plane, offset): (StandardPlane, f64) = args.get_data_and_float()?;
|
||||
let std_plane = args.get_unlabeled_kw_arg("stdPlane")?;
|
||||
let offset = args.get_kw_arg("offset")?;
|
||||
let (std_plane, offset): (StandardPlane, f64) = args.get_data_and_float()?;
|
||||
let plane = inner_offset_plane(std_plane, offset, exec_state).await?;
|
||||
make_offset_plane_in_engine(&plane, exec_state, &args).await?;
|
||||
Ok(KclValue::Plane { value: Box::new(plane) })
|
||||
@ -75,7 +73,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch = startSketchOn(offsetPlane('XY', offset = 150))
|
||||
/// circleSketch = startSketchOn(offsetPlane('XY', 150))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch])
|
||||
@ -91,7 +89,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch = startSketchOn(offsetPlane('XZ', offset = 150))
|
||||
/// circleSketch = startSketchOn(offsetPlane('XZ', 150))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch])
|
||||
@ -107,7 +105,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch = startSketchOn(offsetPlane('YZ', offset = 150))
|
||||
/// circleSketch = startSketchOn(offsetPlane('YZ', 150))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch])
|
||||
@ -123,7 +121,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
/// |> close()
|
||||
///
|
||||
/// circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))
|
||||
/// circleSketch = startSketchOn(offsetPlane('-XZ', -150))
|
||||
/// |> circle({ center = [0, 100], radius = 50 }, %)
|
||||
///
|
||||
/// loft([squareSketch, circleSketch])
|
||||
@ -135,7 +133,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
/// |> circle({ radius = 10, center = [0, 0] }, %)
|
||||
///
|
||||
/// // Triangle on the plane 4 units above
|
||||
/// startSketchOn(offsetPlane("XY", offset = 4))
|
||||
/// startSketchOn(offsetPlane("XY", 4))
|
||||
/// |> startProfileAt([0, 0], %)
|
||||
/// |> line(end = [10, 0])
|
||||
/// |> line(end = [0, 10])
|
||||
@ -145,12 +143,6 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
#[stdlib {
|
||||
name = "offsetPlane",
|
||||
feature_tree_operation = true,
|
||||
keywords = true,
|
||||
unlabeled_first = true,
|
||||
args = {
|
||||
std_plane = { docs = "Which standard plane (e.g. XY) should this new plane be created from?" },
|
||||
offset = { docs = "Distance from the standard plane this new plane will be created at." },
|
||||
}
|
||||
}]
|
||||
async fn inner_offset_plane(
|
||||
std_plane: StandardPlane,
|
||||
|
@ -1388,9 +1388,8 @@ pub(crate) async fn inner_start_profile_at(
|
||||
/// Returns the X component of the sketch profile start point.
|
||||
pub async fn profile_start_x(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let sketch: Sketch = args.get_sketch()?;
|
||||
let ty = sketch.units.into();
|
||||
let x = inner_profile_start_x(sketch)?;
|
||||
Ok(args.make_user_val_from_f64_with_type(x, ty))
|
||||
Ok(args.make_user_val_from_f64(x))
|
||||
}
|
||||
|
||||
/// Extract the provided 2-dimensional sketch's profile's origin's 'x'
|
||||
@ -1413,9 +1412,8 @@ pub(crate) fn inner_profile_start_x(sketch: Sketch) -> Result<f64, KclError> {
|
||||
/// Returns the Y component of the sketch profile start point.
|
||||
pub async fn profile_start_y(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let sketch: Sketch = args.get_sketch()?;
|
||||
let ty = sketch.units.into();
|
||||
let x = inner_profile_start_y(sketch)?;
|
||||
Ok(args.make_user_val_from_f64_with_type(x, ty))
|
||||
Ok(args.make_user_val_from_f64(x))
|
||||
}
|
||||
|
||||
/// Extract the provided 2-dimensional sketch's profile's origin's 'y'
|
||||
@ -1437,9 +1435,8 @@ pub(crate) fn inner_profile_start_y(sketch: Sketch) -> Result<f64, KclError> {
|
||||
/// Returns the sketch profile start point.
|
||||
pub async fn profile_start(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let sketch: Sketch = args.get_sketch()?;
|
||||
let ty = sketch.units.into();
|
||||
let point = inner_profile_start(sketch)?;
|
||||
Ok(KclValue::from_point2d(point, ty, args.into()))
|
||||
Ok(KclValue::from_point2d(point, args.into()))
|
||||
}
|
||||
|
||||
/// Extract the provided 2-dimensional sketch's profile's origin
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing add_lots.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"f": {
|
||||
@ -107,9 +95,6 @@ description: Variables in memory after executing add_lots.kcl
|
||||
"x": {
|
||||
"type": "Number",
|
||||
"value": 10100.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing angled_line.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"arr": {
|
||||
@ -41,15 +29,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -63,15 +42,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -85,15 +55,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -121,15 +82,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -143,15 +95,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -179,15 +122,6 @@ description: Variables in memory after executing array_elem_pop.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"arr": {
|
||||
@ -41,15 +29,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -63,15 +42,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -85,15 +55,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -121,15 +82,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -143,15 +95,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -165,15 +108,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -187,15 +121,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -223,15 +148,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -245,15 +161,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -267,15 +174,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -289,15 +187,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -311,15 +200,6 @@ description: Variables in memory after executing array_elem_push.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,41 +6,26 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"five": {
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -54,15 +39,6 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"four": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -77,11 +53,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 0,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -93,11 +66,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -109,11 +79,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -125,11 +92,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -141,11 +105,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -171,11 +132,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 0,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -187,11 +145,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -203,11 +158,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -219,11 +171,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -235,11 +184,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -265,11 +211,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 0,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -281,11 +224,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -297,11 +237,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -313,11 +250,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -329,11 +263,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -345,11 +276,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 5,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -375,11 +303,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -391,11 +316,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -407,11 +329,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -423,11 +342,8 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -452,15 +368,6 @@ description: Variables in memory after executing array_range_expr.kcl
|
||||
"zero": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,44 +6,29 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"xs": {
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": -5.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": -5,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -55,11 +40,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": -4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": -4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -71,11 +53,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": -3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": -3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -87,11 +66,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": -2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": -2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -103,11 +79,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": -1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": -1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -119,11 +92,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 0,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -135,11 +105,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -151,11 +118,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -167,11 +131,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 3,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -183,11 +144,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 4,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -199,11 +157,8 @@ description: Variables in memory after executing array_range_negative_expr.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 5,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"extrude001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing artifact_graph_example_code_no_
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"rectangleSegmentA001": {
|
||||
|
@ -286,7 +286,7 @@ snapshot_kind: text
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
17,
|
||||
47,
|
||||
38,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -315,7 +315,7 @@ snapshot_kind: text
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
17,
|
||||
47,
|
||||
38,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -332,8 +332,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
65,
|
||||
96,
|
||||
56,
|
||||
78,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -361,8 +361,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
65,
|
||||
96,
|
||||
56,
|
||||
78,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -379,8 +379,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
114,
|
||||
144,
|
||||
96,
|
||||
117,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -408,8 +408,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
114,
|
||||
144,
|
||||
96,
|
||||
117,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -426,8 +426,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -446,8 +446,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -457,8 +457,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -474,8 +474,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
224,
|
||||
249,
|
||||
197,
|
||||
222,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
@ -495,8 +495,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
|
@ -1,12 +1,12 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[193, 218, 0]"]
|
||||
5["Segment<br>[224, 249, 0]"]
|
||||
4["Path<br>[166, 191, 0]"]
|
||||
5["Segment<br>[197, 222, 0]"]
|
||||
end
|
||||
1["Plane<br>[17, 47, 0]"]
|
||||
2["Plane<br>[65, 96, 0]"]
|
||||
3["Plane<br>[114, 144, 0]"]
|
||||
1["Plane<br>[17, 38, 0]"]
|
||||
2["Plane<br>[56, 78, 0]"]
|
||||
3["Plane<br>[96, 117, 0]"]
|
||||
1 --- 4
|
||||
4 --- 5
|
||||
```
|
||||
|
@ -1,14 +1,13 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Result of parsing artifact_graph_example_code_offset_planes.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"declaration": {
|
||||
"end": 47,
|
||||
"end": 38,
|
||||
"id": {
|
||||
"end": 14,
|
||||
"name": "offsetPlane001",
|
||||
@ -18,21 +17,22 @@ snapshot_kind: text
|
||||
"init": {
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "offset"
|
||||
},
|
||||
"arg": {
|
||||
"end": 46,
|
||||
"raw": "20",
|
||||
"start": 44,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 20.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
"end": 33,
|
||||
"raw": "\"XY\"",
|
||||
"start": 29,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "XY"
|
||||
},
|
||||
{
|
||||
"end": 37,
|
||||
"raw": "20",
|
||||
"start": 35,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 20.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -42,23 +42,15 @@ snapshot_kind: text
|
||||
"start": 17,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 47,
|
||||
"end": 38,
|
||||
"start": 17,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 33,
|
||||
"raw": "\"XY\"",
|
||||
"start": 29,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "XY"
|
||||
}
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
"start": 0,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 47,
|
||||
"end": 38,
|
||||
"kind": "const",
|
||||
"start": 0,
|
||||
"type": "VariableDeclaration",
|
||||
@ -66,134 +58,120 @@ snapshot_kind: text
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 96,
|
||||
"end": 78,
|
||||
"id": {
|
||||
"end": 62,
|
||||
"end": 53,
|
||||
"name": "offsetPlane002",
|
||||
"start": 48,
|
||||
"start": 39,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "offset"
|
||||
},
|
||||
"arg": {
|
||||
"argument": {
|
||||
"end": 95,
|
||||
"raw": "50",
|
||||
"start": 93,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 50.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"end": 95,
|
||||
"operator": "-",
|
||||
"start": 92,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 76,
|
||||
"name": "offsetPlane",
|
||||
"start": 65,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 96,
|
||||
"start": 65,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 81,
|
||||
"raw": "\"XZ\"",
|
||||
"start": 77,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "XZ"
|
||||
}
|
||||
},
|
||||
"start": 48,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 96,
|
||||
"kind": "const",
|
||||
"start": 48,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 144,
|
||||
"id": {
|
||||
"end": 111,
|
||||
"name": "offsetPlane003",
|
||||
"start": 97,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"arguments": [
|
||||
"end": 72,
|
||||
"raw": "\"XZ\"",
|
||||
"start": 68,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "XZ"
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"name": "offset"
|
||||
},
|
||||
"arg": {
|
||||
"end": 143,
|
||||
"raw": "10",
|
||||
"start": 141,
|
||||
"argument": {
|
||||
"end": 77,
|
||||
"raw": "50",
|
||||
"start": 75,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.0,
|
||||
"value": 50.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
},
|
||||
"end": 77,
|
||||
"operator": "-",
|
||||
"start": 74,
|
||||
"type": "UnaryExpression",
|
||||
"type": "UnaryExpression"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 125,
|
||||
"end": 67,
|
||||
"name": "offsetPlane",
|
||||
"start": 114,
|
||||
"start": 56,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 144,
|
||||
"start": 114,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"end": 130,
|
||||
"raw": "\"YZ\"",
|
||||
"start": 126,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "YZ"
|
||||
}
|
||||
"end": 78,
|
||||
"start": 56,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
"start": 97,
|
||||
"start": 39,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 144,
|
||||
"end": 78,
|
||||
"kind": "const",
|
||||
"start": 97,
|
||||
"start": 39,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 249,
|
||||
"end": 117,
|
||||
"id": {
|
||||
"end": 155,
|
||||
"end": 93,
|
||||
"name": "offsetPlane003",
|
||||
"start": 79,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"arguments": [
|
||||
{
|
||||
"end": 112,
|
||||
"raw": "\"YZ\"",
|
||||
"start": 108,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "YZ"
|
||||
},
|
||||
{
|
||||
"end": 116,
|
||||
"raw": "10",
|
||||
"start": 114,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 10.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 107,
|
||||
"name": "offsetPlane",
|
||||
"start": 96,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 117,
|
||||
"start": 96,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
"start": 79,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 117,
|
||||
"kind": "const",
|
||||
"start": 79,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 222,
|
||||
"id": {
|
||||
"end": 128,
|
||||
"name": "sketch002",
|
||||
"start": 146,
|
||||
"start": 119,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
@ -201,21 +179,21 @@ snapshot_kind: text
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"end": 186,
|
||||
"end": 159,
|
||||
"name": "offsetPlane001",
|
||||
"start": 172,
|
||||
"start": 145,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 171,
|
||||
"end": 144,
|
||||
"name": "startSketchOn",
|
||||
"start": 158,
|
||||
"start": 131,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 187,
|
||||
"start": 158,
|
||||
"end": 160,
|
||||
"start": 131,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
@ -224,9 +202,9 @@ snapshot_kind: text
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"end": 210,
|
||||
"end": 183,
|
||||
"raw": "0",
|
||||
"start": 209,
|
||||
"start": 182,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -235,9 +213,9 @@ snapshot_kind: text
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 213,
|
||||
"end": 186,
|
||||
"raw": "0",
|
||||
"start": 212,
|
||||
"start": 185,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -246,26 +224,26 @@ snapshot_kind: text
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 214,
|
||||
"start": 208,
|
||||
"end": 187,
|
||||
"start": 181,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
},
|
||||
{
|
||||
"end": 217,
|
||||
"start": 216,
|
||||
"end": 190,
|
||||
"start": 189,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 207,
|
||||
"end": 180,
|
||||
"name": "startProfileAt",
|
||||
"start": 193,
|
||||
"start": 166,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 218,
|
||||
"start": 193,
|
||||
"end": 191,
|
||||
"start": 166,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
},
|
||||
@ -280,9 +258,9 @@ snapshot_kind: text
|
||||
"arg": {
|
||||
"elements": [
|
||||
{
|
||||
"end": 240,
|
||||
"end": 213,
|
||||
"raw": "6.78",
|
||||
"start": 236,
|
||||
"start": 209,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -291,9 +269,9 @@ snapshot_kind: text
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 247,
|
||||
"end": 220,
|
||||
"raw": "15.01",
|
||||
"start": 242,
|
||||
"start": 215,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -302,48 +280,48 @@ snapshot_kind: text
|
||||
}
|
||||
}
|
||||
],
|
||||
"end": 248,
|
||||
"start": 235,
|
||||
"end": 221,
|
||||
"start": 208,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 228,
|
||||
"end": 201,
|
||||
"name": "line",
|
||||
"start": 224,
|
||||
"start": 197,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 249,
|
||||
"start": 224,
|
||||
"end": 222,
|
||||
"start": 197,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": null
|
||||
}
|
||||
],
|
||||
"end": 249,
|
||||
"start": 158,
|
||||
"end": 222,
|
||||
"start": 131,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 146,
|
||||
"start": 119,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 249,
|
||||
"end": 222,
|
||||
"kind": "const",
|
||||
"start": 146,
|
||||
"start": 119,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"end": 250,
|
||||
"end": 223,
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"2": [
|
||||
{
|
||||
"end": 146,
|
||||
"start": 144,
|
||||
"end": 119,
|
||||
"start": 117,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "newLine"
|
||||
|
@ -1,6 +1,6 @@
|
||||
offsetPlane001 = offsetPlane("XY", offset = 20)
|
||||
offsetPlane002 = offsetPlane("XZ", offset = -50)
|
||||
offsetPlane003 = offsetPlane("YZ", offset = 10)
|
||||
offsetPlane001 = offsetPlane("XY", 20)
|
||||
offsetPlane002 = offsetPlane("XZ", -50)
|
||||
offsetPlane003 = offsetPlane("YZ", 10)
|
||||
|
||||
sketch002 = startSketchOn(offsetPlane001)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|
@ -8,8 +8,15 @@ snapshot_kind: text
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"sourceRange": [
|
||||
44,
|
||||
46,
|
||||
35,
|
||||
37,
|
||||
0
|
||||
]
|
||||
},
|
||||
"std_plane": {
|
||||
"sourceRange": [
|
||||
29,
|
||||
33,
|
||||
0
|
||||
]
|
||||
}
|
||||
@ -17,82 +24,78 @@ snapshot_kind: text
|
||||
"name": "offsetPlane",
|
||||
"sourceRange": [
|
||||
17,
|
||||
47,
|
||||
38,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"sourceRange": [
|
||||
29,
|
||||
33,
|
||||
0
|
||||
]
|
||||
}
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"sourceRange": [
|
||||
92,
|
||||
95,
|
||||
74,
|
||||
77,
|
||||
0
|
||||
]
|
||||
},
|
||||
"std_plane": {
|
||||
"sourceRange": [
|
||||
68,
|
||||
72,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "offsetPlane",
|
||||
"sourceRange": [
|
||||
56,
|
||||
78,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"sourceRange": [
|
||||
114,
|
||||
116,
|
||||
0
|
||||
]
|
||||
},
|
||||
"std_plane": {
|
||||
"sourceRange": [
|
||||
108,
|
||||
112,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "offsetPlane",
|
||||
"sourceRange": [
|
||||
65,
|
||||
96,
|
||||
117,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"sourceRange": [
|
||||
77,
|
||||
81,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"offset": {
|
||||
"sourceRange": [
|
||||
141,
|
||||
143,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "offsetPlane",
|
||||
"sourceRange": [
|
||||
114,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
"unlabeledArg": {
|
||||
"sourceRange": [
|
||||
126,
|
||||
130,
|
||||
0
|
||||
]
|
||||
}
|
||||
"unlabeledArg": null
|
||||
},
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
172,
|
||||
186,
|
||||
145,
|
||||
159,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "startSketchOn",
|
||||
"sourceRange": [
|
||||
158,
|
||||
187,
|
||||
131,
|
||||
160,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
|
@ -1,39 +1,26 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Variables in memory after executing artifact_graph_example_code_offset_planes.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"offsetPlane001": {
|
||||
@ -142,8 +129,8 @@ snapshot_kind: text
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
224,
|
||||
249,
|
||||
197,
|
||||
222,
|
||||
0
|
||||
]
|
||||
},
|
||||
@ -202,8 +189,8 @@ snapshot_kind: text
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
]
|
||||
}
|
||||
@ -216,8 +203,8 @@ snapshot_kind: text
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
193,
|
||||
218,
|
||||
166,
|
||||
191,
|
||||
0
|
||||
]
|
||||
}
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing artifact_graph_sketch_on_face_e
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"extrude001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing basic_fillet_cube_close_opposit
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing basic_fillet_cube_end.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing basic_fillet_cube_next_adjacent
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing basic_fillet_cube_previous_adja
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing basic_fillet_cube_start.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing big_number_angle_to_match_lengt
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing boolean_logical_and.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"a": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -80,15 +59,6 @@ description: Variables in memory after executing boolean_logical_and.kcl
|
||||
"b": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -122,15 +92,6 @@ description: Variables in memory after executing boolean_logical_and.kcl
|
||||
"c": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -164,15 +125,6 @@ description: Variables in memory after executing boolean_logical_and.kcl
|
||||
"d": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing boolean_logical_multiple.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"i": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -87,15 +66,6 @@ description: Variables in memory after executing boolean_logical_multiple.kcl
|
||||
"j": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing boolean_logical_or.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"a": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -80,15 +59,6 @@ description: Variables in memory after executing boolean_logical_or.kcl
|
||||
"b": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -122,15 +92,6 @@ description: Variables in memory after executing boolean_logical_or.kcl
|
||||
"c": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -164,15 +125,6 @@ description: Variables in memory after executing boolean_logical_or.kcl
|
||||
"d": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing circle_three_point.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"sketch001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing circular_pattern3d_a_pattern.kc
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"exampleSketch": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing comparisons.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
}
|
||||
}
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"arr": {
|
||||
@ -41,15 +29,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -63,15 +42,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -85,15 +55,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -107,15 +68,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 10.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -140,15 +92,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"i": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -165,15 +108,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"bar": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -187,15 +121,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"foo": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -220,15 +145,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"one": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -255,15 +171,6 @@ description: Variables in memory after executing computed_var.kcl
|
||||
"ten": {
|
||||
"type": "Number",
|
||||
"value": 10.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing cube.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"cube": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"increment": {
|
||||
@ -108,11 +96,8 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
"type": "Array",
|
||||
"value": [
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 0,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -124,11 +109,8 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 1,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -140,11 +122,8 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"type": "Int",
|
||||
"value": 2,
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -172,9 +151,6 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -202,9 +178,6 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -232,9 +205,6 @@ description: Variables in memory after executing double_map_fn.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"border": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -586,15 +565,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"caseHeight": {
|
||||
"type": "Number",
|
||||
"value": 8.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -608,9 +578,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"caseLength": {
|
||||
"type": "Number",
|
||||
"value": 73.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -638,15 +605,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"caseThickness": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -660,9 +618,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"caseWidth": {
|
||||
"type": "Number",
|
||||
"value": 38.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -690,15 +645,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"connectorPadding": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -952,9 +898,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"lengthBetweenScrews": {
|
||||
"type": "Number",
|
||||
"value": 58.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1357,15 +1300,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"microUsb1Distance": {
|
||||
"type": "Number",
|
||||
"value": 41.4,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1379,15 +1313,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"microUsb2Distance": {
|
||||
"type": "Number",
|
||||
"value": 54.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1401,15 +1326,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"microUsbWidth": {
|
||||
"type": "Number",
|
||||
"value": 7.4,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1423,15 +1339,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"miniHdmiDistance": {
|
||||
"type": "Number",
|
||||
"value": 12.4,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1597,15 +1504,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"miniHdmiWidth": {
|
||||
"type": "Number",
|
||||
"value": 11.2,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1619,15 +1517,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"rpizLength": {
|
||||
"type": "Number",
|
||||
"value": 65.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1641,15 +1530,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"rpizWidth": {
|
||||
"type": "Number",
|
||||
"value": 30.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1663,15 +1543,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"screwHeight": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1685,15 +1556,6 @@ description: Variables in memory after executing fillet-and-shell.kcl
|
||||
"widthBetweenScrews": {
|
||||
"type": "Number",
|
||||
"value": 23.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing function_sketch.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"box": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing function_sketch_with_position.k
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"box": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing helix_ccw.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"part001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing helix_simple.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"edge001": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing i_shape.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"brace_base": {
|
||||
@ -670,15 +658,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
"corner_radius": {
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -695,15 +674,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 22.8,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -717,15 +687,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 10.7,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -739,15 +700,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 16.4,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -761,15 +713,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 18.5,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -1712,15 +1655,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
"hand_thickness": {
|
||||
"type": "Number",
|
||||
"value": 24.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -2006,15 +1940,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
"length": {
|
||||
"type": "Number",
|
||||
"value": 120.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -2028,9 +1953,6 @@ description: Variables in memory after executing i_shape.kcl
|
||||
"width": {
|
||||
"type": "Number",
|
||||
"value": 68.4,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing if_else.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"a": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -60,15 +39,6 @@ description: Variables in memory after executing if_else.kcl
|
||||
"b": {
|
||||
"type": "Number",
|
||||
"value": 4.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -82,15 +52,6 @@ description: Variables in memory after executing if_else.kcl
|
||||
"c": {
|
||||
"type": "Number",
|
||||
"value": 5.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing import_constant.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"three": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,47 +6,26 @@ description: Variables in memory after executing import_export.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"three": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing import_foreign.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"cube": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing import_function_not_sketch.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"one": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing import_glob.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"foo": {
|
||||
@ -87,15 +75,6 @@ description: Variables in memory after executing import_glob.kcl
|
||||
"three": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing import_side_effect.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"foo": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing import_whole.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"bar": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"arr": {
|
||||
@ -41,15 +29,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -63,15 +42,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 91.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -85,15 +55,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
{
|
||||
"type": "Number",
|
||||
"value": 92.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -118,9 +79,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
"i": {
|
||||
"type": "Number",
|
||||
"value": 1.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -134,15 +92,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
"result0": {
|
||||
"type": "Number",
|
||||
"value": 91.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -156,15 +105,6 @@ description: Variables in memory after executing index_of_array.kcl
|
||||
"result1": {
|
||||
"type": "Number",
|
||||
"value": 91.0,
|
||||
"ty": {
|
||||
"type": "Default",
|
||||
"len": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"angle": {
|
||||
"type": "Degrees"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing kittycad_svg.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"svg": {
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing kw_fn.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"add": {
|
||||
@ -183,9 +171,6 @@ description: Variables in memory after executing kw_fn.kcl
|
||||
"three": {
|
||||
"type": "Number",
|
||||
"value": 3.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -206,9 +191,6 @@ description: Variables in memory after executing kw_fn.kcl
|
||||
"two": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
@ -69,15 +69,13 @@ description: Result of parsing kw_fn_with_defaults.kcl
|
||||
"type": "Identifier"
|
||||
},
|
||||
"default_value": {
|
||||
"end": 24,
|
||||
"raw": "1",
|
||||
"start": 23,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"raw": "1"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -6,33 +6,21 @@ description: Variables in memory after executing kw_fn_with_defaults.kcl
|
||||
"HALF_TURN": {
|
||||
"type": "Number",
|
||||
"value": 180.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 90.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"THREE_QUARTER_TURN": {
|
||||
"type": "Number",
|
||||
"value": 270.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"ZERO": {
|
||||
"type": "Number",
|
||||
"value": 0.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"increment": {
|
||||
@ -92,15 +80,13 @@ description: Variables in memory after executing kw_fn_with_defaults.kcl
|
||||
"type": "Identifier"
|
||||
},
|
||||
"default_value": {
|
||||
"end": 24,
|
||||
"raw": "1",
|
||||
"start": 23,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
"value": 1.0,
|
||||
"suffix": "None"
|
||||
}
|
||||
},
|
||||
"raw": "1"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -124,9 +110,6 @@ description: Variables in memory after executing kw_fn_with_defaults.kcl
|
||||
"twentyOne": {
|
||||
"type": "Number",
|
||||
"value": 21.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -147,9 +130,6 @@ description: Variables in memory after executing kw_fn_with_defaults.kcl
|
||||
"two": {
|
||||
"type": "Number",
|
||||
"value": 2.0,
|
||||
"ty": {
|
||||
"type": "Unknown"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -157,13 +137,6 @@ description: Variables in memory after executing kw_fn_with_defaults.kcl
|
||||
64,
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"sourceRange": [
|
||||
23,
|
||||
24,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user