KCL: Chamfer and fillet now use keyword arguments (#5389)

Previously:
`|> fillet({ radius = 5, tags = [seg01] }, %)`
Now:
`|> fillet(radius = 5, tags = [seg01])`

Also tweaks the formatter for keyword argument calls slightly.
This commit is contained in:
Adam Chalmers
2025-02-21 14:41:25 -06:00
committed by GitHub
parent 46b4b01d23
commit a094995730
111 changed files with 14517 additions and 9108 deletions

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 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

View File

@ -266,10 +266,10 @@ myRect = rect([20, 0])
myRect myRect
|> extrude(10, %) |> extrude(10, %)
|> fillet({ |> fillet(
radius = 0.5, radius = 0.5,
tags = [myRect.tags.rectangleSegmentA001] tags = [myRect.tags.rectangleSegmentA001]
}, %) )
``` ```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside See how we use the tag `rectangleSegmentA001` in the `fillet` function outside

View File

@ -82,7 +82,7 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
await page.keyboard.press('Enter') // submit await page.keyboard.press('Enter') // submit
await page.waitForTimeout(100) await page.waitForTimeout(100)
await expect(page.locator('.cm-activeLine')).toContainText( await expect(page.locator('.cm-activeLine')).toContainText(
`fillet({ radius = ${KCL_DEFAULT_LENGTH}, tags = [seg01] }, %)` `fillet( radius = ${KCL_DEFAULT_LENGTH}, tags = [seg01] )`
) )
}) })

View File

@ -211,12 +211,13 @@ test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
cameraPos: { x: 16020, y: -2000, z: 10500 }, cameraPos: { x: 16020, y: -2000, z: 10500 },
cameraTarget: { x: -150, y: -4500, z: -80 }, cameraTarget: { x: -150, y: -4500, z: -80 },
beforeChamferSnippet: `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01) beforeChamferSnippet: `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)
chamfer({length = 30,tags = [ chamfer(length = 30,tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02), getNextAdjacentEdge(seg02),
getOppositeEdge(seg01) getOppositeEdge(seg01)
]}, %)`, ],
)`,
afterChamferSelectSnippet: afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)', 'sketch002 = startSketchOn(extrude001, seg03)',
@ -236,14 +237,14 @@ test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
beforeChamferSnippet: `angledLine([ beforeChamferSnippet: `angledLine([
segAng(rectangleSegmentA001) - 90, segAng(rectangleSegmentA001) - 90,
217.26 217.26
], %, $seg01)chamfer({ ], %, $seg01)chamfer(
length = 30, length = 30,
tags = [ tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02) getNextAdjacentEdge(seg02)
] ]
}, %)`, )`,
afterChamferSelectSnippet: afterChamferSelectSnippet:
'sketch003 = startSketchOn(extrude001, seg04)', 'sketch003 = startSketchOn(extrude001, seg04)',
@ -260,13 +261,13 @@ test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
clickCoords: { x: 677, y: 87 }, clickCoords: { x: 677, y: 87 },
cameraPos: { x: -6200, y: 1500, z: 6200 }, cameraPos: { x: -6200, y: 1500, z: 6200 },
cameraTarget: { x: 8300, y: 1100, z: 4800 }, cameraTarget: { x: 8300, y: 1100, z: 4800 },
beforeChamferSnippet: `angledLine([0, 268.43], %, $rectangleSegmentA001)chamfer({ beforeChamferSnippet: `angledLine([0, 268.43], %, $rectangleSegmentA001)chamfer(
length = 30, length = 30,
tags = [ tags = [
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02) getNextAdjacentEdge(seg02)
] ]
}, %)`, )`,
afterChamferSelectSnippet: afterChamferSelectSnippet:
'sketch004 = startSketchOn(extrude001, seg05)', 'sketch004 = startSketchOn(extrude001, seg05)',
afterRectangle1stClickSnippet: afterRectangle1stClickSnippet:
@ -282,10 +283,9 @@ test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
clickCoords: { x: 620, y: 300 }, clickCoords: { x: 620, y: 300 },
cameraPos: { x: -1100, y: -7700, z: 1600 }, cameraPos: { x: -1100, y: -7700, z: 1600 },
cameraTarget: { x: 1450, y: 670, z: 4000 }, cameraTarget: { x: 1450, y: 670, z: 4000 },
beforeChamferSnippet: `chamfer({ beforeChamferSnippet: `chamfer(length = 30, tags = [getNextAdjacentEdge(yo)])`,
length = 30, beforeChamferSnippetEnd:
tags = [getNextAdjacentEdge(yo)] '|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)])',
}, %)`,
afterChamferSelectSnippet: afterChamferSelectSnippet:
'sketch005 = startSketchOn(extrude001, seg06)', 'sketch005 = startSketchOn(extrude001, seg06)',
afterRectangle1stClickSnippet: afterRectangle1stClickSnippet:
@ -313,30 +313,15 @@ test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> chamfer({ |> chamfer(length = 30, tags = [getOppositeEdge(seg01)], tag = $seg03)
length = 30, |> chamfer(length = 30, tags = [seg01], tag = $seg04)
tags = [getOppositeEdge(seg01)] |> chamfer(length = 30, tags = [getNextAdjacentEdge(seg02)], tag = $seg05)
}, %, $seg03) |> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)], tag = $seg06)
|> chamfer({ length = 30, tags = [seg01] }, %, $seg04)
|> chamfer({
length = 30,
tags = [getNextAdjacentEdge(seg02)]
}, %, $seg05)
|> chamfer({
length = 30,
tags = [getNextAdjacentEdge(yo)]
}, %, $seg06)
sketch005 = startSketchOn(extrude001, seg06) sketch005 = startSketchOn(extrude001, seg06)
profile004=startProfileAt([-23.43,19.69], sketch005) profile004=startProfileAt([-23.43,19.69], sketch005)
|> angledLine([0, 9.1], %, $rectangleSegmentA005) |> angledLine([0, 9.1], %, $rectangleSegmentA005)
|> angledLine([ |> angledLine([segAng(rectangleSegmentA005) - 90, 84.07], %)
segAng(rectangleSegmentA005) - 90, |> angledLine([segAng(rectangleSegmentA005), -segLen(rectangleSegmentA005)], %)
84.07
], %)
|> angledLine([
segAng(rectangleSegmentA005),
-segLen(rectangleSegmentA005)
], %)
|> line(endAbsolute=[profileStartX(%), profileStartY(%)]) |> line(endAbsolute=[profileStartX(%), profileStartY(%)])
|> close() |> close()
sketch004 = startSketchOn(extrude001, seg05) sketch004 = startSketchOn(extrude001, seg05)
@ -378,7 +363,6 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
], %) ], %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
`, `,
{ shouldNormalise: true } { shouldNormalise: true }
) )
@ -415,13 +399,13 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
cameraPos: { x: 16020, y: -2000, z: 10500 }, cameraPos: { x: 16020, y: -2000, z: 10500 },
cameraTarget: { x: -150, y: -4500, z: -80 }, cameraTarget: { x: -150, y: -4500, z: -80 },
beforeChamferSnippet: `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01) beforeChamferSnippet: `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)
chamfer({length=30,tags=[ chamfer(extrude001,length=30,tags=[
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02), getNextAdjacentEdge(seg02),
getOppositeEdge(seg01) getOppositeEdge(seg01),
]}, extrude001)`, ])`,
beforeChamferSnippetEnd: '}, extrude001)', beforeChamferSnippetEnd: ')',
afterChamferSelectSnippet: afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)', 'sketch002 = startSketchOn(extrude001, seg03)',
afterRectangle1stClickSnippet: afterRectangle1stClickSnippet:
@ -447,18 +431,20 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
chamf = chamfer({ chamf = chamfer(
extrude001,
length = 30, length = 30,
tags = [getOppositeEdge(seg01)] tags = [getOppositeEdge(seg01)],
}, extrude001, $seg03) tag = $seg03,
|> chamfer({ )
|> chamfer(
length = 30, length = 30,
tags = [ tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02) getNextAdjacentEdge(seg02)
] ],
}, %) )
sketch002 = startSketchOn(extrude001, seg03) sketch002 = startSketchOn(extrude001, seg03)
profile001 = startProfileAt([205.96, 254.59], sketch002) profile001 = startProfileAt([205.96, 254.59], sketch002)
|> angledLine([0, 11.39], %, $rectangleSegmentA002) |> angledLine([0, 11.39], %, $rectangleSegmentA002)
@ -1492,9 +1478,9 @@ sketch002 = startSketchOn('XZ')
|> close() |> close()
extrude001 = extrude(sketch001, length = -12) extrude001 = extrude(sketch001, length = -12)
` `
const firstFilletDeclaration = 'fillet({ radius = 5, tags = [seg01] }, %)' const firstFilletDeclaration = 'fillet(radius = 5, tags = [seg01])'
const secondFilletDeclaration = const secondFilletDeclaration =
'fillet({ radius = 5, tags = [getOppositeEdge(seg01)] }, %)' 'fillet(radius = 5, tags = [getOppositeEdge(seg01)])'
// Locators // Locators
const firstEdgeLocation = { x: 600, y: 193 } const firstEdgeLocation = { x: 600, y: 193 }
@ -1594,7 +1580,7 @@ extrude001 = extrude(sketch001, length = -12)
await editor.expectEditor.toContain(firstFilletDeclaration) await editor.expectEditor.toContain(firstFilletDeclaration)
await editor.expectState({ await editor.expectState({
diagnostics: [], diagnostics: [],
activeLines: ['|>fillet({radius=5,tags=[seg01]},%)'], activeLines: ['|> fillet(radius = 5, tags = [seg01])'],
highlightedCode: '', highlightedCode: '',
}) })
}) })
@ -1674,7 +1660,7 @@ extrude001 = extrude(sketch001, length = -12)
await editor.expectEditor.toContain(secondFilletDeclaration) await editor.expectEditor.toContain(secondFilletDeclaration)
await editor.expectState({ await editor.expectState({
diagnostics: [], diagnostics: [],
activeLines: ['radius=5,'], activeLines: ['|>fillet(radius=5,tags=[getOppositeEdge(seg01)])'],
highlightedCode: '', highlightedCode: '',
}) })
}) })
@ -1726,18 +1712,17 @@ extrude001 = extrude(sketch001, length = -12)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
|> close() |> close()
extrude001 = extrude(sketch001, length = -12) extrude001 = extrude(sketch001, length = -12)
|> fillet({ radius = 5, tags = [seg01] }, %) // fillet01 |> fillet(radius = 5, tags = [seg01]) // fillet01
|> fillet({ radius = 5, tags = [seg02] }, %) // fillet02 |> fillet(radius = 5, tags = [seg02]) // fillet02
fillet03 = fillet({ radius = 5, tags = [getOppositeEdge(seg01)]}, extrude001) fillet03 = fillet(extrude001, radius = 5, tags = [getOppositeEdge(seg01)])
fillet04 = fillet({ radius = 5, tags = [getOppositeEdge(seg02)]}, extrude001) fillet04 = fillet(extrude001, radius = 5, tags = [getOppositeEdge(seg02)])
` `
const pipedFilletDeclaration = 'fillet({ radius = 5, tags = [seg01] }, %)' const pipedFilletDeclaration = 'fillet(radius = 5, tags = [seg01])'
const secondPipedFilletDeclaration = const secondPipedFilletDeclaration = 'fillet(radius = 5, tags = [seg02])'
'fillet({ radius = 5, tags = [seg02] }, %)'
const standaloneFilletDeclaration = const standaloneFilletDeclaration =
'fillet03 = fillet({ radius = 5, tags = [getOppositeEdge(seg01)]}, extrude001)' 'fillet03 = fillet(extrude001, radius = 5, tags = [getOppositeEdge(seg01)])'
const secondStandaloneFilletDeclaration = const secondStandaloneFilletDeclaration =
'fillet04 = fillet({ radius = 5, tags = [getOppositeEdge(seg02)]}, extrude001)' 'fillet04 = fillet(extrude001, radius = 5, tags = [getOppositeEdge(seg02)])'
// Locators // Locators
const pipedFilletEdgeLocation = { x: 600, y: 193 } const pipedFilletEdgeLocation = { x: 600, y: 193 }
@ -1871,9 +1856,9 @@ fillet04 = fillet({ radius = 5, tags = [getOppositeEdge(seg02)]}, extrude001)
|> close() |> close()
extrude001 = extrude(sketch001, length = -12) extrude001 = extrude(sketch001, length = -12)
` `
const firstChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)' const firstChamferDeclaration = 'chamfer(length = 5, tags = [seg01])'
const secondChamferDeclaration = const secondChamferDeclaration =
'chamfer({ length = 5, tags = [getOppositeEdge(seg01)] }, %)' 'chamfer(length = 5, tags = [getOppositeEdge(seg01)])'
// Locators // Locators
const firstEdgeLocation = { x: 600, y: 193 } const firstEdgeLocation = { x: 600, y: 193 }
@ -1964,7 +1949,7 @@ extrude001 = extrude(sketch001, length = -12)
await editor.expectEditor.toContain(firstChamferDeclaration) await editor.expectEditor.toContain(firstChamferDeclaration)
await editor.expectState({ await editor.expectState({
diagnostics: [], diagnostics: [],
activeLines: ['|>chamfer({length=5,tags=[seg01]},%)'], activeLines: ['|>chamfer(length=5,tags=[seg01])'],
highlightedCode: '', highlightedCode: '',
}) })
}) })
@ -2048,7 +2033,7 @@ extrude001 = extrude(sketch001, length = -12)
await editor.expectEditor.toContain(secondChamferDeclaration) await editor.expectEditor.toContain(secondChamferDeclaration)
await editor.expectState({ await editor.expectState({
diagnostics: [], diagnostics: [],
activeLines: ['length=5,'], activeLines: ['|>chamfer(length=5,tags=[getOppositeEdge(seg01)])'],
highlightedCode: '', highlightedCode: '',
}) })
}) })
@ -2096,18 +2081,17 @@ extrude001 = extrude(sketch001, length = -12)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
|> close() |> close()
extrude001 = extrude(sketch001, length = -12) extrude001 = extrude(sketch001, length = -12)
|> chamfer({ length = 5, tags = [seg01] }, %) // chamfer01 |> chamfer(length = 5, tags = [seg01]) // chamfer01
|> chamfer({ length = 5, tags = [seg02] }, %) // chamfer02 |> chamfer(length = 5, tags = [seg02]) // chamfer02
chamfer03 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)]}, extrude001) chamfer03 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])
chamfer04 = chamfer({ length = 5, tags = [getOppositeEdge(seg02)]}, extrude001) chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
` `
const pipedChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)' const pipedChamferDeclaration = 'chamfer(length = 5, tags = [seg01])'
const secondPipedChamferDeclaration = const secondPipedChamferDeclaration = 'chamfer(length = 5, tags = [seg02])'
'chamfer({ length = 5, tags = [seg02] }, %)'
const standaloneChamferDeclaration = const standaloneChamferDeclaration =
'chamfer03 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)]}, extrude001)' 'chamfer03 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])'
const secondStandaloneChamferDeclaration = const secondStandaloneChamferDeclaration =
'chamfer04 = chamfer({ length = 5, tags = [getOppositeEdge(seg02)]}, extrude001)' 'chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])'
// Locators // Locators
const pipedChamferEdgeLocation = { x: 600, y: 193 } const pipedChamferEdgeLocation = { x: 600, y: 193 }

View File

@ -424,7 +424,7 @@ test(
test( test(
'when code with error first loads you get errors in console', 'when code with error first loads you get errors in console',
{ tag: '@electron' }, { tag: '@electron' },
async ({ context, page }, testInfo) => { async ({ context, page, editor }, testInfo) => {
await context.folderSetupFn(async (dir) => { await context.folderSetupFn(async (dir) => {
await fsp.mkdir(path.join(dir, 'broken-code'), { recursive: true }) await fsp.mkdir(path.join(dir, 'broken-code'), { recursive: true })
await fsp.copyFile( await fsp.copyFile(
@ -434,16 +434,19 @@ test(
}) })
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
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.waitForExecutionDone() since the KCL code is going to fail
await expect(page.getByTestId('loading')).toBeAttached() await expect(page.getByTestId('loading')).toBeAttached()
await expect(page.getByTestId('loading')).not.toBeAttached({ await expect(page.getByTestId('loading')).not.toBeAttached({
timeout: 20_000, timeout: 20_000,
}) })
// Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content
await editor.scrollToText(
"|> line(end = [0, wallMountL], tag = 'outerEdge')"
)
// error in guter // error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible() await expect(page.locator('.cm-lint-marker-error')).toBeVisible()

View File

@ -764,15 +764,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> chamfer({ |> chamfer(
length = 30, length = 30,
tags = [ tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02), getNextAdjacentEdge(seg02),
getOppositeEdge(seg01) getOppositeEdge(seg01)
] ],
}, %) )
`) `)
await expect( await expect(
page.getByTestId('model-state-indicator-execution-done') page.getByTestId('model-state-indicator-execution-done')
@ -810,15 +810,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'oppositeChamfer', 'oppositeChamfer',
oppositeChamfer, oppositeChamfer,
`angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)chamfer({length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)]},%)`, `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)chamfer(length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)],)`,
'}, %)' ' )'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'baseChamfer', 'baseChamfer',
baseChamfer, baseChamfer,
`angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)chamfer({length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)]},%)`, `angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)chamfer(length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)],)`,
'}, %)' ' )'
) )
await u.openAndClearDebugPanel() await u.openAndClearDebugPanel()
@ -848,15 +848,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'adjacentChamfer1', 'adjacentChamfer1',
adjacentChamfer1, adjacentChamfer1,
`line(endAbsolute=[profileStartX(%),profileStartY(%)],tag=$seg02)chamfer({length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)]},%)`, `line(endAbsolute=[profileStartX(%),profileStartY(%)],tag=$seg02)chamfer(length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)],)`,
'}, %)' ' )'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'adjacentChamfer2', 'adjacentChamfer2',
adjacentChamfer2, adjacentChamfer2,
`angledLine([segAng(rectangleSegmentA001),-segLen(rectangleSegmentA001)],%,$yo)chamfer({length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)]},%)`, `angledLine([segAng(rectangleSegmentA001),-segLen(rectangleSegmentA001)],%,$yo)chamfer(length=30,tags=[seg01,getNextAdjacentEdge(yo),getNextAdjacentEdge(seg02),getOppositeEdge(seg01)],)`,
'}, %)' ' )'
) )
}) })
test("Extrude button should be disabled if there's no extrudable geometry when nothing is selected", async ({ test("Extrude button should be disabled if there's no extrudable geometry when nothing is selected", async ({

1
exp Normal file
View File

@ -0,0 +1 @@
sketch001=startSketchOn('XZ')|>startProfileAt([75.8,317.2],%)//[$startCapTag,$EndCapTag]|>angledLine([0,268.43],%,$rectangleSegmentA001)|>angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)|>angledLine([segAng(rectangleSegmentA001),-segLen(rectangleSegmentA001)],%,$yo)|>line(endAbsolute=[profileStartX(%),profileStartY(%)],tag=$seg02)|>close()extrude001=extrude(sketch001,length=100)|>chamfer(length=30,tags=[getOppositeEdge(seg01)],tag=$seg03)|>chamfer(length=30,tags=[seg01],tag=$seg04)|>chamfer(length=30,tags=[getNextAdjacentEdge(seg02)],tag=$seg05)|>chamfer(length=30,tags=[getNextAdjacentEdge(yo)],tag=$seg06)sketch004=startSketchOn(extrude001,seg05)profile003=startProfileAt([82.57,322.96],sketch004)|>angledLine([0,11.16],%,$rectangleSegmentA004)|>angledLine([segAng(rectangleSegmentA004)-90,103.07],%)|>angledLine([segAng(rectangleSegmentA004),-segLen(rectangleSegmentA004)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()sketch003=startSketchOn(extrude001,seg04)profile002=startProfileAt([-209.64,255.28],sketch003)|>angledLine([0,11.56],%,$rectangleSegmentA003)|>angledLine([segAng(rectangleSegmentA003)-90,106.84],%)|>angledLine([segAng(rectangleSegmentA003),-segLen(rectangleSegmentA003)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()sketch002=startSketchOn(extrude001,seg03)profile001=startProfileAt([205.96,254.59],sketch002)|>angledLine([0,11.39],%,$rectangleSegmentA002)|>angledLine([segAng(rectangleSegmentA002)-90,105.26],%)|>angledLine([segAng(rectangleSegmentA002),-segLen(rectangleSegmentA002)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()

1
got Normal file
View File

@ -0,0 +1 @@
sketch001=startSketchOn('XZ')|>startProfileAt([75.8,317.2],%)//[$startCapTag,$EndCapTag]|>angledLine([0,268.43],%,$rectangleSegmentA001)|>angledLine([segAng(rectangleSegmentA001)-90,217.26],%,$seg01)|>angledLine([segAng(rectangleSegmentA001),-segLen(rectangleSegmentA001)],%,$yo)|>line(endAbsolute=[profileStartX(%),profileStartY(%)],tag=$seg02)|>close()extrude001=extrude(sketch001,length=100)|>chamfer(length=30,tags=[getOppositeEdge(seg01)],tag=$seg03)|>chamfer(length=30,tags=[seg01],tag=$seg04)|>chamfer(length=30,tags=[getNextAdjacentEdge(seg02)],tag=$seg05)|>chamfer(length=30,tags=[getNextAdjacentEdge(yo)],tag=$seg06)sketch005=startSketchOn(extrude001,seg06)profile004=startProfileAt([-23.43,19.69],sketch005)|>angledLine([0,9.1],%,$rectangleSegmentA005)|>angledLine([segAng(rectangleSegmentA005)-90,84.07],%)|>angledLine([segAng(rectangleSegmentA005),-segLen(rectangleSegmentA005)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()sketch004=startSketchOn(extrude001,seg05)profile003=startProfileAt([82.57,322.96],sketch004)|>angledLine([0,11.16],%,$rectangleSegmentA004)|>angledLine([segAng(rectangleSegmentA004)-90,103.07],%)|>angledLine([segAng(rectangleSegmentA004),-segLen(rectangleSegmentA004)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()sketch003=startSketchOn(extrude001,seg04)profile002=startProfileAt([-209.64,255.28],sketch003)|>angledLine([0,11.56],%,$rectangleSegmentA003)|>angledLine([segAng(rectangleSegmentA003)-90,106.84],%)|>angledLine([segAng(rectangleSegmentA003),-segLen(rectangleSegmentA003)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()sketch002=startSketchOn(extrude001,seg03)profile001=startProfileAt([205.96,254.59],sketch002)|>angledLine([0,11.39],%,$rectangleSegmentA002)|>angledLine([segAng(rectangleSegmentA002)-90,105.26],%)|>angledLine([segAng(rectangleSegmentA002),-segLen(rectangleSegmentA002)],%)|>line(endAbsolute=[profileStartX(%),profileStartY(%)])|>close()

View File

@ -85,7 +85,7 @@
"fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages", "fmt": "prettier --write ./src *.ts *.json *.js ./e2e ./packages",
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages", "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
"fetch:wasm": "./get-latest-wasm-bundle.sh", "fetch:wasm": "./get-latest-wasm-bundle.sh",
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/next/manifest.json", "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/achalmers/kw-fillet-chamfer/manifest.json",
"isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)", "isomorphic-copy-wasm": "(copy src/wasm-lib/pkg/wasm_lib_bg.wasm public || cp src/wasm-lib/pkg/wasm_lib_bg.wasm public)",
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt", "build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
"build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt", "build:wasm": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings && cd ../.. && yarn isomorphic-copy-wasm && yarn fmt",

View File

@ -32,7 +32,7 @@ child_process.spawnSync('git', [
'clone', 'clone',
'--single-branch', '--single-branch',
'--branch', '--branch',
'next', 'achalmers/kw-fillet-chamfer',
URL_GIT_KCL_SAMPLES, URL_GIT_KCL_SAMPLES,
DIR_KCL_SAMPLES, DIR_KCL_SAMPLES,
]) ])

View File

@ -626,7 +626,6 @@ export function sketchOnExtrudedFace(
} else { } else {
_tag = createLiteral(info.subType.toUpperCase()) _tag = createLiteral(info.subType.toUpperCase())
} }
const newSketch = createVariableDeclaration( const newSketch = createVariableDeclaration(
newSketchName, newSketchName,
createCallExpressionStdLib('startSketchOn', [ createCallExpressionStdLib('startSketchOn', [

View File

@ -412,7 +412,7 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -439,7 +439,7 @@ extrude001 = extrude(sketch001, length = -15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> extrude(length = -15) |> extrude(length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -466,7 +466,7 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -493,7 +493,7 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg02] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg02])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -511,7 +511,7 @@ extrude001 = extrude(sketch001, length = -15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> fillet({ radius = 5, tags = [seg01] }, %)` |> fillet( radius = 5, tags = [seg01] )`
const segmentSnippets = ['line(end = [-20, 0])'] const segmentSnippets = ['line(end = [-20, 0])']
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
@ -521,8 +521,8 @@ extrude001 = extrude(sketch001, length = -15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> fillet({ radius = 5, tags = [seg01] }, %) |> fillet(radius = 5, tags = [seg01])
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg02] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg02])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -540,7 +540,7 @@ extrude001 = extrude(sketch001, length = -15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> chamfer({ length = 5, tags = [seg01] }, %)` |> chamfer(length = 5, tags = [seg01])`
const segmentSnippets = ['line(end = [-20, 0])'] const segmentSnippets = ['line(end = [-20, 0])']
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
@ -550,8 +550,8 @@ extrude001 = extrude(sketch001, length = -15)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> chamfer({ length = 5, tags = [seg01] }, %) |> chamfer(length = 5, tags = [seg01])
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg02] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg02])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -578,7 +578,7 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01, seg02] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01, seg02])`
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -617,7 +617,7 @@ extrude002 = extrude(sketch002, length = -25)` // <--- body 2
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01, seg02] }, %) |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01, seg02])
sketch002 = startSketchOn('XY') sketch002 = startSketchOn('XY')
|> startProfileAt([30, 10], %) |> startProfileAt([30, 10], %)
|> line(end = [15, 0]) |> line(end = [15, 0])
@ -626,7 +626,7 @@ sketch002 = startSketchOn('XY')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude002 = extrude(sketch002, length = -25) extrude002 = extrude(sketch002, length = -25)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg03] }, %)` // <-- able to add a new one |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg03])` // <-- able to add a new one
await runModifyAstCloneWithEdgeTreatmentAndTag( await runModifyAstCloneWithEdgeTreatmentAndTag(
code, code,
@ -647,8 +647,8 @@ extrude002 = extrude(sketch002, length = -25)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
const edgeTreatmentSnippet = `${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` const edgeTreatmentSnippet = `${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
@ -673,8 +673,8 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, extrude001)` fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [seg01])`
const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, extrude001)` const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [seg01])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
@ -700,8 +700,8 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [getOppositeEdge(seg01)] }, extrude001)` fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [getOppositeEdge(seg01)])`
const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [getOppositeEdge(seg01)] }, extrude001)` const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [getOppositeEdge(seg01)])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
@ -726,8 +726,8 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [getNextAdjacentEdge(seg01)] }, extrude001)` fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [getNextAdjacentEdge(seg01)])`
const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}({ ${parameterName} = 3, tags = [getNextAdjacentEdge(seg01)] }, extrude001)` const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 3, tags = [getNextAdjacentEdge(seg01)])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
@ -753,11 +753,11 @@ extrude001 = extrude(sketch001, length = -15)`
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %) |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])
|> fillet({ radius = 5, tags = [getOppositeEdge(seg02)] }, %) |> fillet(radius = 5, tags = [getOppositeEdge(seg02)])
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 6, tags = [seg02] }, extrude001) fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 6, tags = [seg02])
chamfer001 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)] }, extrude001)` chamfer001 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])`
const edgeTreatmentSnippet = `${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %)` const edgeTreatmentSnippet = `${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0], tag = $seg01) |> line(end = [20, 0], tag = $seg01)
@ -766,15 +766,9 @@ chamfer001 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)] }, extrude001
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> fillet({ |> fillet(radius = 5, tags = [getOppositeEdge(seg02)])
radius = 5, fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 6, tags = [seg02])
tags = [getOppositeEdge(seg02)] chamfer001 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])`
}, %)
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 6, tags = [seg02] }, extrude001)
chamfer001 = chamfer({
length = 5,
tags = [getOppositeEdge(seg01)]
}, extrude001)`
await runDeleteEdgeTreatmentTest( await runDeleteEdgeTreatmentTest(
code, code,
@ -791,11 +785,11 @@ chamfer001 = chamfer({
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %) |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])
|> fillet({ radius = 5, tags = [getOppositeEdge(seg02)] }, %) |> fillet( radius = 5, tags = [getOppositeEdge(seg02)] )
fillet001 = ${edgeTreatmentType}({ ${parameterName} = 6, tags = [seg02] }, extrude001) fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 6, tags = [seg02])
chamfer001 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)] }, extrude001)` chamfer001 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])`
const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}({ ${parameterName} = 6, tags = [seg02] }, extrude001)` const edgeTreatmentSnippet = `fillet001 = ${edgeTreatmentType}(extrude001, ${parameterName} = 6, tags = [seg02])`
const expectedCode = `sketch001 = startSketchOn('XY') const expectedCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %) |> startProfileAt([-10, 10], %)
|> line(end = [20, 0], tag = $seg01) |> line(end = [20, 0], tag = $seg01)
@ -804,15 +798,9 @@ chamfer001 = chamfer({ length = 5, tags = [getOppositeEdge(seg01)] }, extrude001
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -15) extrude001 = extrude(sketch001, length = -15)
|> ${edgeTreatmentType}({ ${parameterName} = 3, tags = [seg01] }, %) |> ${edgeTreatmentType}(${parameterName} = 3, tags = [seg01])
|> fillet({ |> fillet(radius = 5, tags = [getOppositeEdge(seg02)])
radius = 5, chamfer001 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg01)])`
tags = [getOppositeEdge(seg02)]
}, %)
chamfer001 = chamfer({
length = 5,
tags = [getOppositeEdge(seg01)]
}, extrude001)`
await runDeleteEdgeTreatmentTest( await runDeleteEdgeTreatmentTest(
code, code,
@ -832,14 +820,14 @@ describe('Testing isTagUsedInEdgeTreatment', () => {
|> line(end = [-6.37, 3.88], tag = $seg02) |> line(end = [-6.37, 3.88], tag = $seg02)
|> close() |> close()
extrude001 = extrude(sketch001, length = -5) extrude001 = extrude(sketch001, length = -5)
|> fillet({ |> fillet(
radius = 1.11, radius = 1.11,
tags = [ tags = [
getOppositeEdge(seg01), getOppositeEdge(seg01),
seg01, seg01,
getPreviousAdjacentEdge(seg02) getPreviousAdjacentEdge(seg02)
] ]
}, %) )
` `
it('should correctly identify getOppositeEdge and baseEdge edges', () => { it('should correctly identify getOppositeEdge and baseEdge edges', () => {
const ast = assertParse(code) const ast = assertParse(code)

View File

@ -19,6 +19,8 @@ import {
createArrayExpression, createArrayExpression,
createIdentifier, createIdentifier,
createPipeExpression, createPipeExpression,
createCallExpressionStdLibKw,
createLabeledArg,
} from '../modifyAst' } from '../modifyAst'
import { import {
getNodeFromPath, getNodeFromPath,
@ -166,13 +168,14 @@ export function modifyAstWithEdgeTreatmentAndTag(
const firstTag = tagCalls[0] // can be Identifier or CallExpression (for opposite and adjacent edges) const firstTag = tagCalls[0] // can be Identifier or CallExpression (for opposite and adjacent edges)
// edge treatment call // edge treatment call
const edgeTreatmentCall = createCallExpressionStdLib(parameters.type, [ const edgeTreatmentCall = createCallExpressionStdLibKw(
createObjectExpression({ parameters.type,
[parameterName]: parameterValue, null,
tags: createArrayExpression(tagCalls), [
}), createLabeledArg(parameterName, parameterValue),
createPipeSubstitution(), createLabeledArg('tags', createArrayExpression(tagCalls)),
]) ]
)
// Locate the extrude call // Locate the extrude call
const locatedExtrudeDeclarator = locateExtrudeDeclarator( const locatedExtrudeDeclarator = locateExtrudeDeclarator(
@ -751,6 +754,16 @@ export const isTagUsedInEdgeTreatment = ({
) { ) {
inEdgeTreatment = true inEdgeTreatment = true
} }
if (inEdgeTreatment && node.type === 'CallExpressionKw') {
node.arguments.forEach((prop) => {
if (
prop.label.name === 'tags' &&
prop.arg.type === 'ArrayExpression'
) {
inObj = true
}
})
}
if (inEdgeTreatment && node.type === 'ObjectExpression') { if (inEdgeTreatment && node.type === 'ObjectExpression') {
node.properties.forEach((prop) => { node.properties.forEach((prop) => {
if ( if (
@ -795,6 +808,16 @@ export const isTagUsedInEdgeTreatment = ({
) { ) {
inEdgeTreatment = false inEdgeTreatment = false
} }
if (inEdgeTreatment && node.type === 'CallExpressionKw') {
node.arguments.forEach((prop) => {
if (
prop.label.name === 'tags' &&
prop.arg.type === 'ArrayExpression'
) {
inObj = true
}
})
}
if (inEdgeTreatment && node.type === 'ObjectExpression') { if (inEdgeTreatment && node.type === 'ObjectExpression') {
node.properties.forEach((prop) => { node.properties.forEach((prop) => {
if ( if (

View File

@ -251,27 +251,24 @@ describe('testing addTagForSketchOnFace', () => {
const chamferTestCases = [ const chamferTestCases = [
{ {
desc: 'chamfer in pipeExpr', desc: 'chamfer in pipeExpr',
originalChamfer: ` |> chamfer({ originalChamfer: ` |> chamfer(length = 30, tags = [seg01, getOppositeEdge(seg01)])`,
length = 30, expectedChamfer: ` |> chamfer(length = 30, tags = [getOppositeEdge(seg01)], tag = $seg03)
tags = [seg01, getOppositeEdge(seg01)] |> chamfer(length = 30, tags = [seg01])`,
}, %)`,
expectedChamfer: ` |> chamfer({
length = 30,
tags = [getOppositeEdge(seg01)]
}, %, $seg03)
|> chamfer({ length = 30, tags = [seg01] }, %)`,
}, },
{ {
desc: 'chamfer with its own variable', desc: 'chamfer with its own variable',
originalChamfer: `chamf = chamfer({ originalChamfer: `chamf = chamfer(
extrude001,
length = 30, length = 30,
tags = [seg01, getOppositeEdge(seg01)] tags = [seg01, getOppositeEdge(seg01)],
}, extrude001)`, )`,
expectedChamfer: `chamf = chamfer({ expectedChamfer: `chamf = chamfer(
extrude001,
length = 30, length = 30,
tags = [getOppositeEdge(seg01)] tags = [getOppositeEdge(seg01)],
}, extrude001, $seg03) tag = $seg03,
|> chamfer({ length = 30, tags = [seg01] }, %)`, )
|> chamfer(length = 30, tags = [seg01])`,
}, },
// Add more test cases here if needed // Add more test cases here if needed
] as const ] as const

View File

@ -2573,22 +2573,22 @@ export function replaceSketchLine({
* *
* However things get complicated in situations like: * However things get complicated in situations like:
* ```ts * ```ts
* |> chamfer({ * |> chamfer(
* length: 1, * length = 1,
* tags: [tag1, tagOfInterest] * tags = [tag1, tagOfInterest],
* }, %) * )
* ``` * ```
* Because tag declarator is not allowed on a chamfer with more than one tag, * Because tag declarator is not allowed on a chamfer with more than one tag,
* They must be pulled apart into separate chamfer calls: * They must be pulled apart into separate chamfer calls:
* ```ts * ```ts
* |> chamfer({ * |> chamfer(
* length: 1, * length = 1,
* tags: [tag1] * tags = [tag1],
* }, %) * )
* |> chamfer({ * |> chamfer(
* length: 1, * length = 1,
* tags: [tagOfInterest] * tags = [tagOfInterest],
* }, %, $newTagDeclarator) * , tag = $newTagDeclarator)
* ``` * ```
*/ */
function addTagToChamfer( function addTagToChamfer(
@ -2625,25 +2625,22 @@ function addTagToChamfer(
const callExpr = isPipeExpression const callExpr = isPipeExpression
? pipeExpr.node.body[pipeIndex] ? pipeExpr.node.body[pipeIndex]
: variableDec.node.init : variableDec.node.init
if (callExpr.type !== 'CallExpression') if (callExpr.type !== 'CallExpressionKw')
return new Error('no chamfer call Expr') return new Error('no chamfer call Expr')
const chamferObjArg = callExpr.arguments[0] const inputTags = findKwArg('tags', callExpr)
if (chamferObjArg.type !== 'ObjectExpression')
return new Error('first argument should be an object expression')
const inputTags = getObjExprProperty(chamferObjArg, 'tags')
if (!inputTags) return new Error('no tags property') if (!inputTags) return new Error('no tags property')
if (inputTags.expr.type !== 'ArrayExpression') if (inputTags.type !== 'ArrayExpression')
return new Error('tags should be an array expression') return new Error('tags should be an array expression')
const isChamferBreakUpNeeded = inputTags.expr.elements.length > 1 const isChamferBreakUpNeeded = inputTags.elements.length > 1
if (!isChamferBreakUpNeeded) { if (!isChamferBreakUpNeeded) {
return addTag(2)(tagInfo) return addTagKw()(tagInfo)
} }
// There's more than one input tag, we need to break that chamfer call into a separate chamfer call // There's more than one input tag, we need to break that chamfer call into a separate chamfer call
// so that it can have a tag declarator added. // so that it can have a tag declarator added.
const tagIndexToPullOut = inputTags.expr.elements.findIndex((tag) => { const tagIndexToPullOut = inputTags.elements.findIndex((tag) => {
// e.g. chamfer({ tags: [tagOfInterest, tag2] }, %) // e.g. chamfer(tags: [tagOfInterest, tag2])
// ^^^^^^^^^^^^^ // ^^^^^^^^^^^^^
const elementMatchesBaseTagType = const elementMatchesBaseTagType =
edgeCutMeta?.subType === 'base' && edgeCutMeta?.subType === 'base' &&
@ -2651,7 +2648,7 @@ function addTagToChamfer(
tag.name === edgeCutMeta.tagName tag.name === edgeCutMeta.tagName
if (elementMatchesBaseTagType) return true if (elementMatchesBaseTagType) return true
// e.g. chamfer({ tags: [getOppositeEdge(tagOfInterest), tag2] }, %) // e.g. chamfer(tags: [getOppositeEdge(tagOfInterest), tag2])
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
const tagMatchesOppositeTagType = const tagMatchesOppositeTagType =
edgeCutMeta?.subType === 'opposite' && edgeCutMeta?.subType === 'opposite' &&
@ -2661,7 +2658,7 @@ function addTagToChamfer(
tag.arguments[0].name === edgeCutMeta.tagName tag.arguments[0].name === edgeCutMeta.tagName
if (tagMatchesOppositeTagType) return true if (tagMatchesOppositeTagType) return true
// e.g. chamfer({ tags: [getNextAdjacentEdge(tagOfInterest), tag2] }, %) // e.g. chamfer(tags: [getNextAdjacentEdge(tagOfInterest), tag2])
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
const tagMatchesAdjacentTagType = const tagMatchesAdjacentTagType =
edgeCutMeta?.subType === 'adjacent' && edgeCutMeta?.subType === 'adjacent' &&
@ -2675,34 +2672,30 @@ function addTagToChamfer(
}) })
if (tagIndexToPullOut === -1) return new Error('tag not found') if (tagIndexToPullOut === -1) return new Error('tag not found')
// get the tag we're pulling out // get the tag we're pulling out
const tagToPullOut = inputTags.expr.elements[tagIndexToPullOut] const tagToPullOut = inputTags.elements[tagIndexToPullOut]
// and remove it from the original chamfer call // and remove it from the original chamfer call
// [pullOutTag, tag2] to [tag2] // [pullOutTag, tag2] to [tag2]
inputTags.expr.elements.splice(tagIndexToPullOut, 1) inputTags.elements.splice(tagIndexToPullOut, 1)
// get the length of the chamfer we're breaking up, as the new chamfer will have the same length // get the length of the chamfer we're breaking up, as the new chamfer will have the same length
const chamferLength = getObjExprProperty(chamferObjArg, 'length') const chamferLength = findKwArg('length', callExpr)
if (!chamferLength) return new Error('no chamfer length') if (!chamferLength) return new Error('no chamfer length')
const tagDec = createTagDeclarator(findUniqueName(_node, 'seg', 2)) const tagDec = createTagDeclarator(findUniqueName(_node, 'seg', 2))
const solid3dIdentifierUsedInOriginalChamfer = callExpr.arguments[1] const solid3dIdentifierUsedInOriginalChamfer = callExpr.unlabeled
const newExpressionToInsert = createCallExpression('chamfer', [ const solid = isPipeExpression ? null : solid3dIdentifierUsedInOriginalChamfer
createObjectExpression({ const newExpressionToInsert = createCallExpressionStdLibKw('chamfer', solid, [
length: chamferLength.expr, createLabeledArg('length', chamferLength),
// single tag to add to the new chamfer call // single tag to add to the new chamfer call
tags: createArrayExpression([tagToPullOut]), createLabeledArg('tags', createArrayExpression([tagToPullOut])),
}), createLabeledArg('tag', tagDec),
isPipeExpression
? createPipeSubstitution()
: solid3dIdentifierUsedInOriginalChamfer,
tagDec,
]) ])
// insert the new chamfer call with the tag declarator, add its above the original // insert the new chamfer call with the tag declarator, add it above the original
// alternatively we could use `pipeIndex + 1` to insert it below the original // alternatively we could use `pipeIndex + 1` to insert it below the original
if (isPipeExpression) { if (isPipeExpression) {
pipeExpr.node.body.splice(pipeIndex, 0, newExpressionToInsert) pipeExpr.node.body.splice(pipeIndex, 0, newExpressionToInsert)
} else { } else {
callExpr.arguments[1] = createPipeSubstitution() callExpr.unlabeled = null // defaults to pipe substitution
variableDec.node.init = createPipeExpression([ variableDec.node.init = createPipeExpression([
newExpressionToInsert, newExpressionToInsert,
callExpr, callExpr,

View File

@ -29,22 +29,22 @@ sketch001 = startSketchOn('XZ')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06)
|> close() |> close()
|> extrude(%, length = width) |> extrude(%, length = width)
|> fillet({ |> fillet(
radius = extFilletRadius, radius = extFilletRadius,
tags = [getNextAdjacentEdge(seg03)] tags = [getNextAdjacentEdge(seg03)],
}, %) )
|> fillet({ |> fillet(
radius = filletRadius, radius = filletRadius,
tags = [getNextAdjacentEdge(seg06)] tags = [getNextAdjacentEdge(seg06)],
}, %) )
|> fillet({ |> fillet(
radius = filletRadius, radius = filletRadius,
tags = [seg02, getOppositeEdge(seg02)], tags = [seg02, getOppositeEdge(seg02)],
}, %) )
|> fillet({ |> fillet(
radius = filletRadius, radius = filletRadius,
tags = [seg05, getOppositeEdge(seg05)], tags = [seg05, getOppositeEdge(seg05)],
}, %) )
sketch002 = startSketchOn(sketch001, seg03) sketch002 = startSketchOn(sketch001, seg03)
|> circle({ |> circle({

View File

@ -131,7 +131,7 @@ See later source ranges for more context. about the sweep`,
prompts.push({ prompts.push({
prompt: `This selection is for a segment (line, xLine, angledLine etc) that has been swept (a general-sweep, either an extrusion, revolve, sweep or loft). prompt: `This selection is for a segment (line, xLine, angledLine etc) that has been swept (a general-sweep, either an extrusion, revolve, sweep or loft).
Because it now refers to an edge the way to refer to this edge is to add a tag to the segment, and then use that tag directly. Because it now refers to an edge the way to refer to this edge is to add a tag to the segment, and then use that tag directly.
i.e. \`fillet({ radius = someInteger, tags = [newTag] }, %)\` will work in the case of filleting this edge i.e. \`fillet( radius = someInteger, tags = [newTag])\` will work in the case of filleting this edge
See later source ranges for more context. about the sweep`, See later source ranges for more context. about the sweep`,
range: convertAppRangeToApiRange(selection.codeRef.range, code), range: convertAppRangeToApiRange(selection.codeRef.range, code),
}) })

View File

@ -945,10 +945,7 @@ mod tests {
let snippet = fillet_fn.to_autocomplete_snippet().unwrap(); let snippet = fillet_fn.to_autocomplete_snippet().unwrap();
assert_eq!( assert_eq!(
snippet, snippet,
r#"fillet({ r#"fillet(${0:%}, radius = ${1:3.14}, tags = [${2:"tag_or_edge_fn"}])${}"#
radius = ${0:3.14},
tags = [${1:"tag_or_edge_fn"}],
}, ${2:%})${}"#
); );
} }

View File

@ -109,14 +109,14 @@ const bracket = startSketchOn('XY')
|> line([0, -wallMountL + thickness], %) |> line([0, -wallMountL + thickness], %)
|> close() |> close()
|> extrude(width, %) |> extrude(width, %)
|> fillet({ |> fillet(
radius: filletR, radius = filletR,
tags: [getPreviousAdjacentEdge(innerEdge, %)] tags = [getPreviousAdjacentEdge(innerEdge, %)]
}, %) )
|> fillet({ |> fillet(
radius: filletR + thickness, radius = filletR + thickness,
tags: [getPreviousAdjacentEdge(outerEdge, %)] tags = [getPreviousAdjacentEdge(outerEdge, %)]
}, %) )
" "
); );
@ -156,14 +156,14 @@ const bracket = startSketchOn('XY')
|> line([0, -wallMountL + thickness], %) |> line([0, -wallMountL + thickness], %)
|> close() |> close()
|> extrude(width, %) |> extrude(width, %)
|> fillet({ |> fillet(
radius: filletR, radius = filletR,
tags: [getPreviousAdjacentEdge(innerEdge)] tags = [getPreviousAdjacentEdge(innerEdge)]
}, %) )
|> fillet({ |> fillet(
radius: filletR + thickness, radius = filletR + thickness,
tags: [getPreviousAdjacentEdge(outerEdge)] tags = [getPreviousAdjacentEdge(outerEdge)]
}, %) )
" "
); );
} }

View File

@ -2359,10 +2359,10 @@ async fn kcl_test_kcl_lsp_diagnostics_on_execution_error() {
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close() |> close()
|> extrude(length = 3.14) |> extrude(length = 3.14)
|> fillet({ |> fillet(
radius: 3.14, radius = 3.14,
tags: ["tag_or_edge_fn"], tags = ["tag_or_edge_fn"],
}, %)"# )"#
.to_string(), .to_string(),
}, },
}) })

View File

@ -517,13 +517,6 @@ impl Args {
FromArgs::from_args(self, 0) FromArgs::from_args(self, 0)
} }
pub(crate) fn get_data_and_solid_and_tag<'a, T>(&'a self) -> Result<(T, Box<Solid>, Option<TagNode>), KclError>
where
T: serde::de::DeserializeOwned + FromKclValue<'a> + Sized,
{
FromArgs::from_args(self, 0)
}
pub(crate) fn get_tag_to_number_sketch(&self) -> Result<(TagIdentifier, f64, Sketch), KclError> { pub(crate) fn get_tag_to_number_sketch(&self) -> Result<(TagIdentifier, f64, Sketch), KclError> {
FromArgs::from_args(self, 0) FromArgs::from_args(self, 0)
} }
@ -994,29 +987,6 @@ impl<'a> FromKclValue<'a> for super::sketch::BezierData {
} }
} }
impl<'a> FromKclValue<'a> for super::chamfer::ChamferData {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
let obj = arg.as_object()?;
let_field_of!(obj, length);
let_field_of!(obj, tags);
Some(Self { length, tags })
}
}
impl<'a> FromKclValue<'a> for super::fillet::FilletData {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
let obj = arg.as_object()?;
let_field_of!(obj, radius);
let_field_of!(obj, tolerance?);
let_field_of!(obj, tags);
Some(Self {
radius,
tolerance,
tags,
})
}
}
impl<'a> FromKclValue<'a> for super::helix::HelixRevolutionsData { impl<'a> FromKclValue<'a> for super::helix::HelixRevolutionsData {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> { fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
let obj = arg.as_object()?; let obj = arg.as_object()?;

View File

@ -4,8 +4,6 @@ use anyhow::Result;
use derive_docs::stdlib; use derive_docs::stdlib;
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::CutType, ModelingCmd}; use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::CutType, ModelingCmd};
use kittycad_modeling_cmds as kcmc; use kittycad_modeling_cmds as kcmc;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::{ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
@ -16,22 +14,14 @@ use crate::{
pub(crate) const DEFAULT_TOLERANCE: f64 = 0.0000001; pub(crate) const DEFAULT_TOLERANCE: f64 = 0.0000001;
/// Data for chamfers.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)]
#[serde(rename_all = "camelCase")]
pub struct ChamferData {
/// The length of the chamfer.
pub length: f64,
/// The tags of the paths you want to chamfer.
pub tags: Vec<EdgeReference>,
}
/// Create chamfers on tagged paths. /// Create chamfers on tagged paths.
pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (data, solid, tag): (ChamferData, Box<Solid>, Option<TagNode>) = args.get_data_and_solid_and_tag()?; let solid = args.get_unlabeled_kw_arg("solid")?;
let length = args.get_kw_arg("length")?;
let tags = args.get_kw_arg("tags")?;
let tag = args.get_kw_arg_opt("tag")?;
let value = inner_chamfer(data, solid, tag, exec_state, args).await?; let value = inner_chamfer(solid, length, tags, tag, exec_state, args).await?;
Ok(KclValue::Solid { value }) Ok(KclValue::Solid { value })
} }
@ -56,7 +46,7 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> close(tag = $edge4) /// |> close(tag = $edge4)
/// ///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness) /// mountingPlate = extrude(mountingPlateSketch, length = thickness)
/// |> chamfer({ /// |> chamfer(
/// length = chamferLength, /// length = chamferLength,
/// tags = [ /// tags = [
/// getNextAdjacentEdge(edge1), /// getNextAdjacentEdge(edge1),
@ -64,7 +54,7 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// getNextAdjacentEdge(edge3), /// getNextAdjacentEdge(edge3),
/// getNextAdjacentEdge(edge4) /// getNextAdjacentEdge(edge4)
/// ], /// ],
/// }, %) /// )
/// ``` /// ```
/// ///
/// ```no_run /// ```no_run
@ -82,10 +72,12 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// part001 = cube([0,0], 20) /// part001 = cube([0,0], 20)
/// |> close(tag = $line1) /// |> close(tag = $line1)
/// |> extrude(length = 20) /// |> extrude(length = 20)
/// |> chamfer({ /// // We tag the chamfer to reference it later.
/// |> chamfer(
/// length = 10, /// length = 10,
/// tags = [getOppositeEdge(line1)] /// tags = [getOppositeEdge(line1)],
/// }, %, $chamfer1) // We tag the chamfer to reference it later. /// tag = $chamfer1,
/// )
/// ///
/// sketch001 = startSketchOn(part001, chamfer1) /// sketch001 = startSketchOn(part001, chamfer1)
/// |> startProfileAt([10, 10], %) /// |> startProfileAt([10, 10], %)
@ -99,19 +91,28 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
#[stdlib { #[stdlib {
name = "chamfer", name = "chamfer",
feature_tree_operation = true, feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solid = { docs = "The solid whose edges should be chamfered" },
length = { docs = "The length of the chamfer" },
tags = { docs = "The paths you want to chamfer" },
tag = { docs = "Create a new tag which refers to this chamfer"},
}
}] }]
async fn inner_chamfer( async fn inner_chamfer(
data: ChamferData,
solid: Box<Solid>, solid: Box<Solid>,
length: f64,
tags: Vec<EdgeReference>,
tag: Option<TagNode>, tag: Option<TagNode>,
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Box<Solid>, KclError> { ) -> Result<Box<Solid>, KclError> {
// Check if tags contains any duplicate values. // Check if tags contains any duplicate values.
let mut tags = data.tags.clone(); let mut tags = tags.clone();
tags.sort(); tags.sort();
tags.dedup(); tags.dedup();
if tags.len() != data.tags.len() { if tags.len() != tags.len() {
return Err(KclError::Type(KclErrorDetails { return Err(KclError::Type(KclErrorDetails {
message: "Duplicate tags are not allowed.".to_string(), message: "Duplicate tags are not allowed.".to_string(),
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
@ -120,7 +121,7 @@ async fn inner_chamfer(
// If you try and tag multiple edges with a tagged chamfer, we want to return an // If you try and tag multiple edges with a tagged chamfer, we want to return an
// error to the user that they can only tag one edge at a time. // error to the user that they can only tag one edge at a time.
if tag.is_some() && data.tags.len() > 1 { if tag.is_some() && tags.len() > 1 {
return Err(KclError::Type(KclErrorDetails { return Err(KclError::Type(KclErrorDetails {
message: "You can only tag one edge at a time with a tagged chamfer. Either delete the tag for the chamfer fn if you don't need it OR separate into individual chamfer functions for each tag.".to_string(), message: "You can only tag one edge at a time with a tagged chamfer. Either delete the tag for the chamfer fn if you don't need it OR separate into individual chamfer functions for each tag.".to_string(),
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
@ -128,7 +129,7 @@ async fn inner_chamfer(
} }
let mut solid = solid.clone(); let mut solid = solid.clone();
for edge_tag in data.tags { for edge_tag in tags {
let edge_id = match edge_tag { let edge_id = match edge_tag {
EdgeReference::Uuid(uuid) => uuid, EdgeReference::Uuid(uuid) => uuid,
EdgeReference::Tag(edge_tag) => args.get_tag_engine_info(exec_state, &edge_tag)?.id, EdgeReference::Tag(edge_tag) => args.get_tag_engine_info(exec_state, &edge_tag)?.id,
@ -140,7 +141,7 @@ async fn inner_chamfer(
ModelingCmd::from(mcmd::Solid3dFilletEdge { ModelingCmd::from(mcmd::Solid3dFilletEdge {
edge_id, edge_id,
object_id: solid.id, object_id: solid.id,
radius: LengthUnit(data.length), radius: LengthUnit(length),
tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future. tolerance: LengthUnit(DEFAULT_TOLERANCE), // We can let the user set this in the future.
cut_type: CutType::Chamfer, cut_type: CutType::Chamfer,
// We make this a none so that we can remove it in the future. // We make this a none so that we can remove it in the future.
@ -152,7 +153,7 @@ async fn inner_chamfer(
solid.edge_cuts.push(EdgeCut::Chamfer { solid.edge_cuts.push(EdgeCut::Chamfer {
id, id,
edge_id, edge_id,
length: data.length, length,
tag: Box::new(tag.clone()), tag: Box::new(tag.clone()),
}); });

View File

@ -19,20 +19,6 @@ use crate::{
std::Args, std::Args,
}; };
/// Data for fillets.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)]
#[serde(rename_all = "camelCase")]
pub struct FilletData {
/// The radius of the fillet.
pub radius: f64,
/// The tags of the paths you want to fillet.
pub tags: Vec<EdgeReference>,
/// The tolerance for the fillet.
#[serde(default)]
pub tolerance: Option<f64>,
}
/// A tag or a uuid of an edge. /// A tag or a uuid of an edge.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq, Ord, PartialOrd, Hash)] #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Eq, Ord, PartialOrd, Hash)]
#[ts(export)] #[ts(export)]
@ -55,9 +41,12 @@ impl EdgeReference {
/// Create fillets on tagged paths. /// Create fillets on tagged paths.
pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (data, solid, tag): (FilletData, Box<Solid>, Option<TagNode>) = args.get_data_and_solid_and_tag()?; let solid = args.get_unlabeled_kw_arg("solid")?;
let radius = args.get_kw_arg("radius")?;
let value = inner_fillet(data, solid, tag, exec_state, args).await?; let tolerance = args.get_kw_arg_opt("tolerance")?;
let tags = args.get_kw_arg("tags")?;
let tag = args.get_kw_arg_opt("tag")?;
let value = inner_fillet(solid, radius, tags, tolerance, tag, exec_state, args).await?;
Ok(KclValue::Solid { value }) Ok(KclValue::Solid { value })
} }
@ -81,7 +70,7 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> close(tag = $edge4) /// |> close(tag = $edge4)
/// ///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness) /// mountingPlate = extrude(mountingPlateSketch, length = thickness)
/// |> fillet({ /// |> fillet(
/// radius = filletRadius, /// radius = filletRadius,
/// tags = [ /// tags = [
/// getNextAdjacentEdge(edge1), /// getNextAdjacentEdge(edge1),
@ -89,7 +78,7 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// getNextAdjacentEdge(edge3), /// getNextAdjacentEdge(edge3),
/// getNextAdjacentEdge(edge4) /// getNextAdjacentEdge(edge4)
/// ], /// ],
/// }, %) /// )
/// ``` /// ```
/// ///
/// ```no_run /// ```no_run
@ -106,7 +95,7 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> close(tag = $edge4) /// |> close(tag = $edge4)
/// ///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness) /// mountingPlate = extrude(mountingPlateSketch, length = thickness)
/// |> fillet({ /// |> fillet(
/// radius = filletRadius, /// radius = filletRadius,
/// tolerance = 0.000001, /// tolerance = 0.000001,
/// tags = [ /// tags = [
@ -115,24 +104,35 @@ pub async fn fillet(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// getNextAdjacentEdge(edge3), /// getNextAdjacentEdge(edge3),
/// getNextAdjacentEdge(edge4) /// getNextAdjacentEdge(edge4)
/// ], /// ],
/// }, %) /// )
/// ``` /// ```
#[stdlib { #[stdlib {
name = "fillet", name = "fillet",
feature_tree_operation = true, feature_tree_operation = true,
keywords = true,
unlabeled_first = true,
args = {
solid = { docs = "The solid whose edges should be filletted" },
radius = { docs = "The radius of the fillet" },
tags = { docs = "The paths you want to fillet" },
tolerance = { docs = "The tolerance for this fillet" },
tag = { docs = "Create a new tag which refers to this fillet"},
}
}] }]
async fn inner_fillet( async fn inner_fillet(
data: FilletData,
solid: Box<Solid>, solid: Box<Solid>,
radius: f64,
tags: Vec<EdgeReference>,
tolerance: Option<f64>,
tag: Option<TagNode>, tag: Option<TagNode>,
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Box<Solid>, KclError> { ) -> Result<Box<Solid>, KclError> {
// Check if tags contains any duplicate values. // Check if tags contains any duplicate values.
let mut tags = data.tags.clone(); let mut unique_tags = tags.clone();
tags.sort(); unique_tags.sort();
tags.dedup(); unique_tags.dedup();
if tags.len() != data.tags.len() { if unique_tags.len() != tags.len() {
return Err(KclError::Type(KclErrorDetails { return Err(KclError::Type(KclErrorDetails {
message: "Duplicate tags are not allowed.".to_string(), message: "Duplicate tags are not allowed.".to_string(),
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
@ -140,7 +140,7 @@ async fn inner_fillet(
} }
let mut solid = solid.clone(); let mut solid = solid.clone();
for edge_tag in data.tags { for edge_tag in tags {
let edge_id = edge_tag.get_engine_id(exec_state, &args)?; let edge_id = edge_tag.get_engine_id(exec_state, &args)?;
let id = exec_state.next_uuid(); let id = exec_state.next_uuid();
@ -149,8 +149,8 @@ async fn inner_fillet(
ModelingCmd::from(mcmd::Solid3dFilletEdge { ModelingCmd::from(mcmd::Solid3dFilletEdge {
edge_id, edge_id,
object_id: solid.id, object_id: solid.id,
radius: LengthUnit(data.radius), radius: LengthUnit(radius),
tolerance: LengthUnit(data.tolerance.unwrap_or(default_tolerance(&args.ctx.settings.units))), tolerance: LengthUnit(tolerance.unwrap_or(default_tolerance(&args.ctx.settings.units))),
cut_type: CutType::Fillet, cut_type: CutType::Fillet,
// We make this a none so that we can remove it in the future. // We make this a none so that we can remove it in the future.
face_id: None, face_id: None,
@ -161,7 +161,7 @@ async fn inner_fillet(
solid.edge_cuts.push(EdgeCut::Fillet { solid.edge_cuts.push(EdgeCut::Fillet {
id, id,
edge_id, edge_id,
radius: data.radius, radius,
tag: Box::new(tag.clone()), tag: Box::new(tag.clone()),
}); });
@ -213,10 +213,10 @@ pub async fn get_opposite_edge(exec_state: &mut ExecState, args: Args) -> Result
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
/// |> fillet({ /// |> fillet(
/// radius = 3, /// radius = 3,
/// tags = [getOppositeEdge(referenceEdge)], /// tags = [getOppositeEdge(referenceEdge)],
/// }, %) /// )
/// ``` /// ```
#[stdlib { #[stdlib {
name = "getOppositeEdge", name = "getOppositeEdge",
@ -286,10 +286,10 @@ pub async fn get_next_adjacent_edge(exec_state: &mut ExecState, args: Args) -> R
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
/// |> fillet({ /// |> fillet(
/// radius = 3, /// radius = 3,
/// tags = [getNextAdjacentEdge(referenceEdge)], /// tags = [getNextAdjacentEdge(referenceEdge)],
/// }, %) /// )
/// ``` /// ```
#[stdlib { #[stdlib {
name = "getNextAdjacentEdge", name = "getNextAdjacentEdge",
@ -371,10 +371,10 @@ pub async fn get_previous_adjacent_edge(exec_state: &mut ExecState, args: Args)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
/// |> fillet({ /// |> fillet(
/// radius = 3, /// radius = 3,
/// tags = [getPreviousAdjacentEdge(referenceEdge)], /// tags = [getPreviousAdjacentEdge(referenceEdge)],
/// }, %) /// )
/// ``` /// ```
#[stdlib { #[stdlib {
name = "getPreviousAdjacentEdge", name = "getPreviousAdjacentEdge",

View File

@ -327,6 +327,19 @@ impl CallExpression {
} }
impl CallExpressionKw { impl CallExpressionKw {
fn recast_args(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> Vec<String> {
let mut arg_list = if let Some(first_arg) = &self.unlabeled {
vec![first_arg.recast(options, indentation_level, ctxt)]
} else {
Vec::with_capacity(self.arguments.len())
};
arg_list.extend(
self.arguments
.iter()
.map(|arg| arg.recast(options, indentation_level, ctxt)),
);
arg_list
}
fn recast(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> String { fn recast(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> String {
let indent = if ctxt == ExprContext::Pipe { let indent = if ctxt == ExprContext::Pipe {
"".to_string() "".to_string()
@ -334,23 +347,19 @@ impl CallExpressionKw {
options.get_indentation(indentation_level) options.get_indentation(indentation_level)
}; };
let name = &self.callee.name; let name = &self.callee.name;
let mut arg_list = if let Some(first_arg) = &self.unlabeled { let arg_list = self.recast_args(options, indentation_level, ctxt);
vec![first_arg.recast(options, indentation_level, ctxt)]
} else {
Vec::new()
};
arg_list.extend(
self.arguments
.iter()
.map(|arg| arg.recast(options, indentation_level, ctxt)),
);
let args = arg_list.clone().join(", "); let args = arg_list.clone().join(", ");
if arg_list.len() >= 4 { let has_lots_of_args = arg_list.len() >= 4;
let some_arg_is_already_multiline = arg_list.len() > 1 && arg_list.iter().any(|arg| arg.contains('\n'));
let multiline = has_lots_of_args || some_arg_is_already_multiline;
if multiline {
let next_indent = indentation_level + 1;
let inner_indentation = if ctxt == ExprContext::Pipe { let inner_indentation = if ctxt == ExprContext::Pipe {
options.get_indentation_offset_pipe(indentation_level + 1) options.get_indentation_offset_pipe(next_indent)
} else { } else {
options.get_indentation(indentation_level + 1) options.get_indentation(next_indent)
}; };
let arg_list = self.recast_args(options, next_indent, ctxt);
let mut args = arg_list.join(&format!(",\n{inner_indentation}")); let mut args = arg_list.join(&format!(",\n{inner_indentation}"));
args.push(','); args.push(',');
let args = args; let args = args;
@ -1424,7 +1433,7 @@ fn rectShape = (pos, w, l) => {
// only used for visualization // only used for visualization
scarlett_body = rectShape([0, 0], width, length) scarlett_body = rectShape([0, 0], width, length)
|> extrude(depth, %) |> extrude(depth, %)
|> fillet({ |> fillet(
radius = radius, radius = radius,
tags = [ tags = [
edge2, edge2,
@ -1432,7 +1441,7 @@ scarlett_body = rectShape([0, 0], width, length)
getOppositeEdge(edge2), getOppositeEdge(edge2),
getOppositeEdge(edge4) getOppositeEdge(edge4)
] ]
}, %) )
// build the bracket sketch around the body // build the bracket sketch around the body
fn bracketSketch = (w, d, t) => { fn bracketSketch = (w, d, t) => {
s = startSketchOn({ s = startSketchOn({
@ -1457,15 +1466,15 @@ fn bracketSketch = (w, d, t) => {
// build the body of the bracket // build the body of the bracket
bracket_body = bracketSketch(width, depth, thk) bracket_body = bracketSketch(width, depth, thk)
|> extrude(length + 10, %) |> extrude(length + 10, %)
|> fillet({ |> fillet(
radius = radius, radius = radius,
tags: [ tags = [
getNextAdjacentEdge(edge7), getNextAdjacentEdge(edge7),
getNextAdjacentEdge(edge2), getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3), getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge6) getNextAdjacentEdge(edge6)
] ]
}, %) )
// build the tabs of the mounting bracket (right side) // build the tabs of the mounting bracket (right side)
tabs_r = startSketchOn({ tabs_r = startSketchOn({
plane: { plane: {
@ -1545,15 +1554,15 @@ fn rectShape(pos, w, l) {
// only used for visualization // only used for visualization
scarlett_body = rectShape([0, 0], width, length) scarlett_body = rectShape([0, 0], width, length)
|> extrude(depth, %) |> extrude(depth, %)
|> fillet({ |> fillet(
radius = radius, radius = radius,
tags = [ tags = [
edge2, edge2,
edge4, edge4,
getOppositeEdge(edge2), getOppositeEdge(edge2),
getOppositeEdge(edge4) getOppositeEdge(edge4)
] ],
}, %) )
// build the bracket sketch around the body // build the bracket sketch around the body
fn bracketSketch(w, d, t) { fn bracketSketch(w, d, t) {
s = startSketchOn({ s = startSketchOn({
@ -1578,15 +1587,15 @@ fn bracketSketch(w, d, t) {
// build the body of the bracket // build the body of the bracket
bracket_body = bracketSketch(width, depth, thk) bracket_body = bracketSketch(width, depth, thk)
|> extrude(length + 10, %) |> extrude(length + 10, %)
|> fillet({ |> fillet(
radius = radius, radius = radius,
tags = [ tags = [
getNextAdjacentEdge(edge7), getNextAdjacentEdge(edge7),
getNextAdjacentEdge(edge2), getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3), getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge6) getNextAdjacentEdge(edge6)
] ],
}, %) )
// build the tabs of the mounting bracket (right side) // build the tabs of the mounting bracket (right side)
tabs_r = startSketchOn({ tabs_r = startSketchOn({
plane = { plane = {

View File

@ -652,7 +652,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
298, 298,
339, 332,
0 0
], ],
"command": { "command": {
@ -667,8 +667,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
390, 383,
417, 410,
0 0
], ],
"command": { "command": {
@ -683,8 +683,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
390, 383,
417, 410,
0 0
], ],
"command": { "command": {
@ -694,8 +694,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
390, 383,
417, 410,
0 0
], ],
"command": { "command": {
@ -711,8 +711,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
423, 416,
441, 434,
0 0
], ],
"command": { "command": {
@ -732,8 +732,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
447, 440,
466, 459,
0 0
], ],
"command": { "command": {
@ -753,8 +753,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
472, 465,
528, 521,
0 0
], ],
"command": { "command": {
@ -774,8 +774,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
527,
534, 534,
541,
0 0
], ],
"command": { "command": {
@ -786,8 +786,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -802,8 +802,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -816,8 +816,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -827,8 +827,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -839,8 +839,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -852,8 +852,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -866,8 +866,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -880,8 +880,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -894,8 +894,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -908,8 +908,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {
@ -922,8 +922,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
555, 548,
585, 578,
0 0
], ],
"command": { "command": {

View File

@ -10,11 +10,11 @@ flowchart LR
8[Solid2d] 8[Solid2d]
end end
subgraph path25 [Path] subgraph path25 [Path]
25["Path<br>[390, 417, 0]"] 25["Path<br>[383, 410, 0]"]
26["Segment<br>[423, 441, 0]"] 26["Segment<br>[416, 434, 0]"]
27["Segment<br>[447, 466, 0]"] 27["Segment<br>[440, 459, 0]"]
28["Segment<br>[472, 528, 0]"] 28["Segment<br>[465, 521, 0]"]
29["Segment<br>[534, 541, 0]"] 29["Segment<br>[527, 534, 0]"]
30[Solid2d] 30[Solid2d]
end end
1["Plane<br>[12, 31, 0]"] 1["Plane<br>[12, 31, 0]"]
@ -33,8 +33,8 @@ flowchart LR
21["SweepEdge Adjacent"] 21["SweepEdge Adjacent"]
22["SweepEdge Opposite"] 22["SweepEdge Opposite"]
23["SweepEdge Adjacent"] 23["SweepEdge Adjacent"]
24["EdgeCut Fillet<br>[298, 339, 0]"] 24["EdgeCut Fillet<br>[298, 332, 0]"]
31["Sweep Extrusion<br>[555, 585, 0]"] 31["Sweep Extrusion<br>[548, 578, 0]"]
32[Wall] 32[Wall]
33[Wall] 33[Wall]
34[Wall] 34[Wall]

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing artifact_graph_example_code1.kcl description: Result of parsing artifact_graph_example_code1.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
@ -393,7 +394,7 @@ description: Result of parsing artifact_graph_example_code1.kcl
}, },
{ {
"declaration": { "declaration": {
"end": 339, "end": 332,
"id": { "id": {
"end": 257, "end": 257,
"name": "extrude001", "name": "extrude001",
@ -451,22 +452,15 @@ description: Result of parsing artifact_graph_example_code1.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 335, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 317, "name": "radius"
"key": {
"end": 313,
"name": "radius",
"start": 307,
"type": "Identifier"
}, },
"start": 307, "arg": {
"type": "ObjectProperty", "end": 315,
"value": {
"end": 317,
"raw": "5", "raw": "5",
"start": 316, "start": 314,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -476,56 +470,42 @@ description: Result of parsing artifact_graph_example_code1.kcl
} }
}, },
{ {
"end": 333, "type": "LabeledArg",
"key": { "label": {
"end": 323, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 319,
"type": "Identifier"
}, },
"start": 319, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"end": 332, "end": 330,
"name": "seg01", "name": "seg01",
"start": 327, "start": 325,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"end": 333, "end": 331,
"start": 326, "start": 324,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 305,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 338,
"start": 337,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 304, "end": 304,
"name": "fillet", "name": "fillet",
"start": 298, "start": 298,
"type": "Identifier" "type": "Identifier"
}, },
"end": 339, "end": 332,
"start": 298, "start": 298,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 339, "end": 332,
"start": 260, "start": 260,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -533,7 +513,7 @@ description: Result of parsing artifact_graph_example_code1.kcl
"start": 247, "start": 247,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 339, "end": 332,
"kind": "const", "kind": "const",
"start": 247, "start": 247,
"type": "VariableDeclaration", "type": "VariableDeclaration",
@ -541,11 +521,11 @@ description: Result of parsing artifact_graph_example_code1.kcl
}, },
{ {
"declaration": { "declaration": {
"end": 541, "end": 534,
"id": { "id": {
"end": 349, "end": 342,
"name": "sketch002", "name": "sketch002",
"start": 340, "start": 333,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -553,28 +533,28 @@ description: Result of parsing artifact_graph_example_code1.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 376, "end": 369,
"name": "extrude001", "name": "extrude001",
"start": 366, "start": 359,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 383, "end": 376,
"name": "seg02", "name": "seg02",
"start": 378, "start": 371,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 365, "end": 358,
"name": "startSketchOn", "name": "startSketchOn",
"start": 352, "start": 345,
"type": "Identifier" "type": "Identifier"
}, },
"end": 384, "end": 377,
"start": 352, "start": 345,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -584,9 +564,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
"elements": [ "elements": [
{ {
"argument": { "argument": {
"end": 408, "end": 401,
"raw": "2", "raw": "2",
"start": 407, "start": 400,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -594,17 +574,17 @@ description: Result of parsing artifact_graph_example_code1.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 408, "end": 401,
"operator": "-", "operator": "-",
"start": 406, "start": 399,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"argument": { "argument": {
"end": 412, "end": 405,
"raw": "6", "raw": "6",
"start": 411, "start": 404,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -612,33 +592,33 @@ description: Result of parsing artifact_graph_example_code1.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 412, "end": 405,
"operator": "-", "operator": "-",
"start": 410, "start": 403,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 413, "end": 406,
"start": 405, "start": 398,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"end": 416, "end": 409,
"start": 415, "start": 408,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 404, "end": 397,
"name": "startProfileAt", "name": "startProfileAt",
"start": 390, "start": 383,
"type": "Identifier" "type": "Identifier"
}, },
"end": 417, "end": 410,
"start": 390, "start": 383,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -653,9 +633,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 436, "end": 429,
"raw": "2", "raw": "2",
"start": 435, "start": 428,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -664,9 +644,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
} }
}, },
{ {
"end": 439, "end": 432,
"raw": "3", "raw": "3",
"start": 438, "start": 431,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -675,21 +655,21 @@ description: Result of parsing artifact_graph_example_code1.kcl
} }
} }
], ],
"end": 440, "end": 433,
"start": 434, "start": 427,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 427, "end": 420,
"name": "line", "name": "line",
"start": 423, "start": 416,
"type": "Identifier" "type": "Identifier"
}, },
"end": 441, "end": 434,
"start": 423, "start": 416,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -705,9 +685,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 460, "end": 453,
"raw": "2", "raw": "2",
"start": 459, "start": 452,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -717,9 +697,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
}, },
{ {
"argument": { "argument": {
"end": 464, "end": 457,
"raw": "3", "raw": "3",
"start": 463, "start": 456,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -727,28 +707,28 @@ description: Result of parsing artifact_graph_example_code1.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 464, "end": 457,
"operator": "-", "operator": "-",
"start": 462, "start": 455,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 465, "end": 458,
"start": 458, "start": 451,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 451, "end": 444,
"name": "line", "name": "line",
"start": 447, "start": 440,
"type": "Identifier" "type": "Identifier"
}, },
"end": 466, "end": 459,
"start": 447, "start": 440,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -766,59 +746,59 @@ description: Result of parsing artifact_graph_example_code1.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 507, "end": 500,
"start": 506, "start": 499,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 505, "end": 498,
"name": "profileStartX", "name": "profileStartX",
"start": 492, "start": 485,
"type": "Identifier" "type": "Identifier"
}, },
"end": 508, "end": 501,
"start": 492, "start": 485,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 525, "end": 518,
"start": 524, "start": 517,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 523, "end": 516,
"name": "profileStartY", "name": "profileStartY",
"start": 510, "start": 503,
"type": "Identifier" "type": "Identifier"
}, },
"end": 526, "end": 519,
"start": 510, "start": 503,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 527, "end": 520,
"start": 491, "start": 484,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 476, "end": 469,
"name": "line", "name": "line",
"start": 472, "start": 465,
"type": "Identifier" "type": "Identifier"
}, },
"end": 528, "end": 521,
"start": 472, "start": 465,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -826,38 +806,38 @@ description: Result of parsing artifact_graph_example_code1.kcl
{ {
"arguments": [], "arguments": [],
"callee": { "callee": {
"end": 539, "end": 532,
"name": "close", "name": "close",
"start": 534, "start": 527,
"type": "Identifier" "type": "Identifier"
}, },
"end": 541, "end": 534,
"start": 534, "start": 527,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 541, "end": 534,
"start": 352, "start": 345,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
}, },
"start": 340, "start": 333,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 541, "end": 534,
"kind": "const", "kind": "const",
"start": 340, "start": 333,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"declaration": { "declaration": {
"end": 585, "end": 578,
"id": { "id": {
"end": 552, "end": 545,
"name": "extrude002", "name": "extrude002",
"start": 542, "start": 535,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -869,9 +849,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
"name": "length" "name": "length"
}, },
"arg": { "arg": {
"end": 584, "end": 577,
"raw": "5", "raw": "5",
"start": 583, "start": 576,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -882,34 +862,34 @@ description: Result of parsing artifact_graph_example_code1.kcl
} }
], ],
"callee": { "callee": {
"end": 562, "end": 555,
"name": "extrude", "name": "extrude",
"start": 555, "start": 548,
"type": "Identifier" "type": "Identifier"
}, },
"end": 585, "end": 578,
"start": 555, "start": 548,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": { "unlabeled": {
"end": 572, "end": 565,
"name": "sketch002", "name": "sketch002",
"start": 563, "start": 556,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
}, },
"start": 542, "start": 535,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 585, "end": 578,
"kind": "const", "kind": "const",
"start": 542, "start": 535,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 586, "end": 579,
"start": 0 "start": 0
} }
} }

View File

@ -6,7 +6,7 @@ sketch001 = startSketchOn('XY')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = -10) extrude001 = extrude(sketch001, length = -10)
|> fillet({ radius = 5, tags = [seg01] }, %) |> fillet(radius = 5, tags = [seg01])
sketch002 = startSketchOn(extrude001, seg02) sketch002 = startSketchOn(extrude001, seg02)
|> startProfileAt([-2, -6], %) |> startProfileAt([-2, -6], %)
|> line(end = [2, 3]) |> line(end = [2, 3])

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code1.kcl description: Operations executed artifact_graph_example_code1.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed artifact_graph_example_code1.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 5.0, "value": 5.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed artifact_graph_example_code1.kcl
} }
} }
}, },
"sourceRange": [
314,
315,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -98,25 +103,10 @@ description: Operations executed artifact_graph_example_code1.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
305, 324,
335, 331,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
337,
338,
0 0
] ]
} }
@ -124,11 +114,23 @@ description: Operations executed artifact_graph_example_code1.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
298, 298,
339, 332,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -140,8 +142,8 @@ description: Operations executed artifact_graph_example_code1.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
366, 359,
376, 369,
0 0
] ]
}, },
@ -152,16 +154,16 @@ description: Operations executed artifact_graph_example_code1.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
378, 371,
383, 376,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
352, 345,
384, 377,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -184,16 +186,16 @@ description: Operations executed artifact_graph_example_code1.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
583, 576,
584, 577,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
555, 548,
585, 578,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -205,8 +207,8 @@ description: Operations executed artifact_graph_example_code1.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
563, 556,
572, 565,
0 0
] ]
} }

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Variables in memory after executing artifact_graph_example_code1.kcl description: Variables in memory after executing artifact_graph_example_code1.kcl
snapshot_kind: text
--- ---
{ {
"E": { "E": {
@ -589,8 +590,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
423, 416,
441, 434,
0 0
], ],
"tag": null, "tag": null,
@ -600,8 +601,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
447, 440,
466, 459,
0 0
], ],
"tag": null, "tag": null,
@ -611,8 +612,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
472, 465,
528, 521,
0 0
], ],
"tag": null, "tag": null,
@ -627,8 +628,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
423, 416,
441, 434,
0 0
] ]
}, },
@ -650,8 +651,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
447, 440,
466, 459,
0 0
] ]
}, },
@ -673,8 +674,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
472, 465,
528, 521,
0 0
] ]
}, },
@ -696,8 +697,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
527,
534, 534,
541,
0 0
] ]
}, },
@ -1150,8 +1151,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
352, 345,
384, 377,
0 0
] ]
} }
@ -1173,8 +1174,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
390, 383,
417, 410,
0 0
] ]
} }
@ -1187,8 +1188,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
390, 383,
417, 410,
0 0
] ]
} }
@ -1203,8 +1204,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
390, 383,
417, 410,
0 0
] ]
} }
@ -1710,8 +1711,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
423, 416,
441, 434,
0 0
] ]
}, },
@ -1733,8 +1734,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
447, 440,
466, 459,
0 0
] ]
}, },
@ -1756,8 +1757,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
472, 465,
528, 521,
0 0
] ]
}, },
@ -1779,8 +1780,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
527,
534, 534,
541,
0 0
] ]
}, },
@ -2233,8 +2234,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
352, 345,
384, 377,
0 0
] ]
} }
@ -2256,8 +2257,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
390, 383,
417, 410,
0 0
] ]
} }
@ -2270,8 +2271,8 @@ description: Variables in memory after executing artifact_graph_example_code1.kc
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
390, 383,
417, 410,
0 0
] ]
} }

View File

@ -630,8 +630,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
274, 258,
297, 281,
0 0
], ],
"command": { "command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
223, 223,
309, 283,
0 0
], ],
"command": { "command": {
@ -661,7 +661,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
223, 223,
309, 283,
0 0
], ],
"command": { "command": {

View File

@ -24,8 +24,8 @@ flowchart LR
20["SweepEdge Adjacent"] 20["SweepEdge Adjacent"]
21["SweepEdge Opposite"] 21["SweepEdge Opposite"]
22["SweepEdge Adjacent"] 22["SweepEdge Adjacent"]
23["EdgeCut Fillet<br>[223, 309, 0]"] 23["EdgeCut Fillet<br>[223, 283, 0]"]
24["EdgeCut Fillet<br>[223, 309, 0]"] 24["EdgeCut Fillet<br>[223, 283, 0]"]
1 --- 2 1 --- 2
2 --- 3 2 --- 3
2 --- 4 2 --- 4

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing basic_fillet_cube_close_opposite.kcl description: Result of parsing basic_fillet_cube_close_opposite.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 309, "end": 283,
"id": { "id": {
"end": 7, "end": 7,
"name": "part001", "name": "part001",
@ -344,22 +345,15 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 305, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 249, "name": "radius"
"key": {
"end": 245,
"name": "radius",
"start": 239,
"type": "Identifier"
}, },
"start": 239, "arg": {
"type": "ObjectProperty", "end": 240,
"value": {
"end": 249,
"raw": "2", "raw": "2",
"start": 248, "start": 239,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -369,77 +363,63 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
} }
}, },
{ {
"end": 298, "type": "LabeledArg",
"key": { "label": {
"end": 262, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 258,
"type": "Identifier"
}, },
"start": 258, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"end": 272, "end": 256,
"name": "thing3", "name": "thing3",
"start": 266, "start": 250,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 296, "end": 280,
"name": "thing3", "name": "thing3",
"start": 290, "start": 274,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 289, "end": 273,
"name": "getOppositeEdge", "name": "getOppositeEdge",
"start": 274, "start": 258,
"type": "Identifier" "type": "Identifier"
}, },
"end": 297, "end": 281,
"start": 274, "start": 258,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 298, "end": 282,
"start": 265, "start": 249,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 230,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 308,
"start": 307,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 229, "end": 229,
"name": "fillet", "name": "fillet",
"start": 223, "start": 223,
"type": "Identifier" "type": "Identifier"
}, },
"end": 309, "end": 283,
"start": 223, "start": 223,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 309, "end": 283,
"start": 10, "start": 10,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -447,14 +427,14 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 309, "end": 283,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 310, "end": 284,
"start": 0 "start": 0
} }
} }

View File

@ -5,7 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({ |> fillet(radius = 2, tags = [thing3, getOppositeEdge(thing3)])
radius = 2,
tags = [thing3, getOppositeEdge(thing3)]
}, %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_close_opposite.kcl description: Operations executed basic_fillet_cube_close_opposite.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
} }
} }
}, },
"sourceRange": [
239,
240,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -102,25 +107,10 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
230, 249,
305, 282,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
307,
308,
0 0
] ]
} }
@ -128,10 +118,22 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
223, 223,
309, 283,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
} }
] ]

View File

@ -630,8 +630,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
261, 245,
283, 267,
0 0
], ],
"command": { "command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
211, 211,
295, 269,
0 0
], ],
"command": { "command": {
@ -661,7 +661,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
211, 211,
295, 269,
0 0
], ],
"command": { "command": {

View File

@ -24,8 +24,8 @@ flowchart LR
20["SweepEdge Adjacent"] 20["SweepEdge Adjacent"]
21["SweepEdge Opposite"] 21["SweepEdge Opposite"]
22["SweepEdge Adjacent"] 22["SweepEdge Adjacent"]
23["EdgeCut Fillet<br>[211, 295, 0]"] 23["EdgeCut Fillet<br>[211, 269, 0]"]
24["EdgeCut Fillet<br>[211, 295, 0]"] 24["EdgeCut Fillet<br>[211, 269, 0]"]
1 --- 2 1 --- 2
2 --- 3 2 --- 3
2 --- 4 2 --- 4

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing basic_fillet_cube_end.kcl description: Result of parsing basic_fillet_cube_end.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 295, "end": 269,
"id": { "id": {
"end": 7, "end": 7,
"name": "part001", "name": "part001",
@ -335,22 +336,15 @@ description: Result of parsing basic_fillet_cube_end.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 291, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 237, "name": "radius"
"key": {
"end": 233,
"name": "radius",
"start": 227,
"type": "Identifier"
}, },
"start": 227, "arg": {
"type": "ObjectProperty", "end": 228,
"value": {
"end": 237,
"raw": "2", "raw": "2",
"start": 236, "start": 227,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -360,77 +354,63 @@ description: Result of parsing basic_fillet_cube_end.kcl
} }
}, },
{ {
"end": 284, "type": "LabeledArg",
"key": { "label": {
"end": 250, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 246,
"type": "Identifier"
}, },
"start": 246, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"end": 259, "end": 243,
"name": "thing", "name": "thing",
"start": 254, "start": 238,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 282, "end": 266,
"name": "thing", "name": "thing",
"start": 277, "start": 261,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 276, "end": 260,
"name": "getOppositeEdge", "name": "getOppositeEdge",
"start": 261, "start": 245,
"type": "Identifier" "type": "Identifier"
}, },
"end": 283, "end": 267,
"start": 261, "start": 245,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 284, "end": 268,
"start": 253, "start": 237,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 218,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 294,
"start": 293,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 217, "end": 217,
"name": "fillet", "name": "fillet",
"start": 211, "start": 211,
"type": "Identifier" "type": "Identifier"
}, },
"end": 295, "end": 269,
"start": 211, "start": 211,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 295, "end": 269,
"start": 10, "start": 10,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -438,14 +418,14 @@ description: Result of parsing basic_fillet_cube_end.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 295, "end": 269,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 296, "end": 270,
"start": 0 "start": 0
} }
} }

View File

@ -5,7 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(%) |> close(%)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({ |> fillet(radius = 2, tags = [thing, getOppositeEdge(thing)])
radius = 2,
tags = [thing, getOppositeEdge(thing)]
}, %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_end.kcl description: Operations executed basic_fillet_cube_end.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_end.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_end.kcl
} }
} }
}, },
"sourceRange": [
227,
228,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -102,25 +107,10 @@ description: Operations executed basic_fillet_cube_end.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
218, 237,
291, 268,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
293,
294,
0 0
] ]
} }
@ -128,10 +118,22 @@ description: Operations executed basic_fillet_cube_end.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
211, 211,
295, 269,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
} }
] ]

View File

@ -630,8 +630,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
281, 265,
308, 292,
0 0
], ],
"command": { "command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
238, 238,
320, 294,
0 0
], ],
"command": { "command": {

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing basic_fillet_cube_next_adjacent.kcl description: Result of parsing basic_fillet_cube_next_adjacent.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 320, "end": 294,
"id": { "id": {
"end": 7, "end": 7,
"name": "part001", "name": "part001",
@ -358,22 +359,15 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 316, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 264, "name": "radius"
"key": {
"end": 260,
"name": "radius",
"start": 254,
"type": "Identifier"
}, },
"start": 254, "arg": {
"type": "ObjectProperty", "end": 255,
"value": {
"end": 264,
"raw": "2", "raw": "2",
"start": 263, "start": 254,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -383,70 +377,56 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
} }
}, },
{ {
"end": 309, "type": "LabeledArg",
"key": { "label": {
"end": 277, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 273,
"type": "Identifier"
}, },
"start": 273, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"arguments": [ "arguments": [
{ {
"end": 307, "end": 291,
"name": "thing3", "name": "thing3",
"start": 301, "start": 285,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 300, "end": 284,
"name": "getNextAdjacentEdge", "name": "getNextAdjacentEdge",
"start": 281, "start": 265,
"type": "Identifier" "type": "Identifier"
}, },
"end": 308, "end": 292,
"start": 281, "start": 265,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 309, "end": 293,
"start": 280, "start": 264,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 245,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 319,
"start": 318,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 244, "end": 244,
"name": "fillet", "name": "fillet",
"start": 238, "start": 238,
"type": "Identifier" "type": "Identifier"
}, },
"end": 320, "end": 294,
"start": 238, "start": 238,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 320, "end": 294,
"start": 10, "start": 10,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -454,14 +434,14 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 320, "end": 294,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 321, "end": 295,
"start": 0 "start": 0
} }
} }

View File

@ -5,7 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({ |> fillet(radius = 2, tags = [getNextAdjacentEdge(thing3)])
radius = 2,
tags = [getNextAdjacentEdge(thing3)]
}, %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_next_adjacent.kcl description: Operations executed basic_fillet_cube_next_adjacent.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
} }
} }
}, },
"sourceRange": [
254,
255,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -97,25 +102,10 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
245, 264,
316, 293,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
318,
319,
0 0
] ]
} }
@ -123,10 +113,22 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
238, 238,
320, 294,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
} }
] ]

View File

@ -630,8 +630,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
281, 265,
312, 296,
0 0
], ],
"command": { "command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
238, 238,
324, 298,
0 0
], ],
"command": { "command": {

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing basic_fillet_cube_previous_adjacent.kcl description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 324, "end": 298,
"id": { "id": {
"end": 7, "end": 7,
"name": "part001", "name": "part001",
@ -358,22 +359,15 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 320, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 264, "name": "radius"
"key": {
"end": 260,
"name": "radius",
"start": 254,
"type": "Identifier"
}, },
"start": 254, "arg": {
"type": "ObjectProperty", "end": 255,
"value": {
"end": 264,
"raw": "2", "raw": "2",
"start": 263, "start": 254,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -383,70 +377,56 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
} }
}, },
{ {
"end": 313, "type": "LabeledArg",
"key": { "label": {
"end": 277, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 273,
"type": "Identifier"
}, },
"start": 273, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"arguments": [ "arguments": [
{ {
"end": 311, "end": 295,
"name": "thing3", "name": "thing3",
"start": 305, "start": 289,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 304, "end": 288,
"name": "getPreviousAdjacentEdge", "name": "getPreviousAdjacentEdge",
"start": 281, "start": 265,
"type": "Identifier" "type": "Identifier"
}, },
"end": 312, "end": 296,
"start": 281, "start": 265,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 313, "end": 297,
"start": 280, "start": 264,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 245,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 323,
"start": 322,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 244, "end": 244,
"name": "fillet", "name": "fillet",
"start": 238, "start": 238,
"type": "Identifier" "type": "Identifier"
}, },
"end": 324, "end": 298,
"start": 238, "start": 238,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 324, "end": 298,
"start": 10, "start": 10,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -454,14 +434,14 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 324, "end": 298,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 325, "end": 299,
"start": 0 "start": 0
} }
} }

View File

@ -5,7 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({ |> fillet(radius = 2, tags = [getPreviousAdjacentEdge(thing3)])
radius = 2,
tags = [getPreviousAdjacentEdge(thing3)]
}, %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_previous_adjacent.kcl description: Operations executed basic_fillet_cube_previous_adjacent.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
} }
} }
}, },
"sourceRange": [
254,
255,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -97,25 +102,10 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
245, 264,
320, 297,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
322,
323,
0 0
] ]
} }
@ -123,10 +113,22 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
238, 238,
324, 298,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
} }
] ]

View File

@ -630,7 +630,7 @@ description: Artifact commands basic_fillet_cube_start.kcl
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
211, 211,
260, 253,
0 0
], ],
"command": { "command": {
@ -646,7 +646,7 @@ description: Artifact commands basic_fillet_cube_start.kcl
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
211, 211,
260, 253,
0 0
], ],
"command": { "command": {

View File

@ -24,8 +24,8 @@ flowchart LR
20["SweepEdge Adjacent"] 20["SweepEdge Adjacent"]
21["SweepEdge Opposite"] 21["SweepEdge Opposite"]
22["SweepEdge Adjacent"] 22["SweepEdge Adjacent"]
23["EdgeCut Fillet<br>[211, 260, 0]"] 23["EdgeCut Fillet<br>[211, 253, 0]"]
24["EdgeCut Fillet<br>[211, 260, 0]"] 24["EdgeCut Fillet<br>[211, 253, 0]"]
1 --- 2 1 --- 2
2 --- 3 2 --- 3
2 --- 4 2 --- 4

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing basic_fillet_cube_start.kcl description: Result of parsing basic_fillet_cube_start.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 260, "end": 253,
"id": { "id": {
"end": 7, "end": 7,
"name": "part001", "name": "part001",
@ -335,22 +336,15 @@ description: Result of parsing basic_fillet_cube_start.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 256, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 230, "name": "radius"
"key": {
"end": 226,
"name": "radius",
"start": 220,
"type": "Identifier"
}, },
"start": 220, "arg": {
"type": "ObjectProperty", "end": 228,
"value": {
"end": 230,
"raw": "2", "raw": "2",
"start": 229, "start": 227,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -360,63 +354,49 @@ description: Result of parsing basic_fillet_cube_start.kcl
} }
}, },
{ {
"end": 254, "type": "LabeledArg",
"key": { "label": {
"end": 236, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 232,
"type": "Identifier"
}, },
"start": 232, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"end": 245, "end": 243,
"name": "thing", "name": "thing",
"start": 240, "start": 238,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 253, "end": 251,
"name": "thing2", "name": "thing2",
"start": 247, "start": 245,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"end": 254, "end": 252,
"start": 239, "start": 237,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 218,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 259,
"start": 258,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 217, "end": 217,
"name": "fillet", "name": "fillet",
"start": 211, "start": 211,
"type": "Identifier" "type": "Identifier"
}, },
"end": 260, "end": 253,
"start": 211, "start": 211,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 260, "end": 253,
"start": 10, "start": 10,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -424,14 +404,14 @@ description: Result of parsing basic_fillet_cube_start.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 260, "end": 253,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 261, "end": 254,
"start": 0 "start": 0
} }
} }

View File

@ -5,4 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(%) |> close(%)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({ radius = 2, tags = [thing, thing2] }, %) |> fillet(radius = 2, tags = [thing, thing2])

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_start.kcl description: Operations executed basic_fillet_cube_start.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_start.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_start.kcl
} }
} }
}, },
"sourceRange": [
227,
228,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -103,25 +108,10 @@ description: Operations executed basic_fillet_cube_start.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
218, 237,
256, 252,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
258,
259,
0 0
] ]
} }
@ -129,10 +119,22 @@ description: Operations executed basic_fillet_cube_start.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
211, 211,
260, 253,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
} }
] ]

View File

@ -17,55 +17,55 @@ flowchart LR
14[Solid2d] 14[Solid2d]
end end
subgraph path31 [Path] subgraph path31 [Path]
31["Path<br>[1341, 1366, 0]"] 31["Path<br>[1337, 1362, 0]"]
end end
subgraph path32 [Path] subgraph path32 [Path]
32["Path<br>[1374, 1418, 0]"] 32["Path<br>[1370, 1414, 0]"]
33["Segment<br>[1374, 1418, 0]"] 33["Segment<br>[1370, 1414, 0]"]
34[Solid2d] 34[Solid2d]
end end
subgraph path35 [Path] subgraph path35 [Path]
35["Path<br>[1431, 1476, 0]"] 35["Path<br>[1427, 1472, 0]"]
36["Segment<br>[1431, 1476, 0]"] 36["Segment<br>[1427, 1472, 0]"]
37[Solid2d] 37[Solid2d]
end end
subgraph path45 [Path] subgraph path45 [Path]
45["Path<br>[1341, 1366, 0]"] 45["Path<br>[1337, 1362, 0]"]
end end
subgraph path46 [Path] subgraph path46 [Path]
46["Path<br>[1374, 1418, 0]"] 46["Path<br>[1370, 1414, 0]"]
47["Segment<br>[1374, 1418, 0]"] 47["Segment<br>[1370, 1414, 0]"]
48[Solid2d] 48[Solid2d]
end end
subgraph path49 [Path] subgraph path49 [Path]
49["Path<br>[1431, 1476, 0]"] 49["Path<br>[1427, 1472, 0]"]
50["Segment<br>[1431, 1476, 0]"] 50["Segment<br>[1427, 1472, 0]"]
51[Solid2d] 51[Solid2d]
end end
subgraph path59 [Path] subgraph path59 [Path]
59["Path<br>[1341, 1366, 0]"] 59["Path<br>[1337, 1362, 0]"]
end end
subgraph path60 [Path] subgraph path60 [Path]
60["Path<br>[1374, 1418, 0]"] 60["Path<br>[1370, 1414, 0]"]
61["Segment<br>[1374, 1418, 0]"] 61["Segment<br>[1370, 1414, 0]"]
62[Solid2d] 62[Solid2d]
end end
subgraph path63 [Path] subgraph path63 [Path]
63["Path<br>[1431, 1476, 0]"] 63["Path<br>[1427, 1472, 0]"]
64["Segment<br>[1431, 1476, 0]"] 64["Segment<br>[1427, 1472, 0]"]
65[Solid2d] 65[Solid2d]
end end
subgraph path73 [Path] subgraph path73 [Path]
73["Path<br>[1341, 1366, 0]"] 73["Path<br>[1337, 1362, 0]"]
end end
subgraph path74 [Path] subgraph path74 [Path]
74["Path<br>[1374, 1418, 0]"] 74["Path<br>[1370, 1414, 0]"]
75["Segment<br>[1374, 1418, 0]"] 75["Segment<br>[1370, 1414, 0]"]
76[Solid2d] 76[Solid2d]
end end
subgraph path77 [Path] subgraph path77 [Path]
77["Path<br>[1431, 1476, 0]"] 77["Path<br>[1427, 1472, 0]"]
78["Segment<br>[1431, 1476, 0]"] 78["Segment<br>[1427, 1472, 0]"]
79[Solid2d] 79[Solid2d]
end end
1["Plane<br>[373, 461, 0]"] 1["Plane<br>[373, 461, 0]"]
@ -85,38 +85,38 @@ flowchart LR
27["SweepEdge Adjacent"] 27["SweepEdge Adjacent"]
28["SweepEdge Opposite"] 28["SweepEdge Opposite"]
29["SweepEdge Adjacent"] 29["SweepEdge Adjacent"]
30["Plane<br>[1314, 1333, 0]"] 30["Plane<br>[1310, 1329, 0]"]
38["Sweep Extrusion<br>[1488, 1512, 0]"] 38["Sweep Extrusion<br>[1484, 1508, 0]"]
39[Wall] 39[Wall]
40["Cap Start"] 40["Cap Start"]
41["Cap End"] 41["Cap End"]
42["SweepEdge Opposite"] 42["SweepEdge Opposite"]
43["SweepEdge Adjacent"] 43["SweepEdge Adjacent"]
44["Plane<br>[1314, 1333, 0]"] 44["Plane<br>[1310, 1329, 0]"]
52["Sweep Extrusion<br>[1488, 1512, 0]"] 52["Sweep Extrusion<br>[1484, 1508, 0]"]
53[Wall] 53[Wall]
54["Cap Start"] 54["Cap Start"]
55["Cap End"] 55["Cap End"]
56["SweepEdge Opposite"] 56["SweepEdge Opposite"]
57["SweepEdge Adjacent"] 57["SweepEdge Adjacent"]
58["Plane<br>[1314, 1333, 0]"] 58["Plane<br>[1310, 1329, 0]"]
66["Sweep Extrusion<br>[1488, 1512, 0]"] 66["Sweep Extrusion<br>[1484, 1508, 0]"]
67[Wall] 67[Wall]
68["Cap Start"] 68["Cap Start"]
69["Cap End"] 69["Cap End"]
70["SweepEdge Opposite"] 70["SweepEdge Opposite"]
71["SweepEdge Adjacent"] 71["SweepEdge Adjacent"]
72["Plane<br>[1314, 1333, 0]"] 72["Plane<br>[1310, 1329, 0]"]
80["Sweep Extrusion<br>[1488, 1512, 0]"] 80["Sweep Extrusion<br>[1484, 1508, 0]"]
81[Wall] 81[Wall]
82["Cap Start"] 82["Cap Start"]
83["Cap End"] 83["Cap End"]
84["SweepEdge Opposite"] 84["SweepEdge Opposite"]
85["SweepEdge Adjacent"] 85["SweepEdge Adjacent"]
86["EdgeCut Fillet<br>[1064, 1274, 0]"] 86["EdgeCut Fillet<br>[1064, 1270, 0]"]
87["EdgeCut Fillet<br>[1064, 1274, 0]"] 87["EdgeCut Fillet<br>[1064, 1270, 0]"]
88["EdgeCut Fillet<br>[1064, 1274, 0]"] 88["EdgeCut Fillet<br>[1064, 1270, 0]"]
89["EdgeCut Fillet<br>[1064, 1274, 0]"] 89["EdgeCut Fillet<br>[1064, 1270, 0]"]
1 --- 2 1 --- 2
2 --- 3 2 --- 3
2 --- 4 2 --- 4

File diff suppressed because it is too large Load Diff

View File

@ -47,15 +47,15 @@ case = startSketchOn('XY')
|> line(endAbsolute = [0, caseLength], tag = $edge3) |> line(endAbsolute = [0, caseLength], tag = $edge3)
|> close(tag = $edge4) |> close(tag = $edge4)
|> extrude(length = caseHeight) |> extrude(length = caseHeight)
|> fillet({ |> fillet(
radius = 1, radius = 1,
tags = [ tags = [
getNextAdjacentEdge(edge1), getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2), getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3), getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge4) getNextAdjacentEdge(edge4)
] ],
}, %) )
fn m25Screw(x, y, height) { fn m25Screw(x, y, height) {
screw = startSketchOn("XY") screw = startSketchOn("XY")

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed fillet-and-shell.kcl description: Operations executed fillet-and-shell.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed fillet-and-shell.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 1.0, "value": 1.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed fillet-and-shell.kcl
} }
} }
}, },
"sourceRange": [
1088,
1089,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -109,25 +114,10 @@ description: Operations executed fillet-and-shell.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
1071, 1105,
1270, 1262,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1272,
1273,
0 0
] ]
} }
@ -135,25 +125,37 @@ description: Operations executed fillet-and-shell.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
1064, 1064,
1274, 1270,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"type": "UserDefinedFunctionCall", "type": "UserDefinedFunctionCall",
"name": "m25Screw", "name": "m25Screw",
"functionSourceRange": [ "functionSourceRange": [
1287, 1283,
1529, 1525,
0 0
], ],
"unlabeledArg": null, "unlabeledArg": null,
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [ "sourceRange": [
1531, 1527,
1660, 1656,
0 0
] ]
}, },
@ -165,16 +167,16 @@ description: Operations executed fillet-and-shell.kcl
"value": "XY" "value": "XY"
}, },
"sourceRange": [ "sourceRange": [
1324,
1328, 1328,
1332,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1314, 1310,
1333, 1329,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -190,8 +192,8 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1431, 1427,
1476, 1472,
0 0
] ]
}, },
@ -203,16 +205,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1478, 1474,
1479, 1475,
0 0
] ]
} }
}, },
"name": "hole", "name": "hole",
"sourceRange": [ "sourceRange": [
1426, 1422,
1480, 1476,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -235,16 +237,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1505, 1501,
1511, 1507,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1488, 1484,
1512, 1508,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -269,15 +271,15 @@ description: Operations executed fillet-and-shell.kcl
"type": "UserDefinedFunctionCall", "type": "UserDefinedFunctionCall",
"name": "m25Screw", "name": "m25Screw",
"functionSourceRange": [ "functionSourceRange": [
1287, 1283,
1529, 1525,
0 0
], ],
"unlabeledArg": null, "unlabeledArg": null,
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [ "sourceRange": [
1662, 1658,
1789, 1785,
0 0
] ]
}, },
@ -289,16 +291,16 @@ description: Operations executed fillet-and-shell.kcl
"value": "XY" "value": "XY"
}, },
"sourceRange": [ "sourceRange": [
1324,
1328, 1328,
1332,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1314, 1310,
1333, 1329,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -314,8 +316,8 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1431, 1427,
1476, 1472,
0 0
] ]
}, },
@ -327,16 +329,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1478, 1474,
1479, 1475,
0 0
] ]
} }
}, },
"name": "hole", "name": "hole",
"sourceRange": [ "sourceRange": [
1426, 1422,
1480, 1476,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -359,16 +361,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1505, 1501,
1511, 1507,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1488, 1484,
1512, 1508,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -393,15 +395,15 @@ description: Operations executed fillet-and-shell.kcl
"type": "UserDefinedFunctionCall", "type": "UserDefinedFunctionCall",
"name": "m25Screw", "name": "m25Screw",
"functionSourceRange": [ "functionSourceRange": [
1287, 1283,
1529, 1525,
0 0
], ],
"unlabeledArg": null, "unlabeledArg": null,
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [ "sourceRange": [
1791, 1787,
1916, 1912,
0 0
] ]
}, },
@ -413,16 +415,16 @@ description: Operations executed fillet-and-shell.kcl
"value": "XY" "value": "XY"
}, },
"sourceRange": [ "sourceRange": [
1324,
1328, 1328,
1332,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1314, 1310,
1333, 1329,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -438,8 +440,8 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1431, 1427,
1476, 1472,
0 0
] ]
}, },
@ -451,16 +453,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1478, 1474,
1479, 1475,
0 0
] ]
} }
}, },
"name": "hole", "name": "hole",
"sourceRange": [ "sourceRange": [
1426, 1422,
1480, 1476,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -483,16 +485,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1505, 1501,
1511, 1507,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1488, 1484,
1512, 1508,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -517,15 +519,15 @@ description: Operations executed fillet-and-shell.kcl
"type": "UserDefinedFunctionCall", "type": "UserDefinedFunctionCall",
"name": "m25Screw", "name": "m25Screw",
"functionSourceRange": [ "functionSourceRange": [
1287, 1283,
1529, 1525,
0 0
], ],
"unlabeledArg": null, "unlabeledArg": null,
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [ "sourceRange": [
1918, 1914,
2045, 2041,
0 0
] ]
}, },
@ -537,16 +539,16 @@ description: Operations executed fillet-and-shell.kcl
"value": "XY" "value": "XY"
}, },
"sourceRange": [ "sourceRange": [
1324,
1328, 1328,
1332,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1314, 1310,
1333, 1329,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -562,8 +564,8 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1431, 1427,
1476, 1472,
0 0
] ]
}, },
@ -575,16 +577,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1478, 1474,
1479, 1475,
0 0
] ]
} }
}, },
"name": "hole", "name": "hole",
"sourceRange": [ "sourceRange": [
1426, 1422,
1480, 1476,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -607,16 +609,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1505, 1501,
1511, 1507,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1488, 1484,
1512, 1508,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -650,8 +652,8 @@ description: Operations executed fillet-and-shell.kcl
] ]
}, },
"sourceRange": [ "sourceRange": [
2067, 2063,
2074, 2070,
0 0
] ]
}, },
@ -670,16 +672,16 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
2088, 2084,
2101, 2097,
0 0
] ]
} }
}, },
"name": "shell", "name": "shell",
"sourceRange": [ "sourceRange": [
2047, 2043,
2102, 2098,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -691,8 +693,8 @@ description: Operations executed fillet-and-shell.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
2049,
2053, 2053,
2057,
0 0
] ]
} }

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Variables in memory after executing fillet-and-shell.kcl description: Variables in memory after executing fillet-and-shell.kcl
snapshot_kind: text
--- ---
{ {
"E": { "E": {
@ -1150,11 +1151,11 @@ description: Variables in memory after executing fillet-and-shell.kcl
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 1512, "end": 1508,
"id": { "id": {
"end": 1311, "end": 1307,
"name": "screw", "name": "screw",
"start": 1306, "start": 1302,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -1162,22 +1163,22 @@ description: Variables in memory after executing fillet-and-shell.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 1332, "end": 1328,
"raw": "\"XY\"", "raw": "\"XY\"",
"start": 1328, "start": 1324,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": "XY" "value": "XY"
} }
], ],
"callee": { "callee": {
"end": 1327, "end": 1323,
"name": "startSketchOn", "name": "startSketchOn",
"start": 1314, "start": 1310,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1333, "end": 1329,
"start": 1314, "start": 1310,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1186,9 +1187,9 @@ description: Variables in memory after executing fillet-and-shell.kcl
{ {
"elements": [ "elements": [
{ {
"end": 1358, "end": 1354,
"raw": "0", "raw": "0",
"start": 1357, "start": 1353,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1197,9 +1198,9 @@ description: Variables in memory after executing fillet-and-shell.kcl
} }
}, },
{ {
"end": 1361, "end": 1357,
"raw": "0", "raw": "0",
"start": 1360, "start": 1356,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1208,81 +1209,81 @@ description: Variables in memory after executing fillet-and-shell.kcl
} }
} }
], ],
"end": 1362, "end": 1358,
"start": 1356, "start": 1352,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"end": 1365, "end": 1361,
"start": 1364, "start": 1360,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1355, "end": 1351,
"name": "startProfileAt", "name": "startProfileAt",
"start": 1341, "start": 1337,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1366, "end": 1362,
"start": 1341, "start": 1337,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 1414, "end": 1410,
"properties": [ "properties": [
{ {
"end": 1398, "end": 1394,
"key": { "key": {
"end": 1389, "end": 1385,
"name": "center", "name": "center",
"start": 1383, "start": 1379,
"type": "Identifier" "type": "Identifier"
}, },
"start": 1383, "start": 1379,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"elements": [ "elements": [
{ {
"end": 1394, "end": 1390,
"name": "x", "name": "x",
"start": 1393, "start": 1389,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 1397, "end": 1393,
"name": "y", "name": "y",
"start": 1396, "start": 1392,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"end": 1398, "end": 1394,
"start": 1392, "start": 1388,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
}, },
{ {
"end": 1412, "end": 1408,
"key": { "key": {
"end": 1406, "end": 1402,
"name": "radius", "name": "radius",
"start": 1400, "start": 1396,
"type": "Identifier" "type": "Identifier"
}, },
"start": 1400, "start": 1396,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"end": 1412, "end": 1408,
"raw": "2.5", "raw": "2.5",
"start": 1409, "start": 1405,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1292,25 +1293,25 @@ description: Variables in memory after executing fillet-and-shell.kcl
} }
} }
], ],
"start": 1381, "start": 1377,
"type": "ObjectExpression", "type": "ObjectExpression",
"type": "ObjectExpression" "type": "ObjectExpression"
}, },
{ {
"end": 1417, "end": 1413,
"start": 1416, "start": 1412,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1380, "end": 1376,
"name": "circle", "name": "circle",
"start": 1374, "start": 1370,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1418, "end": 1414,
"start": 1374, "start": 1370,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1319,55 +1320,55 @@ description: Variables in memory after executing fillet-and-shell.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 1472, "end": 1468,
"properties": [ "properties": [
{ {
"end": 1455, "end": 1451,
"key": { "key": {
"end": 1446, "end": 1442,
"name": "center", "name": "center",
"start": 1440, "start": 1436,
"type": "Identifier" "type": "Identifier"
}, },
"start": 1440, "start": 1436,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"elements": [ "elements": [
{ {
"end": 1451, "end": 1447,
"name": "x", "name": "x",
"start": 1450, "start": 1446,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 1454, "end": 1450,
"name": "y", "name": "y",
"start": 1453, "start": 1449,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"end": 1455, "end": 1451,
"start": 1449, "start": 1445,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
}, },
{ {
"end": 1470, "end": 1466,
"key": { "key": {
"end": 1463, "end": 1459,
"name": "radius", "name": "radius",
"start": 1457, "start": 1453,
"type": "Identifier" "type": "Identifier"
}, },
"start": 1457, "start": 1453,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"end": 1470, "end": 1466,
"raw": "1.25", "raw": "1.25",
"start": 1466, "start": 1462,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1377,10 +1378,28 @@ description: Variables in memory after executing fillet-and-shell.kcl
} }
} }
], ],
"start": 1438, "start": 1434,
"type": "ObjectExpression", "type": "ObjectExpression",
"type": "ObjectExpression" "type": "ObjectExpression"
}, },
{
"end": 1471,
"start": 1470,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 1433,
"name": "circle",
"start": 1427,
"type": "Identifier"
},
"end": 1472,
"start": 1427,
"type": "CallExpression",
"type": "CallExpression"
},
{ {
"end": 1475, "end": 1475,
"start": 1474, "start": 1474,
@ -1389,31 +1408,13 @@ description: Variables in memory after executing fillet-and-shell.kcl
} }
], ],
"callee": { "callee": {
"end": 1437, "end": 1426,
"name": "circle", "name": "hole",
"start": 1431, "start": 1422,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1476, "end": 1476,
"start": 1431, "start": 1422,
"type": "CallExpression",
"type": "CallExpression"
},
{
"end": 1479,
"start": 1478,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 1430,
"name": "hole",
"start": 1426,
"type": "Identifier"
},
"end": 1480,
"start": 1426,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1426,89 +1427,89 @@ description: Variables in memory after executing fillet-and-shell.kcl
"name": "length" "name": "length"
}, },
"arg": { "arg": {
"end": 1511, "end": 1507,
"name": "height", "name": "height",
"start": 1505, "start": 1501,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
} }
], ],
"callee": { "callee": {
"end": 1495, "end": 1491,
"name": "extrude", "name": "extrude",
"start": 1488, "start": 1484,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1512, "end": 1508,
"start": 1488, "start": 1484,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
} }
], ],
"end": 1512, "end": 1508,
"start": 1314, "start": 1310,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
}, },
"start": 1306, "start": 1302,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 1512, "end": 1508,
"kind": "const", "kind": "const",
"start": 1306, "start": 1302,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"argument": { "argument": {
"end": 1527, "end": 1523,
"name": "screw", "name": "screw",
"start": 1522, "start": 1518,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"end": 1527, "end": 1523,
"start": 1515, "start": 1511,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"end": 1529, "end": 1525,
"start": 1302 "start": 1298
}, },
"end": 1529, "end": 1525,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"end": 1289, "end": 1285,
"name": "x", "name": "x",
"start": 1288, "start": 1284,
"type": "Identifier" "type": "Identifier"
} }
}, },
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"end": 1292, "end": 1288,
"name": "y", "name": "y",
"start": 1291, "start": 1287,
"type": "Identifier" "type": "Identifier"
} }
}, },
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"end": 1300, "end": 1296,
"name": "height", "name": "height",
"start": 1294, "start": 1290,
"type": "Identifier" "type": "Identifier"
} }
} }
], ],
"start": 1287, "start": 1283,
"type": "FunctionExpression" "type": "FunctionExpression"
}, },
"memory": [ "memory": [
@ -1518,8 +1519,8 @@ description: Variables in memory after executing fillet-and-shell.kcl
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
1287, 1283,
1529, 1525,
0 0
] ]
} }

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing mike_stress_test.kcl description: Result of parsing mike_stress_test.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Variables in memory after executing mike_stress_test.kcl description: Variables in memory after executing mike_stress_test.kcl
snapshot_kind: text
--- ---
{ {
"E": { "E": {

View File

@ -758,8 +758,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
725, 724,
757, 756,
0 0
], ],
"command": { "command": {
@ -773,7 +773,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
646, 646,
777, 773,
0 0
], ],
"command": { "command": {
@ -789,7 +789,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
646, 646,
777, 773,
0 0
], ],
"command": { "command": {
@ -889,8 +889,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -905,8 +905,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -919,8 +919,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -930,8 +930,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -942,8 +942,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -955,8 +955,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -969,8 +969,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
816, 812,
844, 840,
0 0
], ],
"command": { "command": {
@ -983,8 +983,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
929, 924,
961, 956,
0 0
], ],
"command": { "command": {
@ -997,8 +997,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
850, 846,
981, 973,
0 0
], ],
"command": { "command": {
@ -1013,8 +1013,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
850, 846,
981, 973,
0 0
], ],
"command": { "command": {

View File

@ -36,15 +36,15 @@ flowchart LR
24["Cap End"] 24["Cap End"]
25["SweepEdge Opposite"] 25["SweepEdge Opposite"]
26["SweepEdge Adjacent"] 26["SweepEdge Adjacent"]
27["EdgeCut Fillet<br>[646, 777, 0]"] 27["EdgeCut Fillet<br>[646, 773, 0]"]
28["EdgeCut Fillet<br>[646, 777, 0]"] 28["EdgeCut Fillet<br>[646, 773, 0]"]
33["Sweep Extrusion<br>[816, 844, 0]"] 33["Sweep Extrusion<br>[812, 840, 0]"]
34[Wall] 34[Wall]
35["Cap End"] 35["Cap End"]
36["SweepEdge Opposite"] 36["SweepEdge Opposite"]
37["SweepEdge Adjacent"] 37["SweepEdge Adjacent"]
38["EdgeCut Fillet<br>[850, 981, 0]"] 38["EdgeCut Fillet<br>[846, 973, 0]"]
39["EdgeCut Fillet<br>[850, 981, 0]"] 39["EdgeCut Fillet<br>[846, 973, 0]"]
1 --- 2 1 --- 2
2 --- 3 2 --- 3
2 --- 4 2 --- 4

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing pentagon_fillet_sugar.kcl description: Result of parsing pentagon_fillet_sugar.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
@ -840,7 +841,7 @@ description: Result of parsing pentagon_fillet_sugar.kcl
}, },
{ {
"declaration": { "declaration": {
"end": 777, "end": 773,
"id": { "id": {
"end": 601, "end": 601,
"name": "plumbus1", "name": "plumbus1",
@ -888,22 +889,15 @@ description: Result of parsing pentagon_fillet_sugar.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 773, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 672, "name": "radius"
"key": {
"end": 668,
"name": "radius",
"start": 662,
"type": "Identifier"
}, },
"start": 662, "arg": {
"type": "ObjectProperty", "end": 671,
"value": {
"end": 672,
"raw": "5", "raw": "5",
"start": 671, "start": 670,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -913,49 +907,45 @@ description: Result of parsing pentagon_fillet_sugar.kcl
} }
}, },
{ {
"end": 766, "type": "LabeledArg",
"key": { "label": {
"end": 685, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 681,
"type": "Identifier"
}, },
"start": 681, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"computed": false, "computed": false,
"end": 714, "end": 713,
"object": { "object": {
"computed": false, "computed": false,
"end": 706, "end": 705,
"object": { "object": {
"end": 701, "end": 700,
"name": "c1", "name": "c1",
"start": 699, "start": 698,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"end": 706, "end": 705,
"name": "tags", "name": "tags",
"start": 702, "start": 701,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 699, "start": 698,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"end": 714, "end": 713,
"name": "arc_tag", "name": "arc_tag",
"start": 707, "start": 706,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 699, "start": 698,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
@ -963,83 +953,73 @@ description: Result of parsing pentagon_fillet_sugar.kcl
"arguments": [ "arguments": [
{ {
"computed": false, "computed": false,
"end": 756, "end": 755,
"object": { "object": {
"computed": false, "computed": false,
"end": 748, "end": 747,
"object": { "object": {
"end": 743, "end": 742,
"name": "c1", "name": "c1",
"start": 741, "start": 740,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"end": 748, "end": 747,
"name": "tags", "name": "tags",
"start": 744, "start": 743,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 741, "start": 740,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"end": 756, "end": 755,
"name": "arc_tag", "name": "arc_tag",
"start": 749, "start": 748,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 741, "start": 740,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
} }
], ],
"callee": { "callee": {
"end": 740, "end": 739,
"name": "getOppositeEdge", "name": "getOppositeEdge",
"start": 725, "start": 724,
"type": "Identifier" "type": "Identifier"
}, },
"end": 757, "end": 756,
"start": 725, "start": 724,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 766, "end": 765,
"start": 688, "start": 687,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 653,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 776,
"start": 775,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 652, "end": 652,
"name": "fillet", "name": "fillet",
"start": 646, "start": 646,
"type": "Identifier" "type": "Identifier"
}, },
"end": 777, "end": 773,
"start": 646, "start": 646,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 777, "end": 773,
"start": 604, "start": 604,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -1047,7 +1027,7 @@ description: Result of parsing pentagon_fillet_sugar.kcl
"start": 593, "start": 593,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 777, "end": 773,
"kind": "const", "kind": "const",
"start": 593, "start": 593,
"type": "VariableDeclaration", "type": "VariableDeclaration",
@ -1055,19 +1035,19 @@ description: Result of parsing pentagon_fillet_sugar.kcl
}, },
{ {
"declaration": { "declaration": {
"end": 796, "end": 792,
"id": { "id": {
"end": 780, "end": 776,
"name": "c2", "name": "c2",
"start": 778, "start": 774,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"arguments": [ "arguments": [
{ {
"end": 792, "end": 788,
"raw": "200", "raw": "200",
"start": 789, "start": 785,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1076,48 +1056,48 @@ description: Result of parsing pentagon_fillet_sugar.kcl
} }
}, },
{ {
"end": 795, "end": 791,
"name": "a", "name": "a",
"start": 794, "start": 790,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 788, "end": 784,
"name": "circl", "name": "circl",
"start": 783, "start": 779,
"type": "Identifier" "type": "Identifier"
}, },
"end": 796, "end": 792,
"start": 783, "start": 779,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
"start": 778, "start": 774,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 796, "end": 792,
"kind": "const", "kind": "const",
"start": 778, "start": 774,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"declaration": { "declaration": {
"end": 981, "end": 973,
"id": { "id": {
"end": 805, "end": 801,
"name": "plumbus0", "name": "plumbus0",
"start": 797, "start": 793,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"body": [ "body": [
{ {
"end": 810, "end": 806,
"name": "c2", "name": "c2",
"start": 808, "start": 804,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
@ -1130,22 +1110,22 @@ description: Result of parsing pentagon_fillet_sugar.kcl
"name": "length" "name": "length"
}, },
"arg": { "arg": {
"end": 843, "end": 839,
"name": "plumbusLen", "name": "plumbusLen",
"start": 833, "start": 829,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
} }
], ],
"callee": { "callee": {
"end": 823, "end": 819,
"name": "extrude", "name": "extrude",
"start": 816, "start": 812,
"type": "Identifier" "type": "Identifier"
}, },
"end": 844, "end": 840,
"start": 816, "start": 812,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -1153,22 +1133,15 @@ description: Result of parsing pentagon_fillet_sugar.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 977, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 876, "name": "radius"
"key": {
"end": 872,
"name": "radius",
"start": 866,
"type": "Identifier"
}, },
"start": 866, "arg": {
"type": "ObjectProperty", "end": 871,
"value": {
"end": 876,
"raw": "5", "raw": "5",
"start": 875, "start": 870,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1178,49 +1151,45 @@ description: Result of parsing pentagon_fillet_sugar.kcl
} }
}, },
{ {
"end": 970, "type": "LabeledArg",
"key": { "label": {
"end": 889, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 885,
"type": "Identifier"
}, },
"start": 885, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"computed": false, "computed": false,
"end": 918, "end": 913,
"object": { "object": {
"computed": false, "computed": false,
"end": 910,
"object": {
"end": 905, "end": 905,
"object": {
"end": 900,
"name": "c2", "name": "c2",
"start": 903, "start": 898,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"end": 910, "end": 905,
"name": "tags", "name": "tags",
"start": 906, "start": 901,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 903, "start": 898,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"end": 918, "end": 913,
"name": "arc_tag", "name": "arc_tag",
"start": 911, "start": 906,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 903, "start": 898,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
@ -1228,98 +1197,88 @@ description: Result of parsing pentagon_fillet_sugar.kcl
"arguments": [ "arguments": [
{ {
"computed": false, "computed": false,
"end": 960, "end": 955,
"object": { "object": {
"computed": false, "computed": false,
"end": 952,
"object": {
"end": 947, "end": 947,
"object": {
"end": 942,
"name": "c2", "name": "c2",
"start": 945, "start": 940,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"end": 952, "end": 947,
"name": "tags", "name": "tags",
"start": 948, "start": 943,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 945, "start": 940,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"end": 960, "end": 955,
"name": "arc_tag", "name": "arc_tag",
"start": 953, "start": 948,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 945, "start": 940,
"type": "MemberExpression", "type": "MemberExpression",
"type": "MemberExpression" "type": "MemberExpression"
} }
], ],
"callee": { "callee": {
"end": 944, "end": 939,
"name": "getOppositeEdge", "name": "getOppositeEdge",
"start": 929, "start": 924,
"type": "Identifier" "type": "Identifier"
}, },
"end": 961, "end": 956,
"start": 929, "start": 924,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 970, "end": 965,
"start": 892, "start": 887,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 857,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 980,
"start": 979,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 856, "end": 852,
"name": "fillet", "name": "fillet",
"start": 850, "start": 846,
"type": "Identifier" "type": "Identifier"
}, },
"end": 981, "end": 973,
"start": 850, "start": 846,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 981, "end": 973,
"start": 808, "start": 804,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
}, },
"start": 797, "start": 793,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 981, "end": 973,
"kind": "const", "kind": "const",
"start": 797, "start": 793,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 982, "end": 974,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"3": [ "3": [

View File

@ -25,20 +25,20 @@ fn circl(x, face) {
c1 = circl(-200, c) c1 = circl(-200, c)
plumbus1 = c1 plumbus1 = c1
|> extrude(length = plumbusLen) |> extrude(length = plumbusLen)
|> fillet({ |> fillet(
radius = 5, radius = 5,
tags = [ tags = [
c1.tags.arc_tag, c1.tags.arc_tag,
getOppositeEdge(c1.tags.arc_tag) getOppositeEdge(c1.tags.arc_tag)
] ],
}, %) )
c2 = circl(200, a) c2 = circl(200, a)
plumbus0 = c2 plumbus0 = c2
|> extrude(length = plumbusLen) |> extrude(length = plumbusLen)
|> fillet({ |> fillet(
radius = 5, radius = 5,
tags = [ tags = [
c2.tags.arc_tag, c2.tags.arc_tag,
getOppositeEdge(c2.tags.arc_tag) getOppositeEdge(c2.tags.arc_tag)
] ],
}, %) )

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed pentagon_fillet_sugar.kcl description: Operations executed pentagon_fillet_sugar.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -172,11 +173,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 5.0, "value": 5.0,
"ty": { "ty": {
@ -189,7 +187,14 @@ description: Operations executed pentagon_fillet_sugar.kcl
} }
} }
}, },
"sourceRange": [
670,
671,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -202,25 +207,10 @@ description: Operations executed pentagon_fillet_sugar.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
653, 687,
773, 765,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
775,
776,
0 0
] ]
} }
@ -228,11 +218,23 @@ description: Operations executed pentagon_fillet_sugar.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
646, 646,
777, 773,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"type": "UserDefinedFunctionCall", "type": "UserDefinedFunctionCall",
@ -245,8 +247,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
"unlabeledArg": null, "unlabeledArg": null,
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [ "sourceRange": [
783, 779,
796, 792,
0 0
] ]
}, },
@ -307,16 +309,16 @@ description: Operations executed pentagon_fillet_sugar.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
833, 829,
843, 839,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
816, 812,
844, 840,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -336,11 +338,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 5.0, "value": 5.0,
"ty": { "ty": {
@ -353,7 +352,14 @@ description: Operations executed pentagon_fillet_sugar.kcl
} }
} }
}, },
"sourceRange": [
870,
871,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -366,16 +372,22 @@ description: Operations executed pentagon_fillet_sugar.kcl
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
857, 887,
977, 965,
0 0
] ]
}
}, },
"solid": { "name": "fillet",
"sourceRange": [
846,
973,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": { "value": {
"type": "Solid", "type": "Solid",
"value": { "value": {
@ -383,19 +395,10 @@ description: Operations executed pentagon_fillet_sugar.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
979, 0,
980, 0,
0 0
] ]
} }
},
"name": "fillet",
"sourceRange": [
850,
981,
0
],
"type": "StdLibCall",
"unlabeledArg": null
} }
] ]

View File

@ -651,8 +651,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
585, 562,
607, 584,
0 0
], ],
"command": { "command": {
@ -666,7 +666,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
492, 492,
534, 527,
0 0
], ],
"command": { "command": {
@ -681,8 +681,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
540, 533,
627, 600,
0 0
], ],
"command": { "command": {
@ -697,8 +697,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
633, 606,
684, 656,
0 0
], ],
"command": { "command": {
@ -713,8 +713,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -729,8 +729,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -740,8 +740,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -757,8 +757,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
776, 748,
824, 796,
0 0
], ],
"command": { "command": {
@ -778,8 +778,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
830, 802,
931, 903,
0 0
], ],
"command": { "command": {
@ -799,8 +799,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
937, 909,
1057, 1029,
0 0
], ],
"command": { "command": {
@ -820,8 +820,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1063, 1035,
1119, 1091,
0 0
], ],
"command": { "command": {
@ -841,8 +841,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1125, 1097,
1133, 1105,
0 0
], ],
"command": { "command": {
@ -853,8 +853,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -869,8 +869,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -880,8 +880,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -897,8 +897,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1225, 1197,
1273, 1245,
0 0
], ],
"command": { "command": {
@ -918,8 +918,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1279, 1251,
1381, 1353,
0 0
], ],
"command": { "command": {
@ -939,8 +939,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1387, 1359,
1507, 1479,
0 0
], ],
"command": { "command": {
@ -960,8 +960,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1513, 1485,
1569, 1541,
0 0
], ],
"command": { "command": {
@ -981,8 +981,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1575, 1547,
1583, 1555,
0 0
], ],
"command": { "command": {
@ -993,8 +993,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1009,8 +1009,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1023,8 +1023,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1034,8 +1034,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1046,8 +1046,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1059,8 +1059,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1073,8 +1073,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1087,8 +1087,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1101,8 +1101,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1115,8 +1115,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1129,8 +1129,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1143,8 +1143,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1157,8 +1157,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {

View File

@ -10,21 +10,21 @@ flowchart LR
8[Solid2d] 8[Solid2d]
end end
subgraph path27 [Path] subgraph path27 [Path]
27["Path<br>[736, 770, 0]"] 27["Path<br>[708, 742, 0]"]
28["Segment<br>[776, 824, 0]"] 28["Segment<br>[748, 796, 0]"]
29["Segment<br>[830, 931, 0]"] 29["Segment<br>[802, 903, 0]"]
30["Segment<br>[937, 1057, 0]"] 30["Segment<br>[909, 1029, 0]"]
31["Segment<br>[1063, 1119, 0]"] 31["Segment<br>[1035, 1091, 0]"]
32["Segment<br>[1125, 1133, 0]"] 32["Segment<br>[1097, 1105, 0]"]
33[Solid2d] 33[Solid2d]
end end
subgraph path34 [Path] subgraph path34 [Path]
34["Path<br>[1184, 1219, 0]"] 34["Path<br>[1156, 1191, 0]"]
35["Segment<br>[1225, 1273, 0]"] 35["Segment<br>[1197, 1245, 0]"]
36["Segment<br>[1279, 1381, 0]"] 36["Segment<br>[1251, 1353, 0]"]
37["Segment<br>[1387, 1507, 0]"] 37["Segment<br>[1359, 1479, 0]"]
38["Segment<br>[1513, 1569, 0]"] 38["Segment<br>[1485, 1541, 0]"]
39["Segment<br>[1575, 1583, 0]"] 39["Segment<br>[1547, 1555, 0]"]
40[Solid2d] 40[Solid2d]
end end
1["Plane<br>[12, 31, 0]"] 1["Plane<br>[12, 31, 0]"]
@ -43,10 +43,10 @@ flowchart LR
21["SweepEdge Adjacent"] 21["SweepEdge Adjacent"]
22["SweepEdge Opposite"] 22["SweepEdge Opposite"]
23["SweepEdge Adjacent"] 23["SweepEdge Adjacent"]
24["EdgeCut Fillet<br>[492, 534, 0]"] 24["EdgeCut Fillet<br>[492, 527, 0]"]
25["Plane<br>[1184, 1219, 0]"] 25["Plane<br>[1156, 1191, 0]"]
26["Plane<br>[736, 770, 0]"] 26["Plane<br>[708, 742, 0]"]
41["Sweep Extrusion<br>[1597, 1628, 0]"] 41["Sweep Extrusion<br>[1569, 1600, 0]"]
42[Wall] 42[Wall]
43[Wall] 43[Wall]
44[Wall] 44[Wall]

View File

@ -12,12 +12,9 @@ sketch001 = startSketchOn('XZ')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close(%) |> close(%)
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> fillet({ radius = 20, tags = [seg01] }, %) |> fillet(radius = 20, tags = [seg01])
|> chamfer({ |> chamfer(length = 50, tags = [getOppositeEdge(seg01)], tag = $seg03)
length = 50, |> chamfer(length = 50, tags = [seg02], tag = $seg04)
tags = [getOppositeEdge(seg01)]
}, %, $seg03)
|> chamfer({ length = 50, tags = [seg02] }, %, $seg04)
sketch003 = startSketchOn(extrude001, seg04) sketch003 = startSketchOn(extrude001, seg04)
|> startProfileAt([-69.1, 277.34], %) |> startProfileAt([-69.1, 277.34], %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed sketch-on-chamfer-two-times-different-order.kcl description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 20.0, "value": 20.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
} }
}, },
"sourceRange": [
508,
510,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -98,25 +103,10 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
499, 519,
530, 526,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
532,
533,
0 0
] ]
} }
@ -124,19 +114,28 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
492, 492,
534, 527,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"length": { "length": {
"value": {
"type": "Number", "type": "Number",
"value": 50.0, "value": 50.0,
"ty": { "ty": {
@ -149,33 +148,9 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
} }
}, },
"tags": {
"type": "Array",
"value": [
{
"type": "Uuid",
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [ "sourceRange": [
548, 550,
615, 552,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
617,
618,
0 0
] ]
}, },
@ -185,28 +160,53 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"name": "seg03" "name": "seg03"
}, },
"sourceRange": [ "sourceRange": [
620, 593,
626, 599,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": [
561,
585,
0 0
] ]
} }
}, },
"name": "chamfer", "name": "chamfer",
"sourceRange": [ "sourceRange": [
540, 533,
627, 600,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"length": { "length": {
"value": {
"type": "Number", "type": "Number",
"value": 50.0, "value": 50.0,
"ty": { "ty": {
@ -219,34 +219,9 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
} }
}, },
"tags": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
}
]
}
}
},
"sourceRange": [ "sourceRange": [
641, 623,
672, 625,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
674,
675,
0 0
] ]
}, },
@ -256,20 +231,49 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"name": "seg04" "name": "seg04"
}, },
"sourceRange": [ "sourceRange": [
677, 649,
683, 655,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": [
634,
641,
0 0
] ]
} }
}, },
"name": "chamfer", "name": "chamfer",
"sourceRange": [ "sourceRange": [
633, 606,
684, 656,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -281,8 +285,8 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
712, 684,
722, 694,
0 0
] ]
}, },
@ -293,16 +297,16 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
724, 696,
729, 701,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
698, 670,
730, 702,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -318,8 +322,8 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1160, 1132,
1170, 1142,
0 0
] ]
}, },
@ -330,16 +334,16 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
1172, 1144,
1177, 1149,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1146, 1118,
1178, 1150,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -362,16 +366,16 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1625, 1597,
1627, 1599,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1597, 1569,
1628, 1600,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -383,8 +387,8 @@ description: Operations executed sketch-on-chamfer-two-times-different-order.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1605, 1577,
1614, 1586,
0 0
] ]
} }

View File

@ -651,8 +651,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
642, 618,
664, 640,
0 0
], ],
"command": { "command": {
@ -666,7 +666,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
492, 492,
534, 527,
0 0
], ],
"command": { "command": {
@ -681,8 +681,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
540, 533,
591, 583,
0 0
], ],
"command": { "command": {
@ -697,8 +697,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
597, 589,
684, 656,
0 0
], ],
"command": { "command": {
@ -713,8 +713,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -729,8 +729,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -740,8 +740,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
736, 708,
770, 742,
0 0
], ],
"command": { "command": {
@ -757,8 +757,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
776, 748,
824, 796,
0 0
], ],
"command": { "command": {
@ -778,8 +778,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
830, 802,
931, 903,
0 0
], ],
"command": { "command": {
@ -799,8 +799,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
937, 909,
1057, 1029,
0 0
], ],
"command": { "command": {
@ -820,8 +820,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1063, 1035,
1119, 1091,
0 0
], ],
"command": { "command": {
@ -841,8 +841,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1125, 1097,
1133, 1105,
0 0
], ],
"command": { "command": {
@ -853,8 +853,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -869,8 +869,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -880,8 +880,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1184, 1156,
1219, 1191,
0 0
], ],
"command": { "command": {
@ -897,8 +897,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1225, 1197,
1273, 1245,
0 0
], ],
"command": { "command": {
@ -918,8 +918,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1279, 1251,
1381, 1353,
0 0
], ],
"command": { "command": {
@ -939,8 +939,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1387, 1359,
1507, 1479,
0 0
], ],
"command": { "command": {
@ -960,8 +960,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1513, 1485,
1569, 1541,
0 0
], ],
"command": { "command": {
@ -981,8 +981,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1575, 1547,
1583, 1555,
0 0
], ],
"command": { "command": {
@ -993,8 +993,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1009,8 +1009,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1023,8 +1023,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1034,8 +1034,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1046,8 +1046,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1059,8 +1059,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1073,8 +1073,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1087,8 +1087,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1101,8 +1101,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1115,8 +1115,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1129,8 +1129,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1143,8 +1143,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {
@ -1157,8 +1157,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1597, 1569,
1628, 1600,
0 0
], ],
"command": { "command": {

View File

@ -10,21 +10,21 @@ flowchart LR
8[Solid2d] 8[Solid2d]
end end
subgraph path27 [Path] subgraph path27 [Path]
27["Path<br>[736, 770, 0]"] 27["Path<br>[708, 742, 0]"]
28["Segment<br>[776, 824, 0]"] 28["Segment<br>[748, 796, 0]"]
29["Segment<br>[830, 931, 0]"] 29["Segment<br>[802, 903, 0]"]
30["Segment<br>[937, 1057, 0]"] 30["Segment<br>[909, 1029, 0]"]
31["Segment<br>[1063, 1119, 0]"] 31["Segment<br>[1035, 1091, 0]"]
32["Segment<br>[1125, 1133, 0]"] 32["Segment<br>[1097, 1105, 0]"]
33[Solid2d] 33[Solid2d]
end end
subgraph path34 [Path] subgraph path34 [Path]
34["Path<br>[1184, 1219, 0]"] 34["Path<br>[1156, 1191, 0]"]
35["Segment<br>[1225, 1273, 0]"] 35["Segment<br>[1197, 1245, 0]"]
36["Segment<br>[1279, 1381, 0]"] 36["Segment<br>[1251, 1353, 0]"]
37["Segment<br>[1387, 1507, 0]"] 37["Segment<br>[1359, 1479, 0]"]
38["Segment<br>[1513, 1569, 0]"] 38["Segment<br>[1485, 1541, 0]"]
39["Segment<br>[1575, 1583, 0]"] 39["Segment<br>[1547, 1555, 0]"]
40[Solid2d] 40[Solid2d]
end end
1["Plane<br>[12, 31, 0]"] 1["Plane<br>[12, 31, 0]"]
@ -43,10 +43,10 @@ flowchart LR
21["SweepEdge Adjacent"] 21["SweepEdge Adjacent"]
22["SweepEdge Opposite"] 22["SweepEdge Opposite"]
23["SweepEdge Adjacent"] 23["SweepEdge Adjacent"]
24["EdgeCut Fillet<br>[492, 534, 0]"] 24["EdgeCut Fillet<br>[492, 527, 0]"]
25["Plane<br>[736, 770, 0]"] 25["Plane<br>[708, 742, 0]"]
26["Plane<br>[1184, 1219, 0]"] 26["Plane<br>[1156, 1191, 0]"]
41["Sweep Extrusion<br>[1597, 1628, 0]"] 41["Sweep Extrusion<br>[1569, 1600, 0]"]
42[Wall] 42[Wall]
43[Wall] 43[Wall]
44[Wall] 44[Wall]

File diff suppressed because it is too large Load Diff

View File

@ -12,12 +12,9 @@ sketch001 = startSketchOn('XZ')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close(%) |> close(%)
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> fillet({ radius = 20, tags = [seg01] }, %) |> fillet(radius = 20, tags = [seg01])
|> chamfer({ length = 50, tags = [seg02] }, %, $seg04) |> chamfer(length = 50, tags = [seg02], tag = $seg04)
|> chamfer({ |> chamfer(length = 50, tags = [getOppositeEdge(seg01)], tag = $seg03)
length = 50,
tags = [getOppositeEdge(seg01)]
}, %, $seg03)
sketch003 = startSketchOn(extrude001, seg04) sketch003 = startSketchOn(extrude001, seg04)
|> startProfileAt([-69.1, 277.34], %) |> startProfileAt([-69.1, 277.34], %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed sketch-on-chamfer-two-times.kcl description: Operations executed sketch-on-chamfer-two-times.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 20.0, "value": 20.0,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
} }
}, },
"sourceRange": [
508,
510,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -98,25 +103,10 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
499, 519,
530, 526,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
532,
533,
0 0
] ]
} }
@ -124,19 +114,28 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
492, 492,
534, 527,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"length": { "length": {
"value": {
"type": "Number", "type": "Number",
"value": 50.0, "value": 50.0,
"ty": { "ty": {
@ -149,34 +148,9 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
} }
}, },
"tags": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
}
]
}
}
},
"sourceRange": [ "sourceRange": [
548, 550,
579, 552,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
581,
582,
0 0
] ]
}, },
@ -186,28 +160,54 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"name": "seg04" "name": "seg04"
}, },
"sourceRange": [ "sourceRange": [
584, 576,
590, 582,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": [
561,
568,
0 0
] ]
} }
}, },
"name": "chamfer", "name": "chamfer",
"sourceRange": [ "sourceRange": [
540, 533,
591, 583,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"length": { "length": {
"value": {
"type": "Number", "type": "Number",
"value": 50.0, "value": 50.0,
"ty": { "ty": {
@ -220,33 +220,9 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
} }
}, },
"tags": {
"type": "Array",
"value": [
{
"type": "Uuid",
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [ "sourceRange": [
605, 606,
672, 608,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
674,
675,
0 0
] ]
}, },
@ -256,20 +232,48 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"name": "seg03" "name": "seg03"
}, },
"sourceRange": [ "sourceRange": [
677, 649,
683, 655,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "Uuid",
"value": "[uuid]"
}
]
},
"sourceRange": [
617,
641,
0 0
] ]
} }
}, },
"name": "chamfer", "name": "chamfer",
"sourceRange": [ "sourceRange": [
597, 589,
684, 656,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
@ -281,8 +285,8 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
712, 684,
722, 694,
0 0
] ]
}, },
@ -293,16 +297,16 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
724, 696,
729, 701,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
698, 670,
730, 702,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -318,8 +322,8 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1160, 1132,
1170, 1142,
0 0
] ]
}, },
@ -330,16 +334,16 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
1172, 1144,
1177, 1149,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1146, 1118,
1178, 1150,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -362,16 +366,16 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1625, 1597,
1627, 1599,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1597, 1569,
1628, 1600,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -383,8 +387,8 @@ description: Operations executed sketch-on-chamfer-two-times.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1605, 1577,
1614, 1586,
0 0
] ]
} }

View File

@ -728,8 +728,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1383, 1367,
1413, 1397,
0 0
], ],
"command": { "command": {
@ -742,8 +742,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1492, 1450,
1522, 1480,
0 0
], ],
"command": { "command": {
@ -757,7 +757,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1334, 1334,
1425, 1399,
0 0
], ],
"command": { "command": {
@ -772,8 +772,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1431, 1405,
1534, 1482,
0 0
], ],
"command": { "command": {
@ -788,8 +788,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1583, 1531,
1614, 1562,
0 0
], ],
"command": { "command": {
@ -804,8 +804,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1583, 1531,
1614, 1562,
0 0
], ],
"command": { "command": {
@ -815,8 +815,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1583, 1531,
1614, 1562,
0 0
], ],
"command": { "command": {
@ -832,8 +832,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1620, 1568,
1645, 1593,
0 0
], ],
"command": { "command": {
@ -853,8 +853,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1651, 1599,
1676, 1624,
0 0
], ],
"command": { "command": {
@ -874,8 +874,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1682, 1630,
1707, 1655,
0 0
], ],
"command": { "command": {
@ -895,8 +895,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1713, 1661,
1769, 1717,
0 0
], ],
"command": { "command": {
@ -916,8 +916,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1775, 1723,
1783, 1731,
0 0
], ],
"command": { "command": {
@ -928,8 +928,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -944,8 +944,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -958,8 +958,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -969,8 +969,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -981,8 +981,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -994,8 +994,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1008,8 +1008,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1022,8 +1022,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1036,8 +1036,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1050,8 +1050,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1064,8 +1064,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1078,8 +1078,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {
@ -1092,8 +1092,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1789, 1737,
1809, 1757,
0 0
], ],
"command": { "command": {

View File

@ -11,12 +11,12 @@ flowchart LR
9[Solid2d] 9[Solid2d]
end end
subgraph path33 [Path] subgraph path33 [Path]
33["Path<br>[1583, 1614, 0]"] 33["Path<br>[1531, 1562, 0]"]
34["Segment<br>[1620, 1645, 0]"] 34["Segment<br>[1568, 1593, 0]"]
35["Segment<br>[1651, 1676, 0]"] 35["Segment<br>[1599, 1624, 0]"]
36["Segment<br>[1682, 1707, 0]"] 36["Segment<br>[1630, 1655, 0]"]
37["Segment<br>[1713, 1769, 0]"] 37["Segment<br>[1661, 1717, 0]"]
38["Segment<br>[1775, 1783, 0]"] 38["Segment<br>[1723, 1731, 0]"]
39[Solid2d] 39[Solid2d]
end end
1["Plane<br>[992, 1011, 0]"] 1["Plane<br>[992, 1011, 0]"]
@ -41,9 +41,9 @@ flowchart LR
28["SweepEdge Adjacent"] 28["SweepEdge Adjacent"]
29["SweepEdge Opposite"] 29["SweepEdge Opposite"]
30["SweepEdge Adjacent"] 30["SweepEdge Adjacent"]
31["EdgeCut Fillet<br>[1334, 1425, 0]"] 31["EdgeCut Fillet<br>[1334, 1399, 0]"]
32["EdgeCut Fillet<br>[1431, 1534, 0]"] 32["EdgeCut Fillet<br>[1405, 1482, 0]"]
40["Sweep Extrusion<br>[1789, 1809, 0]"] 40["Sweep Extrusion<br>[1737, 1757, 0]"]
41[Wall] 41[Wall]
42[Wall] 42[Wall]
43[Wall] 43[Wall]

View File

@ -396,7 +396,7 @@ snapshot_kind: text
}, },
{ {
"declaration": { "declaration": {
"end": 1534, "end": 1482,
"id": { "id": {
"end": 989, "end": 989,
"name": "bracket", "name": "bracket",
@ -860,191 +860,149 @@ snapshot_kind: text
{ {
"arguments": [ "arguments": [
{ {
"end": 1421, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 1366, "name": "radius"
"key": {
"end": 1356,
"name": "radius",
"start": 1350,
"type": "Identifier"
}, },
"start": 1350, "arg": {
"type": "ObjectProperty", "end": 1357,
"value": {
"end": 1366,
"name": "filletR", "name": "filletR",
"start": 1359, "start": 1350,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
}, },
{ {
"end": 1414, "type": "LabeledArg",
"key": { "label": {
"end": 1379, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 1375,
"type": "Identifier"
}, },
"start": 1375, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"arguments": [ "arguments": [
{ {
"end": 1412, "end": 1396,
"name": "innerEdge", "name": "innerEdge",
"start": 1403, "start": 1387,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 1402, "end": 1386,
"name": "getNextAdjacentEdge", "name": "getNextAdjacentEdge",
"start": 1383, "start": 1367,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1413, "end": 1397,
"start": 1383, "start": 1367,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 1414, "end": 1398,
"start": 1382, "start": 1366,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 1341,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 1424,
"start": 1423,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 1340, "end": 1340,
"name": "fillet", "name": "fillet",
"start": 1334, "start": 1334,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1425, "end": 1399,
"start": 1334, "start": 1334,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 1530, "type": "LabeledArg",
"properties": [ "label": {
{ "type": "Identifier",
"end": 1475, "name": "radius"
"key": {
"end": 1453,
"name": "radius",
"start": 1447,
"type": "Identifier"
}, },
"start": 1447, "arg": {
"type": "ObjectProperty", "end": 1440,
"value": {
"end": 1475,
"left": { "left": {
"end": 1463, "end": 1428,
"name": "filletR", "name": "filletR",
"start": 1456, "start": 1421,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"end": 1475, "end": 1440,
"name": "thickness", "name": "thickness",
"start": 1466, "start": 1431,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"start": 1456, "start": 1421,
"type": "BinaryExpression", "type": "BinaryExpression",
"type": "BinaryExpression" "type": "BinaryExpression"
} }
}, },
{ {
"end": 1523, "type": "LabeledArg",
"key": { "label": {
"end": 1488, "type": "Identifier",
"name": "tags", "name": "tags"
"start": 1484,
"type": "Identifier"
}, },
"start": 1484, "arg": {
"type": "ObjectProperty",
"value": {
"elements": [ "elements": [
{ {
"arguments": [ "arguments": [
{ {
"end": 1521, "end": 1479,
"name": "outerEdge", "name": "outerEdge",
"start": 1512, "start": 1470,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 1511, "end": 1469,
"name": "getNextAdjacentEdge", "name": "getNextAdjacentEdge",
"start": 1492, "start": 1450,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1522, "end": 1480,
"start": 1492, "start": 1450,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 1523, "end": 1481,
"start": 1491, "start": 1449,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"start": 1438,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 1533,
"start": 1532,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": { "callee": {
"end": 1437, "end": 1411,
"name": "fillet", "name": "fillet",
"start": 1431, "start": 1405,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1534, "end": 1482,
"start": 1431, "start": 1405,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 1534, "end": 1482,
"start": 992, "start": 992,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -1052,7 +1010,7 @@ snapshot_kind: text
"start": 982, "start": 982,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 1534, "end": 1482,
"kind": "const", "kind": "const",
"start": 982, "start": 982,
"type": "VariableDeclaration", "type": "VariableDeclaration",
@ -1060,11 +1018,11 @@ snapshot_kind: text
}, },
{ {
"declaration": { "declaration": {
"end": 1809, "end": 1757,
"id": { "id": {
"end": 1545, "end": 1493,
"name": "sketch001", "name": "sketch001",
"start": 1536, "start": 1484,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -1072,28 +1030,28 @@ snapshot_kind: text
{ {
"arguments": [ "arguments": [
{ {
"end": 1569, "end": 1517,
"name": "bracket", "name": "bracket",
"start": 1562, "start": 1510,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 1576, "end": 1524,
"name": "seg01", "name": "seg01",
"start": 1571, "start": 1519,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 1561, "end": 1509,
"name": "startSketchOn", "name": "startSketchOn",
"start": 1548, "start": 1496,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1577, "end": 1525,
"start": 1548, "start": 1496,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1102,9 +1060,9 @@ snapshot_kind: text
{ {
"elements": [ "elements": [
{ {
"end": 1603, "end": 1551,
"raw": "4.28", "raw": "4.28",
"start": 1599, "start": 1547,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1113,9 +1071,9 @@ snapshot_kind: text
} }
}, },
{ {
"end": 1609, "end": 1557,
"raw": "3.83", "raw": "3.83",
"start": 1605, "start": 1553,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1124,26 +1082,26 @@ snapshot_kind: text
} }
} }
], ],
"end": 1610, "end": 1558,
"start": 1598, "start": 1546,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"end": 1613, "end": 1561,
"start": 1612, "start": 1560,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1597, "end": 1545,
"name": "startProfileAt", "name": "startProfileAt",
"start": 1583, "start": 1531,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1614, "end": 1562,
"start": 1583, "start": 1531,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1158,9 +1116,9 @@ snapshot_kind: text
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 1636, "end": 1584,
"raw": "2.17", "raw": "2.17",
"start": 1632, "start": 1580,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1170,9 +1128,9 @@ snapshot_kind: text
}, },
{ {
"argument": { "argument": {
"end": 1643, "end": 1591,
"raw": "0.03", "raw": "0.03",
"start": 1639, "start": 1587,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1180,28 +1138,28 @@ snapshot_kind: text
"suffix": "None" "suffix": "None"
} }
}, },
"end": 1643, "end": 1591,
"operator": "-", "operator": "-",
"start": 1638, "start": 1586,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 1644, "end": 1592,
"start": 1631, "start": 1579,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 1624, "end": 1572,
"name": "line", "name": "line",
"start": 1620, "start": 1568,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1645, "end": 1593,
"start": 1620, "start": 1568,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -1218,9 +1176,9 @@ snapshot_kind: text
"elements": [ "elements": [
{ {
"argument": { "argument": {
"end": 1668, "end": 1616,
"raw": "0.07", "raw": "0.07",
"start": 1664, "start": 1612,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1228,17 +1186,17 @@ snapshot_kind: text
"suffix": "None" "suffix": "None"
} }
}, },
"end": 1668, "end": 1616,
"operator": "-", "operator": "-",
"start": 1663, "start": 1611,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"argument": { "argument": {
"end": 1674, "end": 1622,
"raw": "1.8", "raw": "1.8",
"start": 1671, "start": 1619,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1246,28 +1204,28 @@ snapshot_kind: text
"suffix": "None" "suffix": "None"
} }
}, },
"end": 1674, "end": 1622,
"operator": "-", "operator": "-",
"start": 1670, "start": 1618,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 1675, "end": 1623,
"start": 1662, "start": 1610,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 1655, "end": 1603,
"name": "line", "name": "line",
"start": 1651, "start": 1599,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1676, "end": 1624,
"start": 1651, "start": 1599,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -1284,9 +1242,9 @@ snapshot_kind: text
"elements": [ "elements": [
{ {
"argument": { "argument": {
"end": 1699, "end": 1647,
"raw": "2.07", "raw": "2.07",
"start": 1695, "start": 1643,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1294,16 +1252,16 @@ snapshot_kind: text
"suffix": "None" "suffix": "None"
} }
}, },
"end": 1699, "end": 1647,
"operator": "-", "operator": "-",
"start": 1694, "start": 1642,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"end": 1705, "end": 1653,
"raw": "0.05", "raw": "0.05",
"start": 1701, "start": 1649,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1312,21 +1270,21 @@ snapshot_kind: text
} }
} }
], ],
"end": 1706, "end": 1654,
"start": 1693, "start": 1641,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 1686, "end": 1634,
"name": "line", "name": "line",
"start": 1682, "start": 1630,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1707, "end": 1655,
"start": 1682, "start": 1630,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -1344,59 +1302,59 @@ snapshot_kind: text
{ {
"arguments": [ "arguments": [
{ {
"end": 1748, "end": 1696,
"start": 1747, "start": 1695,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1746, "end": 1694,
"name": "profileStartX", "name": "profileStartX",
"start": 1733, "start": 1681,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1749, "end": 1697,
"start": 1733, "start": 1681,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 1766, "end": 1714,
"start": 1765, "start": 1713,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1764, "end": 1712,
"name": "profileStartY", "name": "profileStartY",
"start": 1751, "start": 1699,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1767, "end": 1715,
"start": 1751, "start": 1699,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 1768, "end": 1716,
"start": 1732, "start": 1680,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 1717, "end": 1665,
"name": "line", "name": "line",
"start": 1713, "start": 1661,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1769, "end": 1717,
"start": 1713, "start": 1661,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -1404,20 +1362,20 @@ snapshot_kind: text
{ {
"arguments": [ "arguments": [
{ {
"end": 1782, "end": 1730,
"start": 1781, "start": 1729,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 1780, "end": 1728,
"name": "close", "name": "close",
"start": 1775, "start": 1723,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1783, "end": 1731,
"start": 1775, "start": 1723,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -1430,9 +1388,9 @@ snapshot_kind: text
"name": "length" "name": "length"
}, },
"arg": { "arg": {
"end": 1808, "end": 1756,
"raw": "10", "raw": "10",
"start": 1806, "start": 1754,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -1443,34 +1401,34 @@ snapshot_kind: text
} }
], ],
"callee": { "callee": {
"end": 1796, "end": 1744,
"name": "extrude", "name": "extrude",
"start": 1789, "start": 1737,
"type": "Identifier" "type": "Identifier"
}, },
"end": 1809, "end": 1757,
"start": 1789, "start": 1737,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
} }
], ],
"end": 1809, "end": 1757,
"start": 1548, "start": 1496,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
}, },
"start": 1536, "start": 1484,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 1809, "end": 1757,
"kind": "const", "kind": "const",
"start": 1536, "start": 1484,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 1810, "end": 1758,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"0": [ "0": [
@ -1631,8 +1589,8 @@ snapshot_kind: text
], ],
"10": [ "10": [
{ {
"end": 1536, "end": 1484,
"start": 1534, "start": 1482,
"type": "NonCodeNode", "type": "NonCodeNode",
"value": { "value": {
"type": "newLine" "type": "newLine"

View File

@ -32,14 +32,8 @@ bracket = startSketchOn('XY')
|> line(end = [0, -wallMountL + thickness]) |> line(end = [0, -wallMountL + thickness])
|> close(%) |> close(%)
|> extrude(length = width) |> extrude(length = width)
|> fillet({ |> fillet(radius = filletR, tags = [getNextAdjacentEdge(innerEdge)])
radius = filletR, |> fillet(radius = filletR + thickness, tags = [getNextAdjacentEdge(outerEdge)])
tags = [getNextAdjacentEdge(innerEdge)]
}, %)
|> fillet({
radius = filletR + thickness,
tags = [getNextAdjacentEdge(outerEdge)]
}, %)
sketch001 = startSketchOn(bracket, seg01) sketch001 = startSketchOn(bracket, seg01)
|> startProfileAt([4.28, 3.83], %) |> startProfileAt([4.28, 3.83], %)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed sketch_on_face_after_fillets_referencing_face.kcl description: Operations executed sketch_on_face_after_fillets_referencing_face.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -72,11 +73,8 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 0.25, "value": 0.25,
"ty": { "ty": {
@ -89,7 +87,14 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
} }
} }
}, },
"sourceRange": [
1350,
1357,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -97,25 +102,10 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
1341, 1366,
1421, 1398,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1423,
1424,
0 0
] ]
} }
@ -123,26 +113,42 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
"name": "fillet", "name": "fillet",
"sourceRange": [ "sourceRange": [
1334, 1334,
1425, 1399,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
"unlabeledArg": null "unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}, },
{ {
"labeledArgs": { "labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": { "radius": {
"value": {
"type": "Number", "type": "Number",
"value": 0.5707134902949093, "value": 0.5707134902949093,
"ty": { "ty": {
"type": "Unknown" "type": "Unknown"
} }
}, },
"sourceRange": [
1421,
1440,
0
]
},
"tags": { "tags": {
"value": {
"type": "Array", "type": "Array",
"value": [ "value": [
{ {
@ -150,16 +156,22 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
"value": "[uuid]" "value": "[uuid]"
} }
] ]
}
}
}, },
"sourceRange": [ "sourceRange": [
1438, 1449,
1530, 1481,
0 0
] ]
}
}, },
"solid": { "name": "fillet",
"sourceRange": [
1405,
1482,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": { "value": {
"type": "Solid", "type": "Solid",
"value": { "value": {
@ -167,21 +179,12 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
} }
}, },
"sourceRange": [ "sourceRange": [
1532, 0,
1533, 0,
0 0
] ]
} }
}, },
"name": "fillet",
"sourceRange": [
1431,
1534,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{ {
"labeledArgs": { "labeledArgs": {
"data": { "data": {
@ -192,8 +195,8 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
} }
}, },
"sourceRange": [ "sourceRange": [
1562, 1510,
1569, 1517,
0 0
] ]
}, },
@ -204,16 +207,16 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
1571, 1519,
1576, 1524,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
1548, 1496,
1577, 1525,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -236,16 +239,16 @@ description: Operations executed sketch_on_face_after_fillets_referencing_face.k
} }
}, },
"sourceRange": [ "sourceRange": [
1806, 1754,
1808, 1756,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1789, 1737,
1809, 1757,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Variables in memory after executing sketch_on_face_after_fillets_referencing_face.kcl description: Variables in memory after executing sketch_on_face_after_fillets_referencing_face.kcl
snapshot_kind: text
--- ---
{ {
"E": { "E": {
@ -1101,8 +1102,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1620, 1568,
1645, 1593,
0 0
], ],
"tag": null, "tag": null,
@ -1112,8 +1113,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1651, 1599,
1676, 1624,
0 0
], ],
"tag": null, "tag": null,
@ -1123,8 +1124,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1682, 1630,
1707, 1655,
0 0
], ],
"tag": null, "tag": null,
@ -1134,8 +1135,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1713, 1661,
1769, 1717,
0 0
], ],
"tag": null, "tag": null,
@ -1150,8 +1151,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1620, 1568,
1645, 1593,
0 0
] ]
}, },
@ -1173,8 +1174,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1651, 1599,
1676, 1624,
0 0
] ]
}, },
@ -1196,8 +1197,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1682, 1630,
1707, 1655,
0 0
] ]
}, },
@ -1219,8 +1220,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1713, 1661,
1769, 1717,
0 0
] ]
}, },
@ -1242,8 +1243,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1775, 1723,
1783, 1731,
0 0
] ]
}, },
@ -1820,8 +1821,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
1548, 1496,
1577, 1525,
0 0
] ]
} }
@ -1843,8 +1844,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1583, 1531,
1614, 1562,
0 0
] ]
} }
@ -1857,8 +1858,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
1583, 1531,
1614, 1562,
0 0
] ]
} }
@ -1873,8 +1874,8 @@ description: Variables in memory after executing sketch_on_face_after_fillets_re
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
1583, 1531,
1614, 1562,
0 0
] ]
} }

View File

@ -5,4 +5,4 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({radius: 2, tags: [thing3, getOppositeEdge(thing3)]}, %) |> fillet(radius = 2, tags = [thing3, getOppositeEdge(thing3)])

View File

@ -5,4 +5,4 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close() |> close()
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({radius: 2, tags: [thing, getOppositeEdge(thing)]}, %) |> fillet(radius = 2, tags = [thing, getOppositeEdge(thing)])

View File

@ -5,4 +5,4 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({radius: 2, tags: [getNextAdjacentEdge(thing3)]}, %) |> fillet(radius = 2, tags = [getNextAdjacentEdge(thing3)], %)

View File

@ -5,4 +5,4 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3) |> close(tag = $thing3)
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({radius: 2, tags: [getPreviousAdjacentEdge(thing3)]}, %) |> fillet(radius = 2, tags = [getPreviousAdjacentEdge(thing3)])

View File

@ -5,5 +5,5 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2) |> line(end = [0, -10], tag = $thing2)
|> close() |> close()
|> extrude(length = 10) |> extrude(length = 10)
|> fillet({radius: 2, tags: [thing, thing2]}, %) |> fillet(radius = 2, tags = [thing, thing2])

View File

@ -29,16 +29,16 @@ const bracket = startSketchOn('XY')
|> line(end = [0, -wallMountL + thickness]) |> line(end = [0, -wallMountL + thickness])
|> close() |> close()
|> extrude(length = width) |> extrude(length = width)
|> fillet({ |> fillet(
radius: filletR, radius = filletR,
tags: [ tags = [
getPreviousAdjacentEdge('innerEdge', %) getPreviousAdjacentEdge('innerEdge', %)
] ]
}, %) )
|> fillet({ |> fillet(
radius: filletR + thickness, radius = filletR + thickness,
tags: [ tags = [
getPreviousAdjacentEdge('outerEdge', %) getPreviousAdjacentEdge('outerEdge', %)
] ]
}, %) )

View File

@ -12,12 +12,13 @@ const sketch001 = startSketchOn('XZ')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
const extrude001 = extrude(sketch001, length = 100) const extrude001 = extrude(sketch001, length = 100)
const chamf = chamfer({ const chamf = chamfer(
length: 30, extrude001,
tags: [ length = 30,
tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02), getNextAdjacentEdge(seg02),
getOppositeEdge(seg01) getOppositeEdge(seg01)
] ]
}, extrude001) )

View File

@ -12,12 +12,12 @@ const sketch001 = startSketchOn('XZ')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close() |> close()
const extrude001 = extrude(sketch001, length = 100) const extrude001 = extrude(sketch001, length = 100)
|> chamfer({ |> chamfer(
length = 30, length = 30,
tags = [ tags = [
seg01, seg01,
getNextAdjacentEdge(yo), getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02), getNextAdjacentEdge(seg02),
getOppositeEdge(seg01) getOppositeEdge(seg01)
] ],
}, %) )

View File

@ -53,15 +53,15 @@ fn bracketSketch = (w, d, t) => {
// build the body of the bracket // build the body of the bracket
const bs = bracketSketch(width, depth, thk) const bs = bracketSketch(width, depth, thk)
const bracketBody = bs const bracketBody = bs
|> fillet({ |> fillet(
radius: radius, radius = radius,
tags: [ tags = [
getPreviousAdjacentEdge(bs.sketch.tags.edge7), getPreviousAdjacentEdge(bs.sketch.tags.edge7),
getPreviousAdjacentEdge(bs.sketch.tags.edge2), getPreviousAdjacentEdge(bs.sketch.tags.edge2),
getPreviousAdjacentEdge(bs.sketch.tags.edge3), getPreviousAdjacentEdge(bs.sketch.tags.edge3),
getPreviousAdjacentEdge(bs.sketch.tags.edge6) getPreviousAdjacentEdge(bs.sketch.tags.edge6)
] ]
}, %) )
// sketch on the face // sketch on the face

View File

@ -47,15 +47,15 @@ const case = startSketchOn('XY')
|> line(endAbsolute = [0, caseLength], $edge3) |> line(endAbsolute = [0, caseLength], $edge3)
|> close(tag = $edge4) |> close(tag = $edge4)
|> extrude(length = caseHeight) |> extrude(length = caseHeight)
|> fillet({ |> fillet(
radius: 1, radius = 1,
tags: [ tags = [
getNextAdjacentEdge(edge1), getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2), getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3), getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge4) getNextAdjacentEdge(edge4)
], ],
}, %) )
fn m25Screw = (x, y, height) => { fn m25Screw = (x, y, height) => {

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