Compare commits

...

14 Commits

Author SHA1 Message Date
e988d792ed Update src/lang/std/sketch.ts
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2024-08-20 20:39:36 -07:00
3d975c8441 Merge branch 'main' into achalmers/remove-tanarc-to 2024-08-12 14:33:55 -07:00
c4e4e9178d trigger CI 2024-08-12 19:33:03 +10:00
ef4197d29d A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-08-12 07:55:15 +00:00
aeef763c56 Merge remote-tracking branch 'origin/main' into achalmers/remove-tanarc-to 2024-08-12 17:44:36 +10:00
46f84a75cf Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit c292ed6116.
2024-08-12 17:44:23 +10:00
0039c6dd67 Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit 5202c72d01.
2024-08-12 17:44:15 +10:00
c00f40b104 Merge branch 'main' into achalmers/remove-tanarc-to 2024-08-09 17:41:11 +10:00
5202c72d01 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-08-08 23:57:18 +00:00
c292ed6116 A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) 2024-08-08 23:55:20 +00:00
5c547efb4f Migrate code within JS 2024-08-08 18:38:45 -05:00
8e1dd4a84e Update docs 2024-08-08 18:13:15 -05:00
2e4ad0af09 Fix up tests 2024-08-08 18:13:15 -05:00
ecb3329177 Add 'relative: bool' to tanArcTo, remove 'to' mode from tanArc 2024-08-08 18:13:15 -05:00
19 changed files with 125 additions and 138 deletions

View File

@ -211843,8 +211843,8 @@
}, },
{ {
"name": "tangentialArc", "name": "tangentialArc",
"summary": "Starting at the current sketch's origin, draw a curved line segment along", "summary": "Draw a curved line segment along some part of an imaginary circle of the specified radius.",
"description": "some part of an imaginary circle of the specified radius.\nThe arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle.", "description": "If `relative` is true, the curve starts at the end of the previous path segment (i.e. the location of the \"pen\" which draws these lines). If `relative` is false, starts from the current sketch's origin.\nThe arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle.",
"tags": [], "tags": [],
"args": [ "args": [
{ {
@ -211871,16 +211871,6 @@
"format": "double" "format": "double"
} }
} }
},
{
"description": "A point where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.",
"type": "array",
"items": {
"type": "number",
"format": "double"
},
"maxItems": 2,
"minItems": 2
} }
] ]
}, },
@ -218589,6 +218579,14 @@
}, },
"required": true "required": true
}, },
{
"name": "relative",
"type": "bool",
"schema": {
"type": "boolean"
},
"required": true
},
{ {
"name": "sketch_group", "name": "sketch_group",
"type": "SketchGroup", "type": "SketchGroup",
@ -225269,7 +225267,7 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArcTo([15, 15], %)\n |> line([10, -15], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)" "const exampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> angledLine({ angle: 60, length: 10 }, %)\n |> tangentialArcTo([15, 15], false, %)\n |> line([10, -15], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)"
] ]
}, },
{ {

View File

@ -1,12 +1,12 @@
--- ---
title: "tangentialArc" title: "tangentialArc"
excerpt: "Starting at the current sketch's origin, draw a curved line segment along" excerpt: "Draw a curved line segment along some part of an imaginary circle of the specified radius."
layout: manual layout: manual
--- ---
Starting at the current sketch's origin, draw a curved line segment along Draw a curved line segment along some part of an imaginary circle of the specified radius.
some part of an imaginary circle of the specified radius. If `relative` is true, the curve starts at the end of the previous path segment (i.e. the location of the "pen" which draws these lines). If `relative` is false, starts from the current sketch's origin.
The arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle. The arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle.
```js ```js
@ -37,8 +37,7 @@ const example = extrude(10, exampleSketch)
offset: number, offset: number,
// Radius of the arc. Not to be confused with Raiders of the Lost Ark. // Radius of the arc. Not to be confused with Raiders of the Lost Ark.
radius: number, radius: number,
} | }
[number, number]
``` ```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js

View File

@ -9,7 +9,7 @@ Starting at the current sketch's origin, draw a curved line segment along
some part of an imaginary circle until it reaches the desired (x, y) coordinates. some part of an imaginary circle until it reaches the desired (x, y) coordinates.
```js ```js
tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup tangentialArcTo(to: [number], relative: bool, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
``` ```
### Examples ### Examples
@ -18,7 +18,7 @@ tangentialArcTo(to: [number], sketch_group: SketchGroup, tag?: TagDeclarator) ->
const exampleSketch = startSketchOn('XZ') const exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 60, length: 10 }, %) |> angledLine({ angle: 60, length: 10 }, %)
|> tangentialArcTo([15, 15], %) |> tangentialArcTo([15, 15], false, %)
|> line([10, -15], %) |> line([10, -15], %)
|> close(%) |> close(%)
@ -30,6 +30,7 @@ const example = extrude(10, exampleSketch)
### Arguments ### Arguments
* `to`: `[number]` (REQUIRED) * `to`: `[number]` (REQUIRED)
* `relative`: `bool` (REQUIRED)
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED) * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js ```js
{ {

View File

@ -648,7 +648,7 @@ test.describe('Editor tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%)` |> close(%)`
) )
}) })
@ -701,7 +701,7 @@ test.describe('Editor tests', () => {
// expect the code to have changed // expect the code to have changed
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`const sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line([12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38], %) |> close(%)const extrude001 = extrude(5, sketch001)` `const sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line([12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38], false, %) |> close(%)const extrude001 = extrude(5, sketch001)`
) )
// Now hit undo // Now hit undo
@ -714,7 +714,7 @@ test.describe('Editor tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%)`) |> close(%)`)
}) })
@ -728,7 +728,7 @@ test.describe('Editor tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> extrude(5, %)` |> extrude(5, %)`
) )
@ -819,7 +819,7 @@ test.describe('Editor tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([7.12, -16.82], %) |> startProfileAt([7.12, -16.82], %)
|> line([15.4, -2.74], %) |> line([15.4, -2.74], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> line([2.65, -2.69], %) |> line([2.65, -2.69], %)
|> close(%) |> close(%)
|> extrude(5, %)`) |> extrude(5, %)`)
@ -833,7 +833,7 @@ test.describe('Editor tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([7.12, -16.82], %) |> startProfileAt([7.12, -16.82], %)
|> line([15.4, -2.74], %) |> line([15.4, -2.74], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> extrude(5, %)`) |> extrude(5, %)`)
@ -846,7 +846,7 @@ test.describe('Editor tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([7.12, -16.82], %) |> startProfileAt([7.12, -16.82], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> extrude(5, %)`) |> extrude(5, %)`)
@ -860,7 +860,7 @@ test.describe('Editor tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> extrude(5, %)`) |> extrude(5, %)`)
}) })

View File

@ -61,7 +61,7 @@ test.describe('Sketch tests', () => {
const part002 = startSketchOn('-XZ') const part002 = startSketchOn('-XZ')
${startProfileAt3} ${startProfileAt3}
|> xLine(width / 4, %) |> xLine(width / 4, %)
|> tangentialArcTo([width / 2, 0], %) |> tangentialArcTo([width / 2, 0], false, %)
|> xLine(-width / 4 + wireRadius, %) |> xLine(-width / 4 + wireRadius, %)
|> yLine(wireOffset, %) |> yLine(wireOffset, %)
|> arc({ |> arc({
@ -115,7 +115,7 @@ test.describe('Sketch tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %)` |> tangentialArcTo([24.95, -5.38], false, %)`
) )
}) })
@ -125,7 +125,7 @@ test.describe('Sketch tests', () => {
await expect(async () => { await expect(async () => {
await page.mouse.click(700, 200) await page.mouse.click(700, 200)
await page.getByText('tangentialArcTo([24.95, -5.38], %)').click() await page.getByText('tangentialArcTo([24.95, -5.38], false, %)').click()
await expect( await expect(
page.getByRole('button', { name: 'Edit Sketch' }) page.getByRole('button', { name: 'Edit Sketch' })
).toBeEnabled({ timeout: 1000 }) ).toBeEnabled({ timeout: 1000 })
@ -134,7 +134,7 @@ test.describe('Sketch tests', () => {
await page.waitForTimeout(600) // wait for animation await page.waitForTimeout(600) // wait for animation
await page.getByText('tangentialArcTo([24.95, -5.38], %)').click() await page.getByText('tangentialArcTo([24.95, -5.38], false, %)').click()
await page.keyboard.press('End') await page.keyboard.press('End')
await page.keyboard.down('Shift') await page.keyboard.down('Shift')
await page.keyboard.press('ArrowUp') await page.keyboard.press('ArrowUp')
@ -193,7 +193,7 @@ test.describe('Sketch tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%)` |> close(%)`
) )
}) })
@ -235,7 +235,7 @@ test.describe('Sketch tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%)`) |> close(%)`)
} else { } else {
// Ensure we don't see the code. // Ensure we don't see the code.
@ -312,7 +312,7 @@ test.describe('Sketch tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([6.44, -12.07], %) |> startProfileAt([6.44, -12.07], %)
|> line([14.72, 1.97], %) |> line([14.72, 1.97], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> line([1.97, 2.06], %) |> line([1.97, 2.06], %)
|> close(%)`) |> close(%)`)
} }
@ -356,7 +356,7 @@ test.describe('Sketch tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> extrude(5, %)` |> extrude(5, %)`
) )
@ -443,7 +443,7 @@ test.describe('Sketch tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([7.12, -16.82], %) |> startProfileAt([7.12, -16.82], %)
|> line([15.4, -2.74], %) |> line([15.4, -2.74], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> line([2.65, -2.69], %) |> line([2.65, -2.69], %)
|> close(%) |> close(%)
|> extrude(5, %)`) |> extrude(5, %)`)
@ -460,7 +460,7 @@ test.describe('Sketch tests', () => {
`const sketch001 = startSketchOn('XZ') `const sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line([12.73, -0.09], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> close(%) |> close(%)
|> revolve({ axis: "X",}, %)` |> revolve({ axis: "X",}, %)`
) )
@ -546,7 +546,7 @@ test.describe('Sketch tests', () => {
.toHaveText(`const sketch001 = startSketchOn('XZ') .toHaveText(`const sketch001 = startSketchOn('XZ')
|> startProfileAt([6.44, -12.07], %) |> startProfileAt([6.44, -12.07], %)
|> line([14.72, 1.97], %) |> line([14.72, 1.97], %)
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], false, %)
|> line([1.97, 2.06], %) |> line([1.97, 2.06], %)
|> close(%) |> close(%)
|> revolve({ axis: "X" }, %)`) |> revolve({ axis: "X" }, %)`)

View File

@ -570,7 +570,7 @@ test.describe(
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
code += ` code += `
|> tangentialArcTo([21.7, -2.44], %)` |> tangentialArcTo([21.7, -2.44], false, %)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
// click tangential arc tool again to unequip it // click tangential arc tool again to unequip it
@ -673,7 +673,7 @@ test.describe(
await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 30, 500 - PUR * 20)
code += ` code += `
|> tangentialArcTo([551.2, -62.01], %)` |> tangentialArcTo([551.2, -62.01], false, %)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page await page

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -82,7 +82,7 @@ export const TEST_CODE_GIZMO = `const part001 = startSketchOn('XZ')
intersectTag: a, intersectTag: a,
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([13.14 + 0, 13.14], %) |> tangentialArcTo([13.14 + 0, 13.14], false, %)
|> close(%) |> close(%)
|> extrude(5 + 7, %) |> extrude(5 + 7, %)
` `

View File

@ -200,7 +200,7 @@ test.describe('Testing segment overlays', () => {
intersectTag: a, intersectTag: a,
offset: 9 offset: 9
}, %) }, %)
|> tangentialArcTo([5 + 3.14 + 13, 20 + 3.14], %) |> tangentialArcTo([5 + 3.14 + 13, 20 + 3.14], false, %)
` `
) )
}) })
@ -438,7 +438,7 @@ const part001 = startSketchOn('XZ')
intersectTag: a, intersectTag: a,
offset: 9 offset: 9
}, %) }, %)
|> tangentialArcTo([3.14 + 13, 3.14], %) |> tangentialArcTo([3.14 + 13, 3.14], false, %)
` `
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
@ -566,7 +566,7 @@ const part001 = startSketchOn('XZ')
intersectTag: a, intersectTag: a,
offset: 9 offset: 9
}, %) }, %)
|> tangentialArcTo([3.14 + 13, 1.14], %) |> tangentialArcTo([3.14 + 13, 1.14], false, %)
` `
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
@ -722,7 +722,7 @@ const part001 = startSketchOn('XZ')
intersectTag: a, intersectTag: a,
offset: 9 offset: 9
}, %) }, %)
|> tangentialArcTo([3.14 + 13, -3.14], %) |> tangentialArcTo([3.14 + 13, -3.14], false, %)
` `
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
@ -755,9 +755,10 @@ const part001 = startSketchOn('XZ')
await clickConstrained({ await clickConstrained({
hoverPos: { x: tangentialArcTo.x, y: tangentialArcTo.y }, hoverPos: { x: tangentialArcTo.x, y: tangentialArcTo.y },
constraintType: 'xAbsolute', constraintType: 'xAbsolute',
expectBeforeUnconstrained: 'tangentialArcTo([3.14 + 13, -3.14], %)', expectBeforeUnconstrained:
expectAfterUnconstrained: 'tangentialArcTo([16.14, -3.14], %)', 'tangentialArcTo([3.14 + 13, -3.14], false, %)',
expectFinal: 'tangentialArcTo([xAbs001, -3.14], %)', expectAfterUnconstrained: 'tangentialArcTo([16.14, -3.14], false, %)',
expectFinal: 'tangentialArcTo([xAbs001, -3.14], false, %)',
ang: ang + 180, ang: ang + 180,
steps: 6, steps: 6,
locator: '[data-overlay-toolbar-index="12"]', locator: '[data-overlay-toolbar-index="12"]',
@ -766,9 +767,11 @@ const part001 = startSketchOn('XZ')
await clickUnconstrained({ await clickUnconstrained({
hoverPos: { x: tangentialArcTo.x, y: tangentialArcTo.y }, hoverPos: { x: tangentialArcTo.x, y: tangentialArcTo.y },
constraintType: 'yAbsolute', constraintType: 'yAbsolute',
expectBeforeUnconstrained: 'tangentialArcTo([xAbs001, -3.14], %)', expectBeforeUnconstrained:
expectAfterUnconstrained: 'tangentialArcTo([xAbs001, yAbs001], %)', 'tangentialArcTo([xAbs001, -3.14], false, %)',
expectFinal: 'tangentialArcTo([xAbs001, -3.14], %)', expectAfterUnconstrained:
'tangentialArcTo([xAbs001, yAbs001], false, %)',
expectFinal: 'tangentialArcTo([xAbs001, -3.14], false, %)',
ang: ang + 180, ang: ang + 180,
steps: 10, steps: 10,
locator: '[data-overlay-toolbar-index="12"]', locator: '[data-overlay-toolbar-index="12"]',
@ -835,7 +838,7 @@ const part001 = startSketchOn('XZ')
intersectTag: a, intersectTag: a,
offset: 9 offset: 9
}, %) }, %)
|> tangentialArcTo([3.14 + 13, 1.14], %) |> tangentialArcTo([3.14 + 13, 1.14], false, %)
` `
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
@ -866,7 +869,7 @@ const part001 = startSketchOn('XZ')
let ang = await u.getAngle(`[data-overlay-index="${12}"]`) let ang = await u.getAngle(`[data-overlay-index="${12}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'tangentialArcTo([3.14 + 13, 1.14], %)', codeToBeDeleted: 'tangentialArcTo([3.14 + 13, 1.14], false, %)',
stdLibFnName: 'tangentialArcTo', stdLibFnName: 'tangentialArcTo',
ang: ang + 180, ang: ang + 180,
steps: 6, steps: 6,

View File

@ -476,7 +476,7 @@ const sketch002 = startSketchOn(launderExtrudeThroughVar, seg02)
intersectTag: a, intersectTag: a,
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([13.14 + 0, 13.14], %) |> tangentialArcTo([13.14 + 0, 13.14], false, %)
|> close(%) |> close(%)
|> extrude(5 + 7, %) |> extrude(5 + 7, %)
` `
@ -680,7 +680,7 @@ const extrude001 = extrude(10, sketch001)`
}, },
{ {
pos: [1107, 161], pos: [1107, 161],
expectedCode: 'tangentialArcTo([167.95, -28.85], %)', expectedCode: 'tangentialArcTo([167.95, -28.85], false, %)',
}, },
] as const ] as const
await page.addInitScript( await page.addInitScript(

View File

@ -584,7 +584,7 @@ describe('Testing removeSingleConstraintInfo', () => {
intersectTag: a, intersectTag: a,
offset: 0 + 0 offset: 0 + 0
}, %) }, %)
|> tangentialArcTo([3.14 + 0, 13.14 + 0], %)` |> tangentialArcTo([3.14 + 0, 13.14 + 0], false, %)`
test.each([ test.each([
[' line([3 + 0, 4], %)', 'arrayIndex', 1], [' line([3 + 0, 4], %)', 'arrayIndex', 1],
[ [
@ -626,7 +626,7 @@ describe('Testing removeSingleConstraintInfo', () => {
'objectProperty', 'objectProperty',
'offset', 'offset',
], ],
['tangentialArcTo([3.14 + 0, 13.14], %)', 'arrayIndex', 1], ['tangentialArcTo([3.14 + 0, 13.14], false, %)', 'arrayIndex', 1],
])('stdlib fn: %s', async (expectedFinish, key, value) => { ])('stdlib fn: %s', async (expectedFinish, key, value) => {
const ast = parse(code) const ast = parse(code)
if (err(ast)) throw ast if (err(ast)) throw ast

View File

@ -82,8 +82,8 @@ describe('Testing addFillet', () => {
|> line([60.04, -55.72], %) |> line([60.04, -55.72], %)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %) |> line([-87.24, -47.08], %)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -97,8 +97,8 @@ describe('Testing addFillet', () => {
|> line([60.04, -55.72], %, $seg01) |> line([60.04, -55.72], %, $seg01)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %) |> line([-87.24, -47.08], %)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -125,8 +125,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %) |> line([60.04, -55.72], %)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg01) |> line([-87.24, -47.08], %, $seg01)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -140,8 +140,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %, $seg02) |> line([60.04, -55.72], %, $seg02)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg01) |> line([-87.24, -47.08], %, $seg01)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -168,8 +168,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %) |> line([60.04, -55.72], %)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg03) |> line([-87.24, -47.08], %, $seg03)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -183,8 +183,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %) |> line([60.04, -55.72], %)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg03) |> line([-87.24, -47.08], %, $seg03)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -210,8 +210,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %) |> line([60.04, -55.72], %)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg03) |> line([-87.24, -47.08], %, $seg03)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)
@ -225,8 +225,8 @@ const extrude001 = extrude(50, sketch001)
|> line([60.04, -55.72], %, $seg01) |> line([60.04, -55.72], %, $seg01)
|> line([1.29, -115.74], %) |> line([1.29, -115.74], %)
|> line([-87.24, -47.08], %, $seg03) |> line([-87.24, -47.08], %, $seg03)
|> tangentialArcTo([56.15, -94.58], %) |> tangentialArcTo([56.15, -94.58], false, %)
|> tangentialArcTo([14.68, -104.52], %) |> tangentialArcTo([14.68, -104.52], false, %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%) |> close(%)
const extrude001 = extrude(50, sketch001) const extrude001 = extrude(50, sketch001)

View File

@ -270,7 +270,7 @@ describe('testing getConstraintInfo', () => {
intersectTag: 'a', intersectTag: 'a',
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([3.14, 13.14], %)` |> tangentialArcTo([3.14, 13.14], false, %)`
const ast = parse(code) const ast = parse(code)
test.each([ test.each([
[ [
@ -629,7 +629,7 @@ describe('testing getConstraintInfo', () => {
intersectTag: 'a', intersectTag: 'a',
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([3.14, 13.14], %)` |> tangentialArcTo([3.14, 13.14], false, %)`
const ast = parse(code) const ast = parse(code)
test.each([ test.each([
[ [
@ -783,7 +783,7 @@ describe('testing getConstraintInfo', () => {
intersectTag: 'a', intersectTag: 'a',
offset: 0 + 0 offset: 0 + 0
}, %) }, %)
|> tangentialArcTo([3.14 + 0, 13.14 + 0], %)` |> tangentialArcTo([3.14 + 0, 13.14 + 0], false, %)`
const ast = parse(code) const ast = parse(code)
test.each([ test.each([
[ [

View File

@ -811,6 +811,7 @@ export const tangentialArcTo: SketchLineHelper = {
} }
const newLine = createCallExpression('tangentialArcTo', [ const newLine = createCallExpression('tangentialArcTo', [
createArrayExpression([toX, toY]), createArrayExpression([toX, toY]),
createLiteral(false),
createPipeSubstitution(), createPipeSubstitution(),
]) ])
if (pipe.type === 'PipeExpression') { if (pipe.type === 'PipeExpression') {

View File

@ -3152,7 +3152,7 @@ mod snapshot_tests {
a, a,
r#"const boxSketch = startSketchAt([0, 0]) r#"const boxSketch = startSketchAt([0, 0])
|> line([0, 10], %) |> line([0, 10], %)
|> tangentialArc([-5, 5], %) |> tangentialArcTo([-5, 5], true, %)
|> line([5, -15], %) |> line([5, -15], %)
|> extrude(10, %) |> extrude(10, %)
"# "#

View File

@ -5,7 +5,7 @@ use serde::de::DeserializeOwned;
use super::{shapes::SketchSurfaceOrGroup, sketch::FaceTag, FnAsArg}; use super::{shapes::SketchSurfaceOrGroup, sketch::FaceTag, FnAsArg};
use crate::{ use crate::{
ast::types::{parse_json_number_as_f64, TagDeclarator}, ast::types::{parse_json_number_as_f64, KclNone, TagDeclarator},
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
executor::{ executor::{
DynamicState, ExecutorContext, ExtrudeGroup, ExtrudeGroupSet, ExtrudeSurface, MemoryItem, Metadata, DynamicState, ExecutorContext, ExtrudeGroup, ExtrudeGroupSet, ExtrudeSurface, MemoryItem, Metadata,
@ -479,11 +479,15 @@ where
{ {
fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError> { fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError> {
let Some(arg) = args.args.get(i) else { return Ok(None) }; let Some(arg) = args.args.get(i) else { return Ok(None) };
if let Some(_kcl_none) = KclNone::from_mem_item(arg) {
return Ok(None);
}
let Some(val) = T::from_mem_item(arg) else { let Some(val) = T::from_mem_item(arg) else {
return Err(KclError::Semantic(KclErrorDetails { return Err(KclError::Semantic(KclErrorDetails {
message: format!( message: format!(
"Argument at index {i} was supposed to be type {} but wasn't", "Argument at index {i} was supposed to be type {} but wasn't, it was {:?}",
type_name::<T>() type_name::<T>(),
arg,
), ),
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
})); }));
@ -615,6 +619,7 @@ impl_from_arg_via_json!(u32);
impl_from_arg_via_json!(u64); impl_from_arg_via_json!(u64);
impl_from_arg_via_json!(f64); impl_from_arg_via_json!(f64);
impl_from_arg_via_json!(bool); impl_from_arg_via_json!(bool);
impl_from_arg_via_json!(KclNone);
impl_from_arg_for_array!(2); impl_from_arg_for_array!(2);
impl_from_arg_for_array!(3); impl_from_arg_for_array!(3);

View File

@ -14,7 +14,7 @@ use crate::{
errors::{KclError, KclErrorDetails}, errors::{KclError, KclErrorDetails},
executor::{ executor::{
BasePath, ExtrudeGroup, Face, GeoMeta, MemoryItem, Path, Plane, PlaneType, Point2d, Point3d, SketchGroup, BasePath, ExtrudeGroup, Face, GeoMeta, MemoryItem, Path, Plane, PlaneType, Point2d, Point3d, SketchGroup,
SketchGroupSet, SketchSurface, SourceRange, TagEngineInfo, TagIdentifier, UserVal, SketchGroupSet, SketchSurface, TagEngineInfo, TagIdentifier, UserVal,
}, },
std::{ std::{
utils::{ utils::{
@ -1634,8 +1634,6 @@ pub enum TangentialArcData {
/// Offset of the arc, in degrees. /// Offset of the arc, in degrees.
offset: f64, offset: f64,
}, },
/// A point where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.
Point([f64; 2]),
} }
/// Draw a tangential arc. /// Draw a tangential arc.
@ -1647,8 +1645,11 @@ pub async fn tangential_arc(args: Args) -> Result<MemoryItem, KclError> {
Ok(MemoryItem::SketchGroup(new_sketch_group)) Ok(MemoryItem::SketchGroup(new_sketch_group))
} }
/// Starting at the current sketch's origin, draw a curved line segment along /// Draw a curved line segment along some part of an imaginary circle of the specified radius.
/// some part of an imaginary circle of the specified radius. ///
/// If `relative` is true, the curve starts at the end of the previous path segment
/// (i.e. the location of the "pen" which draws these lines). If `relative` is false,
/// starts from the current sketch's origin.
/// ///
/// The arc is constructed such that the last line segment is placed tangent /// The arc is constructed such that the last line segment is placed tangent
/// to the imaginary circle of the specified radius. The resulting arc is the /// to the imaginary circle of the specified radius. The resulting arc is the
@ -1728,13 +1729,6 @@ async fn inner_tangential_arc(
.await?; .await?;
(center, to.into(), ccw) (center, to.into(), ccw)
} }
TangentialArcData::Point(to) => {
args.batch_modeling_cmd(id, tan_arc_to(&sketch_group, &to)).await?;
// TODO: Figure out these calculations.
let ccw = false;
let center = Point2d { x: 0.0, y: 0.0 };
(center, to, ccw)
}
}; };
let current_path = Path::TangentialArc { let current_path = Path::TangentialArc {
@ -1775,32 +1769,13 @@ fn tan_arc_to(sketch_group: &SketchGroup, to: &[f64; 2]) -> ModelingCmd {
} }
} }
fn too_few_args(source_range: SourceRange) -> KclError {
KclError::Syntax(KclErrorDetails {
source_ranges: vec![source_range],
message: "too few arguments".to_owned(),
})
}
fn get_arg<I: Iterator>(it: &mut I, src: SourceRange) -> Result<I::Item, KclError> {
it.next().ok_or_else(|| too_few_args(src))
}
/// Draw a tangential arc to a specific point. /// Draw a tangential arc to a specific point.
pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> { pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> {
let src = args.source_range;
// Get arguments to function call // Get arguments to function call
let mut it = args.args.iter(); let (to, relative, sketch_group, tag): ([f64; 2], bool, Box<SketchGroup>, Option<TagDeclarator>) =
let to: [f64; 2] = get_arg(&mut it, src)?.get_json()?; super::args::FromArgs::from_args(&args, 0)?;
let sketch_group: Box<SketchGroup> = get_arg(&mut it, src)?.get_json()?;
let tag = if let Ok(memory_item) = get_arg(&mut it, src) {
memory_item.get_json_opt()?
} else {
None
};
let new_sketch_group = inner_tangential_arc_to(to, sketch_group, tag, args).await?; let new_sketch_group = inner_tangential_arc_to(to, relative, sketch_group, tag, args).await?;
Ok(MemoryItem::SketchGroup(new_sketch_group)) Ok(MemoryItem::SketchGroup(new_sketch_group))
} }
@ -1815,7 +1790,7 @@ pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> {
/// angle: 60, /// angle: 60,
/// length: 10, /// length: 10,
/// }, %) /// }, %)
/// |> tangentialArcTo([15, 15], %) /// |> tangentialArcTo([15, 15], false, %)
/// |> line([10, -15], %) /// |> line([10, -15], %)
/// |> close(%) /// |> close(%)
/// ///
@ -1826,6 +1801,7 @@ pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> {
}] }]
async fn inner_tangential_arc_to( async fn inner_tangential_arc_to(
to: [f64; 2], to: [f64; 2],
relative: bool,
sketch_group: Box<SketchGroup>, sketch_group: Box<SketchGroup>,
tag: Option<TagDeclarator>, tag: Option<TagDeclarator>,
args: Args, args: Args,
@ -1845,9 +1821,13 @@ async fn inner_tangential_arc_to(
obtuse: true, obtuse: true,
}); });
let delta = [to_x - from.x, to_y - from.y]; let to = if relative {
[to_x, to_y]
} else {
[to_x - from.x, to_y - from.y]
};
let id = uuid::Uuid::new_v4(); let id = uuid::Uuid::new_v4();
args.batch_modeling_cmd(id, tan_arc_to(&sketch_group, &delta)).await?; args.batch_modeling_cmd(id, tan_arc_to(&sketch_group, &to)).await?;
let current_path = Path::TangentialArcTo { let current_path = Path::TangentialArcTo {
base: BasePath { base: BasePath {

View File

@ -9,40 +9,40 @@ let corner_radius = 5.0
// because your wrist isn't a perfect cylindrical surface // because your wrist isn't a perfect cylindrical surface
let brace_base = startSketchAt([corner_radius, 0]) let brace_base = startSketchAt([corner_radius, 0])
|> line([width - corner_radius, 0.0], %) |> line([width - corner_radius, 0.0], %)
|> tangentialArc([corner_radius, corner_radius], %) |> tangentialArcTo([corner_radius, corner_radius], true, %)
|> yLine(25.0 - corner_radius, %) |> yLine(25.0 - corner_radius, %)
|> tangentialArc([-corner_radius, corner_radius], %) |> tangentialArcTo([-corner_radius, corner_radius], true, %)
|> xLine(-(d_wrist_circumference[0] - (corner_radius * 2)), %) |> xLine(-(d_wrist_circumference[0] - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, corner_radius], %) |> tangentialArcTo([-corner_radius, corner_radius], true, %)
|> yLine(length - 25.0 - 23.0 - (corner_radius * 2), %) |> yLine(length - 25.0 - 23.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, corner_radius], %) |> tangentialArcTo([corner_radius, corner_radius], true, %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(15.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, corner_radius], %) |> tangentialArcTo([corner_radius, corner_radius], true, %)
|> yLine(23.0 - corner_radius, %) |> yLine(23.0 - corner_radius, %)
|> tangentialArc([-corner_radius, corner_radius], %) |> tangentialArcTo([-corner_radius, corner_radius], true, %)
|> xLine(-(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)), %) |> xLine(-(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, -corner_radius], %) |> tangentialArcTo([-corner_radius, -corner_radius], true, %)
|> yLine(-(23.0 - corner_radius), %) |> yLine(-(23.0 - corner_radius), %)
|> tangentialArc([corner_radius, -corner_radius], %) |> tangentialArcTo([corner_radius, -corner_radius], true, %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(15.0 - (corner_radius * 2), %)
|> tangentialArc([corner_radius, -corner_radius], %) |> tangentialArcTo([corner_radius, -corner_radius], true, %)
|> yLine(-(length - 25.0 - 23.0 - (corner_radius * 2)), %) |> yLine(-(length - 25.0 - 23.0 - (corner_radius * 2)), %)
|> tangentialArc([-corner_radius, -corner_radius], %) |> tangentialArcTo([-corner_radius, -corner_radius], true, %)
|> xLine(-(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius), %) |> xLine(-(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius), %)
|> tangentialArc([-corner_radius, -corner_radius], %) |> tangentialArcTo([-corner_radius, -corner_radius], true, %)
|> yLine(-(25.0 - corner_radius), %) |> yLine(-(25.0 - corner_radius), %)
|> tangentialArc([corner_radius, -corner_radius], %) |> tangentialArcTo([corner_radius, -corner_radius], true, %)
|> close(%) |> close(%)
let inner = startSketchAt([0, 0]) let inner = startSketchAt([0, 0])
|> xLine(1.0, %) |> xLine(1.0, %)
|> tangentialArc([corner_radius, corner_radius], %) |> tangentialArcTo([corner_radius, corner_radius], true, %)
|> yLine(25.0 - (corner_radius * 2), %) |> yLine(25.0 - (corner_radius * 2), %)
|> tangentialArc([-corner_radius, corner_radius], %) |> tangentialArcTo([-corner_radius, corner_radius], true, %)
|> xLine(-1.0, %) |> xLine(-1.0, %)
|> tangentialArc([-corner_radius, -corner_radius], %) |> tangentialArcTo([-corner_radius, -corner_radius], true, %)
|> yLine(-(25.0 - (corner_radius * 2)), %) |> yLine(-(25.0 - (corner_radius * 2)), %)
|> tangentialArc([corner_radius, -corner_radius], %) |> tangentialArcTo([corner_radius, -corner_radius], true, %)
|> close(%) |> close(%)
let final = brace_base let final = brace_base

View File

@ -317,7 +317,7 @@ async fn kcl_test_basic_tangential_arc() {
async fn kcl_test_basic_tangential_arc_with_point() { async fn kcl_test_basic_tangential_arc_with_point() {
let code = r#"const boxSketch = startSketchAt([0, 0]) let code = r#"const boxSketch = startSketchAt([0, 0])
|> line([0, 10], %) |> line([0, 10], %)
|> tangentialArc([-5, 5], %) |> tangentialArcTo([-5, 5], true, %)
|> line([5, -15], %) |> line([5, -15], %)
|> extrude(10, %) |> extrude(10, %)
"#; "#;
@ -330,7 +330,7 @@ async fn kcl_test_basic_tangential_arc_with_point() {
async fn kcl_test_basic_tangential_arc_to() { async fn kcl_test_basic_tangential_arc_to() {
let code = r#"const boxSketch = startSketchAt([0, 0]) let code = r#"const boxSketch = startSketchAt([0, 0])
|> line([0, 10], %) |> line([0, 10], %)
|> tangentialArcTo([-5, 15], %) |> tangentialArcTo([-5, 15], false, %)
|> line([5, -15], %) |> line([5, -15], %)
|> extrude(10, %) |> extrude(10, %)
"#; "#;
@ -463,7 +463,7 @@ const thing = other_circle([2, 2], 20)
#[tokio::test(flavor = "multi_thread")] #[tokio::test(flavor = "multi_thread")]
async fn kcl_test_rounded_with_holes() { async fn kcl_test_rounded_with_holes() {
let code = r#"fn tarc = (to, sketchGroup, tag?) => { let code = r#"fn tarc = (to, sketchGroup, tag?) => {
return tangentialArcTo(to, sketchGroup, tag) return tangentialArcTo(to, false, sketchGroup, tag)
} }
fn roundedRectangle = (pos, w, l, cornerRadius) => { fn roundedRectangle = (pos, w, l, cornerRadius) => {
@ -1530,7 +1530,7 @@ async fn kcl_test_error_empty_start_sketch_on_string() {
|> line([190.03, -118.13], %) |> line([190.03, -118.13], %)
|> line([-33.38, -202.86], %) |> line([-33.38, -202.86], %)
|> line([-315.86, -64.2], %) |> line([-315.86, -64.2], %)
|> tangentialArcTo([-147.66, 121.34], %) |> tangentialArcTo([-147.66, 121.34], false, %)
|> close(%) |> close(%)
|> extrude(100, %) |> extrude(100, %)