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

View File

@ -86,7 +86,7 @@ helixPath = helix(
axis = [0, 0, 1.0],
origin = [0, 0.25, 0]
}
},
},
)
// Create a spring by sweeping around the helix path.

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ loft(
squareSketch,
circleSketch0,
circleSketch1
],
],
baseCurveIndex = 0,
bezApproximateRational = false,
tolerance = 0.000001,

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -424,7 +424,7 @@ test(
test(
'when code with error first loads you get errors in console',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
async ({ context, page, editor }, testInfo) => {
await context.folderSetupFn(async (dir) => {
await fsp.mkdir(path.join(dir, 'broken-code'), { recursive: true })
await fsp.copyFile(
@ -434,16 +434,19 @@ test(
})
await page.setBodyDimensions({ width: 1200, height: 500 })
await expect(page.getByText('broken-code')).toBeVisible()
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')).not.toBeAttached({
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
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)
|> close()
extrude001 = extrude(sketch001, length = 100)
|> chamfer({
|> chamfer(
length = 30,
tags = [
seg01,
getNextAdjacentEdge(yo),
getNextAdjacentEdge(seg02),
getOppositeEdge(seg01)
]
}, %)
],
)
`)
await expect(
page.getByTestId('model-state-indicator-execution-done')
@ -810,15 +810,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
await checkCodeAtHoverPosition(
'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(
'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()
@ -848,15 +848,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
await checkCodeAtHoverPosition(
'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(
'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 ({

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-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
"fetch:wasm": "./get-latest-wasm-bundle.sh",
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/kcl-samples/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)",
"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",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -131,7 +131,7 @@ See later source ranges for more context. about the sweep`,
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).
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`,
range: convertAppRangeToApiRange(selection.codeRef.range, code),
})

View File

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

View File

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

View File

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

View File

@ -517,13 +517,6 @@ impl Args {
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> {
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 {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
let obj = arg.as_object()?;

View File

@ -4,8 +4,6 @@ use anyhow::Result;
use derive_docs::stdlib;
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::CutType, ModelingCmd};
use kittycad_modeling_cmds as kcmc;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::{
errors::{KclError, KclErrorDetails},
@ -16,22 +14,14 @@ use crate::{
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.
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 })
}
@ -56,7 +46,7 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> close(tag = $edge4)
///
/// mountingPlate = extrude(mountingPlateSketch, length = thickness)
/// |> chamfer({
/// |> chamfer(
/// length = chamferLength,
/// tags = [
/// getNextAdjacentEdge(edge1),
@ -64,7 +54,7 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// getNextAdjacentEdge(edge3),
/// getNextAdjacentEdge(edge4)
/// ],
/// }, %)
/// )
/// ```
///
/// ```no_run
@ -82,10 +72,12 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// part001 = cube([0,0], 20)
/// |> close(tag = $line1)
/// |> extrude(length = 20)
/// |> chamfer({
/// // We tag the chamfer to reference it later.
/// |> chamfer(
/// length = 10,
/// tags = [getOppositeEdge(line1)]
/// }, %, $chamfer1) // We tag the chamfer to reference it later.
/// tags = [getOppositeEdge(line1)],
/// tag = $chamfer1,
/// )
///
/// sketch001 = startSketchOn(part001, chamfer1)
/// |> startProfileAt([10, 10], %)
@ -99,19 +91,28 @@ pub async fn chamfer(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
#[stdlib {
name = "chamfer",
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(
data: ChamferData,
solid: Box<Solid>,
length: f64,
tags: Vec<EdgeReference>,
tag: Option<TagNode>,
exec_state: &mut ExecState,
args: Args,
) -> Result<Box<Solid>, KclError> {
// Check if tags contains any duplicate values.
let mut tags = data.tags.clone();
let mut tags = tags.clone();
tags.sort();
tags.dedup();
if tags.len() != data.tags.len() {
if tags.len() != tags.len() {
return Err(KclError::Type(KclErrorDetails {
message: "Duplicate tags are not allowed.".to_string(),
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
// 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 {
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],
@ -128,7 +129,7 @@ async fn inner_chamfer(
}
let mut solid = solid.clone();
for edge_tag in data.tags {
for edge_tag in tags {
let edge_id = match edge_tag {
EdgeReference::Uuid(uuid) => uuid,
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 {
edge_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.
cut_type: CutType::Chamfer,
// 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 {
id,
edge_id,
length: data.length,
length,
tag: Box::new(tag.clone()),
});

View File

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

View File

@ -327,6 +327,19 @@ impl CallExpression {
}
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 {
let indent = if ctxt == ExprContext::Pipe {
"".to_string()
@ -334,23 +347,19 @@ impl CallExpressionKw {
options.get_indentation(indentation_level)
};
let name = &self.callee.name;
let mut arg_list = if let Some(first_arg) = &self.unlabeled {
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 arg_list = self.recast_args(options, indentation_level, ctxt);
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 {
options.get_indentation_offset_pipe(indentation_level + 1)
options.get_indentation_offset_pipe(next_indent)
} 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}"));
args.push(',');
let args = args;
@ -1424,7 +1433,7 @@ fn rectShape = (pos, w, l) => {
// only used for visualization
scarlett_body = rectShape([0, 0], width, length)
|> extrude(depth, %)
|> fillet({
|> fillet(
radius = radius,
tags = [
edge2,
@ -1432,7 +1441,7 @@ scarlett_body = rectShape([0, 0], width, length)
getOppositeEdge(edge2),
getOppositeEdge(edge4)
]
}, %)
)
// build the bracket sketch around the body
fn bracketSketch = (w, d, t) => {
s = startSketchOn({
@ -1457,15 +1466,15 @@ fn bracketSketch = (w, d, t) => {
// build the body of the bracket
bracket_body = bracketSketch(width, depth, thk)
|> extrude(length + 10, %)
|> fillet({
|> fillet(
radius = radius,
tags: [
tags = [
getNextAdjacentEdge(edge7),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge6)
]
}, %)
)
// build the tabs of the mounting bracket (right side)
tabs_r = startSketchOn({
plane: {
@ -1545,15 +1554,15 @@ fn rectShape(pos, w, l) {
// only used for visualization
scarlett_body = rectShape([0, 0], width, length)
|> extrude(depth, %)
|> fillet({
|> fillet(
radius = radius,
tags = [
edge2,
edge4,
getOppositeEdge(edge2),
getOppositeEdge(edge4)
]
}, %)
],
)
// build the bracket sketch around the body
fn bracketSketch(w, d, t) {
s = startSketchOn({
@ -1578,15 +1587,15 @@ fn bracketSketch(w, d, t) {
// build the body of the bracket
bracket_body = bracketSketch(width, depth, thk)
|> extrude(length + 10, %)
|> fillet({
|> fillet(
radius = radius,
tags = [
getNextAdjacentEdge(edge7),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge6)
]
}, %)
],
)
// build the tabs of the mounting bracket (right side)
tabs_r = startSketchOn({
plane = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
---
source: kcl/src/simulation_tests.rs
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": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 2.0,
"ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
}
}
},
"sourceRange": [
239,
240,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -102,25 +107,10 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
230,
305,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
307,
308,
249,
282,
0
]
}
@ -128,10 +118,22 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
"name": "fillet",
"sourceRange": [
223,
309,
283,
0
],
"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]",
"range": [
261,
283,
245,
267,
0
],
"command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]",
"range": [
211,
295,
269,
0
],
"command": {
@ -661,7 +661,7 @@ snapshot_kind: text
"cmdId": "[uuid]",
"range": [
211,
295,
269,
0
],
"command": {

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed basic_fillet_cube_end.kcl
snapshot_kind: text
---
[
{
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_end.kcl
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 2.0,
"ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_end.kcl
}
}
},
"sourceRange": [
227,
228,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -102,25 +107,10 @@ description: Operations executed basic_fillet_cube_end.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
218,
291,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
293,
294,
237,
268,
0
]
}
@ -128,10 +118,22 @@ description: Operations executed basic_fillet_cube_end.kcl
"name": "fillet",
"sourceRange": [
211,
295,
269,
0
],
"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]",
"range": [
281,
308,
265,
292,
0
],
"command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]",
"range": [
238,
320,
294,
0
],
"command": {

View File

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

View File

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

View File

@ -1,6 +1,7 @@
---
source: kcl/src/simulation_tests.rs
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": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 2.0,
"ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
}
}
},
"sourceRange": [
254,
255,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -97,25 +102,10 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
245,
316,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
318,
319,
264,
293,
0
]
}
@ -123,10 +113,22 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
"name": "fillet",
"sourceRange": [
238,
320,
294,
0
],
"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]",
"range": [
281,
312,
265,
296,
0
],
"command": {
@ -645,7 +645,7 @@ snapshot_kind: text
"cmdId": "[uuid]",
"range": [
238,
324,
298,
0
],
"command": {

View File

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

View File

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

View File

@ -1,6 +1,7 @@
---
source: kcl/src/simulation_tests.rs
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": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 2.0,
"ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
}
}
},
"sourceRange": [
254,
255,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -97,25 +102,10 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
245,
320,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
322,
323,
264,
297,
0
]
}
@ -123,10 +113,22 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
"name": "fillet",
"sourceRange": [
238,
324,
298,
0
],
"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]",
"range": [
211,
260,
253,
0
],
"command": {
@ -646,7 +646,7 @@ description: Artifact commands basic_fillet_cube_start.kcl
"cmdId": "[uuid]",
"range": [
211,
260,
253,
0
],
"command": {

View File

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

View File

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

View File

@ -5,4 +5,4 @@ part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2)
|> close(%)
|> 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
description: Operations executed basic_fillet_cube_start.kcl
snapshot_kind: text
---
[
{
@ -72,11 +73,8 @@ description: Operations executed basic_fillet_cube_start.kcl
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 2.0,
"ty": {
@ -89,7 +87,14 @@ description: Operations executed basic_fillet_cube_start.kcl
}
}
},
"sourceRange": [
227,
228,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -103,25 +108,10 @@ description: Operations executed basic_fillet_cube_start.kcl
"artifact_id": "[uuid]"
}
]
}
}
},
"sourceRange": [
218,
256,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
258,
259,
237,
252,
0
]
}
@ -129,10 +119,22 @@ description: Operations executed basic_fillet_cube_start.kcl
"name": "fillet",
"sourceRange": [
211,
260,
253,
0
],
"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]
end
subgraph path31 [Path]
31["Path<br>[1341, 1366, 0]"]
31["Path<br>[1337, 1362, 0]"]
end
subgraph path32 [Path]
32["Path<br>[1374, 1418, 0]"]
33["Segment<br>[1374, 1418, 0]"]
32["Path<br>[1370, 1414, 0]"]
33["Segment<br>[1370, 1414, 0]"]
34[Solid2d]
end
subgraph path35 [Path]
35["Path<br>[1431, 1476, 0]"]
36["Segment<br>[1431, 1476, 0]"]
35["Path<br>[1427, 1472, 0]"]
36["Segment<br>[1427, 1472, 0]"]
37[Solid2d]
end
subgraph path45 [Path]
45["Path<br>[1341, 1366, 0]"]
45["Path<br>[1337, 1362, 0]"]
end
subgraph path46 [Path]
46["Path<br>[1374, 1418, 0]"]
47["Segment<br>[1374, 1418, 0]"]
46["Path<br>[1370, 1414, 0]"]
47["Segment<br>[1370, 1414, 0]"]
48[Solid2d]
end
subgraph path49 [Path]
49["Path<br>[1431, 1476, 0]"]
50["Segment<br>[1431, 1476, 0]"]
49["Path<br>[1427, 1472, 0]"]
50["Segment<br>[1427, 1472, 0]"]
51[Solid2d]
end
subgraph path59 [Path]
59["Path<br>[1341, 1366, 0]"]
59["Path<br>[1337, 1362, 0]"]
end
subgraph path60 [Path]
60["Path<br>[1374, 1418, 0]"]
61["Segment<br>[1374, 1418, 0]"]
60["Path<br>[1370, 1414, 0]"]
61["Segment<br>[1370, 1414, 0]"]
62[Solid2d]
end
subgraph path63 [Path]
63["Path<br>[1431, 1476, 0]"]
64["Segment<br>[1431, 1476, 0]"]
63["Path<br>[1427, 1472, 0]"]
64["Segment<br>[1427, 1472, 0]"]
65[Solid2d]
end
subgraph path73 [Path]
73["Path<br>[1341, 1366, 0]"]
73["Path<br>[1337, 1362, 0]"]
end
subgraph path74 [Path]
74["Path<br>[1374, 1418, 0]"]
75["Segment<br>[1374, 1418, 0]"]
74["Path<br>[1370, 1414, 0]"]
75["Segment<br>[1370, 1414, 0]"]
76[Solid2d]
end
subgraph path77 [Path]
77["Path<br>[1431, 1476, 0]"]
78["Segment<br>[1431, 1476, 0]"]
77["Path<br>[1427, 1472, 0]"]
78["Segment<br>[1427, 1472, 0]"]
79[Solid2d]
end
1["Plane<br>[373, 461, 0]"]
@ -85,38 +85,38 @@ flowchart LR
27["SweepEdge Adjacent"]
28["SweepEdge Opposite"]
29["SweepEdge Adjacent"]
30["Plane<br>[1314, 1333, 0]"]
38["Sweep Extrusion<br>[1488, 1512, 0]"]
30["Plane<br>[1310, 1329, 0]"]
38["Sweep Extrusion<br>[1484, 1508, 0]"]
39[Wall]
40["Cap Start"]
41["Cap End"]
42["SweepEdge Opposite"]
43["SweepEdge Adjacent"]
44["Plane<br>[1314, 1333, 0]"]
52["Sweep Extrusion<br>[1488, 1512, 0]"]
44["Plane<br>[1310, 1329, 0]"]
52["Sweep Extrusion<br>[1484, 1508, 0]"]
53[Wall]
54["Cap Start"]
55["Cap End"]
56["SweepEdge Opposite"]
57["SweepEdge Adjacent"]
58["Plane<br>[1314, 1333, 0]"]
66["Sweep Extrusion<br>[1488, 1512, 0]"]
58["Plane<br>[1310, 1329, 0]"]
66["Sweep Extrusion<br>[1484, 1508, 0]"]
67[Wall]
68["Cap Start"]
69["Cap End"]
70["SweepEdge Opposite"]
71["SweepEdge Adjacent"]
72["Plane<br>[1314, 1333, 0]"]
80["Sweep Extrusion<br>[1488, 1512, 0]"]
72["Plane<br>[1310, 1329, 0]"]
80["Sweep Extrusion<br>[1484, 1508, 0]"]
81[Wall]
82["Cap Start"]
83["Cap End"]
84["SweepEdge Opposite"]
85["SweepEdge Adjacent"]
86["EdgeCut Fillet<br>[1064, 1274, 0]"]
87["EdgeCut Fillet<br>[1064, 1274, 0]"]
88["EdgeCut Fillet<br>[1064, 1274, 0]"]
89["EdgeCut Fillet<br>[1064, 1274, 0]"]
86["EdgeCut Fillet<br>[1064, 1270, 0]"]
87["EdgeCut Fillet<br>[1064, 1270, 0]"]
88["EdgeCut Fillet<br>[1064, 1270, 0]"]
89["EdgeCut Fillet<br>[1064, 1270, 0]"]
1 --- 2
2 --- 3
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)
|> close(tag = $edge4)
|> extrude(length = caseHeight)
|> fillet({
|> fillet(
radius = 1,
tags = [
getNextAdjacentEdge(edge1),
getNextAdjacentEdge(edge2),
getNextAdjacentEdge(edge3),
getNextAdjacentEdge(edge4)
]
}, %)
],
)
fn m25Screw(x, y, height) {
screw = startSketchOn("XY")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed pentagon_fillet_sugar.kcl
snapshot_kind: text
---
[
{
@ -172,11 +173,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
@ -189,7 +187,14 @@ description: Operations executed pentagon_fillet_sugar.kcl
}
}
},
"sourceRange": [
670,
671,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -202,25 +207,10 @@ description: Operations executed pentagon_fillet_sugar.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
653,
773,
0
]
},
"solid": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
775,
776,
687,
765,
0
]
}
@ -228,11 +218,23 @@ description: Operations executed pentagon_fillet_sugar.kcl
"name": "fillet",
"sourceRange": [
646,
777,
773,
0
],
"type": "StdLibCall",
"unlabeledArg": null
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
},
{
"type": "UserDefinedFunctionCall",
@ -245,8 +247,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
"unlabeledArg": null,
"labeledArgs": {},
"sourceRange": [
783,
796,
779,
792,
0
]
},
@ -307,16 +309,16 @@ description: Operations executed pentagon_fillet_sugar.kcl
}
},
"sourceRange": [
833,
843,
829,
839,
0
]
}
},
"name": "extrude",
"sourceRange": [
816,
844,
812,
840,
0
],
"type": "StdLibCall",
@ -336,11 +338,8 @@ description: Operations executed pentagon_fillet_sugar.kcl
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Object",
"value": {
"radius": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
@ -353,7 +352,14 @@ description: Operations executed pentagon_fillet_sugar.kcl
}
}
},
"sourceRange": [
870,
871,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
@ -366,16 +372,22 @@ description: Operations executed pentagon_fillet_sugar.kcl
"value": "[uuid]"
}
]
}
}
},
"sourceRange": [
857,
977,
887,
965,
0
]
}
},
"solid": {
"name": "fillet",
"sourceRange": [
846,
973,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
@ -383,19 +395,10 @@ description: Operations executed pentagon_fillet_sugar.kcl
}
},
"sourceRange": [
979,
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]",
"range": [
585,
607,
562,
584,
0
],
"command": {
@ -666,7 +666,7 @@ snapshot_kind: text
"cmdId": "[uuid]",
"range": [
492,
534,
527,
0
],
"command": {
@ -681,8 +681,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
540,
627,
533,
600,
0
],
"command": {
@ -697,8 +697,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
633,
684,
606,
656,
0
],
"command": {
@ -713,8 +713,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
736,
770,
708,
742,
0
],
"command": {
@ -729,8 +729,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
736,
770,
708,
742,
0
],
"command": {
@ -740,8 +740,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
736,
770,
708,
742,
0
],
"command": {
@ -757,8 +757,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
776,
824,
748,
796,
0
],
"command": {
@ -778,8 +778,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
830,
931,
802,
903,
0
],
"command": {
@ -799,8 +799,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
937,
1057,
909,
1029,
0
],
"command": {
@ -820,8 +820,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1063,
1119,
1035,
1091,
0
],
"command": {
@ -841,8 +841,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1125,
1133,
1097,
1105,
0
],
"command": {
@ -853,8 +853,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1184,
1219,
1156,
1191,
0
],
"command": {
@ -869,8 +869,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1184,
1219,
1156,
1191,
0
],
"command": {
@ -880,8 +880,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1184,
1219,
1156,
1191,
0
],
"command": {
@ -897,8 +897,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1225,
1273,
1197,
1245,
0
],
"command": {
@ -918,8 +918,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1279,
1381,
1251,
1353,
0
],
"command": {
@ -939,8 +939,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1387,
1507,
1359,
1479,
0
],
"command": {
@ -960,8 +960,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1513,
1569,
1485,
1541,
0
],
"command": {
@ -981,8 +981,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1575,
1583,
1547,
1555,
0
],
"command": {
@ -993,8 +993,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1009,8 +1009,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1023,8 +1023,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1034,8 +1034,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1046,8 +1046,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1059,8 +1059,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1073,8 +1073,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1087,8 +1087,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1101,8 +1101,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1115,8 +1115,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1129,8 +1129,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1143,8 +1143,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {
@ -1157,8 +1157,8 @@ snapshot_kind: text
{
"cmdId": "[uuid]",
"range": [
1597,
1628,
1569,
1600,
0
],
"command": {

View File

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

View File

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

View File

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

View File

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

View File

@ -10,21 +10,21 @@ flowchart LR
8[Solid2d]
end
subgraph path27 [Path]
27["Path<br>[736, 770, 0]"]
28["Segment<br>[776, 824, 0]"]
29["Segment<br>[830, 931, 0]"]
30["Segment<br>[937, 1057, 0]"]
31["Segment<br>[1063, 1119, 0]"]
32["Segment<br>[1125, 1133, 0]"]
27["Path<br>[708, 742, 0]"]
28["Segment<br>[748, 796, 0]"]
29["Segment<br>[802, 903, 0]"]
30["Segment<br>[909, 1029, 0]"]
31["Segment<br>[1035, 1091, 0]"]
32["Segment<br>[1097, 1105, 0]"]
33[Solid2d]
end
subgraph path34 [Path]
34["Path<br>[1184, 1219, 0]"]
35["Segment<br>[1225, 1273, 0]"]
36["Segment<br>[1279, 1381, 0]"]
37["Segment<br>[1387, 1507, 0]"]
38["Segment<br>[1513, 1569, 0]"]
39["Segment<br>[1575, 1583, 0]"]
34["Path<br>[1156, 1191, 0]"]
35["Segment<br>[1197, 1245, 0]"]
36["Segment<br>[1251, 1353, 0]"]
37["Segment<br>[1359, 1479, 0]"]
38["Segment<br>[1485, 1541, 0]"]
39["Segment<br>[1547, 1555, 0]"]
40[Solid2d]
end
1["Plane<br>[12, 31, 0]"]
@ -43,10 +43,10 @@ flowchart LR
21["SweepEdge Adjacent"]
22["SweepEdge Opposite"]
23["SweepEdge Adjacent"]
24["EdgeCut Fillet<br>[492, 534, 0]"]
25["Plane<br>[736, 770, 0]"]
26["Plane<br>[1184, 1219, 0]"]
41["Sweep Extrusion<br>[1597, 1628, 0]"]
24["EdgeCut Fillet<br>[492, 527, 0]"]
25["Plane<br>[708, 742, 0]"]
26["Plane<br>[1156, 1191, 0]"]
41["Sweep Extrusion<br>[1569, 1600, 0]"]
42[Wall]
43[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)
|> close(%)
extrude001 = extrude(sketch001, length = 100)
|> fillet({ radius = 20, tags = [seg01] }, %)
|> chamfer({ length = 50, tags = [seg02] }, %, $seg04)
|> chamfer({
length = 50,
tags = [getOppositeEdge(seg01)]
}, %, $seg03)
|> fillet(radius = 20, tags = [seg01])
|> chamfer(length = 50, tags = [seg02], tag = $seg04)
|> chamfer(length = 50, tags = [getOppositeEdge(seg01)], tag = $seg03)
sketch003 = startSketchOn(extrude001, seg04)
|> startProfileAt([-69.1, 277.34], %)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,4 +5,4 @@ const part001 = startSketchOn('XY')
|> line(end = [0, -10], tag = $thing2)
|> close(tag = $thing3)
|> 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)
|> close()
|> 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)
|> close(tag = $thing3)
|> 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)
|> close(tag = $thing3)
|> 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)
|> close()
|> 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])
|> close()
|> extrude(length = width)
|> fillet({
radius: filletR,
tags: [
|> fillet(
radius = filletR,
tags = [
getPreviousAdjacentEdge('innerEdge', %)
]
}, %)
|> fillet({
radius: filletR + thickness,
tags: [
)
|> fillet(
radius = filletR + thickness,
tags = [
getPreviousAdjacentEdge('outerEdge', %)
]
}, %)
)

View File

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

View File

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

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