Compare commits

..

11 Commits

Author SHA1 Message Date
441e18e916 Update generated test output 2025-04-23 19:36:02 -04:00
1502f923ee KCL bugfix: CallExpressionKw was not usable as math operand (#6460)
Closes https://github.com/KittyCAD/modeling-app/issues/4992
2025-04-23 21:21:57 +00:00
f03a684eec Modeling view appearance final tweaks (#6425)
* Remove bug button from LowerRightControls

There is a "report a bug" button in the help menus, both native and
lower-right corner. This is overkill, and users are not using coredump
well.

* Remove coredump from refresh UI button

* Add a "Refresh app" command to palette

* Update snapshots

* Rework "Refresh and report bug" menu item to "Report a bug"

* Add refresh button to sidebar

* Convert upper-right refresh button to Share

* Tweak styles of command button

* Make anonymous user icon same size as known user image

* Remove ModelStateIndicator

* Use hotkeyDisplay for the sidebar too

* Update snapshots

* Remove tooltip from command bar open button

* tsc, lint, and fmt
2025-04-23 15:20:45 -04:00
45e17c50e7 docs: Add docs for creating simulation tests (#6453) 2025-04-23 11:59:07 -07:00
6bf74379a7 Kwargs: hollow (#6438) 2025-04-23 18:35:33 +00:00
01c6fd53fa Fix Cargo.lock (#6452) 2025-04-23 17:39:35 +00:00
f8306c0275 Try running with 8 macOS cores again (#6420)
* Revert "Disable all macOS testing for now (#6395)"

This reverts commit fbc3251c3f.

* Try running with 8 macOS cores again
2025-04-23 13:10:09 -04:00
900ef9e18d Release KCL 63 (#6446) 2025-04-23 12:35:16 -04:00
a46186573c Kwargs: profileStart/x/y (#6439) 2025-04-23 15:21:58 +00:00
90f6c1bb04 Fix Back button on SignIn page & Add Cancel button (#6415)
* Back button on SignIn page leads to Home page
Fixes #6413

* Add regression test for the bug, and for new cancel button

* Full sign in e2e test

* Good bot

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-04-23 15:12:33 +00:00
41d946b339 Remove Spline and Text tools from sketch mode toolbar (#6427)
* Remove Spline and Text tool from sketch toolbar

* Update sketch-related snapshots

* Update snapshots
2025-04-23 13:06:51 +00:00
157 changed files with 3999 additions and 1808 deletions

View File

@ -285,8 +285,7 @@ jobs:
# TODO: enable namespace-profile-windows-latest once available # TODO: enable namespace-profile-windows-latest once available
os: os:
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64" - "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
# TODO: renable this when macoOS runner seem more stable - namespace-profile-macos-8-cores
# - namespace-profile-macos-6-cores
- windows-latest-8-cores - windows-latest-8-cores
shardIndex: [1, 2, 3, 4] shardIndex: [1, 2, 3, 4]
shardTotal: [4] shardTotal: [4]
@ -296,7 +295,7 @@ jobs:
isScheduled: isScheduled:
- ${{ github.event_name == 'schedule' }} - ${{ github.event_name == 'schedule' }}
exclude: exclude:
- os: namespace-profile-macos-6-cores - os: namespace-profile-macos-8-cores
isScheduled: true isScheduled: true
- os: windows-latest-8-cores - os: windows-latest-8-cores
isScheduled: true isScheduled: true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -74,7 +74,7 @@ layout: manual
* [`map`](kcl/map) * [`map`](kcl/map)
* [`max`](kcl/max) * [`max`](kcl/max)
* [`min`](kcl/min) * [`min`](kcl/min)
* [`offsetPlane`](kcl/std-offsetPlane) * [`offsetPlane`](kcl/offsetPlane)
* [`patternCircular2d`](kcl/patternCircular2d) * [`patternCircular2d`](kcl/patternCircular2d)
* [`patternCircular3d`](kcl/patternCircular3d) * [`patternCircular3d`](kcl/patternCircular3d)
* [`patternLinear2d`](kcl/patternLinear2d) * [`patternLinear2d`](kcl/patternLinear2d)

121
docs/kcl/offsetPlane.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin value.
```js ```js
profileStart(sketch: Sketch): [number] profileStart(profile: Sketch): [number]
``` ```
@ -17,7 +17,7 @@ profileStart(sketch: Sketch): [number]
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes | | `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
### Returns ### Returns

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'x' value.
```js ```js
profileStartX(sketch: Sketch): number profileStartX(profile: Sketch): number
``` ```
@ -17,7 +17,7 @@ profileStartX(sketch: Sketch): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes | | `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
### Returns ### Returns

View File

@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'y' value.
```js ```js
profileStartY(sketch: Sketch): number profileStartY(profile: Sketch): number
``` ```
@ -17,7 +17,7 @@ profileStartY(sketch: Sketch): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes | | `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
### Returns ### Returns

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -29,11 +29,11 @@ test.describe('Electron app header tests', () => {
test( test(
'User settings has correct shortcut', 'User settings has correct shortcut',
{ tag: '@electron' }, { tag: '@electron' },
async ({ page }, testInfo) => { async ({ page, toolbar }, testInfo) => {
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
// Open the user sidebar menu. // Open the user sidebar menu.
await page.getByTestId('user-sidebar-toggle').click() await toolbar.userSidebarButton.click()
// No space after "User settings" since it's textContent. // No space after "User settings" since it's textContent.
const text = const text =

View File

@ -0,0 +1,53 @@
import { expect, test } from '@e2e/playwright/zoo-test'
// test file is for testing auth functionality
test.describe('Authentication tests', () => {
test(
`The user can sign out and back in`,
{ tag: ['@electron'] },
async ({ page, homePage, signInPage, toolbar, tronApp }) => {
if (!tronApp) {
fail()
}
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.projectSection.waitFor()
await test.step('Click on sign out and expect sign in page', async () => {
await toolbar.userSidebarButton.click()
await toolbar.signOutButton.click()
await expect(signInPage.signInButton).toBeVisible()
})
await test.step('Click on sign in and cancel, click again and expect different code', async () => {
await signInPage.signInButton.click()
await expect(signInPage.userCode).toBeVisible()
const firstUserCode = await signInPage.userCode.textContent()
await signInPage.cancelSignInButton.click()
await expect(signInPage.signInButton).toBeVisible()
await signInPage.signInButton.click()
await expect(signInPage.userCode).toBeVisible()
const secondUserCode = await signInPage.userCode.textContent()
expect(secondUserCode).not.toEqual(firstUserCode)
})
await test.step('Press back button and remain on home page', async () => {
await page.goBack()
await expect(homePage.projectSection).not.toBeVisible()
await expect(signInPage.signInButton).toBeVisible()
})
await test.step('Sign in, activate, and expect home page', async () => {
await signInPage.signInButton.click()
await expect(signInPage.userCode).toBeVisible()
const userCode = await signInPage.userCode.textContent()
expect(userCode).not.toBeNull()
await signInPage.verifyAndConfirmAuth(userCode!)
// Longer timeout than usual here for the wait on home page
await expect(homePage.projectSection).toBeVisible({ timeout: 10000 })
})
}
)
})

View File

@ -18,6 +18,7 @@ import type { Settings } from '@rust/kcl-lib/bindings/Settings'
import { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture' import { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import { EditorFixture } from '@e2e/playwright/fixtures/editorFixture' import { EditorFixture } from '@e2e/playwright/fixtures/editorFixture'
import { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture' import { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
import { SignInPageFixture } from '@e2e/playwright/fixtures/signInPageFixture'
import { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture' import { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
import { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture' import { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
@ -66,6 +67,7 @@ export interface Fixtures {
toolbar: ToolbarFixture toolbar: ToolbarFixture
scene: SceneFixture scene: SceneFixture
homePage: HomePageFixture homePage: HomePageFixture
signInPage: SignInPageFixture
} }
export class ElectronZoo { export class ElectronZoo {
@ -387,6 +389,9 @@ const fixturesBasedOnProcessEnvPlatform = {
homePage: async ({ page }: { page: Page }, use: FnUse) => { homePage: async ({ page }: { page: Page }, use: FnUse) => {
await use(new HomePageFixture(page)) await use(new HomePageFixture(page))
}, },
signInPage: async ({ page }: { page: Page }, use: FnUse) => {
await use(new SignInPageFixture(page))
},
} }
if (process.env.PLATFORM === 'web') { if (process.env.PLATFORM === 'web') {

View File

@ -0,0 +1,48 @@
import type { Locator, Page } from '@playwright/test'
import { secrets } from '@e2e/playwright/secrets'
export class SignInPageFixture {
public page: Page
signInButton!: Locator
cancelSignInButton!: Locator
userCode!: Locator
apiBaseUrl!: string
constructor(page: Page) {
this.page = page
this.signInButton = this.page.getByTestId('sign-in-button')
this.cancelSignInButton = this.page.getByTestId('cancel-sign-in-button')
this.userCode = this.page.getByTestId('sign-in-user-code')
// TODO: set this thru env var
this.apiBaseUrl = 'https://api.dev.zoo.dev'
}
async verifyAndConfirmAuth(userCode: string) {
// Device flow: stolen from the tauri days
// https://github.com/KittyCAD/modeling-app/blob/d916c7987452e480719004e6d11fd2e595c7d0eb/e2e/tauri/specs/app.spec.ts#L19
const headers = {
Authorization: `Bearer ${secrets.token}`,
Accept: 'application/json',
'Content-Type': 'application/json',
}
const verifyUrl = `${this.apiBaseUrl}/oauth2/device/verify?user_code=${userCode}`
console.log(`GET ${verifyUrl}`)
const vr = await fetch(verifyUrl, { headers })
console.log(vr.status)
// Device flow: confirm
const confirmUrl = `${this.apiBaseUrl}/oauth2/device/confirm`
const data = JSON.stringify({ user_code: userCode })
console.log(`POST ${confirmUrl} ${data}`)
const cr = await fetch(confirmUrl, {
headers,
method: 'POST',
body: data,
})
console.log(cr.status)
}
}

View File

@ -46,6 +46,9 @@ export class ToolbarFixture {
gizmo!: Locator gizmo!: Locator
gizmoDisabled!: Locator gizmoDisabled!: Locator
loadButton!: Locator loadButton!: Locator
/** User button for the user sidebar menu */
userSidebarButton!: Locator
signOutButton!: Locator
constructor(page: Page) { constructor(page: Page) {
this.page = page this.page = page
@ -82,6 +85,9 @@ export class ToolbarFixture {
// element or two different elements can represent these states. // element or two different elements can represent these states.
this.gizmo = page.getByTestId('gizmo') this.gizmo = page.getByTestId('gizmo')
this.gizmoDisabled = page.getByTestId('gizmo-disabled') this.gizmoDisabled = page.getByTestId('gizmo-disabled')
this.userSidebarButton = page.getByTestId('user-sidebar-toggle')
this.signOutButton = page.getByTestId('user-sidebar-sign-out')
} }
get logoLink() { get logoLink() {

View File

@ -409,11 +409,7 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
) )
.toBe(true) .toBe(true)
}) })
test('Home.Help.Refresh and report a bug', async ({ test('Home.Help.Report a bug', async ({ tronApp, cmdBar, page }) => {
tronApp,
cmdBar,
page,
}) => {
if (!tronApp) fail() if (!tronApp) fail()
// Run electron snippet to find the Menu! // Run electron snippet to find the Menu!
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
@ -424,9 +420,8 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
if (!app || !app.applicationMenu) { if (!app || !app.applicationMenu) {
return false return false
} }
const menu = app.applicationMenu.getMenuItemById( const menu =
'Help.Refresh and report a bug' app.applicationMenu.getMenuItemById('Help.Report a bug')
)
if (!menu) return false if (!menu) return false
menu.click() menu.click()
return true return true
@ -2291,7 +2286,7 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
if (!menu) fail() if (!menu) fail()
}) })
}) })
test('Modeling.Help.Refresh and report a bug', async ({ test('Modeling.Help.Report a bug', async ({
tronApp, tronApp,
cmdBar, cmdBar,
page, page,
@ -2315,9 +2310,8 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
async () => async () =>
await tronApp.electron.evaluate(async ({ app }) => { await tronApp.electron.evaluate(async ({ app }) => {
if (!app || !app.applicationMenu) return false if (!app || !app.applicationMenu) return false
const menu = app.applicationMenu.getMenuItemById( const menu =
'Help.Refresh and report a bug' app.applicationMenu.getMenuItemById('Help.Report a bug')
)
if (!menu) return false if (!menu) return false
menu.click() menu.click()
return true return true

View File

@ -331,6 +331,7 @@ test.describe('Onboarding tests', () => {
test('Avatar text updates depending on image load success', async ({ test('Avatar text updates depending on image load success', async ({
context, context,
page, page,
toolbar,
homePage, homePage,
tronApp, tronApp,
}) => { }) => {
@ -362,7 +363,7 @@ test.describe('Onboarding tests', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
// Test that the text in this step is correct // Test that the text in this step is correct
const avatarLocator = page.getByTestId('user-sidebar-toggle').locator('img') const avatarLocator = toolbar.userSidebarButton.locator('img')
const onboardingOverlayLocator = page const onboardingOverlayLocator = page
.getByTestId('onboarding-content') .getByTestId('onboarding-content')
.locator('div') .locator('div')
@ -404,6 +405,7 @@ test.describe('Onboarding tests', () => {
test("Avatar text doesn't mention avatar when no avatar", async ({ test("Avatar text doesn't mention avatar when no avatar", async ({
context, context,
page, page,
toolbar,
homePage, homePage,
tronApp, tronApp,
}) => { }) => {
@ -435,7 +437,7 @@ test.describe('Onboarding tests', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
// Test that the text in this step is correct // Test that the text in this step is correct
const sidebar = page.getByTestId('user-sidebar-toggle') const sidebar = toolbar.userSidebarButton
const avatar = sidebar.locator('img') const avatar = sidebar.locator('img')
const onboardingOverlayLocator = page const onboardingOverlayLocator = page
.getByTestId('onboarding-content') .getByTestId('onboarding-content')
@ -464,6 +466,7 @@ test.describe('Onboarding tests', () => {
test('Restarting onboarding on desktop takes one attempt', async ({ test('Restarting onboarding on desktop takes one attempt', async ({
context, context,
page, page,
toolbar,
tronApp, tronApp,
}) => { }) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
@ -502,7 +505,7 @@ test('Restarting onboarding on desktop takes one attempt', async ({
.filter({ hasText: 'Tutorial Project 00' }) .filter({ hasText: 'Tutorial Project 00' })
const tutorialModalText = page.getByText('Welcome to Design Studio!') const tutorialModalText = page.getByText('Welcome to Design Studio!')
const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' }) const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' })
const userMenuButton = page.getByTestId('user-sidebar-toggle') const userMenuButton = toolbar.userSidebarButton
const userMenuSettingsButton = page.getByRole('button', { const userMenuSettingsButton = page.getByRole('button', {
name: 'User settings', name: 'User settings',
}) })

View File

@ -400,11 +400,6 @@ test(
await expect(page.getByText('broken-code')).toBeVisible() await expect(page.getByText('broken-code')).toBeVisible()
await page.getByText('broken-code').click() await page.getByText('broken-code').click()
// Gotcha: You can not use scene.settled() since the KCL code is going to fail
await expect(
page.getByTestId('model-state-indicator-playing')
).toBeAttached()
// Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content // Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content
await editor.scrollToText( await editor.scrollToText(
"|> line(end = [0, wallMountL], tag = 'outerEdge')" "|> line(end = [0, wallMountL], tag = 'outerEdge')"
@ -779,7 +774,9 @@ test.describe(`Project management commands`, () => {
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')
const commandButton = page.getByRole('button', { name: 'Commands' }) const commandButton = page.getByRole('button', { name: 'Commands' })
const commandOption = page.getByRole('option', { name: 'rename project' }) const commandOption = page.getByRole('option', {
name: 'rename project',
})
const projectNameOption = page.getByRole('option', { name: projectName }) const projectNameOption = page.getByRole('option', { name: projectName })
const projectRenamedName = `untitled` const projectRenamedName = `untitled`
// const projectMenuButton = page.getByTestId('project-sidebar-toggle') // const projectMenuButton = page.getByTestId('project-sidebar-toggle')
@ -839,7 +836,9 @@ test.describe(`Project management commands`, () => {
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')
const commandButton = page.getByRole('button', { name: 'Commands' }) const commandButton = page.getByRole('button', { name: 'Commands' })
const commandOption = page.getByRole('option', { name: 'delete project' }) const commandOption = page.getByRole('option', {
name: 'delete project',
})
const projectNameOption = page.getByRole('option', { name: projectName }) const projectNameOption = page.getByRole('option', { name: projectName })
const commandWarning = page.getByText('Are you sure you want to delete?') const commandWarning = page.getByText('Are you sure you want to delete?')
const commandSubmitButton = page.getByRole('button', { const commandSubmitButton = page.getByRole('button', {
@ -891,7 +890,9 @@ test.describe(`Project management commands`, () => {
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')
const commandButton = page.getByRole('button', { name: 'Commands' }) const commandButton = page.getByRole('button', { name: 'Commands' })
const commandOption = page.getByRole('option', { name: 'rename project' }) const commandOption = page.getByRole('option', {
name: 'rename project',
})
const projectNameOption = page.getByRole('option', { name: projectName }) const projectNameOption = page.getByRole('option', { name: projectName })
const projectRenamedName = `untitled` const projectRenamedName = `untitled`
const commandContinueButton = page.getByRole('button', { const commandContinueButton = page.getByRole('button', {
@ -947,7 +948,9 @@ test.describe(`Project management commands`, () => {
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')
const commandButton = page.getByRole('button', { name: 'Commands' }) const commandButton = page.getByRole('button', { name: 'Commands' })
const commandOption = page.getByRole('option', { name: 'delete project' }) const commandOption = page.getByRole('option', {
name: 'delete project',
})
const projectNameOption = page.getByRole('option', { name: projectName }) const projectNameOption = page.getByRole('option', { name: projectName })
const commandWarning = page.getByText('Are you sure you want to delete?') const commandWarning = page.getByText('Are you sure you want to delete?')
const commandSubmitButton = page.getByRole('button', { const commandSubmitButton = page.getByRole('button', {
@ -1962,13 +1965,13 @@ test(
test( test(
'Settings persist across restarts', 'Settings persist across restarts',
{ tag: '@electron' }, { tag: '@electron' },
async ({ page, scene, cmdBar }, testInfo) => { async ({ page, toolbar }, testInfo) => {
await test.step('We can change a user setting like theme', async () => { await test.step('We can change a user setting like theme', async () => {
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
page.on('console', console.log) page.on('console', console.log)
await page.getByTestId('user-sidebar-toggle').click() await toolbar.userSidebarButton.click()
await page.getByTestId('user-settings').click() await page.getByTestId('user-settings').click()
@ -1995,7 +1998,7 @@ test(
test( test(
'Original project name persist after onboarding', 'Original project name persist after onboarding',
{ tag: '@electron' }, { tag: '@electron' },
async ({ page }, testInfo) => { async ({ page, toolbar }, testInfo) => {
test.fixme(orRunWhenFullSuiteEnabled()) test.fixme(orRunWhenFullSuiteEnabled())
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
@ -2007,7 +2010,7 @@ test(
}) })
await test.step('Should go through onboarding', async () => { await test.step('Should go through onboarding', async () => {
await page.getByTestId('user-sidebar-toggle').click() await toolbar.userSidebarButton.click()
await page.getByTestId('user-settings').click() await page.getByTestId('user-settings').click()
await page.getByRole('button', { name: 'Replay Onboarding' }).click() await page.getByRole('button', { name: 'Replay Onboarding' }).click()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -36,7 +36,6 @@ export const headerMasks = (page: Page) => [
] ]
export const networkingMasks = (page: Page) => [ export const networkingMasks = (page: Page) => [
page.getByTestId('model-state-indicator'),
page.getByTestId('network-toggle'), page.getByTestId('network-toggle'),
] ]
@ -85,12 +84,6 @@ async function waitForPageLoadWithRetry(page: Page) {
await expect(async () => { await expect(async () => {
await page.goto('/') await page.goto('/')
const errorMessage = 'App failed to load - 🔃 Retrying ...' const errorMessage = 'App failed to load - 🔃 Retrying ...'
await expect(
page.getByTestId('model-state-indicator-playing'),
errorMessage
).toBeAttached({
timeout: 20_000,
})
await expect( await expect(
page.getByRole('button', { name: 'sketch Start Sketch' }), page.getByRole('button', { name: 'sketch Start Sketch' }),
@ -103,11 +96,6 @@ async function waitForPageLoadWithRetry(page: Page) {
// lee: This needs to be replaced by scene.settled() eventually. // lee: This needs to be replaced by scene.settled() eventually.
async function waitForPageLoad(page: Page) { async function waitForPageLoad(page: Page) {
// wait for all spinners to be gone
await expect(page.getByTestId('model-state-indicator-playing')).toBeVisible({
timeout: 20_000,
})
await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeEnabled({ await expect(page.getByRole('button', { name: 'Start Sketch' })).toBeEnabled({
timeout: 20_000, timeout: 20_000,
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -6,7 +6,7 @@ uses-engine = { max-threads = 4 }
after-engine = { max-threads = 12 } after-engine = { max-threads = 12 }
[profile.default] [profile.default]
slow-timeout = { period = "180s", terminate-after = 1 } slow-timeout = { period = "90s", terminate-after = 1 }
[profile.ci] [profile.ci]
slow-timeout = { period = "50s", terminate-after = 5 } slow-timeout = { period = "50s", terminate-after = 5 }

20
rust/Cargo.lock generated
View File

@ -1792,7 +1792,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-bumper" name = "kcl-bumper"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1803,7 +1803,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-derive-docs" name = "kcl-derive-docs"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"anyhow", "anyhow",
@ -1822,7 +1822,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-directory-test-macro" name = "kcl-directory-test-macro"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1831,7 +1831,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-language-server" name = "kcl-language-server"
version = "0.2.62" version = "0.2.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1852,7 +1852,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-language-server-release" name = "kcl-language-server-release"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1872,7 +1872,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-lib" name = "kcl-lib"
version = "0.2.62" version = "0.2.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"approx 0.5.1", "approx 0.5.1",
@ -1943,7 +1943,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-python-bindings" name = "kcl-python-bindings"
version = "0.3.62" version = "0.3.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"kcl-lib", "kcl-lib",
@ -1958,7 +1958,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-test-server" name = "kcl-test-server"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"hyper 0.14.32", "hyper 0.14.32",
@ -1971,7 +1971,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-to-core" name = "kcl-to-core"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -1985,7 +1985,7 @@ dependencies = [
[[package]] [[package]]
name = "kcl-wasm-lib" name = "kcl-wasm-lib"
version = "0.1.62" version = "0.1.63"
dependencies = [ dependencies = [
"bson", "bson",
"console_error_panic_hook", "console_error_panic_hook",

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-bumper" name = "kcl-bumper"
version = "0.1.62" version = "0.1.63"
edition = "2021" edition = "2021"
repository = "https://github.com/KittyCAD/modeling-api" repository = "https://github.com/KittyCAD/modeling-api"
rust-version = "1.76" rust-version = "1.76"

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-derive-docs" name = "kcl-derive-docs"
description = "A tool for generating documentation from Rust derive macros" description = "A tool for generating documentation from Rust derive macros"
version = "0.1.62" version = "0.1.63"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -6,12 +6,11 @@
mod tests; mod tests;
mod unbox; mod unbox;
use std::{collections::HashMap, fs}; use std::collections::HashMap;
use convert_case::Casing; use convert_case::Casing;
use inflector::{cases::camelcase::to_camel_case, Inflector}; use inflector::{cases::camelcase::to_camel_case, Inflector};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use proc_macro2::Span;
use quote::{format_ident, quote, quote_spanned, ToTokens}; use quote::{format_ident, quote, quote_spanned, ToTokens};
use regex::Regex; use regex::Regex;
use serde::Deserialize; use serde::Deserialize;
@ -22,16 +21,6 @@ use syn::{
}; };
use unbox::unbox; use unbox::unbox;
#[proc_macro_attribute]
pub fn stdlib(attr: proc_macro::TokenStream, item: proc_macro::TokenStream) -> proc_macro::TokenStream {
do_output(do_stdlib(attr.into(), item.into()))
}
#[proc_macro_attribute]
pub fn for_each_std_mod(_attr: proc_macro::TokenStream, item: proc_macro::TokenStream) -> proc_macro::TokenStream {
do_for_each_std_mod(item.into()).into()
}
/// Describes an argument of a stdlib function. /// Describes an argument of a stdlib function.
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
struct ArgMetadata { struct ArgMetadata {
@ -84,6 +73,11 @@ struct StdlibMetadata {
args: HashMap<String, ArgMetadata>, args: HashMap<String, ArgMetadata>,
} }
#[proc_macro_attribute]
pub fn stdlib(attr: proc_macro::TokenStream, item: proc_macro::TokenStream) -> proc_macro::TokenStream {
do_output(do_stdlib(attr.into(), item.into()))
}
fn do_stdlib( fn do_stdlib(
attr: proc_macro2::TokenStream, attr: proc_macro2::TokenStream,
item: proc_macro2::TokenStream, item: proc_macro2::TokenStream,
@ -92,31 +86,6 @@ fn do_stdlib(
do_stdlib_inner(metadata, attr, item) do_stdlib_inner(metadata, attr, item)
} }
fn do_for_each_std_mod(item: proc_macro2::TokenStream) -> proc_macro2::TokenStream {
let item: syn::ItemFn = syn::parse2(item.clone()).unwrap();
let mut result = proc_macro2::TokenStream::new();
for name in fs::read_dir("kcl-lib/std").unwrap().filter_map(|e| {
let e = e.unwrap();
let filename = e.file_name();
filename.to_str().unwrap().strip_suffix(".kcl").map(str::to_owned)
}) {
let mut item = item.clone();
item.sig.ident = syn::Ident::new(&format!("{}_{}", item.sig.ident, name), Span::call_site());
let stmts = &item.block.stmts;
//let name = format!("\"{name}\"");
let block = quote! {
{
const STD_MOD_NAME: &str = #name;
#(#stmts)*
}
};
item.block = Box::new(syn::parse2(block).unwrap());
result.extend(Some(item.into_token_stream()));
}
result
}
fn do_output(res: Result<(proc_macro2::TokenStream, Vec<Error>), Error>) -> proc_macro::TokenStream { fn do_output(res: Result<(proc_macro2::TokenStream, Vec<Error>), Error>) -> proc_macro::TokenStream {
match res { match res {
Err(err) => err.to_compile_error().into(), Err(err) => err.to_compile_error().into(),
@ -702,7 +671,6 @@ fn normalize_comment_string(s: String) -> Vec<String> {
/// Represent an item without concern for its body which may (or may not) /// Represent an item without concern for its body which may (or may not)
/// contain syntax errors. /// contain syntax errors.
#[derive(Clone)]
struct ItemFnForSignature { struct ItemFnForSignature {
pub attrs: Vec<Attribute>, pub attrs: Vec<Attribute>,
pub vis: Visibility, pub vis: Visibility,

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-directory-test-macro" name = "kcl-directory-test-macro"
description = "A tool for generating tests from a directory of kcl files" description = "A tool for generating tests from a directory of kcl files"
version = "0.1.62" version = "0.1.63"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "kcl-language-server-release" name = "kcl-language-server-release"
version = "0.1.62" version = "0.1.63"
edition = "2021" edition = "2021"
authors = ["KittyCAD Inc <kcl@kittycad.io>"] authors = ["KittyCAD Inc <kcl@kittycad.io>"]
publish = false publish = false

View File

@ -2,7 +2,7 @@
name = "kcl-language-server" name = "kcl-language-server"
description = "A language server for KCL." description = "A language server for KCL."
authors = ["KittyCAD Inc <kcl@kittycad.io>"] authors = ["KittyCAD Inc <kcl@kittycad.io>"]
version = "0.2.62" version = "0.2.63"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,7 +1,7 @@
[package] [package]
name = "kcl-lib" name = "kcl-lib"
description = "KittyCAD Language implementation and tools" description = "KittyCAD Language implementation and tools"
version = "0.2.62" version = "0.2.63"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app" repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -19,6 +19,30 @@ We've built a lot of tooling to make contributing to KCL easier. If you are inte
11. Run `just redo-kcl-stdlib-docs` to generate new Markdown documentation for your function that will be used [to generate docs on our website](https://zoo.dev/docs/kcl). 11. Run `just redo-kcl-stdlib-docs` to generate new Markdown documentation for your function that will be used [to generate docs on our website](https://zoo.dev/docs/kcl).
12. Create a PR in GitHub. 12. Create a PR in GitHub.
## Making a Simulation Test
If you have KCL code that you want to test, simulation tests are the preferred way to do that.
Make a new sim test. Replace `foo_bar` with the snake case name of your test. The name needs to be unique.
```shell
just new-sim-test foo_bar
```
It will show the commands it ran, including the path to a new file `foo_bar/input.kcl`. Edit that with your KCL. If you need additional KCL files to import, include them in this directory.
Then run it.
```shell
just overwrite-sim-test foo_bar
```
The above should create a bunch of output files in the same directory.
Make sure you actually look at them. Specifically, if there's an `execution_error.snap`, it means the execution failed. Depending on the test, this may be what you expect. But if it's not, delete the snap file and run it again.
When it looks good, commit all the files, including `input.kcl`, generated output files in the test directory, and changes to `simulation_tests.rs`.
## Bumping the version ## Bumping the version
If you bump the version of kcl-lib and push it to crates, be sure to update the repos we own that use it as well. These are: If you bump the version of kcl-lib and push it to crates, be sure to update the repos we own that use it as well. These are:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -61,10 +61,8 @@ impl CollectionVisitor {
format!("std::{}::", self.name) format!("std::{}::", self.name)
}; };
let mut dd = match var.kind { let mut dd = match var.kind {
VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual_name, preferred_prefix, name)), VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual_name, preferred_prefix)),
VariableKind::Const => { VariableKind::Const => DocData::Const(ConstData::from_ast(var, qual_name, preferred_prefix)),
DocData::Const(ConstData::from_ast(var, qual_name, preferred_prefix, name))
}
}; };
dd.with_meta(&var.outer_attrs); dd.with_meta(&var.outer_attrs);
@ -81,7 +79,7 @@ impl CollectionVisitor {
} else { } else {
format!("std::{}::", self.name) format!("std::{}::", self.name)
}; };
let mut dd = DocData::Ty(TyData::from_ast(ty, qual_name, preferred_prefix, name)); let mut dd = DocData::Ty(TyData::from_ast(ty, qual_name, preferred_prefix));
dd.with_meta(&ty.outer_attrs); dd.with_meta(&ty.outer_attrs);
for a in &ty.outer_attrs { for a in &ty.outer_attrs {
@ -116,16 +114,6 @@ impl DocData {
} }
} }
/// The name of the module in which the item is declared, e.g., `sketch`
#[allow(dead_code)]
pub fn module_name(&self) -> &str {
match self {
DocData::Fn(f) => &f.module_name,
DocData::Const(c) => &c.module_name,
DocData::Ty(t) => &t.module_name,
}
}
#[allow(dead_code)] #[allow(dead_code)]
pub fn file_name(&self) -> String { pub fn file_name(&self) -> String {
match self { match self {
@ -144,7 +132,6 @@ impl DocData {
} }
} }
/// The path to the module through which the item is accessed, e.g., `std::sketch`
#[allow(dead_code)] #[allow(dead_code)]
pub fn mod_name(&self) -> String { pub fn mod_name(&self) -> String {
let q = match self { let q = match self {
@ -230,8 +217,6 @@ pub struct ConstData {
/// Code examples. /// Code examples.
/// These are tested and we know they compile and execute. /// These are tested and we know they compile and execute.
pub examples: Vec<(String, ExampleProperties)>, pub examples: Vec<(String, ExampleProperties)>,
pub module_name: String,
} }
impl ConstData { impl ConstData {
@ -239,7 +224,6 @@ impl ConstData {
var: &crate::parsing::ast::types::VariableDeclaration, var: &crate::parsing::ast::types::VariableDeclaration,
mut qual_name: String, mut qual_name: String,
preferred_prefix: &str, preferred_prefix: &str,
module_name: &str,
) -> Self { ) -> Self {
assert_eq!(var.kind, crate::parsing::ast::types::VariableKind::Const); assert_eq!(var.kind, crate::parsing::ast::types::VariableKind::Const);
@ -279,7 +263,6 @@ impl ConstData {
summary: None, summary: None,
description: None, description: None,
examples: Vec::new(), examples: Vec::new(),
module_name: module_name.to_owned(),
} }
} }
@ -351,8 +334,6 @@ pub struct FnData {
pub examples: Vec<(String, ExampleProperties)>, pub examples: Vec<(String, ExampleProperties)>,
#[allow(dead_code)] #[allow(dead_code)]
pub referenced_types: Vec<String>, pub referenced_types: Vec<String>,
pub module_name: String,
} }
impl FnData { impl FnData {
@ -360,7 +341,6 @@ impl FnData {
var: &crate::parsing::ast::types::VariableDeclaration, var: &crate::parsing::ast::types::VariableDeclaration,
mut qual_name: String, mut qual_name: String,
preferred_prefix: &str, preferred_prefix: &str,
module_name: &str,
) -> Self { ) -> Self {
assert_eq!(var.kind, crate::parsing::ast::types::VariableKind::Fn); assert_eq!(var.kind, crate::parsing::ast::types::VariableKind::Fn);
let crate::parsing::ast::types::Expr::FunctionExpression(expr) = &var.declaration.init else { let crate::parsing::ast::types::Expr::FunctionExpression(expr) = &var.declaration.init else {
@ -395,7 +375,6 @@ impl FnData {
description: None, description: None,
examples: Vec::new(), examples: Vec::new(),
referenced_types: referenced_types.into_iter().collect(), referenced_types: referenced_types.into_iter().collect(),
module_name: module_name.to_owned(),
} }
} }
@ -675,8 +654,6 @@ pub struct TyData {
pub examples: Vec<(String, ExampleProperties)>, pub examples: Vec<(String, ExampleProperties)>,
#[allow(dead_code)] #[allow(dead_code)]
pub referenced_types: Vec<String>, pub referenced_types: Vec<String>,
pub module_name: String,
} }
impl TyData { impl TyData {
@ -684,7 +661,6 @@ impl TyData {
ty: &crate::parsing::ast::types::TypeDeclaration, ty: &crate::parsing::ast::types::TypeDeclaration,
mut qual_name: String, mut qual_name: String,
preferred_prefix: &str, preferred_prefix: &str,
module_name: &str,
) -> Self { ) -> Self {
let name = ty.name.name.clone(); let name = ty.name.name.clone();
qual_name.push_str(&name); qual_name.push_str(&name);
@ -708,7 +684,6 @@ impl TyData {
description: None, description: None,
examples: Vec::new(), examples: Vec::new(),
referenced_types: referenced_types.into_iter().collect(), referenced_types: referenced_types.into_iter().collect(),
module_name: module_name.to_owned(),
} }
} }
@ -1034,8 +1009,6 @@ fn collect_type_names_from_primitive(ty: &PrimitiveType) -> String {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use kcl_derive_docs::for_each_std_mod;
use super::*; use super::*;
#[test] #[test]
@ -1074,28 +1047,18 @@ mod test {
); );
} }
#[for_each_std_mod] #[tokio::test(flavor = "multi_thread", worker_threads = 5)]
#[tokio::test(flavor = "multi_thread")] async fn test_examples() -> miette::Result<()> {
async fn test_examples() {
let std = walk_prelude(); let std = walk_prelude();
let mut errs = Vec::new();
for d in std { for d in std {
if d.module_name() != STD_MOD_NAME {
continue;
}
for (i, eg) in d.examples().enumerate() { for (i, eg) in d.examples().enumerate() {
let result = match crate::test_server::execute_and_snapshot(eg, None).await { let result = match crate::test_server::execute_and_snapshot(eg, None).await {
Err(crate::errors::ExecError::Kcl(e)) => { Err(crate::errors::ExecError::Kcl(e)) => {
errs.push( return Err(miette::Report::new(crate::errors::Report {
miette::Report::new(crate::errors::Report { error: e.error,
error: e.error, filename: format!("{}{i}", d.name()),
filename: format!("{}{i}", d.name()), kcl_source: eg.to_string(),
kcl_source: eg.to_string(), }));
})
.to_string(),
);
continue;
} }
Err(other_err) => panic!("{}", other_err), Err(other_err) => panic!("{}", other_err),
Ok(img) => img, Ok(img) => img,
@ -1108,8 +1071,6 @@ mod test {
} }
} }
if !errs.is_empty() { Ok(())
panic!("{}", errs.join("\n\n"));
}
} }
} }

View File

@ -1142,6 +1142,9 @@ impl Node<UnaryExpression> {
} }
KclValue::Plane { value } => { KclValue::Plane { value } => {
let mut plane = value.clone(); let mut plane = value.clone();
plane.z_axis.x *= -1.0;
plane.z_axis.y *= -1.0;
plane.z_axis.z *= -1.0;
plane.value = PlaneType::Uninit; plane.value = PlaneType::Uninit;
plane.id = exec_state.next_uuid(); plane.id = exec_state.next_uuid();
@ -2646,15 +2649,7 @@ p2 = -p
.get_from("p2", result.mem_env, SourceRange::default(), 0) .get_from("p2", result.mem_env, SourceRange::default(), 0)
.unwrap() .unwrap()
{ {
KclValue::Plane { value } => { KclValue::Plane { value } => assert_eq!(value.z_axis.z, -1.0),
// The negation implementation only changes the plane type to Uninit
// and updates the id, but doesn't actually negate any vectors
assert_eq!(value.value, PlaneType::Uninit);
// Calculate z-axis as cross product to verify it's still the same direction
let z_axis = value.x_axis.cross(&value.y_axis);
assert_eq!(z_axis.z, 1.0)
},
_ => unreachable!(), _ => unreachable!(),
} }
} }

View File

@ -262,15 +262,14 @@ pub struct Plane {
pub x_axis: Point3d, pub x_axis: Point3d,
/// What should the plane's Y axis be? /// What should the plane's Y axis be?
pub y_axis: Point3d, pub y_axis: Point3d,
/// The z-axis (normal).
pub z_axis: Point3d,
#[serde(skip)] #[serde(skip)]
pub meta: Vec<Metadata>, pub meta: Vec<Metadata>,
} }
impl Plane { impl Plane {
pub(crate) fn into_plane_data(self) -> PlaneData { pub(crate) fn into_plane_data(self) -> PlaneData {
crate::log::log(format!("planeTEST!!"));
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("foo=").into());
if self.origin.is_zero() { if self.origin.is_zero() {
match self { match self {
Self { Self {
@ -297,6 +296,13 @@ impl Plane {
z: 0.0, z: 0.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: 0.0,
y: 0.0,
z: 1.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::XY, } => return PlaneData::XY,
Self { Self {
@ -309,7 +315,7 @@ impl Plane {
}, },
x_axis: x_axis:
Point3d { Point3d {
x: -1.0, x: 1.0,
y: 0.0, y: 0.0,
z: 0.0, z: 0.0,
units: UnitLen::Mm, units: UnitLen::Mm,
@ -321,6 +327,13 @@ impl Plane {
z: 0.0, z: 0.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: 0.0,
y: 0.0,
z: -1.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::NegXY, } => return PlaneData::NegXY,
Self { Self {
@ -345,6 +358,13 @@ impl Plane {
z: 1.0, z: 1.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: 0.0,
y: -1.0,
z: 0.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::XZ, } => return PlaneData::XZ,
Self { Self {
@ -357,7 +377,7 @@ impl Plane {
}, },
x_axis: x_axis:
Point3d { Point3d {
x: -1.0, x: 1.0,
y: 0.0, y: 0.0,
z: 0.0, z: 0.0,
units: UnitLen::Mm, units: UnitLen::Mm,
@ -369,6 +389,13 @@ impl Plane {
z: 1.0, z: 1.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: 0.0,
y: 1.0,
z: 0.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::NegXZ, } => return PlaneData::NegXZ,
Self { Self {
@ -393,6 +420,13 @@ impl Plane {
z: 1.0, z: 1.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: 1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::YZ, } => return PlaneData::YZ,
Self { Self {
@ -406,7 +440,7 @@ impl Plane {
x_axis: x_axis:
Point3d { Point3d {
x: 0.0, x: 0.0,
y: -1.0, y: 1.0,
z: 0.0, z: 0.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
@ -417,6 +451,13 @@ impl Plane {
z: 1.0, z: 1.0,
units: UnitLen::Mm, units: UnitLen::Mm,
}, },
z_axis:
Point3d {
x: -1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
.. ..
} => return PlaneData::NegYZ, } => return PlaneData::NegYZ,
_ => {} _ => {}
@ -427,13 +468,12 @@ impl Plane {
origin: self.origin, origin: self.origin,
x_axis: self.x_axis, x_axis: self.x_axis,
y_axis: self.y_axis, y_axis: self.y_axis,
z_axis: self.z_axis,
} }
} }
pub(crate) fn from_plane_data(value: PlaneData, exec_state: &mut ExecState) -> Self { pub(crate) fn from_plane_data(value: PlaneData, exec_state: &mut ExecState) -> Self {
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("value: {:?}", value).into());
match value { match value {
PlaneData::XY => Plane { PlaneData::XY => Plane {
id, id,
@ -441,6 +481,7 @@ impl Plane {
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
z_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
value: PlaneType::XY, value: PlaneType::XY,
meta: vec![], meta: vec![],
}, },
@ -448,9 +489,10 @@ impl Plane {
id, id,
artifact_id: id.into(), artifact_id: id.into(),
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
value: PlaneType::NegXY, z_axis: Point3d::new(0.0, 0.0, -1.0, UnitLen::Mm),
value: PlaneType::XY,
meta: vec![], meta: vec![],
}, },
PlaneData::XZ => Plane { PlaneData::XZ => Plane {
@ -459,6 +501,7 @@ impl Plane {
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
z_axis: Point3d::new(0.0, -1.0, 0.0, UnitLen::Mm),
value: PlaneType::XZ, value: PlaneType::XZ,
meta: vec![], meta: vec![],
}, },
@ -468,7 +511,8 @@ impl Plane {
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
value: PlaneType::NegXZ, z_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
value: PlaneType::XZ,
meta: vec![], meta: vec![],
}, },
PlaneData::YZ => Plane { PlaneData::YZ => Plane {
@ -477,6 +521,7 @@ impl Plane {
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
z_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm),
value: PlaneType::YZ, value: PlaneType::YZ,
meta: vec![], meta: vec![],
}, },
@ -484,15 +529,17 @@ impl Plane {
id, id,
artifact_id: id.into(), artifact_id: id.into(),
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm), origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(0.0, -1.0, 0.0, UnitLen::Mm), x_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm), y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
value: PlaneType::NegYZ, z_axis: Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
value: PlaneType::YZ,
meta: vec![], meta: vec![],
}, },
PlaneData::Plane { PlaneData::Plane {
origin, origin,
x_axis, x_axis,
y_axis, y_axis,
z_axis,
} => { } => {
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
Plane { Plane {
@ -501,6 +548,7 @@ impl Plane {
origin, origin,
x_axis, x_axis,
y_axis, y_axis,
z_axis,
value: PlaneType::Custom, value: PlaneType::Custom,
meta: vec![], meta: vec![],
} }
@ -546,21 +594,12 @@ pub enum PlaneType {
#[serde(rename = "XY", alias = "xy")] #[serde(rename = "XY", alias = "xy")]
#[display("XY")] #[display("XY")]
XY, XY,
#[serde(rename = "-XY", alias = "-xy")]
#[display("-XY")]
NegXY,
#[serde(rename = "XZ", alias = "xz")] #[serde(rename = "XZ", alias = "xz")]
#[display("XZ")] #[display("XZ")]
XZ, XZ,
#[serde(rename = "-XZ", alias = "-xz")]
#[display("-XZ")]
NegXZ,
#[serde(rename = "YZ", alias = "yz")] #[serde(rename = "YZ", alias = "yz")]
#[display("YZ")] #[display("YZ")]
YZ, YZ,
#[serde(rename = "-YZ", alias = "-yz")]
#[display("-YZ")]
NegYZ,
/// A custom plane. /// A custom plane.
#[display("Custom")] #[display("Custom")]
Custom, Custom,
@ -617,12 +656,8 @@ impl Sketch {
adjust_camera: false, adjust_camera: false,
planar_normal: if let SketchSurface::Plane(plane) = &self.on { planar_normal: if let SketchSurface::Plane(plane) = &self.on {
// We pass in the normal for the plane here. // We pass in the normal for the plane here.
let z_axis = Some(plane.x_axis.cross(&plane.y_axis).into()); Some(plane.z_axis.into())
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("plane normal geo: {:?}, x_axis: {:?}, y_axis: {:?}", z_axis, plane.x_axis, plane.y_axis).into());
z_axis
} else { } else {
crate::log::log(format!("no Plane normal"));
None None
}, },
}), }),
@ -667,7 +702,7 @@ impl SketchSurface {
} }
pub(crate) fn z_axis(&self) -> Point3d { pub(crate) fn z_axis(&self) -> Point3d {
match self { match self {
SketchSurface::Plane(plane) => plane.x_axis.cross(&plane.y_axis), SketchSurface::Plane(plane) => plane.z_axis,
SketchSurface::Face(face) => face.z_axis, SketchSurface::Face(face) => face.z_axis,
} }
} }
@ -894,16 +929,6 @@ impl Point3d {
pub const fn is_zero(&self) -> bool { pub const fn is_zero(&self) -> bool {
self.x == 0.0 && self.y == 0.0 && self.z == 0.0 self.x == 0.0 && self.y == 0.0 && self.z == 0.0
} }
/// Calculate the cross product of this vector with another
pub fn cross(&self, other: &Self) -> Self {
Self {
x: self.y * other.z - self.z * other.y,
y: self.z * other.x - self.x * other.z,
z: self.x * other.y - self.y * other.x,
units: self.units,
}
}
} }
impl From<[TyF64; 3]> for Point3d { impl From<[TyF64; 3]> for Point3d {

View File

@ -1820,18 +1820,6 @@ const bracket = startSketchOn(XY)
parse_execute(ast).await.unwrap(); parse_execute(ast).await.unwrap();
} }
#[tokio::test(flavor = "multi_thread")]
async fn test_bad_arg_count_std() {
let ast = "startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> profileStartX()";
assert!(parse_execute(ast)
.await
.unwrap_err()
.message()
.contains("Expected a sketch argument"));
}
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn test_unary_operator_not_succeeds() { async fn test_unary_operator_not_succeeds() {
let ast = r#" let ast = r#"

View File

@ -1043,6 +1043,10 @@ impl KclValue {
.get("yAxis") .get("yAxis")
.and_then(Point3d::from_kcl_val) .and_then(Point3d::from_kcl_val)
.ok_or(CoercionError::from(self))?; .ok_or(CoercionError::from(self))?;
let z_axis = value
.get("zAxis")
.and_then(Point3d::from_kcl_val)
.ok_or(CoercionError::from(self))?;
let id = exec_state.mod_local.id_generator.next_uuid(); let id = exec_state.mod_local.id_generator.next_uuid();
let plane = Plane { let plane = Plane {
@ -1051,6 +1055,7 @@ impl KclValue {
origin, origin,
x_axis, x_axis,
y_axis, y_axis,
z_axis,
value: super::PlaneType::Uninit, value: super::PlaneType::Uninit,
meta: meta.clone(), meta: meta.clone(),
}; };

View File

@ -43,5 +43,5 @@ async fn main() {
.await .await
.unwrap(); .unwrap();
let mut exec_state = ExecState::new(&ctx); let mut exec_state = ExecState::new(&ctx);
ctx.run(&program, &mut exec_state).await.map_err(|e| e.error).unwrap(); ctx.run(&program, &mut exec_state).await.unwrap();
} }

View File

@ -2074,6 +2074,7 @@ fn possible_operands(i: &mut TokenSlice) -> PResult<Expr> {
member_expression.map(Box::new).map(Expr::MemberExpression), member_expression.map(Box::new).map(Expr::MemberExpression),
literal.map(Expr::Literal), literal.map(Expr::Literal),
fn_call.map(Box::new).map(Expr::CallExpression), fn_call.map(Box::new).map(Expr::CallExpression),
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
name.map(Box::new).map(Expr::Name), name.map(Box::new).map(Expr::Name),
binary_expr_in_parens.map(Box::new).map(Expr::BinaryExpression), binary_expr_in_parens.map(Box::new).map(Expr::BinaryExpression),
unnecessarily_bracketed, unnecessarily_bracketed,
@ -3254,6 +3255,14 @@ mod tests {
assert_eq!(err.message, "Unexpected end of file. The compiler expected )"); assert_eq!(err.message, "Unexpected end of file. The compiler expected )");
} }
#[test]
fn kw_call_as_operand() {
let tokens = crate::parsing::token::lex("f(x = 1)", ModuleId::default()).unwrap();
let tokens = tokens.as_slice();
let op = operand.parse(tokens).unwrap();
println!("{op:#?}");
}
#[test] #[test]
fn weird_program_just_a_pipe() { fn weird_program_just_a_pipe() {
let tokens = crate::parsing::token::lex("|", ModuleId::default()).unwrap(); let tokens = crate::parsing::token::lex("|", ModuleId::default()).unwrap();
@ -5389,6 +5398,7 @@ my14 = 4 ^ 2 - 3 ^ 2 * 2
bar = x, bar = x,
)"# )"#
); );
snapshot_test!(kw_function_in_binary_op, r#"val = f(x = 1) + 1"#);
} }
#[allow(unused)] #[allow(unused)]

View File

@ -0,0 +1,99 @@
---
source: kcl-lib/src/parsing/parser.rs
expression: actual
---
{
"body": [
{
"commentStart": 0,
"declaration": {
"commentStart": 0,
"end": 18,
"id": {
"commentStart": 0,
"end": 3,
"name": "val",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 6,
"end": 18,
"left": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 8,
"end": 9,
"name": "x",
"start": 8,
"type": "Identifier"
},
"arg": {
"commentStart": 12,
"end": 13,
"raw": "1",
"start": 12,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
}
],
"callee": {
"abs_path": false,
"commentStart": 6,
"end": 7,
"name": {
"commentStart": 6,
"end": 7,
"name": "f",
"start": 6,
"type": "Identifier"
},
"path": [],
"start": 6,
"type": "Name"
},
"commentStart": 6,
"end": 14,
"start": 6,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
"operator": "+",
"right": {
"commentStart": 17,
"end": 18,
"raw": "1",
"start": 17,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 6,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 18,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"commentStart": 0,
"end": 18,
"start": 0
}

View File

@ -675,28 +675,6 @@ impl Args {
Ok((sketches, sketch)) Ok((sketches, sketch))
} }
pub(crate) fn get_sketch(&self, exec_state: &mut ExecState) -> Result<Sketch, KclError> {
let Some(arg0) = self.args.first() else {
return Err(KclError::Semantic(KclErrorDetails {
message: "Expected a sketch argument".to_owned(),
source_ranges: vec![self.source_range],
}));
};
let sarg = arg0
.value
.coerce(&RuntimeType::Primitive(PrimitiveType::Sketch), exec_state)
.map_err(|_| {
KclError::Type(KclErrorDetails {
message: format!("Expected a sketch, found {}", arg0.value.human_friendly_type()),
source_ranges: vec![self.source_range],
})
})?;
match sarg {
KclValue::Sketch { value } => Ok(*value),
_ => unreachable!(),
}
}
pub(crate) fn get_data<'a, T>(&'a self) -> Result<T, KclError> pub(crate) fn get_data<'a, T>(&'a self) -> Result<T, KclError>
where where
T: FromArgs<'a>, T: FromArgs<'a>,
@ -708,49 +686,6 @@ impl Args {
FromArgs::from_args(self, 0) FromArgs::from_args(self, 0)
} }
pub(crate) fn get_length_and_solid(&self, exec_state: &mut ExecState) -> Result<(TyF64, Box<Solid>), KclError> {
let Some(arg0) = self.args.first() else {
return Err(KclError::Semantic(KclErrorDetails {
message: "Expected a `number(Length)` for first argument".to_owned(),
source_ranges: vec![self.source_range],
}));
};
let val0 = arg0.value.coerce(&RuntimeType::length(), exec_state).map_err(|_| {
KclError::Type(KclErrorDetails {
message: format!(
"Expected a `number(Length)` for first argument, found {}",
arg0.value.human_friendly_type()
),
source_ranges: vec![self.source_range],
})
})?;
let data = TyF64::from_kcl_val(&val0).unwrap();
let Some(arg1) = self.args.get(1) else {
return Err(KclError::Semantic(KclErrorDetails {
message: "Expected a solid for second argument".to_owned(),
source_ranges: vec![self.source_range],
}));
};
let sarg = arg1
.value
.coerce(&RuntimeType::Primitive(PrimitiveType::Solid), exec_state)
.map_err(|_| {
KclError::Type(KclErrorDetails {
message: format!(
"Expected a solid for second argument, found {}",
arg1.value.human_friendly_type()
),
source_ranges: vec![self.source_range],
})
})?;
let solid = match sarg {
KclValue::Solid { value } => value,
_ => unreachable!(),
};
Ok((data, solid))
}
pub(crate) fn get_tag_to_number_sketch(&self) -> Result<(TagIdentifier, TyF64, Sketch), KclError> { pub(crate) fn get_tag_to_number_sketch(&self) -> Result<(TagIdentifier, TyF64, Sketch), KclError> {
FromArgs::from_args(self, 0) FromArgs::from_args(self, 0)
} }
@ -1032,26 +967,7 @@ impl<'a> FromKclValue<'a> for crate::execution::PlaneType {
"Custom" => Self::Custom, "Custom" => Self::Custom,
_ => return None, _ => return None,
}; };
#[cfg(target_arch = "wasm32")] Some(plane_type)
web_sys::console::log_1(&format!("PlaneData::from_kcl_val with string: {}", arg.as_str()?).into());
return match plane_type {
Self::XY => {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val matching XY").into());
Some(Self::XY)
},
Self::NegXY => {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val matching -XY").into());
Some(Self::NegXY)
},
Self::XZ => Some(Self::XZ),
Self::NegXZ => Some(Self::NegXZ),
Self::YZ => Some(Self::YZ),
Self::NegYZ => Some(Self::NegYZ),
_ => None,
};
} }
} }
@ -1167,30 +1083,18 @@ impl<'a> FromKclValue<'a> for super::sketch::PlaneData {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> { fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
// Case 0: actual plane // Case 0: actual plane
if let KclValue::Plane { value } = arg { if let KclValue::Plane { value } = arg {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val with plane: {:?}", value).into());
return Some(Self::Plane { return Some(Self::Plane {
origin: value.origin, origin: value.origin,
x_axis: value.x_axis, x_axis: value.x_axis,
y_axis: value.y_axis, y_axis: value.y_axis,
z_axis: value.z_axis,
}); });
} }
// Case 1: predefined plane // Case 1: predefined plane
if let Some(s) = arg.as_str() { if let Some(s) = arg.as_str() {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val with string: {}", s).into());
return match s { return match s {
"XY" | "xy" => { "XY" | "xy" => Some(Self::XY),
#[cfg(target_arch = "wasm32")] "-XY" | "-xy" => Some(Self::NegXY),
web_sys::console::log_1(&format!("PlaneData::from_kcl_val matching XY").into());
Some(Self::XY)
},
"-XY" | "-xy" => {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val matching -XY").into());
Some(Self::NegXY)
},
"XZ" | "xz" => Some(Self::XZ), "XZ" | "xz" => Some(Self::XZ),
"-XZ" | "-xz" => Some(Self::NegXZ), "-XZ" | "-xz" => Some(Self::NegXZ),
"YZ" | "yz" => Some(Self::YZ), "YZ" | "yz" => Some(Self::YZ),
@ -1198,18 +1102,18 @@ impl<'a> FromKclValue<'a> for super::sketch::PlaneData {
_ => None, _ => None,
}; };
} }
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("PlaneData::from_kcl_val with object: {:?}", arg).into());
// Case 2: custom plane // Case 2: custom plane
let obj = arg.as_object()?; let obj = arg.as_object()?;
let_field_of!(obj, plane, &KclObjectFields); let_field_of!(obj, plane, &KclObjectFields);
let origin = plane.get("origin").and_then(FromKclValue::from_kcl_val)?; let origin = plane.get("origin").and_then(FromKclValue::from_kcl_val)?;
let x_axis = plane.get("xAxis").and_then(FromKclValue::from_kcl_val)?; let x_axis = plane.get("xAxis").and_then(FromKclValue::from_kcl_val)?;
let y_axis = plane.get("yAxis").and_then(FromKclValue::from_kcl_val)?; let y_axis = plane.get("yAxis").and_then(FromKclValue::from_kcl_val)?;
let z_axis = plane.get("zAxis").and_then(FromKclValue::from_kcl_val)?;
Some(Self::Plane { Some(Self::Plane {
origin, origin,
x_axis, x_axis,
y_axis, y_axis,
z_axis,
}) })
} }
} }

View File

@ -107,6 +107,7 @@ lazy_static! {
Box::new(crate::std::shell::Hollow), Box::new(crate::std::shell::Hollow),
Box::new(crate::std::sweep::Sweep), Box::new(crate::std::sweep::Sweep),
Box::new(crate::std::loft::Loft), Box::new(crate::std::loft::Loft),
Box::new(crate::std::planes::OffsetPlane),
Box::new(crate::std::math::Acos), Box::new(crate::std::math::Acos),
Box::new(crate::std::math::Asin), Box::new(crate::std::math::Asin),
Box::new(crate::std::math::Atan), Box::new(crate::std::math::Atan),
@ -204,10 +205,6 @@ pub(crate) fn std_fn(path: &str, fn_name: &str) -> (crate::std::StdFn, StdFnProp
|e, a| Box::pin(crate::std::revolve::revolve(e, a)), |e, a| Box::pin(crate::std::revolve::revolve(e, a)),
StdFnProps::default("std::revolve").include_in_feature_tree(), StdFnProps::default("std::revolve").include_in_feature_tree(),
), ),
("prelude", "offsetPlane") => (
|e, a| Box::pin(crate::std::planes::offset_plane(e, a)),
StdFnProps::default("std::offsetPlane").include_in_feature_tree(),
),
_ => unreachable!(), _ => unreachable!(),
} }
} }

View File

@ -1,5 +1,6 @@
//! Standard library plane helpers. //! Standard library plane helpers.
use kcl_derive_docs::stdlib;
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Color, ModelingCmd}; use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Color, ModelingCmd};
use kittycad_modeling_cmds as kcmc; use kittycad_modeling_cmds as kcmc;
@ -18,6 +19,98 @@ pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclV
Ok(KclValue::Plane { value: Box::new(plane) }) Ok(KclValue::Plane { value: Box::new(plane) })
} }
/// Offset a plane by a distance along its normal.
///
/// For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ'
/// plane and 10 units away from it.
///
/// ```no_run
/// // Loft a square and a circle on the `XY` plane using offset.
/// squareSketch = startSketchOn('XY')
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane('XY', offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```no_run
/// // Loft a square and a circle on the `XZ` plane using offset.
/// squareSketch = startSketchOn('XZ')
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane('XZ', offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```no_run
/// // Loft a square and a circle on the `YZ` plane using offset.
/// squareSketch = startSketchOn('YZ')
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane('YZ', offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```no_run
/// // Loft a square and a circle on the `-XZ` plane using offset.
/// squareSketch = startSketchOn('-XZ')
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane('-XZ', offset = -150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
/// ```no_run
/// // A circle on the XY plane
/// startSketchOn("XY")
/// |> startProfileAt([0, 0], %)
/// |> circle( radius = 10, center = [0, 0] )
///
/// // Triangle on the plane 4 units above
/// startSketchOn(offsetPlane("XY", offset = 4))
/// |> startProfileAt([0, 0], %)
/// |> line(end = [10, 0])
/// |> line(end = [0, 10])
/// |> close()
/// ```
#[stdlib {
name = "offsetPlane",
feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
plane = { docs = "The plane (e.g. XY) which this new plane is created from." },
offset = { docs = "Distance from the standard plane this new plane will be created at." },
}
}]
async fn inner_offset_plane( async fn inner_offset_plane(
plane: PlaneData, plane: PlaneData,
offset: TyF64, offset: TyF64,
@ -29,10 +122,7 @@ async fn inner_offset_plane(
// standard planes themselves. // standard planes themselves.
plane.value = PlaneType::Custom; plane.value = PlaneType::Custom;
// Calculate z_axis as the cross product of x_axis and y_axis plane.origin += plane.z_axis * offset.to_length_units(plane.origin.units);
let z_axis = plane.x_axis.cross(&plane.y_axis);
plane.origin += z_axis * offset.to_length_units(plane.origin.units);
make_offset_plane_in_engine(&plane, exec_state, args).await?; make_offset_plane_in_engine(&plane, exec_state, args).await?;
Ok(plane) Ok(plane)

View File

@ -247,9 +247,10 @@ async fn inner_shell(
/// Make the inside of a 3D object hollow. /// Make the inside of a 3D object hollow.
pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (thickness, solid) = args.get_length_and_solid(exec_state)?; let solid = args.get_unlabeled_kw_arg_typed("solid", &RuntimeType::solid(), exec_state)?;
let thickness: TyF64 = args.get_kw_arg_typed("thickness", &RuntimeType::length(), exec_state)?;
let value = inner_hollow(thickness, solid, exec_state, args).await?; let value = inner_hollow(solid, thickness, exec_state, args).await?;
Ok(KclValue::Solid { value }) Ok(KclValue::Solid { value })
} }
@ -267,7 +268,7 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> line(end = [-24, 0]) /// |> line(end = [-24, 0])
/// |> close() /// |> close()
/// |> extrude(length = 6) /// |> extrude(length = 6)
/// |> hollow (0.25, %) /// |> hollow(thickness = 0.25)
/// ``` /// ```
/// ///
/// ```no_run /// ```no_run
@ -279,7 +280,7 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> line(end = [-24, 0]) /// |> line(end = [-24, 0])
/// |> close() /// |> close()
/// |> extrude(length = 6) /// |> extrude(length = 6)
/// |> hollow (0.5, %) /// |> hollow(thickness = 0.5)
/// ``` /// ```
/// ///
/// ```no_run /// ```no_run
@ -301,15 +302,21 @@ pub async fn hollow(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> circle( center = [size / 2, -size / 2], radius = 25 ) /// |> circle( center = [size / 2, -size / 2], radius = 25 )
/// |> extrude(length = 50) /// |> extrude(length = 50)
/// ///
/// hollow(0.5, case) /// hollow(case, thickness = 0.5)
/// ``` /// ```
#[stdlib { #[stdlib {
name = "hollow", name = "hollow",
feature_tree_operation = true, feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solid = { docs = "Which solid to shell out" },
thickness = {docs = "The thickness of the shell" },
}
}] }]
async fn inner_hollow( async fn inner_hollow(
thickness: TyF64,
solid: Box<Solid>, solid: Box<Solid>,
thickness: TyF64,
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Box<Solid>, KclError> { ) -> Result<Box<Solid>, KclError> {

View File

@ -13,7 +13,6 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::utils::{point_to_len_unit, point_to_mm, untype_point, untyped_point_to_mm}; use super::utils::{point_to_len_unit, point_to_mm, untype_point, untyped_point_to_mm};
use crate::log;
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
execution::{ execution::{
@ -961,6 +960,9 @@ pub enum PlaneData {
/// What should the planes Y axis be? /// What should the planes Y axis be?
#[serde(rename = "yAxis")] #[serde(rename = "yAxis")]
y_axis: Point3d, y_axis: Point3d,
/// The z-axis (normal).
#[serde(rename = "zAxis")]
z_axis: Point3d,
}, },
} }
@ -971,15 +973,6 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
&RuntimeType::Union(vec![RuntimeType::solid(), RuntimeType::plane()]), &RuntimeType::Union(vec![RuntimeType::solid(), RuntimeType::plane()]),
exec_state, exec_state,
)?; )?;
#[cfg(target_arch = "wasm32")]
if let SketchData::PlaneOrientation(plane_data) = &data {
web_sys::console::log_1(&format!("start_sketch_on called with plane_data={:?}", plane_data).into());
}
// log out args
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("start_sketch_on called with args={:?}", args).into());
let face = args.get_kw_arg_opt("face")?; let face = args.get_kw_arg_opt("face")?;
match inner_start_sketch_on(data, face, exec_state, &args).await? { match inner_start_sketch_on(data, face, exec_state, &args).await? {
@ -1178,13 +1171,8 @@ async fn inner_start_sketch_on(
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: &Args, args: &Args,
) -> Result<SketchSurface, KclError> { ) -> Result<SketchSurface, KclError> {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("inner_start_sketch_on with plane_or_solid={:?}", plane_or_solid).into());
match plane_or_solid { match plane_or_solid {
SketchData::PlaneOrientation(plane_data) => { SketchData::PlaneOrientation(plane_data) => {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("inner_start_sketch_on PlaneOrientation case with plane_data={:?}", plane_data).into());
let plane = make_sketch_plane_from_orientation(plane_data, exec_state, args).await?; let plane = make_sketch_plane_from_orientation(plane_data, exec_state, args).await?;
Ok(SketchSurface::Plane(plane)) Ok(SketchSurface::Plane(plane))
} }
@ -1253,46 +1241,40 @@ async fn make_sketch_plane_from_orientation(
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: &Args, args: &Args,
) -> Result<Box<Plane>, KclError> { ) -> Result<Box<Plane>, KclError> {
#[cfg(target_arch = "wasm32")] let plane = Plane::from_plane_data(data.clone(), exec_state);
web_sys::console::log_1(&format!("make_sketch_plane_from_orientation called with data={:?}", data).into());
let mut plane = Plane::from_plane_data(data.clone(), exec_state);
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("After from_plane_data: plane.x_axis={:?}, plane type={:?}", plane.x_axis, plane.value).into());
// Create the plane on the fly. // Create the plane on the fly.
let clobber = false; let clobber = false;
let size = LengthUnit(60.0); let size = LengthUnit(60.0);
let hide = Some(true); let hide = Some(true);
match data { match data {
PlaneData::XY | PlaneData::NegXY | PlaneData::XZ | PlaneData::NegXZ | PlaneData::YZ | PlaneData::NegYZ => { PlaneData::XY | PlaneData::NegXY | PlaneData::XZ | PlaneData::NegXZ | PlaneData::YZ | PlaneData::NegYZ => {
// Use the x_axis directly from the plane object created by from_plane_data // TODO: ignoring the default planes here since we already created them, breaks the
// No need to recompute it here as it's already correctly set based on the plane type // front end for the feature tree which is stupid and we should fix it.
let x_axis = match data {
#[cfg(target_arch = "wasm32")] PlaneData::NegXY => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
web_sys::console::log_1(&format!("Before modeling cmd: data={:?}, plane.x_axis={:?}", data, plane.x_axis).into()); PlaneData::NegXZ => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
PlaneData::NegYZ => Point3d::new(0.0, -1.0, 0.0, UnitLen::Mm),
_ => plane.x_axis,
};
args.batch_modeling_cmd( args.batch_modeling_cmd(
plane.id, plane.id,
ModelingCmd::from(mcmd::MakePlane { ModelingCmd::from(mcmd::MakePlane {
clobber, clobber,
origin: plane.origin.into(), origin: plane.origin.into(),
size, size,
x_axis: plane.x_axis.into(), x_axis: x_axis.into(),
y_axis: plane.y_axis.into(), y_axis: plane.y_axis.into(),
hide, hide,
}), }),
) )
.await?; .await?;
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("After modeling cmd: plane.x_axis={:?}", plane.x_axis).into());
} }
PlaneData::Plane { PlaneData::Plane {
origin, origin,
x_axis, x_axis,
y_axis, y_axis,
z_axis: _,
} => { } => {
args.batch_modeling_cmd( args.batch_modeling_cmd(
plane.id, plane.id,
@ -1309,8 +1291,6 @@ async fn make_sketch_plane_from_orientation(
} }
} }
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("Returning plane with x_axis={:?}", plane.x_axis).into());
Ok(Box::new(plane)) Ok(Box::new(plane))
} }
@ -1404,16 +1384,8 @@ pub(crate) async fn inner_start_profile_at(
adjust_camera: false, adjust_camera: false,
planar_normal: if let SketchSurface::Plane(plane) = &sketch_surface { planar_normal: if let SketchSurface::Plane(plane) = &sketch_surface {
// We pass in the normal for the plane here. // We pass in the normal for the plane here.
let z_axis = Some(plane.x_axis.cross(&plane.y_axis).into()); Some(plane.z_axis.into())
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("Calculating planar_normal: plane.x_axis={:?}, plane.y_axis={:?}, z_axis={:?}",
plane.x_axis, plane.y_axis, z_axis).into());
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("plane normal sketch: {:?}, x_axis: {:?}, y_axis: {:?}", z_axis, plane.x_axis, plane.y_axis).into());
z_axis
} else { } else {
#[cfg(target_arch = "wasm32")]
web_sys::console::log_1(&format!("no Plane normal").into());
None None
}, },
}), }),
@ -1482,7 +1454,7 @@ pub(crate) async fn inner_start_profile_at(
/// Returns the X component of the sketch profile start point. /// Returns the X component of the sketch profile start point.
pub async fn profile_start_x(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn profile_start_x(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let sketch: Sketch = args.get_sketch(exec_state)?; let sketch: Sketch = args.get_unlabeled_kw_arg_typed("sketch", &RuntimeType::sketch(), exec_state)?;
let ty = sketch.units.into(); let ty = sketch.units.into();
let x = inner_profile_start_x(sketch)?; let x = inner_profile_start_x(sketch)?;
Ok(args.make_user_val_from_f64_with_type(TyF64::new(x, ty))) Ok(args.make_user_val_from_f64_with_type(TyF64::new(x, ty)))
@ -1499,15 +1471,20 @@ pub async fn profile_start_x(exec_state: &mut ExecState, args: Args) -> Result<K
/// |> angledLine(angle = 30, endAbsoluteX = profileStartX(%)) /// |> angledLine(angle = 30, endAbsoluteX = profileStartX(%))
/// ``` /// ```
#[stdlib { #[stdlib {
name = "profileStartX" name = "profileStartX",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
}
}] }]
pub(crate) fn inner_profile_start_x(sketch: Sketch) -> Result<f64, KclError> { pub(crate) fn inner_profile_start_x(profile: Sketch) -> Result<f64, KclError> {
Ok(sketch.start.to[0]) Ok(profile.start.to[0])
} }
/// Returns the Y component of the sketch profile start point. /// Returns the Y component of the sketch profile start point.
pub async fn profile_start_y(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn profile_start_y(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let sketch: Sketch = args.get_sketch(exec_state)?; let sketch: Sketch = args.get_unlabeled_kw_arg_typed("sketch", &RuntimeType::sketch(), exec_state)?;
let ty = sketch.units.into(); let ty = sketch.units.into();
let x = inner_profile_start_y(sketch)?; let x = inner_profile_start_y(sketch)?;
Ok(args.make_user_val_from_f64_with_type(TyF64::new(x, ty))) Ok(args.make_user_val_from_f64_with_type(TyF64::new(x, ty)))
@ -1523,15 +1500,20 @@ pub async fn profile_start_y(exec_state: &mut ExecState, args: Args) -> Result<K
/// |> angledLine(angle = 30, endAbsoluteY = profileStartY(%)) /// |> angledLine(angle = 30, endAbsoluteY = profileStartY(%))
/// ``` /// ```
#[stdlib { #[stdlib {
name = "profileStartY" name = "profileStartY",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
}
}] }]
pub(crate) fn inner_profile_start_y(sketch: Sketch) -> Result<f64, KclError> { pub(crate) fn inner_profile_start_y(profile: Sketch) -> Result<f64, KclError> {
Ok(sketch.start.to[1]) Ok(profile.start.to[1])
} }
/// Returns the sketch profile start point. /// Returns the sketch profile start point.
pub async fn profile_start(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn profile_start(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let sketch: Sketch = args.get_sketch(exec_state)?; let sketch: Sketch = args.get_unlabeled_kw_arg_typed("sketch", &RuntimeType::sketch(), exec_state)?;
let ty = sketch.units.into(); let ty = sketch.units.into();
let point = inner_profile_start(sketch)?; let point = inner_profile_start(sketch)?;
Ok(KclValue::from_point2d(point, ty, args.into())) Ok(KclValue::from_point2d(point, ty, args.into()))
@ -1550,10 +1532,15 @@ pub async fn profile_start(exec_state: &mut ExecState, args: Args) -> Result<Kcl
/// |> extrude(length = 20) /// |> extrude(length = 20)
/// ``` /// ```
#[stdlib { #[stdlib {
name = "profileStart" name = "profileStart",
keywords = true,
unlabeled_first = true,
args = {
profile = {docs = "Profile whose start is being used"},
}
}] }]
pub(crate) fn inner_profile_start(sketch: Sketch) -> Result<[f64; 2], KclError> { pub(crate) fn inner_profile_start(profile: Sketch) -> Result<[f64; 2], KclError> {
Ok(sketch.start.to) Ok(profile.start.to)
} }
/// Close the current sketch. /// Close the current sketch.

View File

@ -449,93 +449,3 @@ export fn toRadians(@num: number(rad)): number(rad) {
export fn toDegrees(@num: number(deg)): number(deg) { export fn toDegrees(@num: number(deg)): number(deg) {
return num return num
} }
/// Offset a plane by a distance along its normal.
///
/// For example, if you offset the `XZ` plane by 10, the new plane will be parallel to the `XZ`
/// plane and 10 units away from it.
///
/// ```
/// // Loft a square and a circle on the `XY` plane using offset.
/// squareSketch = startSketchOn(XY)
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane(XY, offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```
/// // Loft a square and a circle on the `XZ` plane using offset.
/// squareSketch = startSketchOn(XZ)
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane(XZ, offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```
/// // Loft a square and a circle on the `YZ` plane using offset.
/// squareSketch = startSketchOn(YZ)
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane(YZ, offset = 150))
/// |> circle( center = [0, 100], radius = 50 )
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```
/// // Loft a square and a circle on the `-XZ` plane using offset.
/// squareSketch = startSketchOn(-XZ)
/// |> startProfileAt([-100, 200], %)
/// |> line(end = [200, 0])
/// |> line(end = [0, -200])
/// |> line(end = [-200, 0])
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
/// |> close()
///
/// circleSketch = startSketchOn(offsetPlane(-XZ, offset = 150))
/// |> circle(center = [0, 100], radius = 50)
///
/// loft([squareSketch, circleSketch])
/// ```
///
/// ```
/// // A circle on the XY plane
/// startSketchOn(XY)
/// |> startProfileAt([0, 0], %)
/// |> circle( radius = 10, center = [0, 0] )
///
/// // Triangle on the plane 4 units above
/// startSketchOn(offsetPlane(XY, offset = 4))
/// |> startProfileAt([0, 0], %)
/// |> line(end = [10, 0])
/// |> line(end = [0, 10])
/// |> close()
/// ```
@(impl = std_rust)
export fn offsetPlane(
/// The plane (e.g. `XY`) which this new plane is created from.
@plane: Plane,
/// Distance from the standard plane this new plane will be created at.
offset: number(Length),
): Plane {}

View File

@ -184,7 +184,7 @@ description: Artifact commands artifact_graph_example_code_no_3d.kcl
"z": 0.0 "z": 0.0
}, },
"x_axis": { "x_axis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },

View File

@ -303,7 +303,7 @@ description: Variables in memory after executing artifact_graph_example_code_no_
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -4,15 +4,6 @@ description: Operations executed artifact_graph_example_code_offset_planes.kcl
--- ---
[ [
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "String",
"value": "XY"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -31,18 +22,18 @@ description: Operations executed artifact_graph_example_code_offset_planes.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "String", "type": "String",
"value": "XZ" "value": "XY"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -61,18 +52,18 @@ description: Operations executed artifact_graph_example_code_offset_planes.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "String", "type": "String",
"value": "YZ" "value": "XZ"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -91,7 +82,16 @@ description: Operations executed artifact_graph_example_code_offset_planes.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "String",
"value": "YZ"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -20,20 +20,13 @@ description: Result of parsing crazy_multi_profile.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"abs_path": false,
"commentStart": 0, "commentStart": 0,
"end": 0, "end": 0,
"name": { "raw": "'XZ'",
"commentStart": 0,
"end": 0,
"name": "XZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0, "start": 0,
"type": "Name", "type": "Literal",
"type": "Name" "type": "Literal",
"value": "XZ"
} }
], ],
"callee": { "callee": {
@ -2568,28 +2561,13 @@ description: Result of parsing crazy_multi_profile.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"argument": {
"abs_path": false,
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 0,
"end": 0,
"name": "XZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 0, "commentStart": 0,
"end": 0, "end": 0,
"operator": "-", "raw": "'-XZ'",
"start": 0, "start": 0,
"type": "UnaryExpression", "type": "Literal",
"type": "UnaryExpression" "type": "Literal",
"value": "-XZ"
} }
], ],
"callee": { "callee": {

View File

@ -1,4 +1,4 @@
sketch001 = startSketchOn(XZ) sketch001 = startSketchOn('XZ')
profile001 = startProfileAt([6.71, -3.66], sketch001) profile001 = startProfileAt([6.71, -3.66], sketch001)
|> line(end = [2.65, 9.02], tag = $seg02) |> line(end = [2.65, 9.02], tag = $seg02)
|> line(end = [3.73, -9.36], tag = $seg01) |> line(end = [3.73, -9.36], tag = $seg01)
@ -28,7 +28,7 @@ profile006 = startProfileAt([9.65, 3.82], sketch002)
|> close() |> close()
revolve001 = revolve(profile004, angle = 45, axis = getNextAdjacentEdge(seg01)) revolve001 = revolve(profile004, angle = 45, axis = getNextAdjacentEdge(seg01))
extrude002 = extrude(profile006, length = 4) extrude002 = extrude(profile006, length = 4)
sketch003 = startSketchOn(-XZ) sketch003 = startSketchOn('-XZ')
profile007 = startProfileAt([4.8, 7.55], sketch003) profile007 = startProfileAt([4.8, 7.55], sketch003)
|> line(end = [7.39, 2.58]) |> line(end = [7.39, 2.58])
|> line(end = [7.02, -2.85]) |> line(end = [7.02, -2.85])

View File

@ -765,7 +765,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -2756,7 +2756,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -2902,7 +2902,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -3048,7 +3048,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -3143,7 +3143,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -3314,7 +3314,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -3867,7 +3867,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {
@ -4234,7 +4234,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
} }
}, },
"xAxis": { "xAxis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0, "z": 0.0,
"units": { "units": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

@ -40,7 +40,7 @@ description: Artifact commands 80-20-rail.kcl
"z": 0.0 "z": 0.0
}, },
"x_axis": { "x_axis": {
"x": 1.0, "x": -1.0,
"y": 0.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },

View File

@ -371,198 +371,198 @@ flowchart LR
2 --- 67 2 --- 67
2 ---- 72 2 ---- 72
2 --- 68 2 --- 68
3 --- 136 3 --- 73
3 --- 265 3 --- 139
3 --- 266 3 --- 140
4 --- 135 4 --- 74
4 --- 263 4 --- 141
4 --- 264 4 --- 142
5 --- 134 5 --- 75
5 --- 261 5 --- 143
5 --- 262 5 --- 144
6 --- 133 6 --- 76
6 --- 259 6 --- 145
6 --- 260 6 --- 146
7 --- 132 7 --- 77
7 --- 257 7 --- 147
7 --- 258 7 --- 148
8 --- 131 8 --- 78
8 --- 255 8 --- 149
8 --- 256 8 --- 150
9 --- 130 9 --- 79
9 --- 253 9 --- 151
9 --- 254 9 --- 152
10 --- 129 10 --- 80
10 --- 251 10 --- 153
10 --- 252 10 --- 154
11 --- 128 11 --- 81
11 --- 249 11 --- 155
11 --- 250 11 --- 156
12 --- 127 12 --- 82
12 --- 247 12 --- 157
12 --- 248 12 --- 158
13 --- 126 13 --- 83
13 --- 245 13 --- 159
13 --- 246 13 --- 160
14 --- 125 14 --- 84
14 --- 243 14 --- 161
14 --- 244 14 --- 162
15 --- 124 15 --- 85
15 --- 241 15 --- 163
15 --- 242 15 --- 164
16 --- 123 16 --- 86
16 --- 239 16 --- 165
16 --- 240 16 --- 166
17 --- 122 17 --- 87
17 --- 237 17 --- 167
17 --- 238 17 --- 168
18 --- 121 18 --- 88
18 --- 235 18 --- 169
18 --- 236 18 --- 170
19 --- 120 19 --- 89
19 --- 233 19 --- 171
19 --- 234 19 --- 172
20 --- 119 20 --- 90
20 --- 231 20 --- 173
20 --- 232 20 --- 174
21 --- 118 21 --- 91
21 --- 229 21 --- 175
21 --- 230 21 --- 176
22 --- 117 22 --- 92
22 --- 227 22 --- 177
22 --- 228 22 --- 178
23 --- 116 23 --- 93
23 --- 225 23 --- 179
23 --- 226 23 --- 180
24 --- 115 24 --- 94
24 --- 223 24 --- 181
24 --- 224 24 --- 182
25 --- 114 25 --- 95
25 --- 221 25 --- 183
25 --- 222 25 --- 184
26 --- 113 26 --- 96
26 --- 219 26 --- 185
26 --- 220 26 --- 186
27 --- 112 27 --- 97
27 --- 217 27 --- 187
27 --- 218 27 --- 188
28 --- 111 28 --- 98
28 --- 215 28 --- 189
28 --- 216 28 --- 190
29 --- 110 29 --- 99
29 --- 213 29 --- 191
29 --- 214 29 --- 192
30 --- 109 30 --- 100
30 --- 211 30 --- 193
30 --- 212 30 --- 194
31 --- 108 31 --- 101
31 --- 209 31 --- 195
31 --- 210 31 --- 196
32 --- 107 32 --- 102
32 --- 207 32 --- 197
32 --- 208 32 --- 198
33 --- 106 33 --- 103
33 --- 205 33 --- 199
33 --- 206 33 --- 200
34 --- 105 34 --- 104
34 --- 203 34 --- 201
34 --- 204 34 --- 202
35 --- 104 35 --- 105
35 --- 201 35 --- 203
35 --- 202 35 --- 204
36 --- 103 36 --- 106
36 --- 199 36 --- 205
36 --- 200 36 --- 206
37 --- 102 37 --- 107
37 --- 197 37 --- 207
37 --- 198 37 --- 208
38 --- 101 38 --- 108
38 --- 195 38 --- 209
38 --- 196 38 --- 210
39 --- 100 39 --- 109
39 --- 193 39 --- 211
39 --- 194 39 --- 212
40 --- 99 40 --- 110
40 --- 191 40 --- 213
40 --- 192 40 --- 214
41 --- 98 41 --- 111
41 --- 189 41 --- 215
41 --- 190 41 --- 216
42 --- 97 42 --- 112
42 --- 187 42 --- 217
42 --- 188 42 --- 218
43 --- 96 43 --- 113
43 --- 185 43 --- 219
43 --- 186 43 --- 220
44 --- 95 44 --- 114
44 --- 183 44 --- 221
44 --- 184 44 --- 222
45 --- 94 45 --- 115
45 --- 181 45 --- 223
45 --- 182 45 --- 224
46 --- 93 46 --- 116
46 --- 179 46 --- 225
46 --- 180 46 --- 226
47 --- 92 47 --- 117
47 --- 177 47 --- 227
47 --- 178 47 --- 228
48 --- 91 48 --- 118
48 --- 175 48 --- 229
48 --- 176 48 --- 230
49 --- 90 49 --- 119
49 --- 173 49 --- 231
49 --- 174 49 --- 232
50 --- 89 50 --- 120
50 --- 171 50 --- 233
50 --- 172 50 --- 234
51 --- 88 51 --- 121
51 --- 169 51 --- 235
51 --- 170 51 --- 236
52 --- 87 52 --- 122
52 --- 167 52 --- 237
52 --- 168 52 --- 238
53 --- 86 53 --- 123
53 --- 165 53 --- 239
53 --- 166 53 --- 240
54 --- 85 54 --- 124
54 --- 163 54 --- 241
54 --- 164 54 --- 242
55 --- 84 55 --- 125
55 --- 161 55 --- 243
55 --- 162 55 --- 244
56 --- 83 56 --- 126
56 --- 159 56 --- 245
56 --- 160 56 --- 246
57 --- 82 57 --- 127
57 --- 157 57 --- 247
57 --- 158 57 --- 248
58 --- 81 58 --- 128
58 --- 155 58 --- 249
58 --- 156 58 --- 250
59 --- 80 59 --- 129
59 --- 153 59 --- 251
59 --- 154 59 --- 252
60 --- 79 60 --- 130
60 --- 151 60 --- 253
60 --- 152 60 --- 254
61 --- 78 61 --- 131
61 --- 149 61 --- 255
61 --- 150 61 --- 256
62 --- 77 62 --- 132
62 --- 147 62 --- 257
62 --- 148 62 --- 258
63 --- 76 63 --- 133
63 --- 145 63 --- 259
63 --- 146 63 --- 260
64 --- 75 64 --- 134
64 --- 143 64 --- 261
64 --- 144 64 --- 262
65 --- 74 65 --- 135
65 --- 141 65 --- 263
65 --- 142 65 --- 264
66 --- 73 66 --- 136
66 --- 139 66 --- 265
66 --- 140 66 --- 266
69 --- 70 69 --- 70
69 --- 71 69 --- 71
72 --- 73 72 --- 73
@ -759,36 +759,36 @@ flowchart LR
72 --- 264 72 --- 264
72 --- 265 72 --- 265
72 --- 266 72 --- 266
254 <--x 267 152 <--x 267
252 <--x 268 154 <--x 268
250 <--x 269 156 <--x 269
248 <--x 270 158 <--x 270
222 <--x 271 184 <--x 271
220 <--x 272 186 <--x 272
218 <--x 273 188 <--x 273
216 <--x 274 190 <--x 274
190 <--x 275 216 <--x 275
188 <--x 276 218 <--x 276
186 <--x 277 220 <--x 277
184 <--x 278 222 <--x 278
158 <--x 279 248 <--x 279
156 <--x 280 250 <--x 280
154 <--x 281 252 <--x 281
152 <--x 282 254 <--x 282
258 <--x 283 148 <--x 283
256 <--x 284 150 <--x 284
246 <--x 285 160 <--x 285
244 <--x 286 162 <--x 286
226 <--x 287 180 <--x 287
224 <--x 288 182 <--x 288
214 <--x 289 192 <--x 289
212 <--x 290 194 <--x 290
194 <--x 291 212 <--x 291
192 <--x 292 214 <--x 292
182 <--x 293 224 <--x 293
180 <--x 294 226 <--x 294
162 <--x 295 244 <--x 295
160 <--x 296 246 <--x 296
150 <--x 297 256 <--x 297
148 <--x 298 258 <--x 298
``` ```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -757,15 +757,6 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -784,7 +775,16 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -883,15 +883,6 @@ description: Operations executed axial-fan.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -910,7 +901,16 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -1088,15 +1088,6 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1115,7 +1106,16 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -1583,15 +1583,6 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1610,7 +1601,16 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -2078,15 +2078,6 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -2105,7 +2096,16 @@ description: Operations executed axial-fan.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -4,15 +4,6 @@ description: Operations executed ball-bearing.kcl
--- ---
[ [
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -31,7 +22,16 @@ description: Operations executed ball-bearing.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -924,15 +924,6 @@ description: Operations executed ball-bearing.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -951,7 +942,16 @@ description: Operations executed ball-bearing.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -1995,8 +1995,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -2386,8 +2386,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -2837,8 +2837,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -3228,8 +3228,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -7458,8 +7458,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -7581,9 +7581,9 @@ description: Artifact commands bench.kcl
"animated": false, "animated": false,
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": 0.0, "x": -0.0,
"y": 1.0, "y": 1.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -7951,8 +7951,8 @@ description: Artifact commands bench.kcl
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": -1.0, "x": -1.0,
"y": 0.0, "y": -0.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -8074,9 +8074,9 @@ description: Artifact commands bench.kcl
"animated": false, "animated": false,
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": 0.0, "x": -0.0,
"y": 1.0, "y": 1.0,
"z": 0.0 "z": -0.0
} }
} }
}, },

View File

@ -240,15 +240,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -267,7 +258,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -506,15 +506,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -533,7 +524,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -772,15 +772,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -799,7 +790,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -950,15 +950,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -977,7 +968,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -1080,15 +1080,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1107,7 +1098,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -1219,15 +1219,6 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1246,7 +1237,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -1282,15 +1282,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1309,7 +1300,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -1388,15 +1388,6 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1415,7 +1406,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",
@ -1451,15 +1451,6 @@ description: Operations executed bench.kcl
"type": "GroupEnd" "type": "GroupEnd"
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1478,7 +1469,16 @@ description: Operations executed bench.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",

View File

@ -1608,9 +1608,9 @@ description: Artifact commands color-cube.kcl
"animated": false, "animated": false,
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": 0.0, "x": -0.0,
"y": 1.0, "y": 1.0,
"z": 0.0 "z": -0.0
} }
} }
}, },
@ -1727,9 +1727,9 @@ description: Artifact commands color-cube.kcl
"animated": false, "animated": false,
"adjust_camera": false, "adjust_camera": false,
"planar_normal": { "planar_normal": {
"x": 0.0, "x": -0.0,
"y": 1.0, "y": 1.0,
"z": 0.0 "z": -0.0
} }
} }
}, },

View File

@ -4,15 +4,6 @@ description: Operations executed color-cube.kcl
--- ---
[ [
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -31,18 +22,18 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "Plane", "type": "Plane",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -61,18 +52,18 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "Plane", "type": "Plane",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -91,18 +82,18 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "Plane", "type": "Plane",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -121,18 +112,18 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "Plane", "type": "Plane",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -151,18 +142,18 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": []
},
{
"type": "KclStdLibCall",
"name": "offsetPlane", "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": { "unlabeledArg": {
"value": { "value": {
"type": "Plane", "type": "Plane",
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [] "sourceRange": []
}, }
},
{
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -181,7 +172,16 @@ description: Operations executed color-cube.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"type": "GroupBegin", "type": "GroupBegin",

View File

@ -153,9 +153,9 @@ description: Variables in memory after executing color-cube.kcl
} }
}, },
"zAxis": { "zAxis": {
"x": 0.0, "x": -0.0,
"y": 1.0, "y": 1.0,
"z": 0.0, "z": -0.0,
"units": { "units": {
"type": "Mm" "type": "Mm"
} }

View File

@ -34,15 +34,6 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -61,7 +52,16 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -267,15 +267,6 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -294,7 +285,16 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -500,15 +500,6 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -527,7 +518,16 @@ description: Operations executed cycloidal-gear.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -98,15 +98,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -125,7 +116,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -253,15 +253,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -280,7 +271,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -365,15 +365,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -392,7 +383,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -496,15 +496,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -523,7 +514,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -705,15 +705,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -732,7 +723,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -860,15 +860,6 @@ description: Operations executed dual-basin-utility-sink.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -887,7 +878,16 @@ description: Operations executed dual-basin-utility-sink.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -501,15 +501,6 @@ description: Operations executed food-service-spatula.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -528,7 +519,16 @@ description: Operations executed food-service-spatula.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

View File

@ -494,15 +494,6 @@ description: Operations executed french-press.kcl
} }
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -521,7 +512,16 @@ description: Operations executed french-press.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -845,15 +845,6 @@ description: Operations executed french-press.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -872,7 +863,16 @@ description: Operations executed french-press.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -1320,15 +1320,6 @@ description: Operations executed french-press.kcl
"sourceRange": [] "sourceRange": []
}, },
{ {
"type": "KclStdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": { "labeledArgs": {
"offset": { "offset": {
"value": { "value": {
@ -1347,7 +1338,16 @@ description: Operations executed french-press.kcl
"sourceRange": [] "sourceRange": []
} }
}, },
"sourceRange": [] "name": "offsetPlane",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
}, },
{ {
"labeledArgs": { "labeledArgs": {

Some files were not shown because too many files have changed in this diff Show More