Compare commits
116 Commits
nrc-depr-m
...
pierremtb/
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c78dbd4c8 | |||
| 059593372a | |||
| 1ba8c5af00 | |||
| 410b4e81eb | |||
| 30275d86cc | |||
| 39c40b2cde | |||
| 10789d9c3c | |||
| 67cc4f5835 | |||
| 2692f2b73a | |||
| 907102a8fa | |||
| 353eca110e | |||
| fb56820811 | |||
| fb37bb83a8 | |||
| f90811695d | |||
| 5c1dfe0c8e | |||
| f06873a0e2 | |||
| 09025179f9 | |||
| 521a593451 | |||
| 87c4e6c74e | |||
| 82cd106898 | |||
| e14cc4ace3 | |||
| 2a2a31d0ef | |||
| f2669223c5 | |||
| c3bc1fad6d | |||
| 96ff1dd55b | |||
| 82bd04631a | |||
| abec2d6d66 | |||
| 6089b1932a | |||
| 074fd2b5c7 | |||
| b2485b804c | |||
| e753082653 | |||
| 634745bb81 | |||
| e3660c75fc | |||
| ef61d10615 | |||
| c208e16c76 | |||
| 585ca7e80f | |||
| f7bae1d221 | |||
| 339de00e68 | |||
| 4f02e45da3 | |||
| 1908383f0e | |||
| 68204bb23d | |||
| 5438a987ab | |||
| fa3f934948 | |||
| 08e714080e | |||
| df01c233e4 | |||
| b30a37a0b3 | |||
| 82aefec34d | |||
| 679b65f643 | |||
| d64270d494 | |||
| c06b2b4029 | |||
| 8b8a2bc4e2 | |||
| af702ae1b2 | |||
| 83e72dafa3 | |||
| e417e60053 | |||
| ebc6b6460d | |||
| 91f0cfe467 | |||
| a2ff0aeceb | |||
| f05acf92cc | |||
| 670faac1e8 | |||
| ca09224c92 | |||
| 5cbd11cec8 | |||
| 28eb99f655 | |||
| c29be6e341 | |||
| 2193d563c5 | |||
| 570d159c29 | |||
| 713886b274 | |||
| 2aa4a01cb7 | |||
| 2048c26b9f | |||
| cbb8df5904 | |||
| bb67a9e9cf | |||
| b84d5951b7 | |||
| 1e5954e5ed | |||
| d58a147b7d | |||
| 96b06247a4 | |||
| 36d49b1bcb | |||
| 4748c2d1e0 | |||
| 698ce671df | |||
| a2330a0dbc | |||
| c882e34ea9 | |||
| 1ce3d8ccd0 | |||
| 15bedd56f4 | |||
| 746ebf80d1 | |||
| 02b249bd31 | |||
| 524fcb03ad | |||
| 3a9e0c72a8 | |||
| 5dc983ad7b | |||
| 81411033d7 | |||
| 30a24c8ae6 | |||
| 403cee5f16 | |||
| 14eeafb70a | |||
| f4ecd16ffa | |||
| 48380be480 | |||
| 80e32b337f | |||
| 9378d9862b | |||
| 1f515b712b | |||
| 372f2eebcc | |||
| e22a9edde8 | |||
| 75e3f843eb | |||
| f0136a5939 | |||
| 3d2e48732c | |||
| 7545b61b49 | |||
| d1be6d7b64 | |||
| 8ab24ceee7 | |||
| f163870b86 | |||
| 3fc707a2a4 | |||
| 238163d7db | |||
| bfccb79c1c | |||
| fe6d1f8119 | |||
| f496d94258 | |||
| 5d8f3f988a | |||
| 4f06524776 | |||
| d7fe827a9e | |||
| 049e487ac4 | |||
| 5bd89047b2 | |||
| 5822321f35 | |||
| 401dcf8152 |
1
.github/workflows/build-apps.yml
vendored
1
.github/workflows/build-apps.yml
vendored
@ -5,6 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- pierremtb/4088/create-file-url
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
schedule:
|
||||
|
||||
20425
docs/kcl/std.json
20425
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
28
docs/kcl/types/Face.md
Normal file
28
docs/kcl/types/Face.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
title: "Face"
|
||||
excerpt: "A face."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A face.
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `id` |`string`| The id of the face. | No |
|
||||
| `value` |`string`| The tag of the face. | No |
|
||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face’s X axis be? | No |
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A face. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ A helix.
|
||||
| `revolutions` |`number`| Number of revolutions. | No |
|
||||
| `angleStart` |`number`| Start angle (in degrees). | No |
|
||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ A helix.
|
||||
| `revolutions` |`number`| Number of revolutions. | No |
|
||||
| `angleStart` |`number`| Start angle (in degrees). | No |
|
||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
|
||||
@ -168,7 +168,6 @@ Any KCL value.
|
||||
|
||||
|
||||
----
|
||||
A plane.
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
@ -181,17 +180,10 @@ A plane.
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: [`Plane`](/docs/kcl/types/Plane)| | No |
|
||||
| `id` |`string`| The id of the plane. | No |
|
||||
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| Any KCL value. | No |
|
||||
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
|
||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s X axis be? | No |
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
| `value` |[`Plane`](/docs/kcl/types/Plane)| Any KCL value. | No |
|
||||
|
||||
|
||||
----
|
||||
A face.
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
@ -203,14 +195,8 @@ A face.
|
||||
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: `Face`| | No |
|
||||
| `id` |`string`| The id of the face. | No |
|
||||
| `value` |`string`| The tag of the face. | No |
|
||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face’s X axis be? | No |
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
| `type` |enum: [`Face`](/docs/kcl/types/Face)| | No |
|
||||
| `value` |[`Face`](/docs/kcl/types/Face)| Any KCL value. | No |
|
||||
|
||||
|
||||
----
|
||||
@ -246,7 +232,6 @@ A face.
|
||||
|
||||
|
||||
----
|
||||
An solid is a collection of extrude surfaces.
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
@ -259,14 +244,7 @@ An solid is a collection of extrude surfaces.
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: [`Solid`](/docs/kcl/types/Solid)| | No |
|
||||
| `id` |`string`| The id of the solid. | No |
|
||||
| `value` |`[` [`ExtrudeSurface`](/docs/kcl/types/ExtrudeSurface) `]`| The extrude surfaces. | No |
|
||||
| `sketch` |[`Sketch`](/docs/kcl/types/Sketch)| The sketch. | No |
|
||||
| `height` |`number`| The height of the solid. | No |
|
||||
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
||||
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
||||
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||
| `value` |[`Solid`](/docs/kcl/types/Solid)| Any KCL value. | No |
|
||||
|
||||
|
||||
----
|
||||
@ -286,7 +264,6 @@ An solid is a collection of extrude surfaces.
|
||||
|
||||
|
||||
----
|
||||
A helix.
|
||||
|
||||
**Type:** `object`
|
||||
|
||||
@ -299,11 +276,7 @@ A helix.
|
||||
| Property | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `type` |enum: [`Helix`](/docs/kcl/types/Helix)| | No |
|
||||
| `value` |`string`| The id of the helix. | No |
|
||||
| `revolutions` |`number`| Number of revolutions. | No |
|
||||
| `angleStart` |`number`| Start angle (in degrees). | No |
|
||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
| `value` |[`Helix`](/docs/kcl/types/Helix)| Any KCL value. | No |
|
||||
|
||||
|
||||
----
|
||||
|
||||
@ -22,6 +22,7 @@ A plane.
|
||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s X axis be? | No |
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A plane. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ A sketch is a collection of paths.
|
||||
| `on` |[`SketchSurface`](/docs/kcl/types/SketchSurface)| What the sketch is on (can be a plane or a face). | No |
|
||||
| `start` |[`BasePath`](/docs/kcl/types/BasePath)| The starting path. | No |
|
||||
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch is a collection of paths. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ A sketch is a collection of paths.
|
||||
| `on` |[`SketchSurface`](/docs/kcl/types/SketchSurface)| What the sketch is on (can be a plane or a face). | No |
|
||||
| `start` |[`BasePath`](/docs/kcl/types/BasePath)| The starting path. | No |
|
||||
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch or a group of sketches. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ A plane.
|
||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s X axis be? | No |
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
@ -54,6 +55,7 @@ A face.
|
||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face’s Y axis be? | No |
|
||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ An solid is a collection of extrude surfaces.
|
||||
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
||||
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
||||
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| An solid is a collection of extrude surfaces. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ An solid is a collection of extrude surfaces.
|
||||
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
||||
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
||||
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A solid or a group of solids. | No |
|
||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||
|
||||
|
||||
|
||||
107
docs/kcl/types/UnitLen.md
Normal file
107
docs/kcl/types/UnitLen.md
Normal file
@ -0,0 +1,107 @@
|
||||
---
|
||||
title: "UnitLen"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**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 |
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { test, expect } from './zoo-test'
|
||||
|
||||
import { getUtils } from './test-utils'
|
||||
import * as fsp from 'fs/promises'
|
||||
import { executorInputPath, getUtils } from './test-utils'
|
||||
import { KCL_DEFAULT_LENGTH } from 'lib/constants'
|
||||
import path from 'path'
|
||||
|
||||
test.describe('Command bar tests', () => {
|
||||
test('Extrude from command bar selects extrude line after', async ({
|
||||
@ -305,4 +306,132 @@ test.describe('Command bar tests', () => {
|
||||
await arcToolCommand.click()
|
||||
await expect(arcToolButton).toHaveAttribute('aria-pressed', 'true')
|
||||
})
|
||||
|
||||
test(`Reacts to query param to open "import from URL" command`, async ({
|
||||
page,
|
||||
cmdBar,
|
||||
editor,
|
||||
homePage,
|
||||
}) => {
|
||||
await test.step(`Prepare and navigate to home page with query params`, async () => {
|
||||
const targetURL = `?create-file&name=test&units=mm&code=ZXh0cnVzaW9uRGlzdGFuY2UgPSAxMg%3D%3D&ask-open-desktop`
|
||||
await homePage.expectState({
|
||||
projectCards: [],
|
||||
sortBy: 'last-modified-desc',
|
||||
})
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
})
|
||||
|
||||
await test.step(`Submit the command`, async () => {
|
||||
await cmdBar.expectState({
|
||||
stage: 'arguments',
|
||||
commandName: 'Import file from URL',
|
||||
currentArgKey: 'method',
|
||||
currentArgValue: '',
|
||||
headerArguments: {
|
||||
Method: '',
|
||||
Name: 'test',
|
||||
Code: '1 line',
|
||||
},
|
||||
highlightedHeaderArg: 'method',
|
||||
})
|
||||
await cmdBar.selectOption({ name: 'New Project' }).click()
|
||||
await cmdBar.expectState({
|
||||
stage: 'review',
|
||||
commandName: 'Import file from URL',
|
||||
headerArguments: {
|
||||
Method: 'New project',
|
||||
Name: 'test',
|
||||
Code: '1 line',
|
||||
},
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
})
|
||||
|
||||
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
|
||||
await editor.expectEditor.toContain('extrusionDistance = 12')
|
||||
})
|
||||
})
|
||||
|
||||
test(`"import from URL" can add to existing project`, async ({
|
||||
page,
|
||||
cmdBar,
|
||||
editor,
|
||||
homePage,
|
||||
toolbar,
|
||||
context,
|
||||
}) => {
|
||||
await context.folderSetupFn(async (dir) => {
|
||||
const testProjectDir = path.join(dir, 'testProjectDir')
|
||||
await Promise.all([fsp.mkdir(testProjectDir, { recursive: true })])
|
||||
await Promise.all([
|
||||
fsp.copyFile(
|
||||
executorInputPath('cylinder.kcl'),
|
||||
path.join(testProjectDir, 'main.kcl')
|
||||
),
|
||||
])
|
||||
})
|
||||
await test.step(`Prepare and navigate to home page with query params`, async () => {
|
||||
const targetURL = `?create-file&name=test&units=mm&code=ZXh0cnVzaW9uRGlzdGFuY2UgPSAxMg%3D%3D&ask-open-desktop`
|
||||
await homePage.expectState({
|
||||
projectCards: [
|
||||
{
|
||||
fileCount: 1,
|
||||
title: 'testProjectDir',
|
||||
},
|
||||
],
|
||||
sortBy: 'last-modified-desc',
|
||||
})
|
||||
await page.goto(page.url() + targetURL)
|
||||
expect(page.url()).toContain(targetURL)
|
||||
})
|
||||
|
||||
await test.step(`Submit the command`, async () => {
|
||||
await cmdBar.expectState({
|
||||
stage: 'arguments',
|
||||
commandName: 'Import file from URL',
|
||||
currentArgKey: 'method',
|
||||
currentArgValue: '',
|
||||
headerArguments: {
|
||||
Method: '',
|
||||
Name: 'test',
|
||||
Code: '1 line',
|
||||
},
|
||||
highlightedHeaderArg: 'method',
|
||||
})
|
||||
await cmdBar.selectOption({ name: 'Existing Project' }).click()
|
||||
await cmdBar.expectState({
|
||||
stage: 'arguments',
|
||||
commandName: 'Import file from URL',
|
||||
currentArgKey: 'projectName',
|
||||
currentArgValue: '',
|
||||
headerArguments: {
|
||||
Method: 'Existing project',
|
||||
Name: 'test',
|
||||
ProjectName: '',
|
||||
Code: '1 line',
|
||||
},
|
||||
highlightedHeaderArg: 'projectName',
|
||||
})
|
||||
await cmdBar.selectOption({ name: 'testProjectDir' }).click()
|
||||
await cmdBar.expectState({
|
||||
stage: 'review',
|
||||
commandName: 'Import file from URL',
|
||||
headerArguments: {
|
||||
Method: 'Existing project',
|
||||
ProjectName: 'testProjectDir',
|
||||
Name: 'test',
|
||||
Code: '1 line',
|
||||
},
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
})
|
||||
|
||||
await test.step(`Ensure we created the project and are in the modeling scene`, async () => {
|
||||
await editor.expectEditor.toContain('extrusionDistance = 12')
|
||||
await toolbar.openPane('files')
|
||||
await toolbar.expectFileTreeState(['main.kcl', 'test.kcl'])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -151,4 +151,11 @@ export class CmdBarFixture {
|
||||
chooseCommand = async (commandName: string) => {
|
||||
await this.cmdOptions.getByText(commandName).click()
|
||||
}
|
||||
|
||||
/**
|
||||
* Select an option from the command bar
|
||||
*/
|
||||
selectOption = (options: Parameters<typeof this.page.getByRole>[1]) => {
|
||||
return this.page.getByRole('option', options)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 60 KiB |
16
src/App.tsx
16
src/App.tsx
@ -22,6 +22,8 @@ import Gizmo from 'components/Gizmo'
|
||||
import { CoreDumpManager } from 'lib/coredump'
|
||||
import { UnitsMenu } from 'components/UnitsMenu'
|
||||
import { CameraProjectionToggle } from 'components/CameraProjectionToggle'
|
||||
import { useCreateFileLinkQuery } from 'hooks/useCreateFileLinkQueryWatcher'
|
||||
import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { maybeWriteToDisk } from 'lib/telemetry'
|
||||
maybeWriteToDisk()
|
||||
.then(() => {})
|
||||
@ -29,6 +31,20 @@ maybeWriteToDisk()
|
||||
|
||||
export function App() {
|
||||
const { project, file } = useLoaderData() as IndexLoaderData
|
||||
const { commandBarSend } = useCommandsContext()
|
||||
|
||||
// Keep a lookout for a URL query string that invokes the 'import file from URL' command
|
||||
useCreateFileLinkQuery((argDefaultValues) => {
|
||||
commandBarSend({
|
||||
type: 'Find and select command',
|
||||
data: {
|
||||
groupId: 'projects',
|
||||
name: 'Import file from URL',
|
||||
argDefaultValues,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
useRefreshSettings(PATHS.FILE + 'SETTINGS')
|
||||
const navigate = useNavigate()
|
||||
const filePath = useAbsoluteFilePath()
|
||||
|
||||
@ -35,7 +35,7 @@ import { CommandBarProvider } from 'components/CommandBar/CommandBarProvider'
|
||||
import SettingsAuthProvider from 'components/SettingsAuthProvider'
|
||||
import LspProvider from 'components/LspProvider'
|
||||
import { KclContextProvider } from 'lang/KclProvider'
|
||||
import { BROWSER_PROJECT_NAME } from 'lib/constants'
|
||||
import { ASK_TO_OPEN_QUERY_PARAM, BROWSER_PROJECT_NAME } from 'lib/constants'
|
||||
import { CoreDumpManager } from 'lib/coredump'
|
||||
import { codeManager, engineCommandManager } from 'lib/singletons'
|
||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||
@ -47,6 +47,7 @@ import { AppStateProvider } from 'AppState'
|
||||
import { reportRejection } from 'lib/trap'
|
||||
import { RouteProvider } from 'components/RouteProvider'
|
||||
import { ProjectsContextProvider } from 'components/ProjectsContextProvider'
|
||||
import { OpenInDesktopAppHandler } from 'components/OpenInDesktopAppHandler'
|
||||
|
||||
const createRouter = isDesktop() ? createHashRouter : createBrowserRouter
|
||||
|
||||
@ -58,33 +59,44 @@ const router = createRouter([
|
||||
/* Make sure auth is the outermost provider or else we will have
|
||||
* inefficient re-renders, use the react profiler to see. */
|
||||
element: (
|
||||
<CommandBarProvider>
|
||||
<RouteProvider>
|
||||
<SettingsAuthProvider>
|
||||
<LspProvider>
|
||||
<ProjectsContextProvider>
|
||||
<KclContextProvider>
|
||||
<AppStateProvider>
|
||||
<MachineManagerProvider>
|
||||
<Outlet />
|
||||
</MachineManagerProvider>
|
||||
</AppStateProvider>
|
||||
</KclContextProvider>
|
||||
</ProjectsContextProvider>
|
||||
</LspProvider>
|
||||
</SettingsAuthProvider>
|
||||
</RouteProvider>
|
||||
</CommandBarProvider>
|
||||
<OpenInDesktopAppHandler>
|
||||
<CommandBarProvider>
|
||||
<RouteProvider>
|
||||
<SettingsAuthProvider>
|
||||
<LspProvider>
|
||||
<ProjectsContextProvider>
|
||||
<KclContextProvider>
|
||||
<AppStateProvider>
|
||||
<MachineManagerProvider>
|
||||
<Outlet />
|
||||
</MachineManagerProvider>
|
||||
</AppStateProvider>
|
||||
</KclContextProvider>
|
||||
</ProjectsContextProvider>
|
||||
</LspProvider>
|
||||
</SettingsAuthProvider>
|
||||
</RouteProvider>
|
||||
</CommandBarProvider>
|
||||
</OpenInDesktopAppHandler>
|
||||
),
|
||||
errorElement: <ErrorPage />,
|
||||
children: [
|
||||
{
|
||||
path: PATHS.INDEX,
|
||||
loader: async () => {
|
||||
loader: async ({ request }) => {
|
||||
const onDesktop = isDesktop()
|
||||
return onDesktop
|
||||
? redirect(PATHS.HOME)
|
||||
: redirect(PATHS.FILE + '/%2F' + BROWSER_PROJECT_NAME)
|
||||
const url = new URL(request.url)
|
||||
if (onDesktop) {
|
||||
return redirect(PATHS.HOME + (url.search || ''))
|
||||
} else {
|
||||
const searchParams = new URLSearchParams(url.search)
|
||||
if (!searchParams.has(ASK_TO_OPEN_QUERY_PARAM)) {
|
||||
return redirect(
|
||||
PATHS.FILE + '/%2F' + BROWSER_PROJECT_NAME + (url.search || '')
|
||||
)
|
||||
}
|
||||
}
|
||||
return null
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
217
src/Toolbar.tsx
217
src/Toolbar.tsx
@ -1,4 +1,4 @@
|
||||
import { useRef, useMemo, memo } from 'react'
|
||||
import { useRef, useMemo, memo, useCallback, useState } from 'react'
|
||||
import { isCursorInSketchCommandRange } from 'lang/util'
|
||||
import { engineCommandManager, kclManager } from 'lib/singletons'
|
||||
import { useModelingContext } from 'hooks/useModelingContext'
|
||||
@ -34,8 +34,7 @@ export function Toolbar({
|
||||
const bgClassName = '!bg-transparent'
|
||||
const buttonBgClassName =
|
||||
'bg-chalkboard-transparent dark:bg-transparent disabled:bg-transparent dark:disabled:bg-transparent enabled:hover:bg-chalkboard-10 dark:enabled:hover:bg-chalkboard-100 pressed:!bg-primary pressed:enabled:hover:!text-chalkboard-10'
|
||||
const buttonBorderClassName =
|
||||
'!border-transparent hover:!border-chalkboard-20 dark:enabled:hover:!border-primary pressed:!border-primary ui-open:!border-primary'
|
||||
const buttonBorderClassName = '!border-transparent'
|
||||
|
||||
const sketchPathId = useMemo(() => {
|
||||
if (!isSingleCursorInPipe(context.selectionRanges, kclManager.ast))
|
||||
@ -50,6 +49,7 @@ export function Toolbar({
|
||||
const { overallState } = useNetworkContext()
|
||||
const { isExecuting } = useKclContext()
|
||||
const { isStreamReady } = useAppState()
|
||||
const [showRichContent, setShowRichContent] = useState(false)
|
||||
|
||||
const disableAllButtons =
|
||||
(overallState !== NetworkHealthState.Ok &&
|
||||
@ -77,6 +77,40 @@ export function Toolbar({
|
||||
[state, send, commandBarSend, sketchPathId]
|
||||
)
|
||||
|
||||
const tooltipContentClassName = !showRichContent
|
||||
? ''
|
||||
: '!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch'
|
||||
const richContentTimeout = useRef<number | null>(null)
|
||||
const richContentClearTimeout = useRef<number | null>(null)
|
||||
// On mouse enter, show rich content after a 1s delay
|
||||
const handleMouseEnter = useCallback(() => {
|
||||
// Cancel the clear timeout if it's already set
|
||||
if (richContentClearTimeout.current) {
|
||||
clearTimeout(richContentClearTimeout.current)
|
||||
}
|
||||
// Start our own timeout to show the rich content
|
||||
richContentTimeout.current = window.setTimeout(() => {
|
||||
setShowRichContent(true)
|
||||
if (richContentClearTimeout.current) {
|
||||
clearTimeout(richContentClearTimeout.current)
|
||||
}
|
||||
}, 1000)
|
||||
}, [setShowRichContent])
|
||||
// On mouse leave, clear the timeout and hide rich content
|
||||
const handleMouseLeave = useCallback(() => {
|
||||
// Clear the timeout to show rich content
|
||||
if (richContentTimeout.current) {
|
||||
clearTimeout(richContentTimeout.current)
|
||||
}
|
||||
// Start a timeout to hide the rich content
|
||||
richContentClearTimeout.current = window.setTimeout(() => {
|
||||
setShowRichContent(false)
|
||||
if (richContentClearTimeout.current) {
|
||||
clearTimeout(richContentClearTimeout.current)
|
||||
}
|
||||
}, 500)
|
||||
}, [setShowRichContent])
|
||||
|
||||
/**
|
||||
* Resolve all the callbacks and values for the current mode,
|
||||
* so we don't need to worry about the other modes
|
||||
@ -174,44 +208,64 @@ export function Toolbar({
|
||||
status: itemConfig.status,
|
||||
}))}
|
||||
>
|
||||
<ActionButton
|
||||
Element="button"
|
||||
id={maybeIconConfig[0].id}
|
||||
data-testid={maybeIconConfig[0].id}
|
||||
iconStart={{
|
||||
icon: maybeIconConfig[0].icon,
|
||||
className: iconClassName,
|
||||
bgClassName: bgClassName,
|
||||
}}
|
||||
className={
|
||||
'!border-transparent !px-0 pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' +
|
||||
buttonBgClassName
|
||||
}
|
||||
aria-pressed={maybeIconConfig[0].isActive}
|
||||
disabled={
|
||||
disableAllButtons ||
|
||||
maybeIconConfig[0].status !== 'available' ||
|
||||
maybeIconConfig[0].disabled
|
||||
}
|
||||
name={maybeIconConfig[0].title}
|
||||
// aria-description is still in ARIA 1.3 draft.
|
||||
// eslint-disable-next-line jsx-a11y/aria-props
|
||||
aria-description={maybeIconConfig[0].description}
|
||||
onClick={() =>
|
||||
maybeIconConfig[0].onClick(configCallbackProps)
|
||||
}
|
||||
<div
|
||||
className="contents"
|
||||
// Mouse events do not fire on disabled buttons
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<span
|
||||
className={!maybeIconConfig[0].showTitle ? 'sr-only' : ''}
|
||||
<ActionButton
|
||||
Element="button"
|
||||
id={maybeIconConfig[0].id}
|
||||
data-testid={maybeIconConfig[0].id}
|
||||
iconStart={{
|
||||
icon: maybeIconConfig[0].icon,
|
||||
className: iconClassName,
|
||||
bgClassName: bgClassName,
|
||||
}}
|
||||
className={
|
||||
'!border-transparent !px-0 pressed:!text-chalkboard-10 pressed:enabled:hovered:!text-chalkboard-10 ' +
|
||||
buttonBgClassName
|
||||
}
|
||||
aria-pressed={maybeIconConfig[0].isActive}
|
||||
disabled={
|
||||
disableAllButtons ||
|
||||
maybeIconConfig[0].status !== 'available' ||
|
||||
maybeIconConfig[0].disabled
|
||||
}
|
||||
name={maybeIconConfig[0].title}
|
||||
// aria-description is still in ARIA 1.3 draft.
|
||||
// eslint-disable-next-line jsx-a11y/aria-props
|
||||
aria-description={maybeIconConfig[0].description}
|
||||
onClick={() =>
|
||||
maybeIconConfig[0].onClick(configCallbackProps)
|
||||
}
|
||||
>
|
||||
{maybeIconConfig[0].title}
|
||||
</span>
|
||||
</ActionButton>
|
||||
<ToolbarItemTooltip
|
||||
itemConfig={maybeIconConfig[0]}
|
||||
configCallbackProps={configCallbackProps}
|
||||
className="ui-open:!hidden"
|
||||
/>
|
||||
<span
|
||||
className={!maybeIconConfig[0].showTitle ? 'sr-only' : ''}
|
||||
>
|
||||
{maybeIconConfig[0].title}
|
||||
</span>
|
||||
<ToolbarItemTooltip
|
||||
itemConfig={maybeIconConfig[0]}
|
||||
configCallbackProps={configCallbackProps}
|
||||
wrapperClassName="ui-open:!hidden"
|
||||
contentClassName={tooltipContentClassName}
|
||||
>
|
||||
{showRichContent ? (
|
||||
<ToolbarItemTooltipRichContent
|
||||
itemConfig={maybeIconConfig[0]}
|
||||
/>
|
||||
) : (
|
||||
<ToolbarItemTooltipShortContent
|
||||
status={maybeIconConfig[0].status}
|
||||
title={maybeIconConfig[0].title}
|
||||
hotkey={maybeIconConfig[0].hotkey}
|
||||
/>
|
||||
)}
|
||||
</ToolbarItemTooltip>
|
||||
</ActionButton>
|
||||
</div>
|
||||
</ActionButtonDropdown>
|
||||
)
|
||||
}
|
||||
@ -219,7 +273,13 @@ export function Toolbar({
|
||||
|
||||
// A single button
|
||||
return (
|
||||
<div className="relative" key={itemConfig.id}>
|
||||
<div
|
||||
className="relative"
|
||||
key={itemConfig.id}
|
||||
// Mouse events do not fire on disabled buttons
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<ActionButton
|
||||
Element="button"
|
||||
key={itemConfig.id}
|
||||
@ -256,7 +316,18 @@ export function Toolbar({
|
||||
<ToolbarItemTooltip
|
||||
itemConfig={itemConfig}
|
||||
configCallbackProps={configCallbackProps}
|
||||
/>
|
||||
contentClassName={tooltipContentClassName}
|
||||
>
|
||||
{showRichContent ? (
|
||||
<ToolbarItemTooltipRichContent itemConfig={itemConfig} />
|
||||
) : (
|
||||
<ToolbarItemTooltipShortContent
|
||||
status={itemConfig.status}
|
||||
title={itemConfig.title}
|
||||
hotkey={itemConfig.hotkey}
|
||||
/>
|
||||
)}
|
||||
</ToolbarItemTooltip>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
@ -270,6 +341,12 @@ export function Toolbar({
|
||||
)
|
||||
}
|
||||
|
||||
interface ToolbarItemContentsProps extends React.PropsWithChildren {
|
||||
itemConfig: ToolbarItemResolved
|
||||
configCallbackProps: ToolbarItemCallbackProps
|
||||
wrapperClassName?: string
|
||||
contentClassName?: string
|
||||
}
|
||||
/**
|
||||
* The single button and dropdown button share content, so we extract it here
|
||||
* It contains a tooltip with the title, description, and links
|
||||
@ -278,14 +355,10 @@ export function Toolbar({
|
||||
const ToolbarItemTooltip = memo(function ToolbarItemContents({
|
||||
itemConfig,
|
||||
configCallbackProps,
|
||||
className,
|
||||
}: {
|
||||
itemConfig: ToolbarItemResolved
|
||||
configCallbackProps: ToolbarItemCallbackProps
|
||||
className?: string
|
||||
}) {
|
||||
const { state } = useModelingContext()
|
||||
|
||||
wrapperClassName = '',
|
||||
contentClassName = '',
|
||||
children,
|
||||
}: ToolbarItemContentsProps) {
|
||||
useHotkeys(
|
||||
itemConfig.hotkey || '',
|
||||
() => {
|
||||
@ -310,10 +383,48 @@ const ToolbarItemTooltip = memo(function ToolbarItemContents({
|
||||
}
|
||||
hoverOnly
|
||||
position="bottom"
|
||||
wrapperClassName={'!p-4 !pointer-events-auto ' + className}
|
||||
contentClassName="!text-left text-wrap !text-xs !p-0 !pb-2 flex gap-2 !max-w-none !w-72 flex-col items-stretch"
|
||||
wrapperClassName={'!p-4 !pointer-events-auto ' + wrapperClassName}
|
||||
contentClassName={contentClassName}
|
||||
delay={0}
|
||||
>
|
||||
{children}
|
||||
</Tooltip>
|
||||
)
|
||||
})
|
||||
|
||||
const ToolbarItemTooltipShortContent = ({
|
||||
status,
|
||||
title,
|
||||
hotkey,
|
||||
}: {
|
||||
status: string
|
||||
title: string
|
||||
hotkey?: string | string[]
|
||||
}) => (
|
||||
<span
|
||||
className={`text-sm ${
|
||||
status !== 'available' ? 'text-chalkboard-70 dark:text-chalkboard-40' : ''
|
||||
}`}
|
||||
>
|
||||
{title}
|
||||
{hotkey && (
|
||||
<kbd className="inline-block ml-2 flex-none hotkey">{hotkey}</kbd>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
|
||||
const ToolbarItemTooltipRichContent = ({
|
||||
itemConfig,
|
||||
}: {
|
||||
itemConfig: ToolbarItemResolved
|
||||
}) => {
|
||||
const { state } = useModelingContext()
|
||||
return (
|
||||
<>
|
||||
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
|
||||
{itemConfig.icon && (
|
||||
<CustomIcon className="w-5 h-5" name={itemConfig.icon} />
|
||||
)}
|
||||
<span
|
||||
className={`text-sm flex-1 ${
|
||||
itemConfig.status !== 'available'
|
||||
@ -382,6 +493,6 @@ const ToolbarItemTooltip = memo(function ToolbarItemContents({
|
||||
</ul>
|
||||
</>
|
||||
)}
|
||||
</Tooltip>
|
||||
</>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
@ -2051,8 +2051,8 @@ export class SceneEntities {
|
||||
)
|
||||
if (!(sk instanceof Reason)) {
|
||||
sketch = sk
|
||||
} else if ((maybeSketch as Solid).sketch) {
|
||||
sketch = (maybeSketch as Solid).sketch
|
||||
} else if (maybeSketch && (maybeSketch.value as Solid)?.sketch) {
|
||||
sketch = (maybeSketch.value as Solid).sketch
|
||||
}
|
||||
if (!sketch) return
|
||||
|
||||
@ -2541,7 +2541,7 @@ export function sketchFromPathToNode({
|
||||
const varDec = _varDec.node
|
||||
const result = programMemory.get(varDec?.id?.name || '')
|
||||
if (result?.type === 'Solid') {
|
||||
return result.sketch
|
||||
return result.value.sketch
|
||||
}
|
||||
const sg = sketchFromKclValue(result, varDec?.id?.name)
|
||||
if (err(sg)) {
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import { Popover } from '@headlessui/react'
|
||||
import { ActionButtonProps } from './ActionButton'
|
||||
import { CustomIcon } from './CustomIcon'
|
||||
import Tooltip from './Tooltip'
|
||||
|
||||
type ActionButtonSplitProps = ActionButtonProps & { Element: 'button' } & {
|
||||
name?: string
|
||||
dropdownTooltipText?: string
|
||||
splitMenuItems: {
|
||||
id: string
|
||||
label: string
|
||||
@ -17,6 +19,7 @@ type ActionButtonSplitProps = ActionButtonProps & { Element: 'button' } & {
|
||||
export function ActionButtonDropdown({
|
||||
splitMenuItems,
|
||||
className,
|
||||
dropdownTooltipText = 'More tools',
|
||||
children,
|
||||
...props
|
||||
}: ActionButtonSplitProps) {
|
||||
@ -26,7 +29,14 @@ export function ActionButtonDropdown({
|
||||
{({ close }) => (
|
||||
<>
|
||||
{children}
|
||||
<Popover.Button className="border-transparent dark:border-transparent p-0 m-0 rounded-none !outline-none ui-open:border-primary ui-open:bg-primary">
|
||||
<Popover.Button
|
||||
className={
|
||||
'!border-transparent dark:!border-transparent ' +
|
||||
'bg-chalkboard-transparent dark:bg-transparent disabled:bg-transparent dark:disabled:bg-transparent ' +
|
||||
'enabled:hover:bg-chalkboard-10 dark:enabled:hover:bg-chalkboard-100 ' +
|
||||
'pressed:!bg-primary pressed:enabled:hover:!text-chalkboard-10 p-0 m-0 rounded-none !outline-none ui-open:border-primary ui-open:bg-primary'
|
||||
}
|
||||
>
|
||||
<CustomIcon
|
||||
name="caretDown"
|
||||
className={
|
||||
@ -37,6 +47,14 @@ export function ActionButtonDropdown({
|
||||
<span className="sr-only">
|
||||
{props.name ? props.name + ': ' : ''}open menu
|
||||
</span>
|
||||
<Tooltip
|
||||
delay={0}
|
||||
position="bottom"
|
||||
hoverOnly
|
||||
wrapperClassName="ui-open:!hidden"
|
||||
>
|
||||
{dropdownTooltipText}
|
||||
</Tooltip>
|
||||
</Popover.Button>
|
||||
<Popover.Panel
|
||||
as="ul"
|
||||
|
||||
@ -129,6 +129,7 @@ function CommandArgOptionInput({
|
||||
<label
|
||||
htmlFor="option-input"
|
||||
className="capitalize px-2 py-1 rounded-l bg-chalkboard-100 dark:bg-chalkboard-80 text-chalkboard-10 border-b border-b-chalkboard-100 dark:border-b-chalkboard-80"
|
||||
data-testid="cmd-bar-arg-name"
|
||||
>
|
||||
{argName}
|
||||
</label>
|
||||
|
||||
@ -48,8 +48,9 @@ export const FileMachineProvider = ({
|
||||
}) => {
|
||||
const navigate = useNavigate()
|
||||
const { commandBarSend } = useCommandsContext()
|
||||
const { settings } = useSettingsAuthContext()
|
||||
const { project, file } = useRouteLoaderData(PATHS.FILE) as IndexLoaderData
|
||||
const { settings, auth } = useSettingsAuthContext()
|
||||
const projectData = useRouteLoaderData(PATHS.FILE) as IndexLoaderData
|
||||
const { project, file } = projectData
|
||||
const [kclSamples, setKclSamples] = React.useState<KclSamplesManifestItem[]>(
|
||||
[]
|
||||
)
|
||||
@ -296,40 +297,47 @@ export const FileMachineProvider = ({
|
||||
|
||||
const kclCommandMemo = useMemo(
|
||||
() =>
|
||||
kclCommands(
|
||||
async (data) => {
|
||||
if (data.method === 'overwrite') {
|
||||
codeManager.updateCodeStateEditor(data.code)
|
||||
await kclManager.executeCode(true)
|
||||
await codeManager.writeToFile()
|
||||
} else if (data.method === 'newFile' && isDesktop()) {
|
||||
send({
|
||||
type: 'Create file',
|
||||
data: {
|
||||
name: data.sampleName,
|
||||
content: data.code,
|
||||
makeDir: false,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Either way, we want to overwrite the defaultUnit project setting
|
||||
// with the sample's setting.
|
||||
if (data.sampleUnits) {
|
||||
settings.send({
|
||||
type: 'set.modeling.defaultUnit',
|
||||
data: {
|
||||
level: 'project',
|
||||
value: data.sampleUnits,
|
||||
},
|
||||
})
|
||||
}
|
||||
kclCommands({
|
||||
authToken: auth?.context?.token ?? '',
|
||||
projectData,
|
||||
settings: {
|
||||
defaultUnit: settings?.context?.modeling.defaultUnit.current ?? 'mm',
|
||||
},
|
||||
kclSamples.map((sample) => ({
|
||||
value: sample.pathFromProjectDirectoryToFirstFile,
|
||||
name: sample.title,
|
||||
}))
|
||||
).filter(
|
||||
specialPropsForSampleCommand: {
|
||||
onSubmit: async (data) => {
|
||||
if (data.method === 'overwrite') {
|
||||
codeManager.updateCodeStateEditor(data.code)
|
||||
await kclManager.executeCode(true)
|
||||
await codeManager.writeToFile()
|
||||
} else if (data.method === 'newFile' && isDesktop()) {
|
||||
send({
|
||||
type: 'Create file',
|
||||
data: {
|
||||
name: data.sampleName,
|
||||
content: data.code,
|
||||
makeDir: false,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Either way, we want to overwrite the defaultUnit project setting
|
||||
// with the sample's setting.
|
||||
if (data.sampleUnits) {
|
||||
settings.send({
|
||||
type: 'set.modeling.defaultUnit',
|
||||
data: {
|
||||
level: 'project',
|
||||
value: data.sampleUnits,
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
providedOptions: kclSamples.map((sample) => ({
|
||||
value: sample.pathFromProjectDirectoryToFirstFile,
|
||||
name: sample.title,
|
||||
})),
|
||||
},
|
||||
}).filter(
|
||||
(command) => kclSamples.length || command.name !== 'open-kcl-example'
|
||||
),
|
||||
[codeManager, kclManager, send, kclSamples]
|
||||
|
||||
@ -95,9 +95,11 @@ export const processMemory = (programMemory: ProgramMemory) => {
|
||||
) {
|
||||
const sk = sketchFromKclValueOptional(val, key)
|
||||
if (val.type === 'Solid') {
|
||||
processedMemory[key] = val.value.map(({ ...rest }: ExtrudeSurface) => {
|
||||
return rest
|
||||
})
|
||||
processedMemory[key] = val.value.value.map(
|
||||
({ ...rest }: ExtrudeSurface) => {
|
||||
return rest
|
||||
}
|
||||
)
|
||||
} else if (!(sk instanceof Reason)) {
|
||||
processedMemory[key] = sk.paths.map(({ __geoMeta, ...rest }: Path) => {
|
||||
return rest
|
||||
|
||||
68
src/components/OpenInDesktopAppHandler.test.tsx
Normal file
68
src/components/OpenInDesktopAppHandler.test.tsx
Normal file
@ -0,0 +1,68 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react'
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom'
|
||||
import { OpenInDesktopAppHandler } from './OpenInDesktopAppHandler'
|
||||
|
||||
/**
|
||||
* The behavior under test requires a router,
|
||||
* so we wrap the component in a minimal router setup.
|
||||
*/
|
||||
function TestingMinimalRouterWrapper({
|
||||
children,
|
||||
location,
|
||||
}: {
|
||||
location?: string
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<Routes location={location}>
|
||||
<Route
|
||||
path="/"
|
||||
element={<OpenInDesktopAppHandler>{children}</OpenInDesktopAppHandler>}
|
||||
/>
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
|
||||
describe('OpenInDesktopAppHandler tests', () => {
|
||||
test(`does not render the modal if no query param is present`, () => {
|
||||
render(
|
||||
<BrowserRouter>
|
||||
<TestingMinimalRouterWrapper>
|
||||
<p>Dummy app contents</p>
|
||||
</TestingMinimalRouterWrapper>
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
||||
const dummyAppContents = screen.getByText('Dummy app contents')
|
||||
const modalContents = screen.queryByText('Open in desktop app')
|
||||
|
||||
expect(dummyAppContents).toBeInTheDocument()
|
||||
expect(modalContents).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
test(`renders the modal if the query param is present`, () => {
|
||||
render(
|
||||
<BrowserRouter>
|
||||
<TestingMinimalRouterWrapper location="/?ask-open-desktop">
|
||||
<p>Dummy app contents</p>
|
||||
</TestingMinimalRouterWrapper>
|
||||
</BrowserRouter>
|
||||
)
|
||||
|
||||
let dummyAppContents = screen.queryByText('Dummy app contents')
|
||||
let modalButton = screen.queryByText('Continue to web app')
|
||||
|
||||
// Starts as disconnected
|
||||
expect(dummyAppContents).not.toBeInTheDocument()
|
||||
expect(modalButton).not.toBeFalsy()
|
||||
expect(modalButton).toBeInTheDocument()
|
||||
fireEvent.click(modalButton as Element)
|
||||
|
||||
// I don't like that you have to re-query the screen here
|
||||
dummyAppContents = screen.queryByText('Dummy app contents')
|
||||
modalButton = screen.queryByText('Continue to web app')
|
||||
|
||||
expect(dummyAppContents).toBeInTheDocument()
|
||||
expect(modalButton).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
125
src/components/OpenInDesktopAppHandler.tsx
Normal file
125
src/components/OpenInDesktopAppHandler.tsx
Normal file
@ -0,0 +1,125 @@
|
||||
import { getSystemTheme, Themes } from 'lib/theme'
|
||||
import { ZOO_STUDIO_PROTOCOL } from 'lib/constants'
|
||||
import { isDesktop } from 'lib/isDesktop'
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import { ASK_TO_OPEN_QUERY_PARAM } from 'lib/constants'
|
||||
import { VITE_KC_SITE_BASE_URL } from 'env'
|
||||
import { ActionButton } from './ActionButton'
|
||||
import { Transition } from '@headlessui/react'
|
||||
|
||||
/**
|
||||
* This component is a handler that checks if a certain query parameter
|
||||
* is present, and if so, it will show a modal asking the user if they
|
||||
* want to open the current page in the desktop app.
|
||||
*/
|
||||
export const OpenInDesktopAppHandler = (props: React.PropsWithChildren) => {
|
||||
const theme = getSystemTheme()
|
||||
const buttonClasses =
|
||||
'bg-transparent flex-0 hover:bg-primary/10 dark:hover:bg-primary/10'
|
||||
const pathLogomarkSvg = `${isDesktop() ? '.' : ''}/zma-logomark${
|
||||
theme === Themes.Light ? '-dark' : ''
|
||||
}.svg`
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
// We also ignore this param on desktop, as it is redundant
|
||||
const hasAskToOpenParam =
|
||||
!isDesktop() && searchParams.has(ASK_TO_OPEN_QUERY_PARAM)
|
||||
|
||||
/**
|
||||
* This function removes the query param to ask to open in desktop app
|
||||
* and then navigates to the same route but with our custom protocol
|
||||
* `zoo-studio:` instead of `https://${BASE_URL}`, to trigger the user's
|
||||
* desktop app to open.
|
||||
*/
|
||||
function onOpenInDesktopApp() {
|
||||
const newSearchParams = new URLSearchParams(globalThis.location.search)
|
||||
newSearchParams.delete(ASK_TO_OPEN_QUERY_PARAM)
|
||||
const newURL = `${ZOO_STUDIO_PROTOCOL}${globalThis.location.pathname.replace(
|
||||
'/',
|
||||
''
|
||||
)}${searchParams.size > 0 ? `?${newSearchParams.toString()}` : ''}`
|
||||
globalThis.location.href = newURL
|
||||
}
|
||||
|
||||
/**
|
||||
* Just remove the query param to ask to open in desktop app
|
||||
* and continue to the web app.
|
||||
*/
|
||||
function continueToWebApp() {
|
||||
searchParams.delete(ASK_TO_OPEN_QUERY_PARAM)
|
||||
setSearchParams(searchParams)
|
||||
}
|
||||
|
||||
return hasAskToOpenParam ? (
|
||||
<Transition
|
||||
appear
|
||||
show={true}
|
||||
as="div"
|
||||
className={
|
||||
theme +
|
||||
` fixed inset-0 grid p-4 place-content-center ${
|
||||
theme === Themes.Dark ? '!bg-chalkboard-110 text-chalkboard-20' : ''
|
||||
}`
|
||||
}
|
||||
>
|
||||
<Transition.Child
|
||||
as="div"
|
||||
className={`max-w-3xl py-6 px-10 flex flex-col items-center gap-8
|
||||
mx-auto border rounded-lg shadow-lg dark:bg-chalkboard-100`}
|
||||
enter="ease-out duration-300"
|
||||
enterFrom="opacity-0 scale-95"
|
||||
enterTo="opacity-100 scale-100"
|
||||
leave="ease-in duration-200"
|
||||
leaveFrom="opacity-100 scale-100"
|
||||
leaveTo="opacity-0 scale-95"
|
||||
style={{ zIndex: 10 }}
|
||||
>
|
||||
<div>
|
||||
<h1 className="text-2xl">
|
||||
Launching{' '}
|
||||
<img
|
||||
src={pathLogomarkSvg}
|
||||
className="w-48"
|
||||
alt="Zoo Modeling App"
|
||||
/>
|
||||
</h1>
|
||||
</div>
|
||||
<p className="text-primary flex items-center gap-2">
|
||||
Choose where to open this link...
|
||||
</p>
|
||||
<div className="flex flex-col md:flex-row items-start justify-between gap-4 xl:gap-8">
|
||||
<div className="flex flex-col gap-2">
|
||||
<ActionButton
|
||||
Element="button"
|
||||
className={buttonClasses + ' !text-base'}
|
||||
onClick={onOpenInDesktopApp}
|
||||
iconEnd={{ icon: 'arrowRight' }}
|
||||
>
|
||||
Open in desktop app
|
||||
</ActionButton>
|
||||
<ActionButton
|
||||
Element="externalLink"
|
||||
className={
|
||||
buttonClasses +
|
||||
' text-sm border-transparent justify-center dark:bg-transparent'
|
||||
}
|
||||
to={`${VITE_KC_SITE_BASE_URL}/modeling-app/download`}
|
||||
iconEnd={{ icon: 'link', bgClassName: '!bg-transparent' }}
|
||||
>
|
||||
Download desktop app
|
||||
</ActionButton>
|
||||
</div>
|
||||
<ActionButton
|
||||
Element="button"
|
||||
className={buttonClasses + ' -order-1 !text-base'}
|
||||
onClick={continueToWebApp}
|
||||
iconStart={{ icon: 'arrowLeft' }}
|
||||
>
|
||||
Continue to web app
|
||||
</ActionButton>
|
||||
</div>
|
||||
</Transition.Child>
|
||||
</Transition>
|
||||
) : (
|
||||
props.children
|
||||
)
|
||||
}
|
||||
@ -10,11 +10,13 @@ import { APP_NAME } from 'lib/constants'
|
||||
import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { CustomIcon } from './CustomIcon'
|
||||
import { useLspContext } from './LspProvider'
|
||||
import { engineCommandManager, kclManager } from 'lib/singletons'
|
||||
import { codeManager, engineCommandManager, kclManager } from 'lib/singletons'
|
||||
import { MachineManagerContext } from 'components/MachineManagerProvider'
|
||||
import usePlatform from 'hooks/usePlatform'
|
||||
import { useAbsoluteFilePath } from 'hooks/useAbsoluteFilePath'
|
||||
import Tooltip from './Tooltip'
|
||||
import { copyFileShareLink } from 'lib/links'
|
||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||
|
||||
const ProjectSidebarMenu = ({
|
||||
project,
|
||||
@ -95,6 +97,7 @@ function ProjectMenuPopover({
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const filePath = useAbsoluteFilePath()
|
||||
const { settings, auth } = useSettingsAuthContext()
|
||||
const machineManager = useContext(MachineManagerContext)
|
||||
|
||||
const { commandBarState, commandBarSend } = useCommandsContext()
|
||||
@ -155,7 +158,6 @@ function ProjectMenuPopover({
|
||||
data: exportCommandInfo,
|
||||
}),
|
||||
},
|
||||
'break',
|
||||
{
|
||||
id: 'make',
|
||||
Element: 'button',
|
||||
@ -181,6 +183,19 @@ function ProjectMenuPopover({
|
||||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'share-link',
|
||||
Element: 'button',
|
||||
children: 'Share link to file',
|
||||
onClick: async () => {
|
||||
await copyFileShareLink({
|
||||
token: auth?.context.token || '',
|
||||
code: codeManager.code,
|
||||
name: project?.name || '',
|
||||
units: settings.context.modeling.defaultUnit.current,
|
||||
})
|
||||
},
|
||||
},
|
||||
'break',
|
||||
{
|
||||
id: 'go-home',
|
||||
|
||||
@ -3,11 +3,11 @@ import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { useFileSystemWatcher } from 'hooks/useFileSystemWatcher'
|
||||
import { useProjectsLoader } from 'hooks/useProjectsLoader'
|
||||
import { projectsMachine } from 'machines/projectsMachine'
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { createContext, useCallback, useEffect, useState } from 'react'
|
||||
import { Actor, AnyStateMachine, fromPromise, Prop, StateFrom } from 'xstate'
|
||||
import { useLspContext } from './LspProvider'
|
||||
import toast from 'react-hot-toast'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'
|
||||
import { PATHS } from 'lib/paths'
|
||||
import {
|
||||
createNewProjectDirectory,
|
||||
@ -19,11 +19,27 @@ import {
|
||||
interpolateProjectNameWithIndex,
|
||||
doesProjectNameNeedInterpolated,
|
||||
getUniqueProjectName,
|
||||
getNextFileName,
|
||||
} from 'lib/desktopFS'
|
||||
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
||||
import useStateMachineCommands from 'hooks/useStateMachineCommands'
|
||||
import { projectsCommandBarConfig } from 'lib/commandBarConfigs/projectsCommandConfig'
|
||||
import { isDesktop } from 'lib/isDesktop'
|
||||
import {
|
||||
CREATE_FILE_URL_PARAM,
|
||||
FILE_EXT,
|
||||
PROJECT_ENTRYPOINT,
|
||||
} from 'lib/constants'
|
||||
import { DeepPartial } from 'lib/types'
|
||||
import { Configuration } from 'wasm-lib/kcl/bindings/Configuration'
|
||||
import { codeManager } from 'lib/singletons'
|
||||
import {
|
||||
loadAndValidateSettings,
|
||||
projectConfigurationToSettingsPayload,
|
||||
saveSettings,
|
||||
setSettingsAtLevel,
|
||||
} from 'lib/settings/settingsUtils'
|
||||
import { Project } from 'lib/project'
|
||||
|
||||
type MachineContext<T extends AnyStateMachine> = {
|
||||
state?: StateFrom<T>
|
||||
@ -53,12 +69,110 @@ export const ProjectsContextProvider = ({
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* We need some of the functionality of the ProjectsContextProvider in the web version
|
||||
* but we can't perform file system operations in the browser,
|
||||
* so most of the behavior of this machine is stubbed out.
|
||||
*/
|
||||
const ProjectsContextWeb = ({ children }: { children: React.ReactNode }) => {
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const clearImportSearchParams = useCallback(() => {
|
||||
// Clear the search parameters related to the "Import file from URL" command
|
||||
// or we'll never be able cancel or submit it.
|
||||
searchParams.delete(CREATE_FILE_URL_PARAM)
|
||||
searchParams.delete('code')
|
||||
searchParams.delete('name')
|
||||
searchParams.delete('units')
|
||||
setSearchParams(searchParams)
|
||||
}, [searchParams, setSearchParams])
|
||||
const {
|
||||
settings: { context: settings, send: settingsSend },
|
||||
} = useSettingsAuthContext()
|
||||
|
||||
const [state, send, actor] = useMachine(
|
||||
projectsMachine.provide({
|
||||
actions: {
|
||||
navigateToProject: () => {},
|
||||
navigateToProjectIfNeeded: () => {},
|
||||
navigateToFile: () => {},
|
||||
toastSuccess: ({ event }) =>
|
||||
toast.success(
|
||||
('data' in event && typeof event.data === 'string' && event.data) ||
|
||||
('output' in event &&
|
||||
'message' in event.output &&
|
||||
typeof event.output.message === 'string' &&
|
||||
event.output.message) ||
|
||||
''
|
||||
),
|
||||
toastError: ({ event }) =>
|
||||
toast.error(
|
||||
('data' in event && typeof event.data === 'string' && event.data) ||
|
||||
('output' in event &&
|
||||
typeof event.output === 'string' &&
|
||||
event.output) ||
|
||||
''
|
||||
),
|
||||
},
|
||||
actors: {
|
||||
readProjects: fromPromise(async () => [] as Project[]),
|
||||
createProject: fromPromise(async () => ({
|
||||
message: 'not implemented on web',
|
||||
})),
|
||||
renameProject: fromPromise(async () => ({
|
||||
message: 'not implemented on web',
|
||||
oldName: '',
|
||||
newName: '',
|
||||
})),
|
||||
deleteProject: fromPromise(async () => ({
|
||||
message: 'not implemented on web',
|
||||
name: '',
|
||||
})),
|
||||
createFile: fromPromise(async ({ input }) => {
|
||||
// Browser version doesn't navigate, just overwrites the current file
|
||||
clearImportSearchParams()
|
||||
codeManager.updateCodeStateEditor(input.code || '')
|
||||
await codeManager.writeToFile()
|
||||
|
||||
settingsSend({
|
||||
type: 'set.modeling.defaultUnit',
|
||||
data: {
|
||||
level: 'project',
|
||||
value: input.units,
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
message: 'File and units overwritten successfully',
|
||||
fileName: input.name,
|
||||
projectName: '',
|
||||
}
|
||||
}),
|
||||
},
|
||||
}),
|
||||
{
|
||||
input: {
|
||||
projects: [],
|
||||
defaultProjectName: settings.projects.defaultProjectName.current,
|
||||
defaultDirectory: settings.app.projectDirectory.current,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// register all project-related command palette commands
|
||||
useStateMachineCommands({
|
||||
machineId: 'projects',
|
||||
send,
|
||||
state,
|
||||
commandBarConfig: projectsCommandBarConfig,
|
||||
actor,
|
||||
onCancel: clearImportSearchParams,
|
||||
})
|
||||
|
||||
return (
|
||||
<ProjectsMachineContext.Provider
|
||||
value={{
|
||||
state: undefined,
|
||||
send: () => {},
|
||||
state,
|
||||
send,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
@ -73,19 +187,22 @@ const ProjectsContextDesktop = ({
|
||||
}) => {
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const clearImportSearchParams = useCallback(() => {
|
||||
// Clear the search parameters related to the "Import file from URL" command
|
||||
// or we'll never be able cancel or submit it.
|
||||
searchParams.delete(CREATE_FILE_URL_PARAM)
|
||||
searchParams.delete('code')
|
||||
searchParams.delete('name')
|
||||
searchParams.delete('units')
|
||||
setSearchParams(searchParams)
|
||||
}, [searchParams, setSearchParams])
|
||||
const { commandBarSend } = useCommandsContext()
|
||||
const { onProjectOpen } = useLspContext()
|
||||
const {
|
||||
settings: { context: settings },
|
||||
} = useSettingsAuthContext()
|
||||
|
||||
useEffect(() => {
|
||||
console.log(
|
||||
'project directory changed',
|
||||
settings.app.projectDirectory.current
|
||||
)
|
||||
}, [settings.app.projectDirectory.current])
|
||||
|
||||
const [projectsLoaderTrigger, setProjectsLoaderTrigger] = useState(0)
|
||||
const { projectPaths, projectsDir } = useProjectsLoader([
|
||||
projectsLoaderTrigger,
|
||||
@ -169,6 +286,31 @@ const ProjectsContextDesktop = ({
|
||||
}
|
||||
}
|
||||
},
|
||||
navigateToFile: ({ context, event }) => {
|
||||
if (event.type !== 'xstate.done.actor.create-file') return
|
||||
// For now, the browser version of create-file doesn't need to navigate
|
||||
// since it just overwrites the current file.
|
||||
if (!isDesktop()) return
|
||||
let projectPath = window.electron.join(
|
||||
context.defaultDirectory,
|
||||
event.output.projectName
|
||||
)
|
||||
let filePath = window.electron.join(
|
||||
projectPath,
|
||||
event.output.fileName
|
||||
)
|
||||
onProjectOpen(
|
||||
{
|
||||
name: event.output.projectName,
|
||||
path: projectPath,
|
||||
},
|
||||
null
|
||||
)
|
||||
const pathToNavigateTo = `${PATHS.FILE}/${encodeURIComponent(
|
||||
filePath
|
||||
)}`
|
||||
navigate(pathToNavigateTo)
|
||||
},
|
||||
toastSuccess: ({ event }) =>
|
||||
toast.success(
|
||||
('data' in event && typeof event.data === 'string' && event.data) ||
|
||||
@ -218,8 +360,6 @@ const ProjectsContextDesktop = ({
|
||||
name = interpolateProjectNameWithIndex(name, nextIndex)
|
||||
}
|
||||
|
||||
console.log('from Project')
|
||||
|
||||
await renameProjectDirectory(
|
||||
window.electron.path.join(defaultDirectory, oldName),
|
||||
name
|
||||
@ -242,13 +382,82 @@ const ProjectsContextDesktop = ({
|
||||
name: input.name,
|
||||
}
|
||||
}),
|
||||
},
|
||||
guards: {
|
||||
'Has at least 1 project': ({ event }) => {
|
||||
if (event.type !== 'xstate.done.actor.read-projects') return false
|
||||
console.log(`from has at least 1 project: ${event.output.length}`)
|
||||
return event.output.length ? event.output.length >= 1 : false
|
||||
},
|
||||
createFile: fromPromise(async ({ input }) => {
|
||||
let projectName =
|
||||
(input.method === 'newProject' ? input.name : input.projectName) ||
|
||||
settings.projects.defaultProjectName.current
|
||||
let fileName =
|
||||
input.method === 'newProject'
|
||||
? PROJECT_ENTRYPOINT
|
||||
: input.name.endsWith(FILE_EXT)
|
||||
? input.name
|
||||
: input.name + FILE_EXT
|
||||
let message = 'File created successfully'
|
||||
const unitsConfiguration: DeepPartial<Configuration> = {
|
||||
settings: {
|
||||
project: {
|
||||
directory: settings.app.projectDirectory.current,
|
||||
},
|
||||
modeling: {
|
||||
base_unit: input.units,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const needsInterpolated = doesProjectNameNeedInterpolated(projectName)
|
||||
if (needsInterpolated) {
|
||||
const nextIndex = getNextProjectIndex(projectName, input.projects)
|
||||
projectName = interpolateProjectNameWithIndex(
|
||||
projectName,
|
||||
nextIndex
|
||||
)
|
||||
}
|
||||
|
||||
// Create the project around the file if newProject
|
||||
if (input.method === 'newProject') {
|
||||
await createNewProjectDirectory(
|
||||
projectName,
|
||||
input.code,
|
||||
unitsConfiguration
|
||||
)
|
||||
message = `Project "${projectName}" created successfully with link contents`
|
||||
} else {
|
||||
let projectPath = window.electron.join(
|
||||
settings.app.projectDirectory.current,
|
||||
projectName
|
||||
)
|
||||
|
||||
message = `File "${fileName}" created successfully`
|
||||
const existingConfiguration = await loadAndValidateSettings(
|
||||
projectPath
|
||||
)
|
||||
const settingsToSave = setSettingsAtLevel(
|
||||
existingConfiguration.settings,
|
||||
'project',
|
||||
projectConfigurationToSettingsPayload(unitsConfiguration)
|
||||
)
|
||||
await saveSettings(settingsToSave, projectPath)
|
||||
}
|
||||
|
||||
// Create the file
|
||||
let baseDir = window.electron.join(
|
||||
settings.app.projectDirectory.current,
|
||||
projectName
|
||||
)
|
||||
const { name, path } = getNextFileName({
|
||||
entryName: fileName,
|
||||
baseDir,
|
||||
})
|
||||
|
||||
fileName = name
|
||||
await window.electron.writeFile(path, input.code || '')
|
||||
|
||||
return {
|
||||
message,
|
||||
fileName,
|
||||
projectName,
|
||||
}
|
||||
}),
|
||||
},
|
||||
}),
|
||||
{
|
||||
@ -271,6 +480,7 @@ const ProjectsContextDesktop = ({
|
||||
state,
|
||||
commandBarConfig: projectsCommandBarConfig,
|
||||
actor,
|
||||
onCancel: clearImportSearchParams,
|
||||
})
|
||||
|
||||
return (
|
||||
|
||||
@ -6,5 +6,6 @@ export const useCommandsContext = () => {
|
||||
return {
|
||||
commandBarSend: commandBarActor.send,
|
||||
commandBarState,
|
||||
commandBarActor,
|
||||
}
|
||||
}
|
||||
|
||||
65
src/hooks/useCreateFileLinkQueryWatcher.ts
Normal file
65
src/hooks/useCreateFileLinkQueryWatcher.ts
Normal file
@ -0,0 +1,65 @@
|
||||
import { base64ToString } from 'lib/base64'
|
||||
import { CREATE_FILE_URL_PARAM, DEFAULT_FILE_NAME } from 'lib/constants'
|
||||
import { useEffect } from 'react'
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import { useSettingsAuthContext } from './useSettingsAuthContext'
|
||||
import { isDesktop } from 'lib/isDesktop'
|
||||
import { FileLinkParams } from 'lib/links'
|
||||
import { ProjectsCommandSchema } from 'lib/commandBarConfigs/projectsCommandConfig'
|
||||
import { baseUnitsUnion } from 'lib/settings/settingsTypes'
|
||||
|
||||
// For initializing the command arguments, we actually want `method` to be undefined
|
||||
// so that we don't skip it in the command palette.
|
||||
export type CreateFileSchemaMethodOptional = Omit<
|
||||
ProjectsCommandSchema['Import file from URL'],
|
||||
'method'
|
||||
> & {
|
||||
method?: 'newProject' | 'existingProject'
|
||||
}
|
||||
|
||||
/**
|
||||
* companion to createFileLink. This hook runs an effect on mount that
|
||||
* checks the URL for the CREATE_FILE_URL_PARAM and triggers the "Create file"
|
||||
* command if it is present, loading the command's default values from the other
|
||||
* URL parameters.
|
||||
*/
|
||||
export function useCreateFileLinkQuery(
|
||||
callback: (args: CreateFileSchemaMethodOptional) => void
|
||||
) {
|
||||
const [searchParams] = useSearchParams()
|
||||
const { settings } = useSettingsAuthContext()
|
||||
|
||||
useEffect(() => {
|
||||
const createFileParam = searchParams.has(CREATE_FILE_URL_PARAM)
|
||||
|
||||
if (createFileParam) {
|
||||
const params: FileLinkParams = {
|
||||
code: base64ToString(
|
||||
decodeURIComponent(searchParams.get('code') ?? '')
|
||||
),
|
||||
|
||||
name: searchParams.get('name') ?? DEFAULT_FILE_NAME,
|
||||
|
||||
units:
|
||||
(baseUnitsUnion.find((unit) => searchParams.get('units') === unit) ||
|
||||
settings.context.modeling.defaultUnit.default) ??
|
||||
settings.context.modeling.defaultUnit.current,
|
||||
}
|
||||
|
||||
const argDefaultValues: CreateFileSchemaMethodOptional = {
|
||||
name: params.name
|
||||
? isDesktop()
|
||||
? params.name.replace('.kcl', '')
|
||||
: params.name
|
||||
: isDesktop()
|
||||
? settings.context.projects.defaultProjectName.current
|
||||
: DEFAULT_FILE_NAME,
|
||||
code: params.code || '',
|
||||
units: params.units,
|
||||
method: isDesktop() ? undefined : 'existingProject',
|
||||
}
|
||||
|
||||
callback(argDefaultValues)
|
||||
}
|
||||
}, [searchParams])
|
||||
}
|
||||
@ -14,7 +14,7 @@ export const useProjectsLoader = (deps?: [number]) => {
|
||||
|
||||
useEffect(() => {
|
||||
// Useless on web, until we get fake filesystems over there.
|
||||
if (!isDesktop) return
|
||||
if (!isDesktop()) return
|
||||
|
||||
if (deps && deps[0] === lastTs) return
|
||||
|
||||
|
||||
@ -54,6 +54,9 @@ const mySketch001 = startSketchOn('XY')
|
||||
},
|
||||
],
|
||||
id: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: [{ sourceRange: [46, 71, 0] }],
|
||||
},
|
||||
})
|
||||
@ -72,56 +75,65 @@ const mySketch001 = startSketchOn('XY')
|
||||
const sketch001 = execState.memory.get('mySketch001')
|
||||
expect(sketch001).toEqual({
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102, 0],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
value: {
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
paths: [
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-1.59, -1.54],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102, 0],
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-1.59, -1.54],
|
||||
to: [0.46, -5.82],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
id: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
paths: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-1.59, -1.54],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [77, 102, 0],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-1.59, -1.54],
|
||||
to: [0.46, -5.82],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [108, 132, 0],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: [{ sourceRange: [46, 71, 0] }],
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [46, 71, 0] }],
|
||||
})
|
||||
})
|
||||
test('sketch extrude and sketch on one of the faces', async () => {
|
||||
@ -154,187 +166,205 @@ const sk2 = startSketchOn('XY')
|
||||
expect(geos).toEqual([
|
||||
{
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89, 0],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: {
|
||||
end: 116,
|
||||
start: 114,
|
||||
type: 'TagDeclarator',
|
||||
value: 'p',
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 117, 0],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [123, 142, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
value: {
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
tags: {
|
||||
p: {
|
||||
__meta: [
|
||||
{
|
||||
sourceRange: [114, 116, 0],
|
||||
},
|
||||
],
|
||||
type: 'TagIdentifier',
|
||||
value: 'p',
|
||||
info: expect.any(Object),
|
||||
},
|
||||
},
|
||||
paths: [
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89, 0],
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 10],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: {
|
||||
end: 116,
|
||||
start: 114,
|
||||
type: 'TagDeclarator',
|
||||
value: 'p',
|
||||
},
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 117, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 117, 0],
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 10],
|
||||
to: [2.5, 0],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [123, 142, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [123, 142, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
tags: {
|
||||
p: {
|
||||
__meta: [
|
||||
{
|
||||
sourceRange: [114, 116, 0],
|
||||
},
|
||||
],
|
||||
type: 'TagIdentifier',
|
||||
value: 'p',
|
||||
info: expect.any(Object),
|
||||
},
|
||||
},
|
||||
paths: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [69, 89, 0],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 10],
|
||||
tag: {
|
||||
end: 116,
|
||||
start: 114,
|
||||
type: 'TagDeclarator',
|
||||
value: 'p',
|
||||
},
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [95, 117, 0],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 10],
|
||||
to: [2.5, 0],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [123, 142, 0],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: [{ sourceRange: [38, 63, 0] }],
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [38, 63, 0] }],
|
||||
},
|
||||
{
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
value: [
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [373, 393, 0],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: {
|
||||
end: 419,
|
||||
start: 417,
|
||||
type: 'TagDeclarator',
|
||||
value: 'o',
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [399, 420, 0],
|
||||
},
|
||||
{
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
id: expect.any(String),
|
||||
sourceRange: [426, 445, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
value: {
|
||||
type: 'Solid',
|
||||
id: expect.any(String),
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
tags: {
|
||||
o: {
|
||||
__meta: [
|
||||
{
|
||||
sourceRange: [417, 419, 0],
|
||||
},
|
||||
],
|
||||
type: 'TagIdentifier',
|
||||
value: 'o',
|
||||
info: expect.any(Object),
|
||||
},
|
||||
},
|
||||
paths: [
|
||||
value: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [373, 393, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [373, 393, 0],
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 3],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: {
|
||||
end: 419,
|
||||
start: 417,
|
||||
type: 'TagDeclarator',
|
||||
value: 'o',
|
||||
},
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [399, 420, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [399, 420, 0],
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 3],
|
||||
to: [2.5, 0],
|
||||
type: 'extrudePlane',
|
||||
faceId: expect.any(String),
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [426, 445, 0],
|
||||
},
|
||||
id: expect.any(String),
|
||||
sourceRange: [426, 445, 0],
|
||||
},
|
||||
],
|
||||
sketch: {
|
||||
id: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: expect.any(Array),
|
||||
on: expect.any(Object),
|
||||
start: expect.any(Object),
|
||||
type: 'Sketch',
|
||||
tags: {
|
||||
o: {
|
||||
__meta: [
|
||||
{
|
||||
sourceRange: [417, 419, 0],
|
||||
},
|
||||
],
|
||||
type: 'TagIdentifier',
|
||||
value: 'o',
|
||||
info: expect.any(Object),
|
||||
},
|
||||
},
|
||||
paths: [
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 0],
|
||||
to: [-2.5, 0],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [373, 393, 0],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [-2.5, 0],
|
||||
to: [0, 3],
|
||||
tag: {
|
||||
end: 419,
|
||||
start: 417,
|
||||
type: 'TagDeclarator',
|
||||
value: 'o',
|
||||
},
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [399, 420, 0],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ToPoint',
|
||||
from: [0, 3],
|
||||
to: [2.5, 0],
|
||||
tag: null,
|
||||
__geoMeta: {
|
||||
id: expect.any(String),
|
||||
sourceRange: [426, 445, 0],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [342, 367, 0] }],
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
},
|
||||
height: 2,
|
||||
startCapId: expect.any(String),
|
||||
endCapId: expect.any(String),
|
||||
__meta: [{ sourceRange: [342, 367, 0] }],
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
@ -221,6 +221,9 @@ const newVar = myVar + 1`
|
||||
},
|
||||
],
|
||||
id: expect.any(String),
|
||||
units: {
|
||||
type: 'Mm',
|
||||
},
|
||||
__meta: [{ sourceRange: [39, 63, 0] }],
|
||||
},
|
||||
})
|
||||
|
||||
@ -1729,7 +1729,7 @@ export function transformAstSketchLines({
|
||||
let kclVal = programMemory.get(varName)
|
||||
let sketch
|
||||
if (kclVal?.type === 'Solid') {
|
||||
sketch = kclVal.sketch
|
||||
sketch = kclVal.value.sketch
|
||||
} else {
|
||||
sketch = sketchFromKclValue(kclVal, varName)
|
||||
if (err(sketch)) {
|
||||
|
||||
@ -539,7 +539,8 @@ export function sketchFromKclValueOptional(
|
||||
): Sketch | Reason {
|
||||
if (obj?.value?.type === 'Sketch') return obj.value
|
||||
if (obj?.value?.type === 'Solid') return obj.value.sketch
|
||||
if (obj?.type === 'Solid') return obj.sketch
|
||||
if (obj?.type === 'Sketch') return obj.value
|
||||
if (obj?.type === 'Solid') return obj.value.sketch
|
||||
if (!varName) {
|
||||
varName = 'a KCL value'
|
||||
}
|
||||
|
||||
40
src/lib/base64.test.ts
Normal file
40
src/lib/base64.test.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import { expect } from 'vitest'
|
||||
import { base64ToString, stringToBase64 } from './base64'
|
||||
|
||||
describe('base64 encoding', () => {
|
||||
test('to base64, simple code', async () => {
|
||||
const code = `extrusionDistance = 12`
|
||||
// Generated by online tool
|
||||
const expectedBase64 = `ZXh0cnVzaW9uRGlzdGFuY2UgPSAxMg==`
|
||||
|
||||
const base64 = stringToBase64(code)
|
||||
expect(base64).toBe(expectedBase64)
|
||||
})
|
||||
|
||||
test(`to base64, code with UTF-8 characters`, async () => {
|
||||
// example adapted from MDN docs: https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
|
||||
const code = `a = 5; Ā = 12.in(); 𐀀 = Ā; 文 = 12.0; 🦄 = -5;`
|
||||
// Generated by online tool
|
||||
const expectedBase64 = `YSA9IDU7IMSAID0gMTIuaW4oKTsg8JCAgCA9IMSAOyDmlocgPSAxMi4wOyDwn6aEID0gLTU7`
|
||||
|
||||
const base64 = stringToBase64(code)
|
||||
expect(base64).toBe(expectedBase64)
|
||||
})
|
||||
|
||||
// The following are simply the reverse of the above tests
|
||||
test('from base64, simple code', async () => {
|
||||
const base64 = `ZXh0cnVzaW9uRGlzdGFuY2UgPSAxMg==`
|
||||
const expectedCode = `extrusionDistance = 12`
|
||||
|
||||
const code = base64ToString(base64)
|
||||
expect(code).toBe(expectedCode)
|
||||
})
|
||||
|
||||
test(`from base64, code with UTF-8 characters`, async () => {
|
||||
const base64 = `YSA9IDU7IMSAID0gMTIuaW4oKTsg8JCAgCA9IMSAOyDmlocgPSAxMi4wOyDwn6aEID0gLTU7`
|
||||
const expectedCode = `a = 5; Ā = 12.in(); 𐀀 = Ā; 文 = 12.0; 🦄 = -5;`
|
||||
|
||||
const code = base64ToString(base64)
|
||||
expect(code).toBe(expectedCode)
|
||||
})
|
||||
})
|
||||
29
src/lib/base64.ts
Normal file
29
src/lib/base64.ts
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Converts a string to a base64 string, preserving the UTF-8 encoding
|
||||
*/
|
||||
export function stringToBase64(str: string) {
|
||||
return bytesToBase64(new TextEncoder().encode(str))
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a base64 string to a string, preserving the UTF-8 encoding
|
||||
*/
|
||||
export function base64ToString(base64: string) {
|
||||
return new TextDecoder().decode(base64ToBytes(base64))
|
||||
}
|
||||
|
||||
/**
|
||||
* From the MDN Web Docs
|
||||
* https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
|
||||
*/
|
||||
function base64ToBytes(base64: string) {
|
||||
const binString = atob(base64)
|
||||
return Uint8Array.from(binString, (m) => m.codePointAt(0)!)
|
||||
}
|
||||
|
||||
function bytesToBase64(bytes: Uint8Array) {
|
||||
const binString = Array.from(bytes, (byte) =>
|
||||
String.fromCodePoint(byte)
|
||||
).join('')
|
||||
return btoa(binString)
|
||||
}
|
||||
@ -1,5 +1,8 @@
|
||||
import { UnitLength_type } from '@kittycad/lib/dist/types/src/models'
|
||||
import { CommandBarOverwriteWarning } from 'components/CommandBarOverwriteWarning'
|
||||
import { StateMachineCommandSetConfig } from 'lib/commandTypes'
|
||||
import { isDesktop } from 'lib/isDesktop'
|
||||
import { baseUnitLabels, baseUnitsUnion } from 'lib/settings/settingsTypes'
|
||||
import { projectsMachine } from 'machines/projectsMachine'
|
||||
|
||||
export type ProjectsCommandSchema = {
|
||||
@ -17,6 +20,13 @@ export type ProjectsCommandSchema = {
|
||||
oldName: string
|
||||
newName: string
|
||||
}
|
||||
'Import file from URL': {
|
||||
name: string
|
||||
code?: string
|
||||
units: UnitLength_type
|
||||
method: 'newProject' | 'existingProject'
|
||||
projectName?: string
|
||||
}
|
||||
}
|
||||
|
||||
export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
@ -26,6 +36,7 @@ export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
'Open project': {
|
||||
icon: 'arrowRight',
|
||||
description: 'Open a project',
|
||||
status: isDesktop() ? 'active' : 'inactive',
|
||||
args: {
|
||||
name: {
|
||||
inputType: 'options',
|
||||
@ -42,6 +53,7 @@ export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
'Create project': {
|
||||
icon: 'folderPlus',
|
||||
description: 'Create a project',
|
||||
status: isDesktop() ? 'active' : 'inactive',
|
||||
args: {
|
||||
name: {
|
||||
inputType: 'string',
|
||||
@ -53,6 +65,7 @@ export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
'Delete project': {
|
||||
icon: 'close',
|
||||
description: 'Delete a project',
|
||||
status: isDesktop() ? 'active' : 'inactive',
|
||||
needsReview: true,
|
||||
reviewMessage: ({ argumentsToSubmit }) =>
|
||||
CommandBarOverwriteWarning({
|
||||
@ -75,6 +88,7 @@ export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
icon: 'folder',
|
||||
description: 'Rename a project',
|
||||
needsReview: true,
|
||||
status: isDesktop() ? 'active' : 'inactive',
|
||||
args: {
|
||||
oldName: {
|
||||
inputType: 'options',
|
||||
@ -92,4 +106,80 @@ export const projectsCommandBarConfig: StateMachineCommandSetConfig<
|
||||
},
|
||||
},
|
||||
},
|
||||
'Import file from URL': {
|
||||
icon: 'file',
|
||||
description: 'Create a file',
|
||||
needsReview: true,
|
||||
status: 'active',
|
||||
args: {
|
||||
method: {
|
||||
inputType: 'options',
|
||||
required: true,
|
||||
skip: true,
|
||||
options: isDesktop()
|
||||
? [
|
||||
{ name: 'New project', value: 'newProject' },
|
||||
{ name: 'Existing project', value: 'existingProject' },
|
||||
]
|
||||
: [{ name: 'Overwrite', value: 'existingProject' }],
|
||||
valueSummary(value) {
|
||||
return isDesktop()
|
||||
? value === 'newProject'
|
||||
? 'New project'
|
||||
: 'Existing project'
|
||||
: 'Overwrite'
|
||||
},
|
||||
},
|
||||
// TODO: We can't get the currently-opened project to auto-populate here because
|
||||
// it's not available on projectMachine, but lower in fileMachine. Unify these.
|
||||
projectName: {
|
||||
inputType: 'options',
|
||||
required: (commandsContext) =>
|
||||
isDesktop() &&
|
||||
commandsContext.argumentsToSubmit.method === 'existingProject',
|
||||
skip: true,
|
||||
options: (_, context) =>
|
||||
context?.projects.map((p) => ({
|
||||
name: p.name!,
|
||||
value: p.name!,
|
||||
})) || [],
|
||||
},
|
||||
name: {
|
||||
inputType: 'string',
|
||||
required: isDesktop(),
|
||||
skip: true,
|
||||
},
|
||||
code: {
|
||||
inputType: 'text',
|
||||
required: true,
|
||||
skip: true,
|
||||
valueSummary(value) {
|
||||
const lineCount = value?.trim().split('\n').length
|
||||
return `${lineCount} line${lineCount === 1 ? '' : 's'}`
|
||||
},
|
||||
},
|
||||
units: {
|
||||
inputType: 'options',
|
||||
required: false,
|
||||
skip: true,
|
||||
options: baseUnitsUnion.map((unit) => ({
|
||||
name: baseUnitLabels[unit],
|
||||
value: unit,
|
||||
})),
|
||||
},
|
||||
},
|
||||
reviewMessage(commandBarContext) {
|
||||
return isDesktop()
|
||||
? `Will add the contents from URL to a new ${
|
||||
commandBarContext.argumentsToSubmit.method === 'newProject'
|
||||
? 'project with file main.kcl'
|
||||
: `file within the project "${commandBarContext.argumentsToSubmit.projectName}"`
|
||||
} named "${
|
||||
commandBarContext.argumentsToSubmit.name
|
||||
}", and set default units to "${
|
||||
commandBarContext.argumentsToSubmit.units
|
||||
}".`
|
||||
: `Will overwrite the contents of the current file with the contents from the URL.`
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -69,6 +69,7 @@ export const KCL_DEFAULT_DEGREE = `360`
|
||||
export const TEST_SETTINGS_FILE_KEY = 'playwright-test-settings'
|
||||
|
||||
export const DEFAULT_HOST = 'https://api.zoo.dev'
|
||||
export const PROD_APP_URL = 'https://app.zoo.dev'
|
||||
export const SETTINGS_FILE_NAME = 'settings.toml'
|
||||
export const TOKEN_FILE_NAME = 'token.txt'
|
||||
export const PROJECT_SETTINGS_FILE_NAME = 'project.toml'
|
||||
@ -110,6 +111,9 @@ export const KCL_SAMPLES_MANIFEST_URLS = {
|
||||
localFallback: '/kcl-samples-manifest-fallback.json',
|
||||
} as const
|
||||
|
||||
/** URL parameter to create a file */
|
||||
export const CREATE_FILE_URL_PARAM = 'create-file'
|
||||
|
||||
/** Toast id for the app auto-updater toast */
|
||||
export const AUTO_UPDATER_TOAST_ID = 'auto-updater-toast'
|
||||
|
||||
@ -139,3 +143,12 @@ export const VIEW_NAMES_SEMANTIC = {
|
||||
} as const
|
||||
/** The modeling sidebar buttons' IDs get a suffix to prevent collisions */
|
||||
export const SIDEBAR_BUTTON_SUFFIX = '-pane-button'
|
||||
|
||||
/** Custom URL protocol our desktop registers */
|
||||
export const ZOO_STUDIO_PROTOCOL = 'zoo-studio:'
|
||||
|
||||
/**
|
||||
* A query parameter that triggers a modal
|
||||
* to "open in desktop app" when present in the URL
|
||||
*/
|
||||
export const ASK_TO_OPEN_QUERY_PARAM = 'ask-open-desktop'
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
import { CommandBarOverwriteWarning } from 'components/CommandBarOverwriteWarning'
|
||||
import { Command, CommandArgumentOption } from './commandTypes'
|
||||
import { kclManager } from './singletons'
|
||||
import { codeManager, kclManager } from './singletons'
|
||||
import { isDesktop } from './isDesktop'
|
||||
import { FILE_EXT, PROJECT_SETTINGS_FILE_NAME } from './constants'
|
||||
import { UnitLength_type } from '@kittycad/lib/dist/types/src/models'
|
||||
import { parseProjectSettings } from 'lang/wasm'
|
||||
import { err, reportRejection } from './trap'
|
||||
import { projectConfigurationToSettingsPayload } from './settings/settingsUtils'
|
||||
import { copyFileShareLink } from './links'
|
||||
import { IndexLoaderData } from './types'
|
||||
|
||||
interface OnSubmitProps {
|
||||
sampleName: string
|
||||
@ -15,10 +17,21 @@ interface OnSubmitProps {
|
||||
method: 'overwrite' | 'newFile'
|
||||
}
|
||||
|
||||
export function kclCommands(
|
||||
onSubmit: (p: OnSubmitProps) => Promise<void>,
|
||||
providedOptions: CommandArgumentOption<string>[]
|
||||
): Command[] {
|
||||
interface KclCommandConfig {
|
||||
// TODO: find a different approach that doesn't require
|
||||
// special props for a single command
|
||||
specialPropsForSampleCommand: {
|
||||
onSubmit: (p: OnSubmitProps) => Promise<void>
|
||||
providedOptions: CommandArgumentOption<string>[]
|
||||
}
|
||||
projectData: IndexLoaderData
|
||||
authToken: string
|
||||
settings: {
|
||||
defaultUnit: UnitLength_type
|
||||
}
|
||||
}
|
||||
|
||||
export function kclCommands(commandProps: KclCommandConfig): Command[] {
|
||||
return [
|
||||
{
|
||||
name: 'format-code',
|
||||
@ -107,7 +120,9 @@ export function kclCommands(
|
||||
)
|
||||
.then((props) => {
|
||||
if (props?.code) {
|
||||
onSubmit(props).catch(reportError)
|
||||
commandProps.specialPropsForSampleCommand
|
||||
.onSubmit(props)
|
||||
.catch(reportError)
|
||||
}
|
||||
})
|
||||
.catch(reportError)
|
||||
@ -149,9 +164,25 @@ export function kclCommands(
|
||||
}
|
||||
return value
|
||||
},
|
||||
options: providedOptions,
|
||||
options: commandProps.specialPropsForSampleCommand.providedOptions,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'share-file-link',
|
||||
displayName: 'Share file',
|
||||
description: 'Create a link that contains a copy of the current file.',
|
||||
groupId: 'code',
|
||||
needsReview: false,
|
||||
icon: 'link',
|
||||
onSubmit: () => {
|
||||
copyFileShareLink({
|
||||
token: commandProps.authToken,
|
||||
code: codeManager.code,
|
||||
name: commandProps.projectData.project?.name || '',
|
||||
units: commandProps.settings.defaultUnit,
|
||||
}).catch(reportRejection)
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
16
src/lib/links.test.ts
Normal file
16
src/lib/links.test.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { createCreateFileUrl } from './links'
|
||||
|
||||
describe(`link creation tests`, () => {
|
||||
test(`createCreateFileUrl happy path`, async () => {
|
||||
const code = `extrusionDistance = 12`
|
||||
const name = `test`
|
||||
const units = `mm`
|
||||
|
||||
// Converted with external online tools
|
||||
const expectedEncodedCode = `ZXh0cnVzaW9uRGlzdGFuY2UgPSAxMg%3D%3D`
|
||||
const expectedLink = `http://localhost:3000/?create-file=true&name=test&units=mm&code=${expectedEncodedCode}&ask-open-desktop=true`
|
||||
|
||||
const result = createCreateFileUrl({ code, name, units })
|
||||
expect(result.toString()).toBe(expectedLink)
|
||||
})
|
||||
})
|
||||
100
src/lib/links.ts
Normal file
100
src/lib/links.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import { UnitLength_type } from '@kittycad/lib/dist/types/src/models'
|
||||
import {
|
||||
ASK_TO_OPEN_QUERY_PARAM,
|
||||
CREATE_FILE_URL_PARAM,
|
||||
PROD_APP_URL,
|
||||
} from './constants'
|
||||
import { stringToBase64 } from './base64'
|
||||
import { DEV, VITE_KC_API_BASE_URL } from 'env'
|
||||
import toast from 'react-hot-toast'
|
||||
import { err } from './trap'
|
||||
export interface FileLinkParams {
|
||||
code: string
|
||||
name: string
|
||||
units: UnitLength_type
|
||||
}
|
||||
|
||||
export async function copyFileShareLink(
|
||||
args: FileLinkParams & { token: string }
|
||||
) {
|
||||
const token = args.token
|
||||
if (!token) {
|
||||
toast.error('You need to be signed in to share a file.', {
|
||||
duration: 5000,
|
||||
})
|
||||
return
|
||||
}
|
||||
const shareUrl = createCreateFileUrl(args)
|
||||
const shortlink = await createShortlink(token, shareUrl.toString())
|
||||
|
||||
if (err(shortlink)) {
|
||||
toast.error(shortlink.message, {
|
||||
duration: 5000,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await globalThis.navigator.clipboard.writeText(shortlink.url)
|
||||
toast.success(
|
||||
'Link copied to clipboard. Anyone who clicks this link will get a copy of this file. Share carefully!',
|
||||
{
|
||||
duration: 5000,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a URL with the necessary query parameters to trigger
|
||||
* the "Import file from URL" command in the app.
|
||||
*
|
||||
* With the additional step of asking the user if they want to
|
||||
* open the URL in the desktop app.
|
||||
*/
|
||||
export function createCreateFileUrl({ code, name, units }: FileLinkParams) {
|
||||
// Use the dev server if we are in development mode
|
||||
let origin = DEV ? 'http://localhost:3000' : PROD_APP_URL
|
||||
const searchParams = new URLSearchParams({
|
||||
[CREATE_FILE_URL_PARAM]: String(true),
|
||||
name,
|
||||
units,
|
||||
code: stringToBase64(code),
|
||||
[ASK_TO_OPEN_QUERY_PARAM]: String(true),
|
||||
})
|
||||
const createFileUrl = new URL(`?${searchParams.toString()}`, origin)
|
||||
|
||||
return createFileUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a file's code, name, and units, creates shareable link to the
|
||||
* web app with a query parameter that triggers a modal to "open in desktop app".
|
||||
* That modal is defined in the `OpenInDesktopAppHandler` component.
|
||||
* TODO: update the return type to use TS library after its updated
|
||||
*/
|
||||
export async function createShortlink(
|
||||
token: string,
|
||||
url: string
|
||||
): Promise<Error | { key: string; url: string }> {
|
||||
/**
|
||||
* We don't use our `withBaseURL` function here because
|
||||
* there is no URL shortener service in the dev API.
|
||||
*/
|
||||
const response = await fetch(`${VITE_KC_API_BASE_URL}/user/shortlinks`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
// In future we can support org-scoped and password-protected shortlinks here
|
||||
// https://zoo.dev/docs/api/shortlinks/create-a-shortlink-for-a-user?lang=typescript
|
||||
}),
|
||||
})
|
||||
if (!response.ok) {
|
||||
const error = await response.json()
|
||||
return new Error(`Failed to create shortlink: ${error.message}`)
|
||||
} else {
|
||||
return response.json()
|
||||
}
|
||||
}
|
||||
@ -114,7 +114,7 @@ export const fileLoader: LoaderFunction = async (
|
||||
return redirect(
|
||||
`${PATHS.FILE}/${encodeURIComponent(
|
||||
isDesktop() ? fallbackFile : params.id + '/' + PROJECT_ENTRYPOINT
|
||||
)}`
|
||||
)}${new URL(routerData.request.url).search || ''}`
|
||||
)
|
||||
}
|
||||
|
||||
@ -188,11 +188,14 @@ export const fileLoader: LoaderFunction = async (
|
||||
|
||||
// Loads the settings and by extension the projects in the default directory
|
||||
// and returns them to the Home route, along with any errors that occurred
|
||||
export const homeLoader: LoaderFunction = async (): Promise<
|
||||
HomeLoaderData | Response
|
||||
> => {
|
||||
export const homeLoader: LoaderFunction = async ({
|
||||
request,
|
||||
}): Promise<HomeLoaderData | Response> => {
|
||||
const url = new URL(request.url)
|
||||
if (!isDesktop()) {
|
||||
return redirect(PATHS.FILE + '/%2F' + BROWSER_PROJECT_NAME)
|
||||
return redirect(
|
||||
PATHS.FILE + '/%2F' + BROWSER_PROJECT_NAME + (url.search || '')
|
||||
)
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ export async function submitAndAwaitTextToKcl({
|
||||
.toLowerCase()}${FILE_EXT}`
|
||||
|
||||
if (isDesktop()) {
|
||||
// We have to pre-emptively run our unique file name logic,
|
||||
// We have to preemptively run our unique file name logic,
|
||||
// so that we can pass the unique file name to the toast,
|
||||
// and by extension the file-deletion-on-reject logic.
|
||||
newFileName = getNextFileName({
|
||||
|
||||
@ -280,7 +280,12 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
status: 'available',
|
||||
title: 'Offset plane',
|
||||
description: 'Create a plane parallel to an existing plane.',
|
||||
links: [],
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl/offsetPlane',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'plane-points',
|
||||
@ -305,7 +310,12 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
status: 'available',
|
||||
title: 'Text-to-CAD',
|
||||
description: 'Generate geometry from a text prompt.',
|
||||
links: [],
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/api/ml/generate-a-cad-model-from-text',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'prompt-to-edit',
|
||||
|
||||
@ -25,6 +25,10 @@ export const projectsMachine = setup({
|
||||
type: 'Delete project'
|
||||
data: ProjectsCommandSchema['Delete project']
|
||||
}
|
||||
| {
|
||||
type: 'Import file from URL'
|
||||
data: ProjectsCommandSchema['Import file from URL']
|
||||
}
|
||||
| { type: 'navigate'; data: { name: string } }
|
||||
| {
|
||||
type: 'xstate.done.actor.read-projects'
|
||||
@ -42,6 +46,10 @@ export const projectsMachine = setup({
|
||||
type: 'xstate.done.actor.rename-project'
|
||||
output: { message: string; oldName: string; newName: string }
|
||||
}
|
||||
| {
|
||||
type: 'xstate.done.actor.create-file'
|
||||
output: { message: string; projectName: string; fileName: string }
|
||||
}
|
||||
| { type: 'assign'; data: { [key: string]: any } },
|
||||
input: {} as {
|
||||
projects: Project[]
|
||||
@ -60,6 +68,7 @@ export const projectsMachine = setup({
|
||||
toastError: () => {},
|
||||
navigateToProject: () => {},
|
||||
navigateToProjectIfNeeded: () => {},
|
||||
navigateToFile: () => {},
|
||||
},
|
||||
actors: {
|
||||
readProjects: fromPromise(() => Promise.resolve([] as Project[])),
|
||||
@ -90,12 +99,22 @@ export const projectsMachine = setup({
|
||||
name: '',
|
||||
})
|
||||
),
|
||||
createFile: fromPromise(
|
||||
(_: {
|
||||
input: ProjectsCommandSchema['Import file from URL'] & {
|
||||
projects: Project[]
|
||||
}
|
||||
}) => Promise.resolve({ message: '', projectName: '', fileName: '' })
|
||||
),
|
||||
},
|
||||
guards: {
|
||||
'Has at least 1 project': () => false,
|
||||
'Has at least 1 project': ({ event }) => {
|
||||
if (event.type !== 'xstate.done.actor.read-projects') return false
|
||||
return event.output.length ? event.output.length >= 1 : false
|
||||
},
|
||||
},
|
||||
}).createMachine({
|
||||
/** @xstate-layout N4IgpgJg5mDOIC5QAkD2BbMACdBDAxgBYCWAdmAMS6yzFSkDaADALqKgAOqtALsaqXYgAHogAsAJgA0IAJ6IAjBIkA2AHQAOCUw0qNkjQE4xYjQF8zMtJhwES5NcmpZSqLBwBOqAFZh8PWAoAJTBcCHcvX39YZjYkEC5efkF40QQFFQBmAHY1Qwz9QwBWU0NMrRl5BGyxBTUVJlVM01rtBXNLEGtsPCIyMEdnVwifPwCKAGEPUJ5sT1H-WKFE4j4BITSMzMzNIsyJDSZMhSYmFWzKxAkTNSYxIuU9zOKT7IsrDB67fsHYEajxiEwv8xjFWMtuKtkhsrpJboZsioincFMdTIjLggVGJ1GImMVMg0JISjEV3l1PrY+g4nH95gDAiFSLgbPSxkt4is1ilQGlrhJ4YjkbU0RoMXJEIYkWoikV8hJinjdOdyd0qfYBrSQdFJtNcLNtTwOZxIdyYQh+YKkSjReKqqYBQoEQpsgiSi9MqrKb0Nb9DYEACJgAA2YANbMW4M5puhqVhAvxQptCnRKkxCleuw0Gm2+2aRVRXpsPp+Woj4wA8hwwKRDcaEjH1nGLXDE9aRSmxWmJVipWocmdsbL8kxC501SWHFMZmQoIaKBABAMyAA3VAAawG+D1swAtOX61zY7zENlEWoMkoatcdPoipjCWIZRIirozsPiYYi19qQNp-rZ3nMAPC8Dw1A4YN9QAM1QDx0DUbcZjAfdInZKMTSSJsT2qc9Lwka8lTvTFTB2WUMiyQwc3yPRv3VH4mRZQDywXJc1FXDcBmmZlMBQhYjXQhtMJ5ERT1wlQr0kQj7kxKiZTxM5s2zbQEVoycBgY9AmNQ-wKGA0DwMgngYLgtQuJZZCDwEo8sJEnD1Dwgjb2kntig0GUkWVfZDEMfFVO+Bwg1DPhSDnZjFwcdjNzUCAQzDCztP4uIMKhGy0jPezxPwySnPvHsTjlPIhyOHRsnwlM-N-NRArDLS+N0kDYIM6DYPgmKgvivjD0bYS+VbBF21RTs7UUUcimfRpXyYRF8LFCrfSBCBaoZFiItINcor1CBeIZLqhPNdKL0yxzs2cqoNDqdpSo0EoSoLOb6NCRaQv9FblzWjjTMe7bQQYBQksElKesUMRjFubRMllCHsm2a5MVldRDBfFpmj0IpxPuhwFqW0F6v0iDmpMzbvuiXbAfNFNQcaI5IaKaH9jETFsUMNRVDxOU5TxBULE6VwYvgeIJ38sAIT25td27KpdzG7yZeho5slHVmMc1IY3HLfnkrNZt2hOW5smRCQM2uhQHkZ6VtkRBFnmu0qFGVv11ZFsnm0kdN8QFJVjlUPZ9co+3-2C0KEqdrXsJMJ8ryc86iUyYiCvxFNzldb3jHtjTsf8EPj1ssQchZlR8jR5EmDRrIGZcuF7maF1aZtslx29IWqtiwPDSz1LxDxepnlOfYDghp03eyOpngzXuYdHNPHozgJ26B9IXR2cTvP0BVkSRXKqgLtyq8OfQcXOwlubMIA */
|
||||
/** @xstate-layout N4IgpgJg5mDOIC5QAkD2BbMACdBDAxgBYCWAdmAMS6yzFSkDaADALqKgAOqtALsaqXYgAHogAsAJgA0IAJ6IAjAHYAbADoArBJVMFTCQA4mTAMwmxAXwsy0mHARLkKASXRcATjywAzYgBtsb3cMLABVACUAGWY2JBAuXn5BONEESRl5BAUFFQM1HQUxJSYATmyFAyUTKxsMbDwiMjA1ZGosUlQsDmCAKzB8HlgKcLBcCC7e-sGYoQTiPgEhVIUy9SKSiQ0NEwkclRyMxGKJNRKlMRVDU23zpRqQW3qHJpa2jonUPoGhgGF3UZ42G6nymMzicwWyVAyzKJzECg0OiYGjERhK+kOWUMSlOGiUlTEJlMxRKBnuj3sjXIr1gHy+g2Go3GwPpsDBnG48ySS0QGj0+Q0JTOGkqBg2JhKmNRJy2OyUEn0Kml5LqlMczVatJZUyGI1IuDs2oG7PinMhPIQfKYAqFShF+PFkrkRwkYjU8OUShKKhMKg0pUs1geqoa6ppdJ1FD+AKBk2NrFmZu5KV5-L9tvtYokEsxelRagUCoMiMumyUdpVdlDL01Ee+FAAImAAoC6zwTRDk9DU9b08LRY7MWd1AZcoS-aoLiYFJWnlSNW0jQyAPIcMCkNsdpOLFOWtOC-sO7NOzLbGWFbY6acmFESWdql7R3B8UhQNsUCACZpkABuqAA1s0+D-M+YAALRLluiQ7t2WRMGIbryjeBgGBIEglNsCi5sY6hMOchQqEoCLFCh97VtST4vm+S4UGA7jBO4agcH4z7eKg7joGowExhBcbtgm4LblCIiKPBiHZiKqHoZhuaFhoBbGMYBhiPBCgStUQYUuRzR6gaZDUXxH5fmov4Ac0-z6pgvEgvGsQctBwnLGJahIZJaEYdOmKEfJuQSoRRKSRcZHPNSunoPp750QxTEsTwbEcWoFkGuBkECfZXIwSJcEIS5Ekoe5MnOggXqIaUqFiiUhIInemkhiFzRNi2EU0Z+1KmYBagQM2YCAtZ9JQRljmiTlrn5dJnlFShOLwcpZjKBs+KBrUVb1WojU9c1hlRexMWsexnFdS2KV8QN5q7laNqHlmOaTcpmjoWc8L6HoYrBfOagjGMm02QyrXfqQf4dSBEB9Tqp1dllebichUkeVhRXTiU+QecUKhCps4pvWGn0QN9rJGW1ANmYlTKg98DAKHZpoORanoyqh8oImU3pKJifJ5Ohdr7CYqjIvKWMvDjeORttjHMXtCXA2T0xpdTg20+W9MSIzgorIRXlpr6ORbPs+jwQLFEgVRPj+JQf0mUTHXcaBYG+AE4OZcsxbuts5hbCK+zFmImJgSc5zPV6BQVD6RQG80lERXblCi7tcX7VxRvgVHDtDQgaE4vK2gXKiTA6ItubmJo8IoqOylERUVhBh0XXwHEWn1YmNO7mBKg+2KpzK2IpIBUwBhqUtwYre9tbvEutfpWdsFFnkPpVJnQqz15Ozur36FoypREbGH4Zj438u7tO1qIu5qK5PBGyYjebpEkS44e9oVTbxHr5tnvk9ZeXajTuW+zaHNuzYRUmoeCEp-RKlUHJbeYVhYDDfhDVIxR5IGGnISQk6E+6EkxMUBQX9c66EMMg3Q5Zt7rWNkuOBjsjilDUAqQsZQzzgOkJNUk7o7SmF-tiXOUCmQwMGBQ1OF4TgVGzFUG8yIxQGDZiYPI4oqh+mPsrDSy05xhmfm+KO-CLT+iRucEUuwFQqWzMWXM2YTAuTtL6ZBylkRcMrkAA */
|
||||
id: 'Home machine',
|
||||
|
||||
initial: 'Reading projects',
|
||||
@ -111,6 +130,8 @@ export const projectsMachine = setup({
|
||||
})),
|
||||
target: '.Reading projects',
|
||||
},
|
||||
|
||||
'Import file from URL': '.Creating file',
|
||||
},
|
||||
states: {
|
||||
'Has no projects': {
|
||||
@ -155,7 +176,10 @@ export const projectsMachine = setup({
|
||||
id: 'create-project',
|
||||
src: 'createProject',
|
||||
input: ({ event, context }) => {
|
||||
if (event.type !== 'Create project') {
|
||||
if (
|
||||
event.type !== 'Create project' &&
|
||||
event.type !== 'Import file from URL'
|
||||
) {
|
||||
return {
|
||||
name: '',
|
||||
projects: context.projects,
|
||||
@ -272,5 +296,39 @@ export const projectsMachine = setup({
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
'Creating file': {
|
||||
invoke: {
|
||||
id: 'create-file',
|
||||
src: 'createFile',
|
||||
input: ({ event, context }) => {
|
||||
if (event.type !== 'Import file from URL') {
|
||||
return {
|
||||
code: '',
|
||||
name: '',
|
||||
units: 'mm',
|
||||
method: 'existingProject',
|
||||
projects: context.projects,
|
||||
}
|
||||
}
|
||||
return {
|
||||
code: event.data.code || '',
|
||||
name: event.data.name,
|
||||
units: event.data.units,
|
||||
method: event.data.method,
|
||||
projectName: event.data.projectName,
|
||||
projects: context.projects,
|
||||
}
|
||||
},
|
||||
onDone: {
|
||||
target: 'Reading projects',
|
||||
actions: ['navigateToFile', 'toastSuccess'],
|
||||
},
|
||||
onError: {
|
||||
target: 'Reading projects',
|
||||
actions: 'toastError',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
79
src/main.ts
79
src/main.ts
@ -21,6 +21,7 @@ import minimist from 'minimist'
|
||||
import getCurrentProjectFile from 'lib/getCurrentProjectFile'
|
||||
import os from 'node:os'
|
||||
import { reportRejection } from 'lib/trap'
|
||||
import { ZOO_STUDIO_PROTOCOL } from 'lib/constants'
|
||||
import argvFromYargs from './commandLineArgs'
|
||||
|
||||
import * as packageJSON from '../package.json'
|
||||
@ -42,15 +43,13 @@ if (!process.env.NODE_ENV)
|
||||
dotenv.config({ path: [`.env.${NODE_ENV}.local`, `.env.${NODE_ENV}`] })
|
||||
|
||||
process.env.VITE_KC_API_WS_MODELING_URL ??=
|
||||
'wss://api.zoo.dev/ws/modeling/commands'
|
||||
process.env.VITE_KC_API_BASE_URL ??= 'https://api.zoo.dev'
|
||||
process.env.VITE_KC_SITE_BASE_URL ??= 'https://zoo.dev'
|
||||
'wss://api.dev.zoo.dev/ws/modeling/commands'
|
||||
process.env.VITE_KC_API_BASE_URL ??= 'https://api.dev.zoo.dev'
|
||||
process.env.VITE_KC_SITE_BASE_URL ??= 'https://dev.zoo.dev'
|
||||
process.env.VITE_KC_SKIP_AUTH ??= 'false'
|
||||
process.env.VITE_KC_CONNECTION_TIMEOUT_MS ??= '15000'
|
||||
|
||||
const ZOO_STUDIO_PROTOCOL = 'zoo-studio'
|
||||
|
||||
/// Register our application to handle all "electron-fiddle://" protocols.
|
||||
/// Register our application to handle all "zoo-studio:" protocols.
|
||||
if (process.defaultApp) {
|
||||
if (process.argv.length >= 2) {
|
||||
app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [
|
||||
@ -65,7 +64,7 @@ if (process.defaultApp) {
|
||||
// Must be done before ready event.
|
||||
registerStartupListeners()
|
||||
|
||||
const createWindow = (filePath?: string, reuse?: boolean): BrowserWindow => {
|
||||
const createWindow = (pathToOpen?: string, reuse?: boolean): BrowserWindow => {
|
||||
let newWindow
|
||||
|
||||
if (reuse) {
|
||||
@ -90,32 +89,54 @@ const createWindow = (filePath?: string, reuse?: boolean): BrowserWindow => {
|
||||
})
|
||||
}
|
||||
|
||||
const pathIsCustomProtocolLink =
|
||||
pathToOpen?.startsWith(ZOO_STUDIO_PROTOCOL) ?? false
|
||||
|
||||
// and load the index.html of the app.
|
||||
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
||||
newWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL).catch(reportRejection)
|
||||
const filteredPath = pathToOpen
|
||||
? decodeURI(pathToOpen.replace(ZOO_STUDIO_PROTOCOL, ''))
|
||||
: ''
|
||||
const fullHashBasedUrl = `${MAIN_WINDOW_VITE_DEV_SERVER_URL}/#/${filteredPath}`
|
||||
newWindow.loadURL(fullHashBasedUrl).catch(reportRejection)
|
||||
} else {
|
||||
getProjectPathAtStartup(filePath)
|
||||
.then(async (projectPath) => {
|
||||
const startIndex = path.join(
|
||||
__dirname,
|
||||
`../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`
|
||||
)
|
||||
|
||||
if (projectPath === null) {
|
||||
await newWindow.loadFile(startIndex)
|
||||
return
|
||||
}
|
||||
|
||||
console.log('Loading file', projectPath)
|
||||
|
||||
const fullUrl = `/file/${encodeURIComponent(projectPath)}`
|
||||
console.log('Full URL', fullUrl)
|
||||
|
||||
await newWindow.loadFile(startIndex, {
|
||||
hash: fullUrl,
|
||||
if (pathIsCustomProtocolLink && pathToOpen) {
|
||||
// We're trying to open a custom protocol link
|
||||
const filteredPath = pathToOpen
|
||||
? decodeURI(pathToOpen.replace(ZOO_STUDIO_PROTOCOL, ''))
|
||||
: ''
|
||||
const startIndex = path.join(
|
||||
__dirname,
|
||||
`../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`
|
||||
)
|
||||
newWindow
|
||||
.loadFile(startIndex, {
|
||||
hash: filteredPath,
|
||||
})
|
||||
})
|
||||
.catch(reportRejection)
|
||||
.catch(reportRejection)
|
||||
} else {
|
||||
// otherwise we're trying to open a local file from the command line
|
||||
getProjectPathAtStartup(pathToOpen)
|
||||
.then(async (projectPath) => {
|
||||
const startIndex = path.join(
|
||||
__dirname,
|
||||
`../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`
|
||||
)
|
||||
|
||||
if (projectPath === null) {
|
||||
await newWindow.loadFile(startIndex)
|
||||
return
|
||||
}
|
||||
|
||||
const fullUrl = `/file/${encodeURIComponent(projectPath)}`
|
||||
console.log('Full URL', fullUrl)
|
||||
|
||||
await newWindow.loadFile(startIndex, {
|
||||
hash: fullUrl,
|
||||
})
|
||||
})
|
||||
.catch(reportRejection)
|
||||
}
|
||||
}
|
||||
|
||||
// Open the DevTools.
|
||||
|
||||
@ -25,6 +25,7 @@ import { useFileSystemWatcher } from 'hooks/useFileSystemWatcher'
|
||||
import { useProjectsLoader } from 'hooks/useProjectsLoader'
|
||||
import { useProjectsContext } from 'hooks/useProjectsContext'
|
||||
import { useCommandsContext } from 'hooks/useCommandsContext'
|
||||
import { useCreateFileLinkQuery } from 'hooks/useCreateFileLinkQueryWatcher'
|
||||
|
||||
// This route only opens in the desktop context for now,
|
||||
// as defined in Router.tsx, so we can use the desktop APIs and types.
|
||||
@ -34,6 +35,18 @@ const Home = () => {
|
||||
const [projectsLoaderTrigger, setProjectsLoaderTrigger] = useState(0)
|
||||
const { projectsDir } = useProjectsLoader([projectsLoaderTrigger])
|
||||
|
||||
// Keep a lookout for a URL query string that invokes the 'import file from URL' command
|
||||
useCreateFileLinkQuery((argDefaultValues) => {
|
||||
commandBarSend({
|
||||
type: 'Find and select command',
|
||||
data: {
|
||||
groupId: 'projects',
|
||||
name: 'Import file from URL',
|
||||
argDefaultValues,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
useRefreshSettings(PATHS.HOME + 'SETTINGS')
|
||||
const navigate = useNavigate()
|
||||
const {
|
||||
|
||||
@ -11,6 +11,11 @@ pub(super) const SETTINGS: &str = "settings";
|
||||
pub(super) const SETTINGS_UNIT_LENGTH: &str = "defaultLengthUnit";
|
||||
pub(super) const SETTINGS_UNIT_ANGLE: &str = "defaultAngleUnit";
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub(super) enum AnnotationScope {
|
||||
Module,
|
||||
}
|
||||
|
||||
pub(super) fn expect_properties<'a>(
|
||||
for_key: &'static str,
|
||||
annotation: &'a NonCodeValue,
|
||||
|
||||
@ -121,8 +121,8 @@ impl Node<MemberExpression> {
|
||||
source_ranges: vec![self.clone().into()],
|
||||
}))
|
||||
}
|
||||
(KclValue::Solid(solid), Property::String(prop)) if prop == "sketch" => Ok(KclValue::Sketch {
|
||||
value: Box::new(solid.sketch),
|
||||
(KclValue::Solid { value }, Property::String(prop)) if prop == "sketch" => Ok(KclValue::Sketch {
|
||||
value: Box::new(value.sketch),
|
||||
}),
|
||||
(KclValue::Sketch { value: sk }, Property::String(prop)) if prop == "tags" => Ok(KclValue::Object {
|
||||
meta: vec![Metadata {
|
||||
@ -662,11 +662,11 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
|
||||
exec_state.mut_memory().update_tag(&tag.value, tag.clone())?;
|
||||
}
|
||||
}
|
||||
KclValue::Solid(ref mut solid) => {
|
||||
for value in &solid.value {
|
||||
if let Some(tag) = value.get_tag() {
|
||||
KclValue::Solid { ref mut value } => {
|
||||
for v in &value.value {
|
||||
if let Some(tag) = v.get_tag() {
|
||||
// Get the past tag and update it.
|
||||
let mut t = if let Some(t) = solid.sketch.tags.get(&tag.name) {
|
||||
let mut t = if let Some(t) = value.sketch.tags.get(&tag.name) {
|
||||
t.clone()
|
||||
} else {
|
||||
// It's probably a fillet or a chamfer.
|
||||
@ -674,10 +674,10 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
|
||||
TagIdentifier {
|
||||
value: tag.name.clone(),
|
||||
info: Some(TagEngineInfo {
|
||||
id: value.get_id(),
|
||||
surface: Some(value.clone()),
|
||||
id: v.get_id(),
|
||||
surface: Some(v.clone()),
|
||||
path: None,
|
||||
sketch: solid.id,
|
||||
sketch: value.id,
|
||||
}),
|
||||
meta: vec![Metadata {
|
||||
source_range: tag.clone().into(),
|
||||
@ -693,21 +693,21 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
|
||||
};
|
||||
|
||||
let mut info = info.clone();
|
||||
info.surface = Some(value.clone());
|
||||
info.sketch = solid.id;
|
||||
info.surface = Some(v.clone());
|
||||
info.sketch = value.id;
|
||||
t.info = Some(info);
|
||||
|
||||
exec_state.mut_memory().update_tag(&tag.name, t.clone())?;
|
||||
|
||||
// update the sketch tags.
|
||||
solid.sketch.tags.insert(tag.name.clone(), t);
|
||||
value.sketch.tags.insert(tag.name.clone(), t);
|
||||
}
|
||||
}
|
||||
|
||||
// Find the stale sketch in memory and update it.
|
||||
let cur_env_index = exec_state.memory().current_env.index();
|
||||
if let Some(current_env) = exec_state.mut_memory().environments.get_mut(cur_env_index) {
|
||||
current_env.update_sketch_tags(&solid.sketch);
|
||||
current_env.update_sketch_tags(&value.sketch);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@ -62,19 +62,27 @@ pub enum KclValue {
|
||||
},
|
||||
TagIdentifier(Box<TagIdentifier>),
|
||||
TagDeclarator(crate::parsing::ast::types::BoxNode<TagDeclarator>),
|
||||
Plane(Box<Plane>),
|
||||
Face(Box<Face>),
|
||||
Plane {
|
||||
value: Box<Plane>,
|
||||
},
|
||||
Face {
|
||||
value: Box<Face>,
|
||||
},
|
||||
Sketch {
|
||||
value: Box<Sketch>,
|
||||
},
|
||||
Sketches {
|
||||
value: Vec<Box<Sketch>>,
|
||||
},
|
||||
Solid(Box<Solid>),
|
||||
Solid {
|
||||
value: Box<Solid>,
|
||||
},
|
||||
Solids {
|
||||
value: Vec<Box<Solid>>,
|
||||
},
|
||||
Helix(Box<Helix>),
|
||||
Helix {
|
||||
value: Box<Helix>,
|
||||
},
|
||||
ImportedGeometry(ImportedGeometry),
|
||||
#[ts(skip)]
|
||||
Function {
|
||||
@ -120,7 +128,7 @@ impl From<Vec<Box<Sketch>>> for KclValue {
|
||||
impl From<SolidSet> for KclValue {
|
||||
fn from(eg: SolidSet) -> Self {
|
||||
match eg {
|
||||
SolidSet::Solid(eg) => KclValue::Solid(eg),
|
||||
SolidSet::Solid(eg) => KclValue::Solid { value: eg },
|
||||
SolidSet::Solids(egs) => KclValue::Solids { value: egs },
|
||||
}
|
||||
}
|
||||
@ -129,7 +137,7 @@ impl From<SolidSet> for KclValue {
|
||||
impl From<Vec<Box<Solid>>> for KclValue {
|
||||
fn from(eg: Vec<Box<Solid>>) -> Self {
|
||||
if eg.len() == 1 {
|
||||
KclValue::Solid(eg[0].clone())
|
||||
KclValue::Solid { value: eg[0].clone() }
|
||||
} else {
|
||||
KclValue::Solids { value: eg }
|
||||
}
|
||||
@ -140,15 +148,15 @@ impl From<KclValue> for Vec<SourceRange> {
|
||||
match item {
|
||||
KclValue::TagDeclarator(t) => vec![SourceRange::new(t.start, t.end, t.module_id)],
|
||||
KclValue::TagIdentifier(t) => to_vec_sr(&t.meta),
|
||||
KclValue::Solid(e) => to_vec_sr(&e.meta),
|
||||
KclValue::Solid { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Solids { value } => value.iter().flat_map(|eg| to_vec_sr(&eg.meta)).collect(),
|
||||
KclValue::Sketch { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Sketches { value } => value.iter().flat_map(|eg| to_vec_sr(&eg.meta)).collect(),
|
||||
KclValue::Helix(e) => to_vec_sr(&e.meta),
|
||||
KclValue::Helix { value } => to_vec_sr(&value.meta),
|
||||
KclValue::ImportedGeometry(i) => to_vec_sr(&i.meta),
|
||||
KclValue::Function { meta, .. } => to_vec_sr(&meta),
|
||||
KclValue::Plane(p) => to_vec_sr(&p.meta),
|
||||
KclValue::Face(f) => to_vec_sr(&f.meta),
|
||||
KclValue::Plane { value } => to_vec_sr(&value.meta),
|
||||
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),
|
||||
@ -171,15 +179,15 @@ impl From<&KclValue> for Vec<SourceRange> {
|
||||
match item {
|
||||
KclValue::TagDeclarator(t) => vec![SourceRange::new(t.start, t.end, t.module_id)],
|
||||
KclValue::TagIdentifier(t) => to_vec_sr(&t.meta),
|
||||
KclValue::Solid(e) => to_vec_sr(&e.meta),
|
||||
KclValue::Solid { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Solids { value } => value.iter().flat_map(|eg| to_vec_sr(&eg.meta)).collect(),
|
||||
KclValue::Sketch { value } => to_vec_sr(&value.meta),
|
||||
KclValue::Sketches { value } => value.iter().flat_map(|eg| to_vec_sr(&eg.meta)).collect(),
|
||||
KclValue::Helix(x) => to_vec_sr(&x.meta),
|
||||
KclValue::Helix { value } => to_vec_sr(&value.meta),
|
||||
KclValue::ImportedGeometry(i) => to_vec_sr(&i.meta),
|
||||
KclValue::Function { meta, .. } => to_vec_sr(meta),
|
||||
KclValue::Plane(p) => to_vec_sr(&p.meta),
|
||||
KclValue::Face(f) => to_vec_sr(&f.meta),
|
||||
KclValue::Plane { value } => to_vec_sr(&value.meta),
|
||||
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),
|
||||
@ -205,13 +213,13 @@ impl KclValue {
|
||||
KclValue::Object { value: _, meta } => meta.clone(),
|
||||
KclValue::TagIdentifier(x) => x.meta.clone(),
|
||||
KclValue::TagDeclarator(x) => vec![x.metadata()],
|
||||
KclValue::Plane(x) => x.meta.clone(),
|
||||
KclValue::Face(x) => x.meta.clone(),
|
||||
KclValue::Plane { value } => value.meta.clone(),
|
||||
KclValue::Face { value } => value.meta.clone(),
|
||||
KclValue::Sketch { value } => value.meta.clone(),
|
||||
KclValue::Sketches { value } => value.iter().flat_map(|sketch| &sketch.meta).copied().collect(),
|
||||
KclValue::Solid(x) => x.meta.clone(),
|
||||
KclValue::Solid { value } => value.meta.clone(),
|
||||
KclValue::Solids { value } => value.iter().flat_map(|sketch| &sketch.meta).copied().collect(),
|
||||
KclValue::Helix(x) => x.meta.clone(),
|
||||
KclValue::Helix { value } => value.meta.clone(),
|
||||
KclValue::ImportedGeometry(x) => x.meta.clone(),
|
||||
KclValue::Function { meta, .. } => meta.clone(),
|
||||
KclValue::Module { meta, .. } => meta.clone(),
|
||||
@ -230,7 +238,7 @@ impl KclValue {
|
||||
|
||||
pub(crate) fn get_solid_set(&self) -> Result<SolidSet> {
|
||||
match self {
|
||||
KclValue::Solid(e) => Ok(SolidSet::Solid(e.clone())),
|
||||
KclValue::Solid { value } => Ok(SolidSet::Solid(value.clone())),
|
||||
KclValue::Solids { value } => Ok(SolidSet::Solids(value.clone())),
|
||||
KclValue::Array { value, .. } => {
|
||||
let solids: Vec<_> = value
|
||||
@ -266,15 +274,15 @@ impl KclValue {
|
||||
KclValue::Uuid { .. } => "Unique ID (uuid)",
|
||||
KclValue::TagDeclarator(_) => "TagDeclarator",
|
||||
KclValue::TagIdentifier(_) => "TagIdentifier",
|
||||
KclValue::Solid(_) => "Solid",
|
||||
KclValue::Solid { .. } => "Solid",
|
||||
KclValue::Solids { .. } => "Solids",
|
||||
KclValue::Sketch { .. } => "Sketch",
|
||||
KclValue::Sketches { .. } => "Sketches",
|
||||
KclValue::Helix(_) => "Helix",
|
||||
KclValue::Helix { .. } => "Helix",
|
||||
KclValue::ImportedGeometry(_) => "ImportedGeometry",
|
||||
KclValue::Function { .. } => "Function",
|
||||
KclValue::Plane(_) => "Plane",
|
||||
KclValue::Face(_) => "Face",
|
||||
KclValue::Plane { .. } => "Plane",
|
||||
KclValue::Face { .. } => "Face",
|
||||
KclValue::Bool { .. } => "boolean (true/false value)",
|
||||
KclValue::Number { .. } => "number",
|
||||
KclValue::Int { .. } => "integer",
|
||||
@ -383,7 +391,7 @@ impl KclValue {
|
||||
}
|
||||
|
||||
pub fn as_plane(&self) -> Option<&Plane> {
|
||||
if let KclValue::Plane(value) = &self {
|
||||
if let KclValue::Plane { value } = &self {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
@ -391,7 +399,7 @@ impl KclValue {
|
||||
}
|
||||
|
||||
pub fn as_solid(&self) -> Option<&Solid> {
|
||||
if let KclValue::Solid(value) = &self {
|
||||
if let KclValue::Solid { value } = &self {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
@ -614,6 +622,19 @@ impl From<crate::UnitLength> for UnitLen {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<UnitLen> for crate::UnitLength {
|
||||
fn from(unit: UnitLen) -> Self {
|
||||
match unit {
|
||||
UnitLen::Cm => crate::UnitLength::Cm,
|
||||
UnitLen::Feet => crate::UnitLength::Ft,
|
||||
UnitLen::Inches => crate::UnitLength::In,
|
||||
UnitLen::M => crate::UnitLength::M,
|
||||
UnitLen::Mm => crate::UnitLength::Mm,
|
||||
UnitLen::Yards => crate::UnitLength::Yd,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq)]
|
||||
#[ts(export)]
|
||||
#[serde(tag = "type")]
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use annotations::AnnotationScope;
|
||||
use anyhow::Result;
|
||||
use artifact::build_artifact_graph;
|
||||
use async_recursion::async_recursion;
|
||||
@ -391,7 +392,7 @@ impl ProgramMemory {
|
||||
env.bindings
|
||||
.values()
|
||||
.filter_map(|item| match item {
|
||||
KclValue::Solid(eg) if eg.sketch.id == sketch_id => Some(eg.clone()),
|
||||
KclValue::Solid { value } if value.sketch.id == sketch_id => Some(value.clone()),
|
||||
_ => None,
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
@ -505,8 +506,8 @@ impl DynamicState {
|
||||
fn append(&mut self, memory: &ProgramMemory) {
|
||||
for env in &memory.environments {
|
||||
for item in env.bindings.values() {
|
||||
if let KclValue::Solid(eg) = item {
|
||||
self.solid_ids.push(SolidLazyIds::from(eg.as_ref()));
|
||||
if let KclValue::Solid { value } = item {
|
||||
self.solid_ids.push(SolidLazyIds::from(value.as_ref()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -759,6 +760,7 @@ pub struct Helix {
|
||||
pub angle_start: f64,
|
||||
/// Is the helix rotation counter clockwise?
|
||||
pub ccw: bool,
|
||||
pub units: UnitLen,
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
}
|
||||
@ -780,6 +782,7 @@ pub struct Plane {
|
||||
pub y_axis: Point3d,
|
||||
/// The z-axis (normal).
|
||||
pub z_axis: Point3d,
|
||||
pub units: UnitLen,
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
}
|
||||
@ -795,6 +798,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 1.0, 0.0),
|
||||
z_axis: Point3d::new(0.0, 0.0, 1.0),
|
||||
value: PlaneType::XY,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::NegXY => Plane {
|
||||
@ -804,6 +808,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 1.0, 0.0),
|
||||
z_axis: Point3d::new(0.0, 0.0, -1.0),
|
||||
value: PlaneType::XY,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::XZ => Plane {
|
||||
@ -813,6 +818,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 0.0, 1.0),
|
||||
z_axis: Point3d::new(0.0, -1.0, 0.0),
|
||||
value: PlaneType::XZ,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::NegXZ => Plane {
|
||||
@ -822,6 +828,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 0.0, 1.0),
|
||||
z_axis: Point3d::new(0.0, 1.0, 0.0),
|
||||
value: PlaneType::XZ,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::YZ => Plane {
|
||||
@ -831,6 +838,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 0.0, 1.0),
|
||||
z_axis: Point3d::new(1.0, 0.0, 0.0),
|
||||
value: PlaneType::YZ,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::NegYZ => Plane {
|
||||
@ -840,6 +848,7 @@ impl Plane {
|
||||
y_axis: Point3d::new(0.0, 0.0, 1.0),
|
||||
z_axis: Point3d::new(-1.0, 0.0, 0.0),
|
||||
value: PlaneType::YZ,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
crate::std::sketch::PlaneData::Plane {
|
||||
@ -854,6 +863,7 @@ impl Plane {
|
||||
y_axis: *y_axis,
|
||||
z_axis: *z_axis,
|
||||
value: PlaneType::Custom,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![],
|
||||
},
|
||||
}
|
||||
@ -900,6 +910,7 @@ pub struct Face {
|
||||
pub z_axis: Point3d,
|
||||
/// The solid the face is on.
|
||||
pub solid: Box<Solid>,
|
||||
pub units: UnitLen,
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
}
|
||||
@ -1018,6 +1029,7 @@ pub struct Sketch {
|
||||
/// is sketched on face etc.
|
||||
#[serde(skip)]
|
||||
pub original_id: uuid::Uuid,
|
||||
pub units: UnitLen,
|
||||
/// Metadata.
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
@ -1141,6 +1153,7 @@ pub struct Solid {
|
||||
/// Chamfers or fillets on this solid.
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub edge_cuts: Vec<EdgeCut>,
|
||||
pub units: UnitLen,
|
||||
/// Metadata.
|
||||
#[serde(rename = "__meta")]
|
||||
pub meta: Vec<Metadata>,
|
||||
@ -2304,6 +2317,36 @@ impl ExecutorContext {
|
||||
}
|
||||
}
|
||||
|
||||
async fn handle_annotations(
|
||||
&self,
|
||||
annotations: impl Iterator<Item = (&NonCodeValue, SourceRange)>,
|
||||
scope: AnnotationScope,
|
||||
exec_state: &mut ExecState,
|
||||
) -> Result<(), KclError> {
|
||||
for (annotation, source_range) in annotations {
|
||||
if annotation.annotation_name() == Some(annotations::SETTINGS) {
|
||||
if scope == AnnotationScope::Module {
|
||||
let old_units = exec_state.length_unit();
|
||||
exec_state
|
||||
.mod_local
|
||||
.settings
|
||||
.update_from_annotation(annotation, source_range)?;
|
||||
let new_units = exec_state.length_unit();
|
||||
if old_units != new_units {
|
||||
self.engine.set_units(new_units.into(), source_range).await?;
|
||||
}
|
||||
} else {
|
||||
return Err(KclError::Semantic(KclErrorDetails {
|
||||
message: "Settings can only be modified at the top level scope of a file".to_owned(),
|
||||
source_ranges: vec![source_range],
|
||||
}));
|
||||
}
|
||||
}
|
||||
// TODO warn on unknown annotations
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Execute an AST's program.
|
||||
#[async_recursion]
|
||||
pub(crate) async fn inner_execute<'a>(
|
||||
@ -2312,21 +2355,16 @@ impl ExecutorContext {
|
||||
exec_state: &mut ExecState,
|
||||
body_type: BodyType,
|
||||
) -> Result<Option<KclValue>, KclError> {
|
||||
if let Some((annotation, source_range)) = program
|
||||
.non_code_meta
|
||||
.start_nodes
|
||||
.iter()
|
||||
.filter_map(|n| {
|
||||
n.annotation(annotations::SETTINGS)
|
||||
.map(|result| (result, n.as_source_range()))
|
||||
})
|
||||
.next()
|
||||
{
|
||||
exec_state
|
||||
.mod_local
|
||||
.settings
|
||||
.update_from_annotation(annotation, source_range)?;
|
||||
}
|
||||
self.handle_annotations(
|
||||
program
|
||||
.non_code_meta
|
||||
.start_nodes
|
||||
.iter()
|
||||
.filter_map(|n| n.annotation().map(|result| (result, n.as_source_range()))),
|
||||
AnnotationScope::Module,
|
||||
exec_state,
|
||||
)
|
||||
.await?;
|
||||
|
||||
let mut last_expr = None;
|
||||
// Iterate over the body of the program.
|
||||
@ -2509,6 +2547,7 @@ impl ExecutorContext {
|
||||
exec_kind: ExecutionKind,
|
||||
source_range: SourceRange,
|
||||
) -> Result<(Option<KclValue>, ProgramMemory, Vec<String>), KclError> {
|
||||
let old_units = exec_state.length_unit();
|
||||
// TODO It sucks that we have to clone the whole module AST here
|
||||
let info = exec_state.global.module_infos[&module_id].clone();
|
||||
|
||||
@ -2525,7 +2564,11 @@ impl ExecutorContext {
|
||||
.inner_execute(&info.parsed.unwrap(), exec_state, crate::execution::BodyType::Root)
|
||||
.await;
|
||||
|
||||
let new_units = exec_state.length_unit();
|
||||
std::mem::swap(&mut exec_state.mod_local, &mut local_state);
|
||||
if new_units != old_units {
|
||||
self.engine.set_units(old_units.into(), Default::default()).await?;
|
||||
}
|
||||
self.engine.replace_execution_kind(original_execution);
|
||||
|
||||
let result = result.map_err(|err| {
|
||||
|
||||
@ -1011,9 +1011,9 @@ impl NonCodeNode {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn annotation(&self, expected_name: &str) -> Option<&NonCodeValue> {
|
||||
pub fn annotation(&self) -> Option<&NonCodeValue> {
|
||||
match &self.value {
|
||||
a @ NonCodeValue::Annotation { name, .. } if name.name == expected_name => Some(a),
|
||||
a @ NonCodeValue::Annotation { .. } => Some(a),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1071,6 +1071,15 @@ pub enum NonCodeValue {
|
||||
},
|
||||
}
|
||||
|
||||
impl NonCodeValue {
|
||||
pub fn annotation_name(&self) -> Option<&str> {
|
||||
match self {
|
||||
NonCodeValue::Annotation { name, .. } => Some(&name.name),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
@ -119,7 +119,7 @@ async fn execute(test_name: &str, render_to_png: bool) {
|
||||
.global
|
||||
.artifact_graph
|
||||
.to_mermaid_flowchart()
|
||||
.unwrap_or_else(|e| format!("Failed to convert artifact graph to mind map: {e}"));
|
||||
.unwrap_or_else(|e| format!("Failed to convert artifact graph to flowchart: {e}"));
|
||||
// Change the snapshot suffix so that it is rendered as a
|
||||
// Markdown file in GitHub.
|
||||
insta::assert_binary_snapshot!("artifact_graph_flowchart.md", flowchart.as_bytes().to_owned());
|
||||
|
||||
@ -863,27 +863,7 @@ impl<'a> FromKclValue<'a> for crate::std::planes::StandardPlane {
|
||||
|
||||
impl<'a> FromKclValue<'a> for crate::execution::Plane {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
if let Some(plane) = arg.as_plane() {
|
||||
return Some(plane.clone());
|
||||
}
|
||||
|
||||
let obj = arg.as_object()?;
|
||||
let_field_of!(obj, id);
|
||||
let_field_of!(obj, value);
|
||||
let_field_of!(obj, origin);
|
||||
let_field_of!(obj, x_axis "xAxis");
|
||||
let_field_of!(obj, y_axis "yAxis");
|
||||
let_field_of!(obj, z_axis "zAxis");
|
||||
let_field_of!(obj, meta "__meta");
|
||||
Some(Self {
|
||||
id,
|
||||
value,
|
||||
origin,
|
||||
x_axis,
|
||||
y_axis,
|
||||
z_axis,
|
||||
meta,
|
||||
})
|
||||
arg.as_plane().cloned()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1238,12 +1218,12 @@ impl<'a> FromKclValue<'a> for crate::execution::Point3d {
|
||||
impl<'a> FromKclValue<'a> for super::sketch::PlaneData {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
// Case 0: actual plane
|
||||
if let KclValue::Plane(p) = arg {
|
||||
if let KclValue::Plane { value } = arg {
|
||||
return Some(Self::Plane {
|
||||
origin: Box::new(p.origin),
|
||||
x_axis: Box::new(p.x_axis),
|
||||
y_axis: Box::new(p.y_axis),
|
||||
z_axis: Box::new(p.z_axis),
|
||||
origin: Box::new(value.origin),
|
||||
x_axis: Box::new(value.x_axis),
|
||||
y_axis: Box::new(value.y_axis),
|
||||
z_axis: Box::new(value.z_axis),
|
||||
});
|
||||
}
|
||||
// Case 1: predefined plane
|
||||
@ -1612,7 +1592,7 @@ impl<'a> FromKclValue<'a> for Sketch {
|
||||
|
||||
impl<'a> FromKclValue<'a> for Helix {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
let KclValue::Helix(value) = arg else {
|
||||
let KclValue::Helix { value } = arg else {
|
||||
return None;
|
||||
};
|
||||
Some(value.as_ref().to_owned())
|
||||
@ -1668,10 +1648,10 @@ impl<'a> FromKclValue<'a> for SketchSet {
|
||||
|
||||
impl<'a> FromKclValue<'a> for Box<Solid> {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
let KclValue::Solid(s) = arg else {
|
||||
let KclValue::Solid { value } = arg else {
|
||||
return None;
|
||||
};
|
||||
Some(s.to_owned())
|
||||
Some(value.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
@ -1691,8 +1671,8 @@ impl<'a> FromKclValue<'a> for SketchOrSurface {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Sketch { value: sg } => Some(Self::Sketch(sg.to_owned())),
|
||||
KclValue::Plane(sg) => Some(Self::SketchSurface(SketchSurface::Plane(sg.clone()))),
|
||||
KclValue::Face(sg) => Some(Self::SketchSurface(SketchSurface::Face(sg.clone()))),
|
||||
KclValue::Plane { value } => Some(Self::SketchSurface(SketchSurface::Plane(value.clone()))),
|
||||
KclValue::Face { value } => Some(Self::SketchSurface(SketchSurface::Face(value.clone()))),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1700,8 +1680,8 @@ impl<'a> FromKclValue<'a> for SketchOrSurface {
|
||||
impl<'a> FromKclValue<'a> for SketchSurface {
|
||||
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
|
||||
match arg {
|
||||
KclValue::Plane(sg) => Some(Self::Plane(sg.clone())),
|
||||
KclValue::Face(sg) => Some(Self::Face(sg.clone())),
|
||||
KclValue::Plane { value } => Some(Self::Plane(value.clone())),
|
||||
KclValue::Face { value } => Some(Self::Face(value.clone())),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,8 +31,8 @@ pub struct ChamferData {
|
||||
pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, solid, tag): (ChamferData, Box<Solid>, Option<TagNode>) = args.get_data_and_solid_and_tag()?;
|
||||
|
||||
let solid = inner_chamfer(data, solid, tag, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_chamfer(data, solid, tag, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Cut a straight transitional edge along a tagged path.
|
||||
|
||||
@ -280,6 +280,7 @@ pub(crate) async fn do_post_extrude(
|
||||
id: sketch.id,
|
||||
value: new_value,
|
||||
meta: sketch.meta.clone(),
|
||||
units: sketch.units,
|
||||
sketch,
|
||||
height: length,
|
||||
start_cap_id,
|
||||
|
||||
@ -57,8 +57,8 @@ impl EdgeReference {
|
||||
pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, solid, tag): (FilletData, Box<Solid>, Option<TagNode>) = args.get_data_and_solid_and_tag()?;
|
||||
|
||||
let solid = inner_fillet(data, solid, tag, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_fillet(data, solid, tag, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Blend a transitional edge along a tagged path, smoothing the sharp edge.
|
||||
|
||||
@ -39,8 +39,8 @@ pub struct HelixData {
|
||||
pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let data: HelixData = args.get_data()?;
|
||||
|
||||
let helix = inner_helix(data, exec_state, args).await?;
|
||||
Ok(KclValue::Helix(helix))
|
||||
let value = inner_helix(data, exec_state, args).await?;
|
||||
Ok(KclValue::Helix { value })
|
||||
}
|
||||
|
||||
/// Create a helix.
|
||||
@ -117,6 +117,7 @@ async fn inner_helix(data: HelixData, exec_state: &mut ExecState, args: Args) ->
|
||||
revolutions: data.revolutions,
|
||||
angle_start: data.angle_start,
|
||||
ccw: data.ccw,
|
||||
units: exec_state.length_unit(),
|
||||
meta: vec![args.source_range.into()],
|
||||
});
|
||||
|
||||
@ -193,8 +194,8 @@ pub struct HelixRevolutionsData {
|
||||
pub async fn helix_revolutions(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, solid): (HelixRevolutionsData, Box<Solid>) = args.get_data_and_solid()?;
|
||||
|
||||
let solid = inner_helix_revolutions(data, solid, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_helix_revolutions(data, solid, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Create a helix on a cylinder.
|
||||
|
||||
@ -30,7 +30,7 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
// Tolerance for the loft operation.
|
||||
let tolerance: Option<f64> = args.get_kw_arg_opt("tolerance");
|
||||
|
||||
let solid = inner_loft(
|
||||
let value = inner_loft(
|
||||
sketches,
|
||||
v_degree,
|
||||
bez_approximate_rational,
|
||||
@ -40,7 +40,7 @@ pub async fn loft(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
|
||||
args,
|
||||
)
|
||||
.await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Create a 3D surface or solid by interpolating between two or more sketches.
|
||||
|
||||
@ -55,7 +55,7 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
|
||||
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(Box::new(plane)))
|
||||
Ok(KclValue::Plane { value: Box::new(plane) })
|
||||
}
|
||||
|
||||
/// Offset a plane by a distance along its normal.
|
||||
|
||||
@ -32,8 +32,8 @@ pub struct RevolveData {
|
||||
pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, sketch): (RevolveData, Sketch) = args.get_data_and_sketch()?;
|
||||
|
||||
let solid = inner_revolve(data, sketch, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_revolve(data, sketch, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Rotate a sketch around some provided axis, creating a solid from its extent.
|
||||
|
||||
@ -247,8 +247,8 @@ async fn inner_shell(
|
||||
pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (thickness, solid): (f64, Box<Solid>) = args.get_data_and_solid()?;
|
||||
|
||||
let solid = inner_hollow(thickness, solid, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_hollow(thickness, solid, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Make the inside of a 3D object hollow.
|
||||
|
||||
@ -955,8 +955,8 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
|
||||
let (data, tag): (SketchData, Option<FaceTag>) = args.get_data_and_optional_tag()?;
|
||||
|
||||
match inner_start_sketch_on(data, tag, exec_state, &args).await? {
|
||||
SketchSurface::Plane(plane) => Ok(KclValue::Plane(plane)),
|
||||
SketchSurface::Face(face) => Ok(KclValue::Face(face)),
|
||||
SketchSurface::Plane(value) => Ok(KclValue::Plane { value }),
|
||||
SketchSurface::Face(value) => Ok(KclValue::Face { value }),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1124,6 +1124,7 @@ async fn start_sketch_on_face(
|
||||
x_axis: solid.sketch.on.x_axis(),
|
||||
y_axis: solid.sketch.on.y_axis(),
|
||||
z_axis: solid.sketch.on.z_axis(),
|
||||
units: solid.units,
|
||||
solid,
|
||||
meta: vec![args.source_range.into()],
|
||||
}))
|
||||
@ -1262,6 +1263,11 @@ pub(crate) async fn inner_start_profile_at(
|
||||
_ => {}
|
||||
}
|
||||
|
||||
let units = match &sketch_surface {
|
||||
SketchSurface::Face(face) => face.units,
|
||||
SketchSurface::Plane(_) => exec_state.length_unit(),
|
||||
};
|
||||
|
||||
// Enter sketch mode on the surface.
|
||||
// We call this here so you can reuse the sketch surface for multiple sketches.
|
||||
let id = exec_state.next_uuid();
|
||||
@ -1311,6 +1317,7 @@ pub(crate) async fn inner_start_profile_at(
|
||||
original_id: path_id,
|
||||
on: sketch_surface.clone(),
|
||||
paths: vec![],
|
||||
units,
|
||||
meta: vec![args.source_range.into()],
|
||||
tags: if let Some(tag) = &tag {
|
||||
let mut tag_identifier: TagIdentifier = tag.into();
|
||||
|
||||
@ -39,8 +39,8 @@ pub struct SweepData {
|
||||
pub async fn sweep(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let (data, sketch): (SweepData, Sketch) = args.get_data_and_sketch()?;
|
||||
|
||||
let solid = inner_sweep(data, sketch, exec_state, args).await?;
|
||||
Ok(KclValue::Solid(solid))
|
||||
let value = inner_sweep(data, sketch, exec_state, args).await?;
|
||||
Ok(KclValue::Solid { value })
|
||||
}
|
||||
|
||||
/// Extrude a sketch along a path.
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing angled_line.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,117 +28,28 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
73,
|
||||
94,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
136,
|
||||
159,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
165,
|
||||
202,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
208,
|
||||
232,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
238,
|
||||
246,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
73,
|
||||
94,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
4.83,
|
||||
12.56
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
73,
|
||||
94,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
19.93,
|
||||
15.04
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
19.93,
|
||||
15.04
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
@ -147,198 +57,310 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
23.08,
|
||||
5.19
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
136,
|
||||
159,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
23.08,
|
||||
5.19
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
7.91,
|
||||
1.09
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
165,
|
||||
202,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
7.91,
|
||||
1.09
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
11.6718,
|
||||
-10.6731
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
208,
|
||||
232,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
11.6718,
|
||||
-10.6731
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-1.3482,
|
||||
-0.6431
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
238,
|
||||
246,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-1.3482,
|
||||
-0.6431
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"to": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
67,
|
||||
136,
|
||||
159,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
165,
|
||||
202,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
208,
|
||||
232,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
238,
|
||||
246,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
19.93,
|
||||
15.040000000000001
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
23.08,
|
||||
5.190000000000001
|
||||
],
|
||||
"type": "ToPoint"
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
73,
|
||||
94,
|
||||
0
|
||||
]
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
19.93,
|
||||
15.04
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
19.93,
|
||||
15.04
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
23.08,
|
||||
5.19
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
123,
|
||||
129,
|
||||
136,
|
||||
159,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"from": [
|
||||
23.08,
|
||||
5.19
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
7.91,
|
||||
1.09
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
165,
|
||||
202,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
7.91,
|
||||
1.09
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
11.6718,
|
||||
-10.6731
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
208,
|
||||
232,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
11.6718,
|
||||
-10.6731
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-1.3482,
|
||||
-0.6431
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
238,
|
||||
246,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-1.3482,
|
||||
-0.6431
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"to": [
|
||||
4.83,
|
||||
12.56
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
67,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
19.93,
|
||||
15.040000000000001
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
23.08,
|
||||
5.190000000000001
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
100,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 129,
|
||||
"start": 123,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
123,
|
||||
129,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
67,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 4.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -349,19 +371,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 4.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
67,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing artifact_graph_example_code_no_3d.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -308,6 +307,9 @@ snapshot_kind: text
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
@ -463,6 +465,9 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
@ -575,6 +580,9 @@ snapshot_kind: text
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
@ -596,6 +604,9 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing artifact_graph_example_code_offset_planes.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,81 +28,96 @@ snapshot_kind: text
|
||||
},
|
||||
"offsetPlane001": {
|
||||
"type": "Plane",
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 20.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
"value": {
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 20.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
}
|
||||
},
|
||||
"offsetPlane002": {
|
||||
"type": "Plane",
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 50.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": -1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"__meta": []
|
||||
"value": {
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 50.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": -1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
}
|
||||
},
|
||||
"offsetPlane003": {
|
||||
"type": "Plane",
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 10.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"__meta": []
|
||||
"value": {
|
||||
"id": "[uuid]",
|
||||
"value": "Custom",
|
||||
"origin": {
|
||||
"x": 10.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
}
|
||||
},
|
||||
"sketch002": {
|
||||
"type": "Sketch",
|
||||
@ -156,6 +170,9 @@ snapshot_kind: text
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
@ -177,6 +194,9 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing basic_fillet_cube_close_opposite.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,85 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
@ -115,44 +46,26 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
@ -160,24 +73,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
@ -185,236 +89,370 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
159,
|
||||
166,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
167,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 166,
|
||||
"start": 159,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
159,
|
||||
166,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -425,35 +463,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing basic_fillet_cube_end.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,80 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
158,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
@ -110,44 +46,26 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
@ -155,197 +73,317 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -356,35 +394,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing basic_fillet_cube_next_adjacent.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,90 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
@ -120,24 +46,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
@ -145,24 +62,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
@ -170,24 +78,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
@ -195,295 +94,427 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing1": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing1",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
113,
|
||||
120,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
145,
|
||||
152,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
168,
|
||||
175,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing1": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing1",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
113,
|
||||
120,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
145,
|
||||
152,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
168,
|
||||
175,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -494,28 +525,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing basic_fillet_cube_previous_adjacent.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,90 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
@ -120,24 +46,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
@ -145,24 +62,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
@ -170,24 +78,15 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
@ -195,295 +94,427 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing1": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing1",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
113,
|
||||
120,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
145,
|
||||
152,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
168,
|
||||
175,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing1": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing1",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
121,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 120,
|
||||
"start": 113,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing1"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
113,
|
||||
120,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
127,
|
||||
153,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 152,
|
||||
"start": 145,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
145,
|
||||
152,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing3": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing3",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
159,
|
||||
176,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 175,
|
||||
"start": 168,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing3"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
168,
|
||||
175,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -494,28 +525,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing basic_fillet_cube_start.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,80 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
158,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
@ -110,44 +46,26 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
96,
|
||||
112,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
@ -155,197 +73,317 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
96,
|
||||
112,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"from": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
150,
|
||||
158,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"to": [
|
||||
0.0,
|
||||
10.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 89,
|
||||
"start": 83,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
83,
|
||||
89,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"thing2": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "thing2",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
10.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
118,
|
||||
144,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 143,
|
||||
"start": 136,
|
||||
"type": "TagDeclarator",
|
||||
"value": "thing2"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
136,
|
||||
143,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -356,35 +394,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"edgeCuts": [
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
},
|
||||
{
|
||||
"type": "fillet",
|
||||
"id": "[uuid]",
|
||||
"radius": 2.0,
|
||||
"edgeId": "[uuid]",
|
||||
"tag": null
|
||||
}
|
||||
],
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"thing": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing big_number_angle_to_match_length_x.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,64 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
98,
|
||||
154,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
@ -94,158 +46,228 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
3.0,
|
||||
0.4152
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
3.0,
|
||||
0.4152
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
85,
|
||||
91,
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
3.0,
|
||||
0.4152
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
3.0,
|
||||
0.4152
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
85,
|
||||
91,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -256,19 +278,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing big_number_angle_to_match_length_y.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,64 +28,17 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
98,
|
||||
154,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
@ -94,158 +46,228 @@ snapshot_kind: text
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
3.0,
|
||||
3.3954
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
3.0,
|
||||
3.3954
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
85,
|
||||
91,
|
||||
98,
|
||||
154,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"from": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
3.0,
|
||||
3.3954
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
160,
|
||||
168,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
3.0,
|
||||
3.3954
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
"value": "seg01",
|
||||
"info": {
|
||||
"type": "TagEngineInfo",
|
||||
"id": "[uuid]",
|
||||
"sketch": "[uuid]",
|
||||
"path": {
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"to": [
|
||||
1.0,
|
||||
3.82
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
"surface": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
66,
|
||||
92,
|
||||
0
|
||||
],
|
||||
"tag": {
|
||||
"end": 91,
|
||||
"start": 85,
|
||||
"type": "TagDeclarator",
|
||||
"value": "seg01"
|
||||
},
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
85,
|
||||
91,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -256,19 +278,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
60,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"seg01": {
|
||||
"type": "TagIdentifier",
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
assertion_line: 99
|
||||
description: Program memory after executing circle_three_point.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -30,26 +28,92 @@ snapshot_kind: text
|
||||
},
|
||||
"example": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
24.749999999999996,
|
||||
19.749999999999996
|
||||
],
|
||||
"from": [
|
||||
30.0059,
|
||||
19.75
|
||||
],
|
||||
"radius": 5.255949010407163,
|
||||
"tag": null,
|
||||
"to": [
|
||||
30.0059,
|
||||
19.75
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
30.00594901040716,
|
||||
19.749999999999996
|
||||
],
|
||||
"to": [
|
||||
30.00594901040716,
|
||||
19.749999999999996
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
@ -57,69 +121,26 @@ snapshot_kind: text
|
||||
98,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
24.749999999999996,
|
||||
19.749999999999996
|
||||
],
|
||||
"from": [
|
||||
30.0059,
|
||||
19.75
|
||||
],
|
||||
"radius": 5.255949010407163,
|
||||
"tag": null,
|
||||
"to": [
|
||||
30.0059,
|
||||
19.75
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
30.00594901040716,
|
||||
19.749999999999996
|
||||
],
|
||||
"to": [
|
||||
30.00594901040716,
|
||||
19.749999999999996
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
]
|
||||
}
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -130,19 +151,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
37,
|
||||
98,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sketch001": {
|
||||
"type": "Sketch",
|
||||
@ -201,6 +210,9 @@ snapshot_kind: text
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
@ -222,6 +234,9 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -736,203 +736,226 @@ description: Program memory after executing cube.kcl
|
||||
},
|
||||
"myCube": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
202,
|
||||
215,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
223,
|
||||
236,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
244,
|
||||
257,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
265,
|
||||
278,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
202,
|
||||
215,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
223,
|
||||
236,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
20.0,
|
||||
20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
244,
|
||||
257,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
20.0,
|
||||
20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
265,
|
||||
278,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
286,
|
||||
294,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
177,
|
||||
194,
|
||||
202,
|
||||
215,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
223,
|
||||
236,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
244,
|
||||
257,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
265,
|
||||
278,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
202,
|
||||
215,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
223,
|
||||
236,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
20.0,
|
||||
20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
244,
|
||||
257,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
20.0,
|
||||
20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
265,
|
||||
278,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
286,
|
||||
294,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"to": [
|
||||
-20.0,
|
||||
-20.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
177,
|
||||
194,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
177,
|
||||
194,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 40.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -943,19 +966,7 @@ description: Program memory after executing cube.kcl
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 40.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
177,
|
||||
194,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": null
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -429,183 +429,206 @@ description: Program memory after executing function_sketch.kcl
|
||||
},
|
||||
"fnBox": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
88,
|
||||
103,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
111,
|
||||
126,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
134,
|
||||
150,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
158,
|
||||
166,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
88,
|
||||
103,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
111,
|
||||
126,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
134,
|
||||
150,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
158,
|
||||
166,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
55,
|
||||
80,
|
||||
88,
|
||||
103,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
111,
|
||||
126,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
134,
|
||||
150,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
158,
|
||||
166,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
88,
|
||||
103,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
111,
|
||||
126,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
134,
|
||||
150,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
158,
|
||||
166,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
55,
|
||||
80,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
55,
|
||||
80,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 3.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -616,19 +639,7 @@ description: Program memory after executing function_sketch.kcl
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 3.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
55,
|
||||
80,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": null
|
||||
|
||||
@ -415,183 +415,206 @@ description: Program memory after executing function_sketch_with_position.kcl
|
||||
},
|
||||
"thing": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
86,
|
||||
101,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
109,
|
||||
124,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
132,
|
||||
148,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
156,
|
||||
164,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
86,
|
||||
101,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
109,
|
||||
124,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
132,
|
||||
148,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
156,
|
||||
164,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
58,
|
||||
78,
|
||||
86,
|
||||
101,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
109,
|
||||
124,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
132,
|
||||
148,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
156,
|
||||
164,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
86,
|
||||
101,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
109,
|
||||
124,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
132,
|
||||
148,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
6.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
156,
|
||||
164,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
10.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
58,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
58,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 3.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -602,19 +625,7 @@ description: Program memory after executing function_sketch_with_position.kcl
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 3.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
58,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": null
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
assertion_line: 105
|
||||
description: Program memory after executing helix_ccw.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -30,26 +28,92 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
5.0,
|
||||
5.0
|
||||
],
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"radius": 10.0,
|
||||
"tag": null,
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
@ -57,69 +121,26 @@ snapshot_kind: text
|
||||
78,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
5.0,
|
||||
5.0
|
||||
],
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"radius": 10.0,
|
||||
"tag": null,
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
}
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -130,19 +151,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
35,
|
||||
78,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": null
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Artifact commands import_whole.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
@ -286,7 +285,19 @@ snapshot_kind: text
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
0,
|
||||
19,
|
||||
35,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
"type": "set_scene_units",
|
||||
"unit": "in"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
36,
|
||||
55,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -314,8 +325,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -334,8 +345,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -345,8 +356,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -362,8 +373,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -391,8 +402,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -403,8 +414,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -423,8 +434,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -437,8 +448,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -448,8 +459,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -460,8 +471,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -473,8 +484,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -487,8 +498,8 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
74,
|
||||
88,
|
||||
110,
|
||||
124,
|
||||
1
|
||||
],
|
||||
"command": {
|
||||
@ -501,8 +512,20 @@ snapshot_kind: text
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
49,
|
||||
96,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
"type": "set_scene_units",
|
||||
"unit": "mm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cmdId": "[uuid]",
|
||||
"range": [
|
||||
83,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"command": {
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path2 [Path]
|
||||
2["Path<br>[25, 68, 1]"]
|
||||
3["Segment<br>[25, 68, 1]"]
|
||||
2["Path<br>[61, 104, 1]"]
|
||||
3["Segment<br>[61, 104, 1]"]
|
||||
4[Solid2d]
|
||||
end
|
||||
1["Plane<br>[0, 19, 1]"]
|
||||
5["Sweep Extrusion<br>[74, 88, 1]"]
|
||||
1["Plane<br>[36, 55, 1]"]
|
||||
5["Sweep Extrusion<br>[110, 124, 1]"]
|
||||
6[Wall]
|
||||
7["Cap Start"]
|
||||
8["Cap End"]
|
||||
|
||||
@ -6,85 +6,85 @@ description: Result of parsing import_whole.kcl
|
||||
"Ok": {
|
||||
"body": [
|
||||
{
|
||||
"end": 32,
|
||||
"end": 66,
|
||||
"path": "exported_mod.kcl",
|
||||
"selector": {
|
||||
"type": "None",
|
||||
"alias": {
|
||||
"end": 32,
|
||||
"end": 66,
|
||||
"name": "foo",
|
||||
"start": 29,
|
||||
"start": 63,
|
||||
"type": "Identifier"
|
||||
}
|
||||
},
|
||||
"start": 0,
|
||||
"start": 34,
|
||||
"type": "ImportStatement",
|
||||
"type": "ImportStatement"
|
||||
},
|
||||
{
|
||||
"declaration": {
|
||||
"end": 96,
|
||||
"end": 130,
|
||||
"id": {
|
||||
"end": 37,
|
||||
"end": 71,
|
||||
"name": "bar",
|
||||
"start": 34,
|
||||
"start": 68,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"init": {
|
||||
"body": [
|
||||
{
|
||||
"end": 43,
|
||||
"end": 77,
|
||||
"name": "foo",
|
||||
"start": 40,
|
||||
"start": 74,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
},
|
||||
{
|
||||
"arguments": [
|
||||
{
|
||||
"end": 92,
|
||||
"end": 126,
|
||||
"properties": [
|
||||
{
|
||||
"end": 72,
|
||||
"end": 106,
|
||||
"key": {
|
||||
"end": 62,
|
||||
"end": 96,
|
||||
"name": "faces",
|
||||
"start": 57,
|
||||
"start": 91,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"start": 57,
|
||||
"start": 91,
|
||||
"type": "ObjectProperty",
|
||||
"value": {
|
||||
"elements": [
|
||||
{
|
||||
"end": 71,
|
||||
"end": 105,
|
||||
"raw": "'end'",
|
||||
"start": 66,
|
||||
"start": 100,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "end"
|
||||
}
|
||||
],
|
||||
"end": 72,
|
||||
"start": 65,
|
||||
"end": 106,
|
||||
"start": 99,
|
||||
"type": "ArrayExpression",
|
||||
"type": "ArrayExpression"
|
||||
}
|
||||
},
|
||||
{
|
||||
"end": 90,
|
||||
"end": 124,
|
||||
"key": {
|
||||
"end": 83,
|
||||
"end": 117,
|
||||
"name": "thickness",
|
||||
"start": 74,
|
||||
"start": 108,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"start": 74,
|
||||
"start": 108,
|
||||
"type": "ObjectProperty",
|
||||
"value": {
|
||||
"end": 90,
|
||||
"end": 124,
|
||||
"raw": "0.25",
|
||||
"start": 86,
|
||||
"start": 120,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": {
|
||||
@ -94,51 +94,51 @@ description: Result of parsing import_whole.kcl
|
||||
}
|
||||
}
|
||||
],
|
||||
"start": 55,
|
||||
"start": 89,
|
||||
"type": "ObjectExpression",
|
||||
"type": "ObjectExpression"
|
||||
},
|
||||
{
|
||||
"end": 95,
|
||||
"start": 94,
|
||||
"end": 129,
|
||||
"start": 128,
|
||||
"type": "PipeSubstitution",
|
||||
"type": "PipeSubstitution"
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"end": 54,
|
||||
"end": 88,
|
||||
"name": "shell",
|
||||
"start": 49,
|
||||
"start": 83,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"end": 96,
|
||||
"start": 49,
|
||||
"end": 130,
|
||||
"start": 83,
|
||||
"type": "CallExpression",
|
||||
"type": "CallExpression"
|
||||
}
|
||||
],
|
||||
"end": 96,
|
||||
"start": 40,
|
||||
"end": 130,
|
||||
"start": 74,
|
||||
"type": "PipeExpression",
|
||||
"type": "PipeExpression"
|
||||
},
|
||||
"start": 34,
|
||||
"start": 68,
|
||||
"type": "VariableDeclarator"
|
||||
},
|
||||
"end": 96,
|
||||
"end": 130,
|
||||
"kind": "const",
|
||||
"start": 34,
|
||||
"start": 68,
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
}
|
||||
],
|
||||
"end": 97,
|
||||
"end": 131,
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"0": [
|
||||
{
|
||||
"end": 34,
|
||||
"start": 32,
|
||||
"end": 68,
|
||||
"start": 66,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "newLine"
|
||||
@ -146,7 +146,42 @@ description: Result of parsing import_whole.kcl
|
||||
}
|
||||
]
|
||||
},
|
||||
"startNodes": []
|
||||
"startNodes": [
|
||||
{
|
||||
"end": 33,
|
||||
"start": 0,
|
||||
"type": "NonCodeNode",
|
||||
"value": {
|
||||
"type": "annotation",
|
||||
"name": {
|
||||
"end": 9,
|
||||
"name": "settings",
|
||||
"start": 1,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"end": 32,
|
||||
"key": {
|
||||
"end": 27,
|
||||
"name": "defaultLengthUnit",
|
||||
"start": 10,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"start": 10,
|
||||
"type": "ObjectProperty",
|
||||
"value": {
|
||||
"end": 32,
|
||||
"name": "mm",
|
||||
"start": 30,
|
||||
"type": "Identifier",
|
||||
"type": "Identifier"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"start": 0
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
@settings(defaultLengthUnit = inch)
|
||||
startSketchOn('XY')
|
||||
|> circle({ center = [5, 5], radius = 10 }, %)
|
||||
|> extrude(10, %)
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
@settings(defaultLengthUnit = mm)
|
||||
import "exported_mod.kcl" as foo
|
||||
|
||||
bar = foo
|
||||
|
||||
@ -1,30 +1,29 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Operations executed import_whole.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
[
|
||||
{
|
||||
"labeledArgs": {
|
||||
"data": {
|
||||
"sourceRange": [
|
||||
55,
|
||||
92,
|
||||
89,
|
||||
126,
|
||||
0
|
||||
]
|
||||
},
|
||||
"solid_set": {
|
||||
"sourceRange": [
|
||||
94,
|
||||
95,
|
||||
128,
|
||||
129,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "shell",
|
||||
"sourceRange": [
|
||||
49,
|
||||
96,
|
||||
83,
|
||||
130,
|
||||
0
|
||||
],
|
||||
"type": "StdLibCall",
|
||||
|
||||
@ -28,119 +28,130 @@ description: Program memory after executing import_whole.kcl
|
||||
},
|
||||
"bar": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
25,
|
||||
68,
|
||||
1
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
25,
|
||||
68,
|
||||
1
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
5.0,
|
||||
5.0
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
61,
|
||||
104,
|
||||
1
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
61,
|
||||
104,
|
||||
1
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
5.0,
|
||||
5.0
|
||||
],
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"radius": 10.0,
|
||||
"tag": null,
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"radius": 10.0,
|
||||
"tag": null,
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"type": "Circle"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
61,
|
||||
104,
|
||||
1
|
||||
]
|
||||
}
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
"units": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
61,
|
||||
104,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"to": [
|
||||
15.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
25,
|
||||
68,
|
||||
1
|
||||
]
|
||||
}
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Inches"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
25,
|
||||
68,
|
||||
61,
|
||||
104,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 10.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
25,
|
||||
68,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"foo": {
|
||||
"type": "Module",
|
||||
@ -148,8 +159,8 @@ description: Program memory after executing import_whole.kcl
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
0,
|
||||
32,
|
||||
34,
|
||||
66,
|
||||
0
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
description: Program memory after executing neg_xz_plane.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -29,152 +28,175 @@ snapshot_kind: text
|
||||
},
|
||||
"part001": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
67,
|
||||
88,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
94,
|
||||
113,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
119,
|
||||
127,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
67,
|
||||
88,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
100.0,
|
||||
100.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
94,
|
||||
113,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
100.0,
|
||||
100.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
100.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
119,
|
||||
127,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
100.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XZ",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": -1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
36,
|
||||
61,
|
||||
67,
|
||||
88,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
94,
|
||||
113,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
119,
|
||||
127,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
67,
|
||||
88,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
100.0,
|
||||
100.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
94,
|
||||
113,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
100.0,
|
||||
100.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
100.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
119,
|
||||
127,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
100.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XZ",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": -1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
36,
|
||||
61,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
36,
|
||||
61,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 12.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -185,19 +207,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 12.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
36,
|
||||
61,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"parent": null
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
assertion_line: 92
|
||||
description: Program memory after executing parametric.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -43,245 +41,268 @@ snapshot_kind: text
|
||||
},
|
||||
"bracket": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
284,
|
||||
302,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
308,
|
||||
326,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
332,
|
||||
356,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
362,
|
||||
393,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
399,
|
||||
430,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
436,
|
||||
444,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
284,
|
||||
302,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
308,
|
||||
326,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
8.0,
|
||||
5.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
332,
|
||||
356,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
8.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
8.0,
|
||||
4.8148
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
362,
|
||||
393,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
8.0,
|
||||
4.8148
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.1852,
|
||||
4.8148
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
399,
|
||||
430,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.1852,
|
||||
4.8148
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.1852,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
436,
|
||||
444,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.1852,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
253,
|
||||
278,
|
||||
284,
|
||||
302,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
308,
|
||||
326,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
332,
|
||||
356,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
362,
|
||||
393,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
399,
|
||||
430,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
436,
|
||||
444,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
284,
|
||||
302,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
308,
|
||||
326,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
8.0,
|
||||
5.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
332,
|
||||
356,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
8.0,
|
||||
5.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
8.0,
|
||||
4.8148
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
362,
|
||||
393,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
8.0,
|
||||
4.8148
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.1852,
|
||||
4.8148
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
399,
|
||||
430,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.1852,
|
||||
4.8148
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.1852,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
436,
|
||||
444,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.1852,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
253,
|
||||
278,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
253,
|
||||
278,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 9.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -292,19 +313,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 9.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
253,
|
||||
278,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"distance": {
|
||||
"type": "Number",
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
---
|
||||
source: kcl/src/simulation_tests.rs
|
||||
assertion_line: 92
|
||||
description: Program memory after executing parametric_with_tan_arc.kcl
|
||||
snapshot_kind: text
|
||||
---
|
||||
{
|
||||
"environments": [
|
||||
@ -43,317 +41,340 @@ snapshot_kind: text
|
||||
},
|
||||
"bracket": {
|
||||
"type": "Solid",
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"value": [
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
266,
|
||||
290,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
296,
|
||||
347,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
353,
|
||||
379,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
385,
|
||||
409,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
415,
|
||||
440,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
446,
|
||||
529,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
535,
|
||||
560,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
566,
|
||||
574,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"value": {
|
||||
"type": "Solid",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
"value": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
266,
|
||||
290,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
8.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
296,
|
||||
347,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
-0.7236272269866327,
|
||||
8.0
|
||||
],
|
||||
"from": [
|
||||
0.0,
|
||||
8.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.7236,
|
||||
8.7236
|
||||
],
|
||||
"type": "TangentialArc"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
353,
|
||||
379,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.7236,
|
||||
8.7236
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-9.7236,
|
||||
8.7236
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
385,
|
||||
409,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-9.7236,
|
||||
8.7236
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-9.7236,
|
||||
8.3618
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
415,
|
||||
440,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-9.7236,
|
||||
8.3618
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.7236,
|
||||
8.3618
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
446,
|
||||
529,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": false,
|
||||
"center": [
|
||||
-0.7236272269866326,
|
||||
8.0
|
||||
],
|
||||
"from": [
|
||||
-0.7236,
|
||||
8.3618
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.3618,
|
||||
8.0
|
||||
],
|
||||
"type": "TangentialArc"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
535,
|
||||
560,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.3618,
|
||||
8.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.3618,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
566,
|
||||
574,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.3618,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
239,
|
||||
260,
|
||||
266,
|
||||
290,
|
||||
0
|
||||
]
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
296,
|
||||
347,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
353,
|
||||
379,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
385,
|
||||
409,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
415,
|
||||
440,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
446,
|
||||
529,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudeArc"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
535,
|
||||
560,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
},
|
||||
{
|
||||
"faceId": "[uuid]",
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
566,
|
||||
574,
|
||||
0
|
||||
],
|
||||
"tag": null,
|
||||
"type": "extrudePlane"
|
||||
}
|
||||
],
|
||||
"sketch": {
|
||||
"type": "Sketch",
|
||||
"id": "[uuid]",
|
||||
"paths": [
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
266,
|
||||
290,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
8.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
296,
|
||||
347,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": true,
|
||||
"center": [
|
||||
-0.7236272269866327,
|
||||
8.0
|
||||
],
|
||||
"from": [
|
||||
0.0,
|
||||
8.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.7236,
|
||||
8.7236
|
||||
],
|
||||
"type": "TangentialArc"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
353,
|
||||
379,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.7236,
|
||||
8.7236
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-9.7236,
|
||||
8.7236
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
385,
|
||||
409,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-9.7236,
|
||||
8.7236
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-9.7236,
|
||||
8.3618
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
415,
|
||||
440,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-9.7236,
|
||||
8.3618
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.7236,
|
||||
8.3618
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
446,
|
||||
529,
|
||||
0
|
||||
]
|
||||
},
|
||||
"ccw": false,
|
||||
"center": [
|
||||
-0.7236272269866326,
|
||||
8.0
|
||||
],
|
||||
"from": [
|
||||
-0.7236,
|
||||
8.3618
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.3618,
|
||||
8.0
|
||||
],
|
||||
"type": "TangentialArc"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
535,
|
||||
560,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.3618,
|
||||
8.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
-0.3618,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
},
|
||||
{
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
566,
|
||||
574,
|
||||
0
|
||||
]
|
||||
},
|
||||
"from": [
|
||||
-0.3618,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"type": "ToPoint"
|
||||
}
|
||||
],
|
||||
"on": {
|
||||
"type": "plane",
|
||||
"id": "[uuid]",
|
||||
"value": "XY",
|
||||
"origin": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"xAxis": {
|
||||
"x": 1.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"yAxis": {
|
||||
"x": 0.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"zAxis": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 1.0
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": []
|
||||
},
|
||||
"start": {
|
||||
"from": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"to": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"tag": null,
|
||||
"__geoMeta": {
|
||||
"id": "[uuid]",
|
||||
"sourceRange": [
|
||||
239,
|
||||
260,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
239,
|
||||
260,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 11.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"units": {
|
||||
"type": "Mm"
|
||||
},
|
||||
"__meta": [
|
||||
{
|
||||
@ -364,19 +385,7 @@ snapshot_kind: text
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"height": 11.0,
|
||||
"startCapId": "[uuid]",
|
||||
"endCapId": "[uuid]",
|
||||
"__meta": [
|
||||
{
|
||||
"sourceRange": [
|
||||
239,
|
||||
260,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"distance": {
|
||||
"type": "Number",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user