Compare commits
2 Commits
nightly-v2
...
jtran/json
Author | SHA1 | Date | |
---|---|---|---|
4a5ef17c92 | |||
83220a7255 |
@ -19,11 +19,6 @@
|
|||||||
"plugin:jsx-a11y/recommended",
|
"plugin:jsx-a11y/recommended",
|
||||||
"plugin:react-hooks/recommended"
|
"plugin:react-hooks/recommended"
|
||||||
],
|
],
|
||||||
"settings": {
|
|
||||||
"react": {
|
|
||||||
"version": "detect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||||
"@typescript-eslint/no-array-constructor": "error",
|
"@typescript-eslint/no-array-constructor": "error",
|
||||||
@ -66,7 +61,6 @@
|
|||||||
"jsx-a11y/click-events-have-key-events": "off",
|
"jsx-a11y/click-events-have-key-events": "off",
|
||||||
"jsx-a11y/no-autofocus": "off",
|
"jsx-a11y/no-autofocus": "off",
|
||||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||||
"react/no-unknown-property": "error",
|
|
||||||
"no-restricted-globals": [
|
"no-restricted-globals": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
11
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -26,8 +26,8 @@ max_retries=1
|
|||||||
# Retry failed tests, doing our own retries because using inbuilt Playwright retries causes connection issues
|
# Retry failed tests, doing our own retries because using inbuilt Playwright retries causes connection issues
|
||||||
while [[ $retry -le $max_retries ]]; do
|
while [[ $retry -le $max_retries ]]; do
|
||||||
if [[ -f "test-results/.last-run.json" ]]; then
|
if [[ -f "test-results/.last-run.json" ]]; then
|
||||||
status=$(jq -r '.status' test-results/.last-run.json)
|
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
|
||||||
if [[ "$status" == "failed" ]]; then
|
if [[ $failed_tests -gt 0 ]]; then
|
||||||
echo "retried=true" >>$GITHUB_OUTPUT
|
echo "retried=true" >>$GITHUB_OUTPUT
|
||||||
echo "run playwright with last failed tests and retry $retry"
|
echo "run playwright with last failed tests and retry $retry"
|
||||||
if [[ "$3" == *ubuntu* ]]; then
|
if [[ "$3" == *ubuntu* ]]; then
|
||||||
@ -56,11 +56,10 @@ done
|
|||||||
echo "retried=false" >>$GITHUB_OUTPUT
|
echo "retried=false" >>$GITHUB_OUTPUT
|
||||||
|
|
||||||
if [[ -f "test-results/.last-run.json" ]]; then
|
if [[ -f "test-results/.last-run.json" ]]; then
|
||||||
status=$(jq -r '.status' test-results/.last-run.json)
|
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
|
||||||
if [[ "$status" == "failed" ]]; then
|
if [[ $failed_tests -gt 0 ]]; then
|
||||||
# If it still fails after retries, then fail the job
|
# If it still fails after 3 retries, then fail the job
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
4
.github/workflows/e2e-tests.yml
vendored
@ -285,7 +285,7 @@ jobs:
|
|||||||
# TODO: enable namespace-profile-windows-latest once available
|
# TODO: enable namespace-profile-windows-latest once available
|
||||||
os:
|
os:
|
||||||
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||||
- namespace-profile-macos-8-cores
|
- namespace-profile-macos-6-cores
|
||||||
- windows-latest-8-cores
|
- windows-latest-8-cores
|
||||||
shardIndex: [1, 2, 3, 4]
|
shardIndex: [1, 2, 3, 4]
|
||||||
shardTotal: [4]
|
shardTotal: [4]
|
||||||
@ -295,7 +295,7 @@ jobs:
|
|||||||
isScheduled:
|
isScheduled:
|
||||||
- ${{ github.event_name == 'schedule' }}
|
- ${{ github.event_name == 'schedule' }}
|
||||||
exclude:
|
exclude:
|
||||||
- os: namespace-profile-macos-8-cores
|
- os: namespace-profile-macos-6-cores
|
||||||
isScheduled: true
|
isScheduled: true
|
||||||
- os: windows-latest-8-cores
|
- os: windows-latest-8-cores
|
||||||
isScheduled: true
|
isScheduled: true
|
||||||
|
@ -5,6 +5,6 @@ command = "vscode-eslint-language-server"
|
|||||||
[[language]]
|
[[language]]
|
||||||
name = "typescript"
|
name = "typescript"
|
||||||
auto-format = true
|
auto-format = true
|
||||||
formatter = { command = "./node_modules/@biomejs/biome/bin/biome", args = ["format", "--write", "--stdin-file-path=foo.ts"] }
|
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
|
||||||
# language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
||||||
|
|
||||||
|
45
docs/kcl/arcTo.md
Normal file
@ -10,10 +10,8 @@ Draw a smooth, continuous, curved line segment from the current origin to the de
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
bezierCurve(
|
bezierCurve(
|
||||||
|
data: BezierData,
|
||||||
sketch: Sketch,
|
sketch: Sketch,
|
||||||
control1: [number],
|
|
||||||
control2: [number],
|
|
||||||
end: [number],
|
|
||||||
tag?: TagDeclarator,
|
tag?: TagDeclarator,
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
@ -23,11 +21,9 @@ bezierCurve(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
|
| `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes |
|
||||||
| `control1` | [`[number]`](/docs/kcl/types/number) | First control point for the cubic | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
| `control2` | [`[number]`](/docs/kcl/types/number) | Second control point for the cubic | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
| `end` | [`[number]`](/docs/kcl/types/number) | How far away (along the X and Y axes) should this line go? | Yes |
|
|
||||||
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
|
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -40,7 +36,11 @@ bezierCurve(
|
|||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [0, 10])
|
|> line(end = [0, 10])
|
||||||
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|
|> bezierCurve({
|
||||||
|
to = [10, 10],
|
||||||
|
control1 = [5, 0],
|
||||||
|
control2 = [5, 10]
|
||||||
|
}, %)
|
||||||
|> line(endAbsolute = [10, 0])
|
|> line(endAbsolute = [10, 0])
|
||||||
|> close()
|
|> close()
|
||||||
|
|
||||||
|
@ -42,10 +42,18 @@ extrude(
|
|||||||
example = startSketchOn(XZ)
|
example = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> arc(angleStart = 120, angleEnd = 0, radius = 5)
|
|> arc({
|
||||||
|
angleStart = 120,
|
||||||
|
angleEnd = 0,
|
||||||
|
radius = 5
|
||||||
|
}, %)
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> line(end = [0, 10])
|
|> line(end = [0, 10])
|
||||||
|> bezierCurve(control1 = [-10, 0], control2 = [2, 10], end = [-5, 10])
|
|> bezierCurve({
|
||||||
|
control1 = [-10, 0],
|
||||||
|
control2 = [2, 10],
|
||||||
|
to = [-5, 10]
|
||||||
|
}, %)
|
||||||
|> line(end = [-5, -2])
|
|> line(end = [-5, -2])
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 10)
|
|> extrude(length = 10)
|
||||||
@ -56,10 +64,18 @@ example = startSketchOn(XZ)
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([-10, 0], %)
|
|> startProfileAt([-10, 0], %)
|
||||||
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|
|> arc({
|
||||||
|
angleStart = 120,
|
||||||
|
angleEnd = -60,
|
||||||
|
radius = 5
|
||||||
|
}, %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
|
|> bezierCurve({
|
||||||
|
control1 = [-3, 0],
|
||||||
|
control2 = [2, 10],
|
||||||
|
to = [-5, 10]
|
||||||
|
}, %)
|
||||||
|> line(end = [-4, 10])
|
|> line(end = [-4, 10])
|
||||||
|> line(end = [-5, -2])
|
|> line(end = [-5, -2])
|
||||||
|> close()
|
|> close()
|
||||||
@ -72,10 +88,18 @@ example = extrude(exampleSketch, length = 10)
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([-10, 0], %)
|
|> startProfileAt([-10, 0], %)
|
||||||
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|
|> arc({
|
||||||
|
angleStart = 120,
|
||||||
|
angleEnd = -60,
|
||||||
|
radius = 5
|
||||||
|
}, %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
|
|> bezierCurve({
|
||||||
|
control1 = [-3, 0],
|
||||||
|
control2 = [2, 10],
|
||||||
|
to = [-5, 10]
|
||||||
|
}, %)
|
||||||
|> line(end = [-4, 10])
|
|> line(end = [-4, 10])
|
||||||
|> line(end = [-5, -2])
|
|> line(end = [-5, -2])
|
||||||
|> close()
|
|> close()
|
||||||
@ -88,10 +112,18 @@ example = extrude(exampleSketch, length = 20, symmetric = true)
|
|||||||
```js
|
```js
|
||||||
exampleSketch = startSketchOn(XZ)
|
exampleSketch = startSketchOn(XZ)
|
||||||
|> startProfileAt([-10, 0], %)
|
|> startProfileAt([-10, 0], %)
|
||||||
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|
|> arc({
|
||||||
|
angleStart = 120,
|
||||||
|
angleEnd = -60,
|
||||||
|
radius = 5
|
||||||
|
}, %)
|
||||||
|> line(end = [10, 0])
|
|> line(end = [10, 0])
|
||||||
|> line(end = [5, 0])
|
|> line(end = [5, 0])
|
||||||
|> bezierCurve(control1 = [-3, 0], control2 = [2, 10], end = [-5, 10])
|
|> bezierCurve({
|
||||||
|
control1 = [-3, 0],
|
||||||
|
control2 = [2, 10],
|
||||||
|
to = [-5, 10]
|
||||||
|
}, %)
|
||||||
|> line(end = [-4, 10])
|
|> line(end = [-4, 10])
|
||||||
|> line(end = [-5, -2])
|
|> line(end = [-5, -2])
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from centimeters to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from centimeters to the current default unit.
|
Converts a number from centimeters to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42cm`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in centimeters.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in centimeters.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromCm(1)` will return `0.393701`. If the current file uses millimeters, `fromCm(1)` will return `10`. If the current file uses centimeters, `fromCm(1)` will return `1`.
|
For example, if the current file uses inches, `fromCm(1)` will return `0.393701`. If the current file uses millimeters, `fromCm(1)` will return `10`. If the current file uses centimeters, `fromCm(1)` will return `1`.
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from feet to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from feet to the current default unit.
|
Converts a number from feet to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42ft`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in feet.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in feet.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromFt(1)` will return `12`. If the current file uses millimeters, `fromFt(1)` will return `304.8`. If the current file uses feet, `fromFt(1)` will return `1`.
|
For example, if the current file uses inches, `fromFt(1)` will return `12`. If the current file uses millimeters, `fromFt(1)` will return `304.8`. If the current file uses feet, `fromFt(1)` will return `1`.
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from inches to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from inches to the current default unit.
|
Converts a number from inches to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42inch`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in inches.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in inches.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromInches(1)` will return `1`. If the current file uses millimeters, `fromInches(1)` will return `25.4`.
|
For example, if the current file uses inches, `fromInches(1)` will return `1`. If the current file uses millimeters, `fromInches(1)` will return `25.4`.
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from meters to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from meters to the current default unit.
|
Converts a number from meters to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42m`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in meters.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in meters.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromM(1)` will return `39.3701`. If the current file uses millimeters, `fromM(1)` will return `1000`. If the current file uses meters, `fromM(1)` will return `1`.
|
For example, if the current file uses inches, `fromM(1)` will return `39.3701`. If the current file uses millimeters, `fromM(1)` will return `1000`. If the current file uses meters, `fromM(1)` will return `1`.
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from mm to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from mm to the current default unit.
|
Converts a number from mm to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42mm`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in millimeters.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in millimeters.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromMm(1)` will return `1/25.4`. If the current file uses millimeters, `fromMm(1)` will return `1`.
|
For example, if the current file uses inches, `fromMm(1)` will return `1/25.4`. If the current file uses millimeters, `fromMm(1)` will return `1`.
|
||||||
|
@ -4,12 +4,8 @@ excerpt: "Converts a number from yards to the current default unit."
|
|||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
**WARNING:** This function is deprecated.
|
|
||||||
|
|
||||||
Converts a number from yards to the current default unit.
|
Converts a number from yards to the current default unit.
|
||||||
|
|
||||||
*DEPRECATED* prefer using explicit numeric suffixes (e.g., `42yd`) or the `to...` conversion functions.
|
|
||||||
|
|
||||||
No matter what units the current file uses, this function will always return a number equivalent to the input in yards.
|
No matter what units the current file uses, this function will always return a number equivalent to the input in yards.
|
||||||
|
|
||||||
For example, if the current file uses inches, `fromYd(1)` will return `36`. If the current file uses millimeters, `fromYd(1)` will return `914.4`. If the current file uses yards, `fromYd(1)` will return `1`.
|
For example, if the current file uses inches, `fromYd(1)` will return `36`. If the current file uses millimeters, `fromYd(1)` will return `914.4`. If the current file uses yards, `fromYd(1)` will return `1`.
|
||||||
|
@ -22,8 +22,18 @@ layout: manual
|
|||||||
* [`string`](kcl/types/string)
|
* [`string`](kcl/types/string)
|
||||||
* [`tag`](kcl/types/tag)
|
* [`tag`](kcl/types/tag)
|
||||||
* **std**
|
* **std**
|
||||||
|
* [`Axis2d`](kcl/types/Axis2d)
|
||||||
|
* [`Axis3d`](kcl/types/Axis3d)
|
||||||
* [`END`](kcl/consts/std-END)
|
* [`END`](kcl/consts/std-END)
|
||||||
|
* [`Edge`](kcl/types/Edge)
|
||||||
|
* [`Face`](kcl/types/Face)
|
||||||
|
* [`Helix`](kcl/types/Helix)
|
||||||
|
* [`Plane`](kcl/types/Plane)
|
||||||
|
* [`Point2d`](kcl/types/Point2d)
|
||||||
|
* [`Point3d`](kcl/types/Point3d)
|
||||||
* [`START`](kcl/consts/std-START)
|
* [`START`](kcl/consts/std-START)
|
||||||
|
* [`Sketch`](kcl/types/Sketch)
|
||||||
|
* [`Solid`](kcl/types/Solid)
|
||||||
* [`X`](kcl/consts/std-X)
|
* [`X`](kcl/consts/std-X)
|
||||||
* [`XY`](kcl/consts/std-XY)
|
* [`XY`](kcl/consts/std-XY)
|
||||||
* [`XZ`](kcl/consts/std-XZ)
|
* [`XZ`](kcl/consts/std-XZ)
|
||||||
@ -38,9 +48,14 @@ layout: manual
|
|||||||
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
* [`angledLineThatIntersects`](kcl/angledLineThatIntersects)
|
||||||
* [`appearance`](kcl/appearance)
|
* [`appearance`](kcl/appearance)
|
||||||
* [`arc`](kcl/arc)
|
* [`arc`](kcl/arc)
|
||||||
|
* [`arcTo`](kcl/arcTo)
|
||||||
* [`asin`](kcl/asin)
|
* [`asin`](kcl/asin)
|
||||||
* [`assert`](kcl/assert)
|
* [`assert`](kcl/assert)
|
||||||
* [`assertIs`](kcl/assertIs)
|
* [`assertEqual`](kcl/assertEqual)
|
||||||
|
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
||||||
|
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
||||||
|
* [`assertLessThan`](kcl/assertLessThan)
|
||||||
|
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
||||||
* [`atan`](kcl/atan)
|
* [`atan`](kcl/atan)
|
||||||
* [`atan2`](kcl/atan2)
|
* [`atan2`](kcl/atan2)
|
||||||
* [`bezierCurve`](kcl/bezierCurve)
|
* [`bezierCurve`](kcl/bezierCurve)
|
||||||
@ -51,6 +66,12 @@ layout: manual
|
|||||||
* [`extrude`](kcl/extrude)
|
* [`extrude`](kcl/extrude)
|
||||||
* [`fillet`](kcl/fillet)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`floor`](kcl/floor)
|
* [`floor`](kcl/floor)
|
||||||
|
* [`fromCm`](kcl/fromCm)
|
||||||
|
* [`fromFt`](kcl/fromFt)
|
||||||
|
* [`fromInches`](kcl/fromInches)
|
||||||
|
* [`fromM`](kcl/fromM)
|
||||||
|
* [`fromMm`](kcl/fromMm)
|
||||||
|
* [`fromYd`](kcl/fromYd)
|
||||||
* [`getCommonEdge`](kcl/getCommonEdge)
|
* [`getCommonEdge`](kcl/getCommonEdge)
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
@ -110,14 +131,8 @@ layout: manual
|
|||||||
* [`sweep`](kcl/sweep)
|
* [`sweep`](kcl/sweep)
|
||||||
* [`tangentToEnd`](kcl/tangentToEnd)
|
* [`tangentToEnd`](kcl/tangentToEnd)
|
||||||
* [`tangentialArc`](kcl/tangentialArc)
|
* [`tangentialArc`](kcl/tangentialArc)
|
||||||
* [`toCentimeters`](kcl/std-toCentimeters)
|
* [`toDegrees`](kcl/toDegrees)
|
||||||
* [`toDegrees`](kcl/std-toDegrees)
|
* [`toRadians`](kcl/toRadians)
|
||||||
* [`toFeet`](kcl/std-toFeet)
|
|
||||||
* [`toInches`](kcl/std-toInches)
|
|
||||||
* [`toMeters`](kcl/std-toMeters)
|
|
||||||
* [`toMillimeters`](kcl/std-toMillimeters)
|
|
||||||
* [`toRadians`](kcl/std-toRadians)
|
|
||||||
* [`toYards`](kcl/std-toYards)
|
|
||||||
* [`translate`](kcl/translate)
|
* [`translate`](kcl/translate)
|
||||||
* [`union`](kcl/union)
|
* [`union`](kcl/union)
|
||||||
* [`xLine`](kcl/xLine)
|
* [`xLine`](kcl/xLine)
|
||||||
@ -138,14 +153,3 @@ layout: manual
|
|||||||
* [`turns::QUARTER_TURN`](kcl/consts/std-turns-QUARTER_TURN)
|
* [`turns::QUARTER_TURN`](kcl/consts/std-turns-QUARTER_TURN)
|
||||||
* [`turns::THREE_QUARTER_TURN`](kcl/consts/std-turns-THREE_QUARTER_TURN)
|
* [`turns::THREE_QUARTER_TURN`](kcl/consts/std-turns-THREE_QUARTER_TURN)
|
||||||
* [`turns::ZERO`](kcl/consts/std-turns-ZERO)
|
* [`turns::ZERO`](kcl/consts/std-turns-ZERO)
|
||||||
* **std::types**
|
|
||||||
* [`Axis2d`](kcl/types/Axis2d)
|
|
||||||
* [`Axis3d`](kcl/types/Axis3d)
|
|
||||||
* [`Edge`](kcl/types/Edge)
|
|
||||||
* [`Face`](kcl/types/Face)
|
|
||||||
* [`Helix`](kcl/types/Helix)
|
|
||||||
* [`Plane`](kcl/types/Plane)
|
|
||||||
* [`Point2d`](kcl/types/Point2d)
|
|
||||||
* [`Point3d`](kcl/types/Point3d)
|
|
||||||
* [`Sketch`](kcl/types/Sketch)
|
|
||||||
* [`Solid`](kcl/types/Solid)
|
|
||||||
|
@ -34,7 +34,7 @@ int(num: number): number
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
n = int(ceil(5 / 2))
|
n = int(ceil(5 / 2))
|
||||||
assert(n, isEqualTo = 3, error = "5/2 = 2.5, rounded up makes 3")
|
assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
|
||||||
// Draw n cylinders.
|
// Draw n cylinders.
|
||||||
startSketchOn(XZ)
|
startSketchOn(XZ)
|
||||||
|> circle(center = [0, 0], radius = 2)
|
|> circle(center = [0, 0], radius = 2)
|
||||||
|
@ -22,5 +22,3 @@ once fixed in engine will just start working here with no language changes.
|
|||||||
chamfer cases work currently.
|
chamfer cases work currently.
|
||||||
|
|
||||||
- **Appearance**: Changing the appearance on a loft does not work.
|
- **Appearance**: Changing the appearance on a loft does not work.
|
||||||
|
|
||||||
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.
|
|
||||||
|
@ -174,7 +174,7 @@ t = 0.005 // taper factor [0-1)
|
|||||||
// Defines how to modify each layer of the vase.
|
// Defines how to modify each layer of the vase.
|
||||||
// Each replica is shifted up the Z axis, and has a smoothly-varying radius
|
// Each replica is shifted up the Z axis, and has a smoothly-varying radius
|
||||||
fn transform(replicaId) {
|
fn transform(replicaId) {
|
||||||
scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8: number(rad)))
|
scale = r * abs(1 - (t * replicaId)) * (5 + cos(replicaId / 8))
|
||||||
return {
|
return {
|
||||||
translate = [0, 0, replicaId * 10],
|
translate = [0, 0, replicaId * 10],
|
||||||
scale = [scale, scale, 0]
|
scale = [scale, scale, 0]
|
||||||
@ -205,12 +205,12 @@ fn transform(i) {
|
|||||||
}
|
}
|
||||||
startSketchOn(XY)
|
startSketchOn(XY)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> polygon(
|
|> polygon({
|
||||||
radius = 10,
|
radius = 10,
|
||||||
numSides = 4,
|
numSides = 4,
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
inscribed = false,
|
inscribed = false
|
||||||
)
|
}, %)
|
||||||
|> extrude(length = 4)
|
|> extrude(length = 4)
|
||||||
|> patternTransform(instances = 3, transform = transform)
|
|> patternTransform(instances = 3, transform = transform)
|
||||||
```
|
```
|
||||||
|
@ -10,11 +10,9 @@ Create a regular polygon with the specified number of sides that is either inscr
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
polygon(
|
polygon(
|
||||||
|
data: PolygonData,
|
||||||
sketchSurfaceOrGroup: SketchOrSurface,
|
sketchSurfaceOrGroup: SketchOrSurface,
|
||||||
radius: number,
|
tag?: TagDeclarator,
|
||||||
numSides: u64,
|
|
||||||
center: [number],
|
|
||||||
inscribed?: bool,
|
|
||||||
): Sketch
|
): Sketch
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -23,11 +21,9 @@ polygon(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on | Yes |
|
| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes |
|
||||||
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the polygon | Yes |
|
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
||||||
| `numSides` | `u64` | The number of sides in the polygon | Yes |
|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||||
| `center` | [`[number]`](/docs/kcl/types/number) | The center point of the polygon | Yes |
|
|
||||||
| `inscribed` | [`bool`](/docs/kcl/types/bool) | Whether the polygon is inscribed (true, the default) or circumscribed (false) about a circle with the specified radius | No |
|
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
@ -39,12 +35,12 @@ polygon(
|
|||||||
```js
|
```js
|
||||||
// Create a regular hexagon inscribed in a circle of radius 10
|
// Create a regular hexagon inscribed in a circle of radius 10
|
||||||
hex = startSketchOn(XY)
|
hex = startSketchOn(XY)
|
||||||
|> polygon(
|
|> polygon({
|
||||||
radius = 10,
|
radius = 10,
|
||||||
numSides = 6,
|
numSides = 6,
|
||||||
center = [0, 0],
|
center = [0, 0],
|
||||||
inscribed = true,
|
inscribed = true
|
||||||
)
|
}, %)
|
||||||
|
|
||||||
example = extrude(hex, length = 5)
|
example = extrude(hex, length = 5)
|
||||||
```
|
```
|
||||||
@ -54,12 +50,12 @@ example = extrude(hex, length = 5)
|
|||||||
```js
|
```js
|
||||||
// Create a square circumscribed around a circle of radius 5
|
// Create a square circumscribed around a circle of radius 5
|
||||||
square = startSketchOn(XY)
|
square = startSketchOn(XY)
|
||||||
|> polygon(
|
|> polygon({
|
||||||
radius = 5.0,
|
radius = 5.0,
|
||||||
numSides = 4,
|
numSides = 4,
|
||||||
center = [10, 10],
|
center = [10, 10],
|
||||||
inscribed = false,
|
inscribed = false
|
||||||
)
|
}, %)
|
||||||
example = extrude(square, length = 5)
|
example = extrude(square, length = 5)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin value.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
profileStart(profile: Sketch): [number]
|
profileStart(sketch: Sketch): [number]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ profileStart(profile: Sketch): [number]
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'x' value.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
profileStartX(profile: Sketch): number
|
profileStartX(sketch: Sketch): number
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ profileStartX(profile: Sketch): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ Extract the provided 2-dimensional sketch's profile's origin's 'y' value.
|
|||||||
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
profileStartY(profile: Sketch): number
|
profileStartY(sketch: Sketch): number
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ profileStartY(profile: Sketch): number
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `profile` | [`Sketch`](/docs/kcl/types/Sketch) | Profile whose start is being used | Yes |
|
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ helix(
|
|||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `revolutions` | `number(_)` | Number of revolutions. | Yes |
|
| `revolutions` | `number(_)` | Number of revolutions. | Yes |
|
||||||
| `angleStart` | `number(Angle)` | Start angle. | Yes |
|
| `angleStart` | `number(Angle)` | Start angle (in degrees). | Yes |
|
||||||
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
|
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
|
||||||
| `radius` | `number(Length)` | Radius of the helix. | No |
|
| `radius` | `number(Length)` | Radius of the helix. | No |
|
||||||
| `axis` | `Axis3d | Edge` | Axis to use for the helix. | No |
|
| `axis` | `Axis3d | Edge` | Axis to use for the helix. | No |
|
||||||
|
@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 30,
|
angle = 30,
|
||||||
length = 3 / cos(30deg),
|
length = 3 / cos(toRadians(30)),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -11,7 +11,7 @@ cartesian (x/y/z grid) coordinates.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
polar(
|
polar(
|
||||||
angle: number(rad),
|
angle: number(Angle),
|
||||||
length: number(Length),
|
length: number(Length),
|
||||||
): Point2d
|
): Point2d
|
||||||
```
|
```
|
||||||
@ -21,7 +21,7 @@ polar(
|
|||||||
|
|
||||||
| Name | Type | Description | Required |
|
| Name | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `angle` | `number(rad)` | | Yes |
|
| `angle` | `number(Angle)` | | Yes |
|
||||||
| `length` | `number(Length)` | | Yes |
|
| `length` | `number(Length)` | | Yes |
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 15 / sin(135deg),
|
length = 15 / sin(toRadians(135)),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -31,7 +31,7 @@ exampleSketch = startSketchOn(XZ)
|
|||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = 50,
|
angle = 50,
|
||||||
length = 50 * tan((1/2): number(rad)),
|
length = 50 * tan(1/2),
|
||||||
)
|
)
|
||||||
|> yLine(endAbsolute = 0)
|
|> yLine(endAbsolute = 0)
|
||||||
|> close()
|
|> close()
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toCentimeters"
|
|
||||||
excerpt: "Convert a number to centimeters from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Convert a number to centimeters from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toCentimeters(@num: number(cm)): number(cm)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(cm)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(cm)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toFeet"
|
|
||||||
excerpt: "Convert a number to feet from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Convert a number to feet from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toFeet(@num: number(ft)): number(ft)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(ft)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(ft)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toInches"
|
|
||||||
excerpt: "Convert a number to inches from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Convert a number to inches from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toInches(@num: number(in)): number(in)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(in)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(in)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toMeters"
|
|
||||||
excerpt: "Convert a number to meters from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Convert a number to meters from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toMeters(@num: number(m)): number(m)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(m)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(m)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toMillimeters"
|
|
||||||
excerpt: "Convert a number to millimeters from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Convert a number to millimeters from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toMillimeters(@num: number(mm)): number(mm)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(mm)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(mm)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
title: "std::toYards"
|
|
||||||
excerpt: "Converts a number to yards from its current units."
|
|
||||||
layout: manual
|
|
||||||
---
|
|
||||||
|
|
||||||
Converts a number to yards from its current units.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```js
|
|
||||||
toYards(@num: number(yd)): number(yd)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Arguments
|
|
||||||
|
|
||||||
| Name | Type | Description | Required |
|
|
||||||
|----------|------|-------------|----------|
|
|
||||||
| `num` | `number(yd)` | | Yes |
|
|
||||||
|
|
||||||
### Returns
|
|
||||||
|
|
||||||
`number(yd)`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
27347
docs/kcl/std.json
@ -73,7 +73,7 @@ rectangleExtrude = extrude(rectangleSketch, length = 10)
|
|||||||
```js
|
```js
|
||||||
bottom = startSketchOn(XY)
|
bottom = startSketchOn(XY)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> arc(endAbsolute = [10, 10], interiorAbsolute = [5, 1], tag = $arc1)
|
|> arcTo({ end = [10, 10], interior = [5, 1] }, %, $arc1)
|
||||||
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|
||||||
|> close()
|
|> close()
|
||||||
```
|
```
|
||||||
|
45
docs/kcl/toDegrees.md
Normal file
45
docs/kcl/toRadians.md
Normal file
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Axis2d"
|
title: "std::Axis2d"
|
||||||
excerpt: "An infinite line in 2d space."
|
excerpt: "An infinite line in 2d space."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Axis3d"
|
title: "std::Axis3d"
|
||||||
excerpt: "An infinite line in 3d space."
|
excerpt: "An infinite line in 3d space."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Edge"
|
title: "std::Edge"
|
||||||
excerpt: "The edge of a solid."
|
excerpt: "The edge of a solid."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Face"
|
title: "std::Face"
|
||||||
excerpt: "A face."
|
excerpt: "A face."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Helix"
|
title: "std::Helix"
|
||||||
excerpt: "A helix."
|
excerpt: "A helix."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -141,8 +141,8 @@ A base path.
|
|||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: `ArcThreePoint`| | No |
|
| `type` |enum: `ArcThreePoint`| | No |
|
||||||
| `p1` |`[number, number]`| Point 1 of the arc (base on the end of previous segment) | No |
|
| `p1` |`[number, number]`| Point 1 of the arc (base on the end of previous segment) | No |
|
||||||
| `p2` |`[number, number]`| Point 2 of the arc (interiorAbsolute kwarg) | No |
|
| `p2` |`[number, number]`| Point 2 of the arc (interior kwarg) | No |
|
||||||
| `p3` |`[number, number]`| Point 3 of the arc (endAbsolute kwarg) | No |
|
| `p3` |`[number, number]`| Point 3 of the arc (end kwarg) | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Plane"
|
title: "std::Plane"
|
||||||
excerpt: "A plane."
|
excerpt: "A plane."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Point2d"
|
title: "std::Point2d"
|
||||||
excerpt: "A point in two dimensional space."
|
excerpt: "A point in two dimensional space."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: "std::types::Point3d"
|
title: "std::Point3d"
|
||||||
excerpt: "A point in three dimensional space."
|
excerpt: "A point in three dimensional space."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
@ -31,6 +31,7 @@ A sketch type.
|
|||||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
||||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
||||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||||
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
@ -12,7 +12,7 @@ The syntax for declaring a tag is `$myTag` you would use it in the following
|
|||||||
way:
|
way:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
startSketchOn(XZ)
|
startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
@ -46,7 +46,7 @@ However if the code was written like this:
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn(XZ)
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
@ -75,7 +75,7 @@ For example the following code works.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
fn rect(origin) {
|
fn rect(origin) {
|
||||||
return startSketchOn(XZ)
|
return startSketchOn('XZ')
|
||||||
|> startProfileAt(origin, %)
|
|> startProfileAt(origin, %)
|
||||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
|
@ -29,11 +29,11 @@ test.describe('Electron app header tests', () => {
|
|||||||
test(
|
test(
|
||||||
'User settings has correct shortcut',
|
'User settings has correct shortcut',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ page, toolbar }, testInfo) => {
|
async ({ page }, testInfo) => {
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||||
|
|
||||||
// Open the user sidebar menu.
|
// Open the user sidebar menu.
|
||||||
await toolbar.userSidebarButton.click()
|
await page.getByTestId('user-sidebar-toggle').click()
|
||||||
|
|
||||||
// No space after "User settings" since it's textContent.
|
// No space after "User settings" since it's textContent.
|
||||||
const text =
|
const text =
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
|
||||||
|
|
||||||
// test file is for testing auth functionality
|
|
||||||
test.describe('Authentication tests', () => {
|
|
||||||
test(
|
|
||||||
`The user can sign out and back in`,
|
|
||||||
{ tag: ['@electron'] },
|
|
||||||
async ({ page, homePage, signInPage, toolbar, tronApp }) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
|
||||||
await homePage.projectSection.waitFor()
|
|
||||||
|
|
||||||
await test.step('Click on sign out and expect sign in page', async () => {
|
|
||||||
await toolbar.userSidebarButton.click()
|
|
||||||
await toolbar.signOutButton.click()
|
|
||||||
await expect(signInPage.signInButton).toBeVisible()
|
|
||||||
})
|
|
||||||
|
|
||||||
await test.step('Click on sign in and cancel, click again and expect different code', async () => {
|
|
||||||
await signInPage.signInButton.click()
|
|
||||||
await expect(signInPage.userCode).toBeVisible()
|
|
||||||
const firstUserCode = await signInPage.userCode.textContent()
|
|
||||||
await signInPage.cancelSignInButton.click()
|
|
||||||
await expect(signInPage.signInButton).toBeVisible()
|
|
||||||
|
|
||||||
await signInPage.signInButton.click()
|
|
||||||
await expect(signInPage.userCode).toBeVisible()
|
|
||||||
const secondUserCode = await signInPage.userCode.textContent()
|
|
||||||
expect(secondUserCode).not.toEqual(firstUserCode)
|
|
||||||
})
|
|
||||||
|
|
||||||
await test.step('Press back button and remain on home page', async () => {
|
|
||||||
await page.goBack()
|
|
||||||
await expect(homePage.projectSection).not.toBeVisible()
|
|
||||||
await expect(signInPage.signInButton).toBeVisible()
|
|
||||||
})
|
|
||||||
|
|
||||||
await test.step('Sign in, activate, and expect home page', async () => {
|
|
||||||
await signInPage.signInButton.click()
|
|
||||||
await expect(signInPage.userCode).toBeVisible()
|
|
||||||
const userCode = await signInPage.userCode.textContent()
|
|
||||||
expect(userCode).not.toBeNull()
|
|
||||||
await signInPage.verifyAndConfirmAuth(userCode!)
|
|
||||||
|
|
||||||
// Longer timeout than usual here for the wait on home page
|
|
||||||
await expect(homePage.projectSection).toBeVisible({ timeout: 10000 })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
@ -430,17 +430,5 @@ profile003 = startProfileAt([0, -4.93], sketch001)
|
|||||||
await editor.expectEditor.not.toContain('sketch001 =')
|
await editor.expectEditor.not.toContain('sketch001 =')
|
||||||
await editor.expectEditor.not.toContain('profile002 = ')
|
await editor.expectEditor.not.toContain('profile002 = ')
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step(`Delete the remaining plane via feature tree`, async () => {
|
|
||||||
const operationButton = await toolbar.getFeatureTreeOperation(
|
|
||||||
'Offset Plane',
|
|
||||||
0
|
|
||||||
)
|
|
||||||
await operationButton.click({ button: 'left' })
|
|
||||||
await page.keyboard.press('Delete')
|
|
||||||
|
|
||||||
// Verify the plane code is gone, and https://github.com/KittyCAD/modeling-app/issues/5988 is fixed.
|
|
||||||
await editor.expectEditor.not.toContain('plane001 =')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -18,7 +18,6 @@ import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
|||||||
import { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
|
import { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
|
||||||
import { EditorFixture } from '@e2e/playwright/fixtures/editorFixture'
|
import { EditorFixture } from '@e2e/playwright/fixtures/editorFixture'
|
||||||
import { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
|
import { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
|
||||||
import { SignInPageFixture } from '@e2e/playwright/fixtures/signInPageFixture'
|
|
||||||
import { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
|
import { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
|
||||||
import { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
|
import { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
|
||||||
|
|
||||||
@ -67,7 +66,6 @@ export interface Fixtures {
|
|||||||
toolbar: ToolbarFixture
|
toolbar: ToolbarFixture
|
||||||
scene: SceneFixture
|
scene: SceneFixture
|
||||||
homePage: HomePageFixture
|
homePage: HomePageFixture
|
||||||
signInPage: SignInPageFixture
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ElectronZoo {
|
export class ElectronZoo {
|
||||||
@ -389,9 +387,6 @@ const fixturesBasedOnProcessEnvPlatform = {
|
|||||||
homePage: async ({ page }: { page: Page }, use: FnUse) => {
|
homePage: async ({ page }: { page: Page }, use: FnUse) => {
|
||||||
await use(new HomePageFixture(page))
|
await use(new HomePageFixture(page))
|
||||||
},
|
},
|
||||||
signInPage: async ({ page }: { page: Page }, use: FnUse) => {
|
|
||||||
await use(new SignInPageFixture(page))
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.PLATFORM === 'web') {
|
if (process.env.PLATFORM === 'web') {
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
import type { Locator, Page } from '@playwright/test'
|
|
||||||
import { secrets } from '@e2e/playwright/secrets'
|
|
||||||
|
|
||||||
export class SignInPageFixture {
|
|
||||||
public page: Page
|
|
||||||
|
|
||||||
signInButton!: Locator
|
|
||||||
cancelSignInButton!: Locator
|
|
||||||
userCode!: Locator
|
|
||||||
|
|
||||||
apiBaseUrl!: string
|
|
||||||
|
|
||||||
constructor(page: Page) {
|
|
||||||
this.page = page
|
|
||||||
|
|
||||||
this.signInButton = this.page.getByTestId('sign-in-button')
|
|
||||||
this.cancelSignInButton = this.page.getByTestId('cancel-sign-in-button')
|
|
||||||
this.userCode = this.page.getByTestId('sign-in-user-code')
|
|
||||||
|
|
||||||
// TODO: set this thru env var
|
|
||||||
this.apiBaseUrl = 'https://api.dev.zoo.dev'
|
|
||||||
}
|
|
||||||
|
|
||||||
async verifyAndConfirmAuth(userCode: string) {
|
|
||||||
// Device flow: stolen from the tauri days
|
|
||||||
// https://github.com/KittyCAD/modeling-app/blob/d916c7987452e480719004e6d11fd2e595c7d0eb/e2e/tauri/specs/app.spec.ts#L19
|
|
||||||
const headers = {
|
|
||||||
Authorization: `Bearer ${secrets.token}`,
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
}
|
|
||||||
const verifyUrl = `${this.apiBaseUrl}/oauth2/device/verify?user_code=${userCode}`
|
|
||||||
console.log(`GET ${verifyUrl}`)
|
|
||||||
const vr = await fetch(verifyUrl, { headers })
|
|
||||||
console.log(vr.status)
|
|
||||||
|
|
||||||
// Device flow: confirm
|
|
||||||
const confirmUrl = `${this.apiBaseUrl}/oauth2/device/confirm`
|
|
||||||
const data = JSON.stringify({ user_code: userCode })
|
|
||||||
console.log(`POST ${confirmUrl} ${data}`)
|
|
||||||
const cr = await fetch(confirmUrl, {
|
|
||||||
headers,
|
|
||||||
method: 'POST',
|
|
||||||
body: data,
|
|
||||||
})
|
|
||||||
console.log(cr.status)
|
|
||||||
}
|
|
||||||
}
|
|
@ -46,9 +46,6 @@ export class ToolbarFixture {
|
|||||||
gizmo!: Locator
|
gizmo!: Locator
|
||||||
gizmoDisabled!: Locator
|
gizmoDisabled!: Locator
|
||||||
loadButton!: Locator
|
loadButton!: Locator
|
||||||
/** User button for the user sidebar menu */
|
|
||||||
userSidebarButton!: Locator
|
|
||||||
signOutButton!: Locator
|
|
||||||
|
|
||||||
constructor(page: Page) {
|
constructor(page: Page) {
|
||||||
this.page = page
|
this.page = page
|
||||||
@ -85,9 +82,6 @@ export class ToolbarFixture {
|
|||||||
// element or two different elements can represent these states.
|
// element or two different elements can represent these states.
|
||||||
this.gizmo = page.getByTestId('gizmo')
|
this.gizmo = page.getByTestId('gizmo')
|
||||||
this.gizmoDisabled = page.getByTestId('gizmo-disabled')
|
this.gizmoDisabled = page.getByTestId('gizmo-disabled')
|
||||||
|
|
||||||
this.userSidebarButton = page.getByTestId('user-sidebar-toggle')
|
|
||||||
this.signOutButton = page.getByTestId('user-sidebar-sign-out')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get logoLink() {
|
get logoLink() {
|
||||||
|
@ -1,25 +1,6 @@
|
|||||||
import type {
|
import type { Reporter, TestCase, TestResult } from '@playwright/test/reporter'
|
||||||
Reporter,
|
|
||||||
TestCase,
|
|
||||||
TestResult,
|
|
||||||
FullResult,
|
|
||||||
} from '@playwright/test/reporter'
|
|
||||||
|
|
||||||
class MyAPIReporter implements Reporter {
|
class MyAPIReporter implements Reporter {
|
||||||
private pendingRequests: Promise<void>[] = []
|
|
||||||
private allResults: Record<string, any>[] = []
|
|
||||||
private blockingResults: Record<string, any>[] = []
|
|
||||||
|
|
||||||
async onEnd(result: FullResult): Promise<void> {
|
|
||||||
await Promise.all(this.pendingRequests)
|
|
||||||
if (this.allResults.length > 0 && this.blockingResults.length === 0) {
|
|
||||||
result.status = 'passed'
|
|
||||||
if (!process.env.CI) {
|
|
||||||
console.error('TAB API - Marked failures as non-blocking')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onTestEnd(test: TestCase, result: TestResult): void {
|
onTestEnd(test: TestCase, result: TestResult): void {
|
||||||
if (!process.env.TAB_API_URL || !process.env.TAB_API_KEY) {
|
if (!process.env.TAB_API_URL || !process.env.TAB_API_KEY) {
|
||||||
return
|
return
|
||||||
@ -39,7 +20,6 @@ class MyAPIReporter implements Reporter {
|
|||||||
platform: process.env.RUNNER_OS || process.platform,
|
platform: process.env.RUNNER_OS || process.platform,
|
||||||
// Extra test and result data
|
// Extra test and result data
|
||||||
annotations: test.annotations.map((a) => a.type), // e.g. 'fail' or 'fixme'
|
annotations: test.annotations.map((a) => a.type), // e.g. 'fail' or 'fixme'
|
||||||
id: test.id, // computed file/test/project ID used for reruns
|
|
||||||
retry: result.retry,
|
retry: result.retry,
|
||||||
tags: test.tags, // e.g. '@snapshot' or '@skipWin'
|
tags: test.tags, // e.g. '@snapshot' or '@skipWin'
|
||||||
// Extra environment variables
|
// Extra environment variables
|
||||||
@ -55,7 +35,7 @@ class MyAPIReporter implements Reporter {
|
|||||||
RUNNER_ARCH: process.env.RUNNER_ARCH || null,
|
RUNNER_ARCH: process.env.RUNNER_ARCH || null,
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = (async () => {
|
void (async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${process.env.TAB_API_URL}/api/results`, {
|
const response = await fetch(`${process.env.TAB_API_URL}/api/results`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -66,27 +46,18 @@ class MyAPIReporter implements Reporter {
|
|||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.ok) {
|
if (!response.ok && !process.env.CI) {
|
||||||
const result = await response.json()
|
console.error(
|
||||||
this.allResults.push(result)
|
'TAB API - Failed to send test result:',
|
||||||
if (result.block) {
|
await response.text()
|
||||||
this.blockingResults.push(result)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} catch {
|
||||||
const error = await response.json()
|
|
||||||
if (!process.env.CI) {
|
if (!process.env.CI) {
|
||||||
console.error('TAB API - Failed to send test result:', error)
|
console.error('TAB API - Unable to send test result')
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
const message = error instanceof Error ? error.message : String(error)
|
|
||||||
if (!process.env.CI) {
|
|
||||||
console.error('TAB API - Unable to send test result:', message)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
this.pendingRequests.push(request)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,18 +63,6 @@ export const isErrorWhitelisted = (exception: Error) => {
|
|||||||
'e2e/playwright/can-create-sketches-on-all-planes-and-their-back-sides.spec.ts XY',
|
'e2e/playwright/can-create-sketches-on-all-planes-and-their-back-sides.spec.ts XY',
|
||||||
project: 'Google Chrome',
|
project: 'Google Chrome',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'fE',
|
|
||||||
message:
|
|
||||||
'engine: Failed to wait for promise from send modeling command: JsValue("no connection to send on")',
|
|
||||||
stack: `fE: engine: Failed to wait for promise from send modeling command: JsValue("no connection to send on")
|
|
||||||
at ET (file:///home/runner/_work/modeling-app/modeling-app/.vite/renderer/main_window/assets/index-BvtRFNLF.js:49875:12)
|
|
||||||
at WGe.clearSceneAndBustCache (file:///home/runner/_work/modeling-app/modeling-app/.vite/renderer/main_window/assets/index-BvtRFNLF.js:91886:19)
|
|
||||||
at async a.onEngineConnectionOpened (file:///home/runner/_work/modeling-app/modeling-app/.vite/renderer/main_window/assets/index-BvtRFNLF.js:91483:9)`,
|
|
||||||
foundInSpec:
|
|
||||||
'e2e/playwright/testing-constraints.spec.ts is frequent but could be any spec',
|
|
||||||
project: 'Google Chrome',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'RangeError',
|
name: 'RangeError',
|
||||||
message: 'Position 160 is out of range for changeset of length 0',
|
message: 'Position 160 is out of range for changeset of length 0',
|
||||||
|
@ -21,9 +21,8 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
if (!app || !app.applicationMenu) {
|
if (!app || !app.applicationMenu) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const newProject = app.applicationMenu.getMenuItemById(
|
const newProject =
|
||||||
'File.Create project'
|
app.applicationMenu.getMenuItemById('File.New project')
|
||||||
)
|
|
||||||
if (!newProject) return false
|
if (!newProject) return false
|
||||||
newProject.click()
|
newProject.click()
|
||||||
return true
|
return true
|
||||||
@ -409,7 +408,11 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
)
|
)
|
||||||
.toBe(true)
|
.toBe(true)
|
||||||
})
|
})
|
||||||
test('Home.Help.Report a bug', async ({ tronApp, cmdBar, page }) => {
|
test('Home.Help.Refresh and report a bug', async ({
|
||||||
|
tronApp,
|
||||||
|
cmdBar,
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
if (!tronApp) fail()
|
if (!tronApp) fail()
|
||||||
// Run electron snippet to find the Menu!
|
// Run electron snippet to find the Menu!
|
||||||
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
|
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
|
||||||
@ -420,8 +423,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
if (!app || !app.applicationMenu) {
|
if (!app || !app.applicationMenu) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const menu =
|
const menu = app.applicationMenu.getMenuItemById(
|
||||||
app.applicationMenu.getMenuItemById('Help.Report a bug')
|
'Help.Refresh and report a bug'
|
||||||
|
)
|
||||||
if (!menu) return false
|
if (!menu) return false
|
||||||
menu.click()
|
menu.click()
|
||||||
return true
|
return true
|
||||||
@ -480,9 +484,8 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
|
await page.waitForTimeout(100) // wait for createModelingPageMenu() to run
|
||||||
await tronApp.electron.evaluate(async ({ app }) => {
|
await tronApp.electron.evaluate(async ({ app }) => {
|
||||||
if (!app || !app.applicationMenu) fail()
|
if (!app || !app.applicationMenu) fail()
|
||||||
const newProject = app.applicationMenu.getMenuItemById(
|
const newProject =
|
||||||
'File.Create project'
|
app.applicationMenu.getMenuItemById('File.New project')
|
||||||
)
|
|
||||||
if (!newProject) fail()
|
if (!newProject) fail()
|
||||||
newProject.click()
|
newProject.click()
|
||||||
})
|
})
|
||||||
@ -605,7 +608,7 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
const expected = 'Export'
|
const expected = 'Export'
|
||||||
expect(actual).toBe(expected)
|
expect(actual).toBe(expected)
|
||||||
})
|
})
|
||||||
test('Modeling.File.Share part via Zoo link', async ({
|
test('Modeling.File.Share current part (via Zoo link)', async ({
|
||||||
tronApp,
|
tronApp,
|
||||||
cmdBar,
|
cmdBar,
|
||||||
page,
|
page,
|
||||||
@ -626,10 +629,10 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
throw new Error('app or app.applicationMenu is missing')
|
throw new Error('app or app.applicationMenu is missing')
|
||||||
}
|
}
|
||||||
const openProject = app.applicationMenu.getMenuItemById(
|
const openProject = app.applicationMenu.getMenuItemById(
|
||||||
'File.Share part via Zoo link'
|
'File.Share current part (via Zoo link)'
|
||||||
)
|
)
|
||||||
if (!openProject) {
|
if (!openProject) {
|
||||||
throw new Error('File.Share part via Zoo link')
|
throw new Error('File.Share current part (via Zoo link)')
|
||||||
}
|
}
|
||||||
openProject.click()
|
openProject.click()
|
||||||
})
|
})
|
||||||
@ -2286,7 +2289,7 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
if (!menu) fail()
|
if (!menu) fail()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
test('Modeling.Help.Report a bug', async ({
|
test('Modeling.Help.Refresh and report a bug', async ({
|
||||||
tronApp,
|
tronApp,
|
||||||
cmdBar,
|
cmdBar,
|
||||||
page,
|
page,
|
||||||
@ -2310,8 +2313,9 @@ test.describe('Native file menu', { tag: ['@electron'] }, () => {
|
|||||||
async () =>
|
async () =>
|
||||||
await tronApp.electron.evaluate(async ({ app }) => {
|
await tronApp.electron.evaluate(async ({ app }) => {
|
||||||
if (!app || !app.applicationMenu) return false
|
if (!app || !app.applicationMenu) return false
|
||||||
const menu =
|
const menu = app.applicationMenu.getMenuItemById(
|
||||||
app.applicationMenu.getMenuItemById('Help.Report a bug')
|
'Help.Refresh and report a bug'
|
||||||
|
)
|
||||||
if (!menu) return false
|
if (!menu) return false
|
||||||
menu.click()
|
menu.click()
|
||||||
return true
|
return true
|
||||||
|
@ -63,7 +63,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
{
|
{
|
||||||
tag: '@electron',
|
tag: '@electron',
|
||||||
},
|
},
|
||||||
async ({ page, tronApp, scene }) => {
|
async ({ page, tronApp }) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
@ -72,6 +72,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
onboarding_status: '',
|
onboarding_status: '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
const u = await getUtils(page)
|
||||||
|
|
||||||
const viewportSize = { width: 1200, height: 500 }
|
const viewportSize = { width: 1200, height: 500 }
|
||||||
await page.setBodyDimensions(viewportSize)
|
await page.setBodyDimensions(viewportSize)
|
||||||
@ -79,7 +80,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
await test.step(`Create a project and open to the onboarding`, async () => {
|
await test.step(`Create a project and open to the onboarding`, async () => {
|
||||||
await createProject({ name: 'project-link', page })
|
await createProject({ name: 'project-link', page })
|
||||||
await test.step(`Ensure the engine connection works by testing the sketch button`, async () => {
|
await test.step(`Ensure the engine connection works by testing the sketch button`, async () => {
|
||||||
await scene.connectionEstablished()
|
await u.waitForPageLoad()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -106,10 +107,12 @@ test.describe('Onboarding tests', () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
test('Code resets after confirmation', async ({
|
test('Code resets after confirmation', async ({
|
||||||
|
context,
|
||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
scene,
|
scene,
|
||||||
|
cmdBar,
|
||||||
}) => {
|
}) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
@ -273,8 +276,6 @@ test.describe('Onboarding tests', () => {
|
|||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
editor,
|
|
||||||
toolbar,
|
|
||||||
}) => {
|
}) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
@ -288,6 +289,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const u = await getUtils(page)
|
||||||
const badCode = `// This is bad code we shouldn't see`
|
const badCode = `// This is bad code we shouldn't see`
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
||||||
@ -297,19 +299,18 @@ test.describe('Onboarding tests', () => {
|
|||||||
.poll(() => page.url())
|
.poll(() => page.url())
|
||||||
.toContain(onboardingPaths.PARAMETRIC_MODELING)
|
.toContain(onboardingPaths.PARAMETRIC_MODELING)
|
||||||
|
|
||||||
|
const bracketNoNewLines = bracket.replace(/\n/g, '')
|
||||||
|
|
||||||
// Check the code got reset on load
|
// Check the code got reset on load
|
||||||
await toolbar.openPane('code')
|
await expect(page.locator('#code-pane')).toBeVisible()
|
||||||
await editor.expectEditor.toContain(bracket, {
|
await expect(u.codeLocator).toHaveText(bracketNoNewLines, {
|
||||||
shouldNormalise: true,
|
|
||||||
timeout: 10_000,
|
timeout: 10_000,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Mess with the code again
|
// Mess with the code again
|
||||||
await editor.replaceCode('', badCode)
|
await u.codeLocator.selectText()
|
||||||
await editor.expectEditor.toContain(badCode, {
|
await u.codeLocator.fill(badCode)
|
||||||
shouldNormalise: true,
|
await expect(u.codeLocator).toHaveText(badCode)
|
||||||
timeout: 10_000,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Click to the next step
|
// Click to the next step
|
||||||
await page.locator('[data-testid="onboarding-next"]').hover()
|
await page.locator('[data-testid="onboarding-next"]').hover()
|
||||||
@ -319,10 +320,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Check that the code has been reset
|
// Check that the code has been reset
|
||||||
await editor.expectEditor.toContain(bracket, {
|
await expect(u.codeLocator).toHaveText(bracketNoNewLines)
|
||||||
shouldNormalise: true,
|
|
||||||
timeout: 10_000,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// (lee) The two avatar tests are weird because even on main, we don't have
|
// (lee) The two avatar tests are weird because even on main, we don't have
|
||||||
@ -331,7 +329,6 @@ test.describe('Onboarding tests', () => {
|
|||||||
test('Avatar text updates depending on image load success', async ({
|
test('Avatar text updates depending on image load success', async ({
|
||||||
context,
|
context,
|
||||||
page,
|
page,
|
||||||
toolbar,
|
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
}) => {
|
}) => {
|
||||||
@ -363,7 +360,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
await homePage.goToModelingScene()
|
await homePage.goToModelingScene()
|
||||||
|
|
||||||
// Test that the text in this step is correct
|
// Test that the text in this step is correct
|
||||||
const avatarLocator = toolbar.userSidebarButton.locator('img')
|
const avatarLocator = page.getByTestId('user-sidebar-toggle').locator('img')
|
||||||
const onboardingOverlayLocator = page
|
const onboardingOverlayLocator = page
|
||||||
.getByTestId('onboarding-content')
|
.getByTestId('onboarding-content')
|
||||||
.locator('div')
|
.locator('div')
|
||||||
@ -405,7 +402,6 @@ test.describe('Onboarding tests', () => {
|
|||||||
test("Avatar text doesn't mention avatar when no avatar", async ({
|
test("Avatar text doesn't mention avatar when no avatar", async ({
|
||||||
context,
|
context,
|
||||||
page,
|
page,
|
||||||
toolbar,
|
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
tronApp,
|
||||||
}) => {
|
}) => {
|
||||||
@ -437,7 +433,7 @@ test.describe('Onboarding tests', () => {
|
|||||||
await homePage.goToModelingScene()
|
await homePage.goToModelingScene()
|
||||||
|
|
||||||
// Test that the text in this step is correct
|
// Test that the text in this step is correct
|
||||||
const sidebar = toolbar.userSidebarButton
|
const sidebar = page.getByTestId('user-sidebar-toggle')
|
||||||
const avatar = sidebar.locator('img')
|
const avatar = sidebar.locator('img')
|
||||||
const onboardingOverlayLocator = page
|
const onboardingOverlayLocator = page
|
||||||
.getByTestId('onboarding-content')
|
.getByTestId('onboarding-content')
|
||||||
@ -466,7 +462,6 @@ test.describe('Onboarding tests', () => {
|
|||||||
test('Restarting onboarding on desktop takes one attempt', async ({
|
test('Restarting onboarding on desktop takes one attempt', async ({
|
||||||
context,
|
context,
|
||||||
page,
|
page,
|
||||||
toolbar,
|
|
||||||
tronApp,
|
tronApp,
|
||||||
}) => {
|
}) => {
|
||||||
test.fixme(orRunWhenFullSuiteEnabled())
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
@ -505,7 +500,7 @@ test('Restarting onboarding on desktop takes one attempt', async ({
|
|||||||
.filter({ hasText: 'Tutorial Project 00' })
|
.filter({ hasText: 'Tutorial Project 00' })
|
||||||
const tutorialModalText = page.getByText('Welcome to Design Studio!')
|
const tutorialModalText = page.getByText('Welcome to Design Studio!')
|
||||||
const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' })
|
const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' })
|
||||||
const userMenuButton = toolbar.userSidebarButton
|
const userMenuButton = page.getByTestId('user-sidebar-toggle')
|
||||||
const userMenuSettingsButton = page.getByRole('button', {
|
const userMenuSettingsButton = page.getByRole('button', {
|
||||||
name: 'User settings',
|
name: 'User settings',
|
||||||
})
|
})
|
||||||
|
@ -143,45 +143,28 @@ test.describe('Point-and-click assemblies tests', () => {
|
|||||||
await scene.settled(cmdBar)
|
await scene.settled(cmdBar)
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Insert a second time with the same name and expect error', async () => {
|
await test.step('Insert a second time and expect error', async () => {
|
||||||
await toolbar.insertButton.click()
|
// TODO: revisit once we have clone with #6209
|
||||||
await cmdBar.selectOption({ name: 'bracket.kcl' }).click()
|
await insertPartIntoAssembly(
|
||||||
await cmdBar.expectState({
|
'bracket.kcl',
|
||||||
stage: 'arguments',
|
'bracket',
|
||||||
currentArgKey: 'localName',
|
toolbar,
|
||||||
currentArgValue: '',
|
cmdBar,
|
||||||
headerArguments: { Path: 'bracket.kcl', LocalName: '' },
|
page
|
||||||
highlightedHeaderArg: 'localName',
|
)
|
||||||
commandName: 'Insert',
|
|
||||||
})
|
|
||||||
await page.keyboard.insertText('bracket')
|
|
||||||
await cmdBar.progressCmdBar()
|
|
||||||
await expect(
|
|
||||||
page.getByText('This variable name is already in use')
|
|
||||||
).toBeVisible()
|
|
||||||
})
|
|
||||||
|
|
||||||
await test.step('Insert a second time with a different name and expect error', async () => {
|
|
||||||
await page.keyboard.insertText('2')
|
|
||||||
await cmdBar.progressCmdBar()
|
|
||||||
await cmdBar.expectState({
|
|
||||||
stage: 'review',
|
|
||||||
headerArguments: { Path: 'bracket.kcl', LocalName: 'bracket2' },
|
|
||||||
commandName: 'Insert',
|
|
||||||
})
|
|
||||||
await cmdBar.progressCmdBar()
|
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`
|
`
|
||||||
import "cylinder.kcl" as cylinder
|
import "cylinder.kcl" as cylinder
|
||||||
import "bracket.kcl" as bracket
|
import "bracket.kcl" as bracket
|
||||||
import "bracket.kcl" as bracket2
|
import "bracket.kcl" as bracket
|
||||||
cylinder
|
cylinder
|
||||||
bracket
|
bracket
|
||||||
bracket2
|
bracket
|
||||||
`,
|
`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
)
|
)
|
||||||
// TODO: update once we have clone() with #6209
|
await scene.settled(cmdBar)
|
||||||
|
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -278,7 +261,7 @@ test.describe('Point-and-click assemblies tests', () => {
|
|||||||
highlightedHeaderArg: 'x',
|
highlightedHeaderArg: 'x',
|
||||||
commandName: 'Translate',
|
commandName: 'Translate',
|
||||||
})
|
})
|
||||||
await page.keyboard.insertText('100')
|
await page.keyboard.insertText('5')
|
||||||
await cmdBar.progressCmdBar()
|
await cmdBar.progressCmdBar()
|
||||||
await page.keyboard.insertText('0.1')
|
await page.keyboard.insertText('0.1')
|
||||||
await cmdBar.progressCmdBar()
|
await cmdBar.progressCmdBar()
|
||||||
@ -287,7 +270,7 @@ test.describe('Point-and-click assemblies tests', () => {
|
|||||||
await cmdBar.expectState({
|
await cmdBar.expectState({
|
||||||
stage: 'review',
|
stage: 'review',
|
||||||
headerArguments: {
|
headerArguments: {
|
||||||
X: '100',
|
X: '5',
|
||||||
Y: '0.1',
|
Y: '0.1',
|
||||||
Z: '0.2',
|
Z: '0.2',
|
||||||
},
|
},
|
||||||
@ -299,7 +282,7 @@ test.describe('Point-and-click assemblies tests', () => {
|
|||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`
|
`
|
||||||
bracket
|
bracket
|
||||||
|> translate(x = 100, y = 0.1, z = 0.2)
|
|> translate(x = 5, y = 0.1, z = 0.2)
|
||||||
`,
|
`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
)
|
)
|
||||||
@ -348,7 +331,7 @@ test.describe('Point-and-click assemblies tests', () => {
|
|||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`
|
`
|
||||||
bracket
|
bracket
|
||||||
|> translate(x = 100, y = 0.1, z = 0.2)
|
|> translate(x = 5, y = 0.1, z = 0.2)
|
||||||
|> rotate(roll = 0.1, pitch = 0.2, yaw = 0.3)
|
|> rotate(roll = 0.1, pitch = 0.2, yaw = 0.3)
|
||||||
`,
|
`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
|
@ -400,6 +400,11 @@ test(
|
|||||||
await expect(page.getByText('broken-code')).toBeVisible()
|
await expect(page.getByText('broken-code')).toBeVisible()
|
||||||
await page.getByText('broken-code').click()
|
await page.getByText('broken-code').click()
|
||||||
|
|
||||||
|
// Gotcha: You can not use scene.settled() since the KCL code is going to fail
|
||||||
|
await expect(
|
||||||
|
page.getByTestId('model-state-indicator-playing')
|
||||||
|
).toBeAttached()
|
||||||
|
|
||||||
// Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content
|
// Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content
|
||||||
await editor.scrollToText(
|
await editor.scrollToText(
|
||||||
"|> line(end = [0, wallMountL], tag = 'outerEdge')"
|
"|> line(end = [0, wallMountL], tag = 'outerEdge')"
|
||||||
@ -774,9 +779,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
// Constants and locators
|
// Constants and locators
|
||||||
const projectHomeLink = page.getByTestId('project-link')
|
const projectHomeLink = page.getByTestId('project-link')
|
||||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||||
const commandOption = page.getByRole('option', {
|
const commandOption = page.getByRole('option', { name: 'rename project' })
|
||||||
name: 'rename project',
|
|
||||||
})
|
|
||||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||||
const projectRenamedName = `untitled`
|
const projectRenamedName = `untitled`
|
||||||
// const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
// const projectMenuButton = page.getByTestId('project-sidebar-toggle')
|
||||||
@ -836,9 +839,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
// Constants and locators
|
// Constants and locators
|
||||||
const projectHomeLink = page.getByTestId('project-link')
|
const projectHomeLink = page.getByTestId('project-link')
|
||||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||||
const commandOption = page.getByRole('option', {
|
const commandOption = page.getByRole('option', { name: 'delete project' })
|
||||||
name: 'delete project',
|
|
||||||
})
|
|
||||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||||
const commandWarning = page.getByText('Are you sure you want to delete?')
|
const commandWarning = page.getByText('Are you sure you want to delete?')
|
||||||
const commandSubmitButton = page.getByRole('button', {
|
const commandSubmitButton = page.getByRole('button', {
|
||||||
@ -890,9 +891,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
// Constants and locators
|
// Constants and locators
|
||||||
const projectHomeLink = page.getByTestId('project-link')
|
const projectHomeLink = page.getByTestId('project-link')
|
||||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||||
const commandOption = page.getByRole('option', {
|
const commandOption = page.getByRole('option', { name: 'rename project' })
|
||||||
name: 'rename project',
|
|
||||||
})
|
|
||||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||||
const projectRenamedName = `untitled`
|
const projectRenamedName = `untitled`
|
||||||
const commandContinueButton = page.getByRole('button', {
|
const commandContinueButton = page.getByRole('button', {
|
||||||
@ -948,9 +947,7 @@ test.describe(`Project management commands`, () => {
|
|||||||
// Constants and locators
|
// Constants and locators
|
||||||
const projectHomeLink = page.getByTestId('project-link')
|
const projectHomeLink = page.getByTestId('project-link')
|
||||||
const commandButton = page.getByRole('button', { name: 'Commands' })
|
const commandButton = page.getByRole('button', { name: 'Commands' })
|
||||||
const commandOption = page.getByRole('option', {
|
const commandOption = page.getByRole('option', { name: 'delete project' })
|
||||||
name: 'delete project',
|
|
||||||
})
|
|
||||||
const projectNameOption = page.getByRole('option', { name: projectName })
|
const projectNameOption = page.getByRole('option', { name: projectName })
|
||||||
const commandWarning = page.getByText('Are you sure you want to delete?')
|
const commandWarning = page.getByText('Are you sure you want to delete?')
|
||||||
const commandSubmitButton = page.getByRole('button', {
|
const commandSubmitButton = page.getByRole('button', {
|
||||||
@ -1965,13 +1962,13 @@ test(
|
|||||||
test(
|
test(
|
||||||
'Settings persist across restarts',
|
'Settings persist across restarts',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ page, toolbar }, testInfo) => {
|
async ({ page, scene, cmdBar }, testInfo) => {
|
||||||
await test.step('We can change a user setting like theme', async () => {
|
await test.step('We can change a user setting like theme', async () => {
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||||
|
|
||||||
page.on('console', console.log)
|
page.on('console', console.log)
|
||||||
|
|
||||||
await toolbar.userSidebarButton.click()
|
await page.getByTestId('user-sidebar-toggle').click()
|
||||||
|
|
||||||
await page.getByTestId('user-settings').click()
|
await page.getByTestId('user-settings').click()
|
||||||
|
|
||||||
@ -1998,7 +1995,7 @@ test(
|
|||||||
test(
|
test(
|
||||||
'Original project name persist after onboarding',
|
'Original project name persist after onboarding',
|
||||||
{ tag: '@electron' },
|
{ tag: '@electron' },
|
||||||
async ({ page, toolbar }, testInfo) => {
|
async ({ page }, testInfo) => {
|
||||||
test.fixme(orRunWhenFullSuiteEnabled())
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||||
|
|
||||||
@ -2010,7 +2007,7 @@ test(
|
|||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Should go through onboarding', async () => {
|
await test.step('Should go through onboarding', async () => {
|
||||||
await toolbar.userSidebarButton.click()
|
await page.getByTestId('user-sidebar-toggle').click()
|
||||||
await page.getByTestId('user-settings').click()
|
await page.getByTestId('user-settings').click()
|
||||||
await page.getByRole('button', { name: 'Replay Onboarding' }).click()
|
await page.getByRole('button', { name: 'Replay Onboarding' }).click()
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { orRunWhenFullSuiteEnabled } from '@e2e/playwright/test-utils'
|
||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||||
|
|
||||||
/* eslint-disable jest/no-conditional-expect */
|
/* eslint-disable jest/no-conditional-expect */
|
||||||
@ -50,6 +51,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
page,
|
page,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
await context.addInitScript((file) => {
|
await context.addInitScript((file) => {
|
||||||
localStorage.setItem('persistCode', file)
|
localStorage.setItem('persistCode', file)
|
||||||
}, file)
|
}, file)
|
||||||
@ -198,6 +200,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
page,
|
page,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const body1CapCoords = { x: 571, y: 311 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
|
|
||||||
await context.addInitScript((file) => {
|
await context.addInitScript((file) => {
|
||||||
@ -257,6 +260,7 @@ test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => {
|
|||||||
page,
|
page,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const body1CapCoords = { x: 571, y: 311 }
|
const body1CapCoords = { x: 571, y: 311 }
|
||||||
const body2WallCoords = { x: 620, y: 152 }
|
const body2WallCoords = { x: 620, y: 152 }
|
||||||
const [clickBody1Cap] = scene.makeMouseHelpers(
|
const [clickBody1Cap] = scene.makeMouseHelpers(
|
||||||
|
@ -45,7 +45,11 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
|
|||||||
|
|
||||||
screwHole = startSketchOn(XY)
|
screwHole = startSketchOn(XY)
|
||||||
${startProfileAt1}
|
${startProfileAt1}
|
||||||
|> arc(angleStart = 0, angleEnd = 360, radius = screwRadius)
|
|> arc({
|
||||||
|
radius = screwRadius,
|
||||||
|
angleStart = 0,
|
||||||
|
angleEnd = 360
|
||||||
|
}, %)
|
||||||
|
|
||||||
part001 = startSketchOn(XY)
|
part001 = startSketchOn(XY)
|
||||||
${startProfileAt2}
|
${startProfileAt2}
|
||||||
@ -62,7 +66,11 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
|
|||||||
|> tangentialArc(endAbsolute = [width / 2, 0])
|
|> tangentialArc(endAbsolute = [width / 2, 0])
|
||||||
|> xLine(length = -width / 4 + wireRadius)
|
|> xLine(length = -width / 4 + wireRadius)
|
||||||
|> yLine(length = wireOffset)
|
|> yLine(length = wireOffset)
|
||||||
|> arc(angleStart = 0, angleEnd = 180, radius = wireRadius)
|
|> arc({
|
||||||
|
radius = wireRadius,
|
||||||
|
angleStart = 0,
|
||||||
|
angleEnd = 180
|
||||||
|
}, %)
|
||||||
|> yLine(length = -wireOffset)
|
|> yLine(length = -wireOffset)
|
||||||
|> xLine(length = -width / 4)
|
|> xLine(length = -width / 4)
|
||||||
|> close()
|
|> close()
|
||||||
@ -206,8 +214,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
|> startProfileAt([4.61, -14.01], %)
|
|> startProfileAt([4.61, -14.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||||
|> arc(interiorAbsolute = [20.18, -1.7], endAbsolute = [11.82, -1.16])
|
|> arcTo({
|
||||||
|> arc(angleStart = -89.36, angleEnd = 135.81, radius = 5.92)
|
interior = [20.18, -1.7],
|
||||||
|
end = [11.82, -1.16]
|
||||||
|
}, %)
|
||||||
|
|> arc({
|
||||||
|
radius = 5.92,
|
||||||
|
angleStart = -89.36,
|
||||||
|
angleEnd = 135.81
|
||||||
|
}, %)
|
||||||
|> close()`
|
|> close()`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -249,8 +264,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
|> startProfileAt([4.61, -14.01], %)
|
|> startProfileAt([4.61, -14.01], %)
|
||||||
|> line(end = [12.73, -0.09])
|
|> line(end = [12.73, -0.09])
|
||||||
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||||
|> arc(interiorAbsolute = [20.18, -1.7], endAbsolute = [11.82, -1.16])
|
|> arcTo({
|
||||||
|> arc(angleStart = -89.36, angleEnd = 135.81, radius = 5.92)
|
interior = [20.18, -1.7],
|
||||||
|
end = [11.82, -1.16]
|
||||||
|
}, %)
|
||||||
|
|> arc({
|
||||||
|
radius = 5.92,
|
||||||
|
angleStart = -89.36,
|
||||||
|
angleEnd = 135.81
|
||||||
|
}, %)
|
||||||
|> close()
|
|> close()
|
||||||
`)
|
`)
|
||||||
} else {
|
} else {
|
||||||
@ -316,7 +338,7 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
await expect(page.locator('.cm-content')).not.toHaveText(prevContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// drag arcTo interiorAbsolute handle (three point arc)
|
// drag arcTo interior handle (three point arc)
|
||||||
const arcToHandle = await u.getBoundingBox('[data-overlay-index="2"]')
|
const arcToHandle = await u.getBoundingBox('[data-overlay-index="2"]')
|
||||||
await page.mouse.move(arcToHandle.x, arcToHandle.y - 5)
|
await page.mouse.move(arcToHandle.x, arcToHandle.y - 5)
|
||||||
await page.mouse.down()
|
await page.mouse.down()
|
||||||
@ -388,8 +410,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
|
|||||||
|> startProfileAt([6.44, -12.07], %)
|
|> startProfileAt([6.44, -12.07], %)
|
||||||
|> line(end = [14.72, 1.97])
|
|> line(end = [14.72, 1.97])
|
||||||
|> tangentialArc(endAbsolute = [26.92, -3.32])
|
|> tangentialArc(endAbsolute = [26.92, -3.32])
|
||||||
|> arc(interiorAbsolute = [18.11, -3.73], endAbsolute = [9.77, -3.19])
|
|> arcTo({
|
||||||
|> arc(angleStart = -58.29, angleEnd = 161.17, radius = 3.75)
|
interior = [18.11, -3.73],
|
||||||
|
end = [9.77, -3.19]
|
||||||
|
}, %)
|
||||||
|
|> arc({
|
||||||
|
radius = 3.75,
|
||||||
|
angleStart = -58.29,
|
||||||
|
angleEnd = 161.17
|
||||||
|
}, %)
|
||||||
|> close()
|
|> close()
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
@ -919,9 +948,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
|
|||||||
|
|
||||||
await page.mouse.move(pointA[0] - 12, pointA[1] + 12, { steps: 10 })
|
await page.mouse.move(pointA[0] - 12, pointA[1] + 12, { steps: 10 })
|
||||||
const pointNotQuiteA = [pointA[0] - 7, pointA[1] + 7]
|
const pointNotQuiteA = [pointA[0] - 7, pointA[1] + 7]
|
||||||
await page.mouse.move(pointNotQuiteA[0], pointNotQuiteA[1], {
|
await page.mouse.move(pointNotQuiteA[0], pointNotQuiteA[1], { steps: 10 })
|
||||||
steps: 10,
|
|
||||||
})
|
|
||||||
|
|
||||||
await page.mouse.click(pointNotQuiteA[0], pointNotQuiteA[1], {
|
await page.mouse.click(pointNotQuiteA[0], pointNotQuiteA[1], {
|
||||||
delay: 200,
|
delay: 200,
|
||||||
@ -1473,12 +1500,12 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
|
|||||||
await circle3Point1()
|
await circle3Point1()
|
||||||
await page.waitForTimeout(200)
|
await page.waitForTimeout(200)
|
||||||
await circle3Point2()
|
await circle3Point2()
|
||||||
await editor.expectEditor.toContain('arc(')
|
await editor.expectEditor.toContain('arcTo({')
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('equip line tool and verify three-point-arc code is removed after second click', async () => {
|
await test.step('equip line tool and verify three-point-arc code is removed after second click', async () => {
|
||||||
await toolbar.lineBtn.click()
|
await toolbar.lineBtn.click()
|
||||||
await editor.expectEditor.not.toContain('arc(')
|
await editor.expectEditor.not.toContain('arcTo({')
|
||||||
})
|
})
|
||||||
|
|
||||||
const [cornerRectPoint1] = scene.makeMouseHelpers(600, 300)
|
const [cornerRectPoint1] = scene.makeMouseHelpers(600, 300)
|
||||||
@ -1515,9 +1542,9 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
|
|||||||
await continueProfile2Clk()
|
await continueProfile2Clk()
|
||||||
await page.waitForTimeout(200)
|
await page.waitForTimeout(200)
|
||||||
await circle3Point1()
|
await circle3Point1()
|
||||||
await editor.expectEditor.toContain('arc(')
|
await editor.expectEditor.toContain('arcTo({')
|
||||||
await toolbar.lineBtn.click()
|
await toolbar.lineBtn.click()
|
||||||
await editor.expectEditor.not.toContain('arc(')
|
await editor.expectEditor.not.toContain('arcTo({')
|
||||||
await editor.expectEditor.toContain('profile002')
|
await editor.expectEditor.toContain('profile002')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1814,9 +1841,7 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
|||||||
await page.waitForTimeout(300)
|
await page.waitForTimeout(300)
|
||||||
|
|
||||||
// Verify the three-point arc was created correctly
|
// Verify the three-point arc was created correctly
|
||||||
await editor.expectEditor.toContain(`arc(`)
|
await editor.expectEditor.toContain(`|> arcTo(`)
|
||||||
await editor.expectEditor.toContain(`interiorAbsolute`)
|
|
||||||
await editor.expectEditor.toContain(`endAbsolute`)
|
|
||||||
|
|
||||||
// Switch back to line tool to continue
|
// Switch back to line tool to continue
|
||||||
await toolbar.lineBtn.click()
|
await toolbar.lineBtn.click()
|
||||||
@ -2036,7 +2061,10 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
|||||||
// Verify the first three-point arc was created correctly
|
// Verify the first three-point arc was created correctly
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
`profile011 = startProfileAt([13.56, -9.97], sketch001)
|
`profile011 = startProfileAt([13.56, -9.97], sketch001)
|
||||||
|> arc(interiorAbsolute = [15.19, -6.51], endAbsolute = [19.33, -11.19])`,
|
|> arcTo({
|
||||||
|
interior = [15.19, -6.51],
|
||||||
|
end = [19.33, -11.19]
|
||||||
|
}, %)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -2053,8 +2081,14 @@ profile003 = startProfileAt([206.63, -56.73], sketch001)
|
|||||||
|
|
||||||
// Verify the second three-point arc was created correctly
|
// Verify the second three-point arc was created correctly
|
||||||
await editor.expectEditor.toContain(
|
await editor.expectEditor.toContain(
|
||||||
` |> arc(interiorAbsolute = [19.8, 1.7], endAbsolute = [21.7, 2.92])
|
` |> arcTo({
|
||||||
|> arc(interiorAbsolute = [27.47, 1.42], endAbsolute = [27.57, 1.52])`,
|
interior = [19.8, 1.7],
|
||||||
|
end = [21.7, 2.92]
|
||||||
|
}, %)
|
||||||
|
|> arcTo({
|
||||||
|
interior = [27.47, 1.42],
|
||||||
|
end = [27.57, 1.52]
|
||||||
|
}, %)`,
|
||||||
{ shouldNormalise: true }
|
{ shouldNormalise: true }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -2829,29 +2863,33 @@ test.describe(`Click based selection don't brick the app when clicked out of ran
|
|||||||
`sketch001 = startSketchOn(XZ)
|
`sketch001 = startSketchOn(XZ)
|
||||||
|> startProfileAt([0, 0], %)
|
|> startProfileAt([0, 0], %)
|
||||||
|> line(end = [3.14, 3.14])
|
|> line(end = [3.14, 3.14])
|
||||||
|> arc(
|
|> arcTo({
|
||||||
interiorAbsolute = [1, 2],
|
end = [4, 2],
|
||||||
endAbsolute = [4, 2]
|
interior = [1, 2]
|
||||||
)`
|
}, %)
|
||||||
|
`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
await homePage.goToModelingScene()
|
await homePage.goToModelingScene()
|
||||||
await scene.settled(cmdBar)
|
await scene.settled(cmdBar)
|
||||||
|
|
||||||
const formattedArc = `arc(interiorAbsolute = [1, 2], endAbsolute = [4, 2])`
|
|
||||||
await test.step(`format the code`, async () => {
|
await test.step(`format the code`, async () => {
|
||||||
// doesn't contain condensed version
|
// doesn't contain condensed version
|
||||||
await editor.expectEditor.not.toContain(formattedArc)
|
await editor.expectEditor.not.toContain(
|
||||||
|
`arcTo({ end = [4, 2], interior = [1, 2] }, %)`
|
||||||
|
)
|
||||||
// click the code to enter sketch mode
|
// click the code to enter sketch mode
|
||||||
await page.getByText(`arc`).click()
|
await page.getByText(`arcTo`).click()
|
||||||
// Format the code.
|
// Format the code.
|
||||||
await page.locator('#code-pane button:first-child').click()
|
await page.locator('#code-pane button:first-child').click()
|
||||||
await page.locator('button:has-text("Format code")').click()
|
await page.locator('button:has-text("Format code")').click()
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step(`Ensure the code reformatted`, async () => {
|
await test.step(`Ensure the code reformatted`, async () => {
|
||||||
await editor.expectEditor.toContain(formattedArc)
|
await editor.expectEditor.toContain(
|
||||||
|
`arcTo({ end = [4, 2], interior = [1, 2] }, %)`
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const [arcClick, arcHover] = scene.makeMouseHelpers(699, 337)
|
const [arcClick, arcHover] = scene.makeMouseHelpers(699, 337)
|
||||||
@ -2862,7 +2900,7 @@ test.describe(`Click based selection don't brick the app when clicked out of ran
|
|||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: ['sketch001=startSketchOn(XZ)'],
|
activeLines: ['sketch001=startSketchOn(XZ)'],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
highlightedCode: 'arc(interiorAbsolute = [1, 2], endAbsolute = [4, 2])',
|
highlightedCode: 'arcTo({end = [4, 2], interior = [1, 2]}, %)',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -2884,7 +2922,7 @@ test.describe(`Click based selection don't brick the app when clicked out of ran
|
|||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: [],
|
activeLines: [],
|
||||||
diagnostics: [],
|
diagnostics: [],
|
||||||
highlightedCode: 'arc(interiorAbsolute = [1, 2], endAbsolute = [4, 2])',
|
highlightedCode: 'arcTo({end = [4, 2], interior = [1, 2]}, %)',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -2998,7 +3036,10 @@ profile001 = startProfileAt([0, 0], sketch001)
|
|||||||
|> line(end = [191.39, 191.39])
|
|> line(end = [191.39, 191.39])
|
||||||
|> tangentialArc(endAbsolute = [287.08, 95.69], tag = $seg01)
|
|> tangentialArc(endAbsolute = [287.08, 95.69], tag = $seg01)
|
||||||
|> angledLine(angle = tangentToEnd(seg01), length = 135.34)
|
|> angledLine(angle = tangentToEnd(seg01), length = 135.34)
|
||||||
|> arc(interiorAbsolute = [191.39, -95.69], endAbsolute = [287.08, -95.69], tag = $seg02)
|
|> arcTo({
|
||||||
|
interior = [191.39, -95.69],
|
||||||
|
end = [287.08, -95.69]
|
||||||
|
}, %, $seg02)
|
||||||
|> angledLine(angle = tangentToEnd(seg02) + turns::HALF_TURN, length = 270.67)
|
|> angledLine(angle = tangentToEnd(seg02) + turns::HALF_TURN, length = 270.67)
|
||||||
`.replaceAll('\n', '')
|
`.replaceAll('\n', '')
|
||||||
)
|
)
|
||||||
@ -3295,7 +3336,7 @@ profile003 = startProfileAt([-201.08, 254.17], sketch002)
|
|||||||
)
|
)
|
||||||
await editor.expectState({
|
await editor.expectState({
|
||||||
activeLines: [],
|
activeLines: [],
|
||||||
diagnostics: ['`badBadBadFn`isnotdefined'],
|
diagnostics: ['memoryitemkey`badBadBadFn`isnotdefined'],
|
||||||
highlightedCode: '',
|
highlightedCode: '',
|
||||||
})
|
})
|
||||||
await expect(
|
await expect(
|
||||||
|
@ -49,6 +49,7 @@ test(
|
|||||||
'exports of each format should work',
|
'exports of each format should work',
|
||||||
{ tag: ['@snapshot', '@skipWin', '@skipMacos'] },
|
{ tag: ['@snapshot', '@skipWin', '@skipMacos'] },
|
||||||
async ({ page, context, scene, cmdBar, tronApp }) => {
|
async ({ page, context, scene, cmdBar, tronApp }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
@ -376,6 +377,8 @@ test.describe(
|
|||||||
'extrude on default planes should be stable',
|
'extrude on default planes should be stable',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
() => {
|
() => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
test('XY', async ({ page, context, cmdBar, scene }) => {
|
test('XY', async ({ page, context, cmdBar, scene }) => {
|
||||||
await extrudeDefaultPlane(context, page, cmdBar, scene, 'XY')
|
await extrudeDefaultPlane(context, page, cmdBar, scene, 'XY')
|
||||||
})
|
})
|
||||||
@ -406,6 +409,7 @@ test(
|
|||||||
'Draft segments should look right',
|
'Draft segments should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, scene, toolbar }) => {
|
async ({ page, scene, toolbar }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
@ -530,6 +534,8 @@ test(
|
|||||||
'Draft rectangles should look right',
|
'Draft rectangles should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context, cmdBar, scene }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
@ -575,6 +581,7 @@ test(
|
|||||||
'Draft circle should look right',
|
'Draft circle should look right',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context, cmdBar, scene }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
const PUR = 400 / 37.5 //pixeltoUnitRatio
|
||||||
@ -621,6 +628,8 @@ test.describe(
|
|||||||
'Client side scene scale should match engine scale',
|
'Client side scene scale should match engine scale',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
() => {
|
() => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
test('Inch scale', async ({ page, cmdBar, scene }) => {
|
test('Inch scale', async ({ page, cmdBar, scene }) => {
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await page.setViewportSize({ width: 1200, height: 500 })
|
await page.setViewportSize({ width: 1200, height: 500 })
|
||||||
@ -796,6 +805,8 @@ test(
|
|||||||
'Sketch on face with none z-up',
|
'Sketch on face with none z-up',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context, cmdBar, scene }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async (KCL_DEFAULT_LENGTH) => {
|
await context.addInitScript(async (KCL_DEFAULT_LENGTH) => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -854,6 +865,8 @@ test(
|
|||||||
'Zoom to fit on load - solid 2d',
|
'Zoom to fit on load - solid 2d',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context, cmdBar, scene }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async () => {
|
await context.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -890,6 +903,8 @@ test(
|
|||||||
'Zoom to fit on load - solid 3d',
|
'Zoom to fit on load - solid 3d',
|
||||||
{ tag: '@snapshot' },
|
{ tag: '@snapshot' },
|
||||||
async ({ page, context, cmdBar, scene }) => {
|
async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
|
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async () => {
|
await context.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -929,6 +944,7 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
cmdBar,
|
cmdBar,
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
}) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
const stream = page.getByTestId('stream')
|
const stream = page.getByTestId('stream')
|
||||||
|
|
||||||
@ -988,6 +1004,7 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Grid turned off', async ({ page, cmdBar, scene }) => {
|
test('Grid turned off', async ({ page, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
const stream = page.getByTestId('stream')
|
const stream = page.getByTestId('stream')
|
||||||
|
|
||||||
@ -1009,6 +1026,7 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Grid turned on', async ({ page, context, cmdBar, scene }) => {
|
test('Grid turned on', async ({ page, context, cmdBar, scene }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
await context.addInitScript(
|
await context.addInitScript(
|
||||||
async ({ settingsKey, settings }) => {
|
async ({ settingsKey, settings }) => {
|
||||||
localStorage.setItem(settingsKey, settings)
|
localStorage.setItem(settingsKey, settings)
|
||||||
@ -1118,6 +1136,7 @@ test('theme persists', async ({ page, context }) => {
|
|||||||
|
|
||||||
test.describe('code color goober', { tag: '@snapshot' }, () => {
|
test.describe('code color goober', { tag: '@snapshot' }, () => {
|
||||||
test('code color goober', async ({ page, context, scene, cmdBar }) => {
|
test('code color goober', async ({ page, context, scene, cmdBar }) => {
|
||||||
|
test.fixme(orRunWhenFullSuiteEnabled())
|
||||||
const u = await getUtils(page)
|
const u = await getUtils(page)
|
||||||
await context.addInitScript(async () => {
|
await context.addInitScript(async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
@ -1135,7 +1154,11 @@ sweepPath = startSketchOn(XZ)
|
|||||||
|
|
||||||
sweepSketch = startSketchOn(XY)
|
sweepSketch = startSketchOn(XY)
|
||||||
|> startProfileAt([2, 0], %)
|
|> startProfileAt([2, 0], %)
|
||||||
|> arc(angleStart = 0, angleEnd = 360, radius = 2)
|
|> arc({
|
||||||
|
angleEnd = 360,
|
||||||
|
angleStart = 0,
|
||||||
|
radius = 2
|
||||||
|
}, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> appearance(
|
|> appearance(
|
||||||
color = "#bb00ff",
|
color = "#bb00ff",
|
||||||
@ -1180,7 +1203,11 @@ sweepPath = startSketchOn(XZ)
|
|||||||
|
|
||||||
sweepSketch = startSketchOn(XY)
|
sweepSketch = startSketchOn(XY)
|
||||||
|> startProfileAt([2, 0], %)
|
|> startProfileAt([2, 0], %)
|
||||||
|> arc(angleStart = 0, angleEnd = 360, radius = 2)
|
|> arc({
|
||||||
|
angleEnd = 360,
|
||||||
|
angleStart = 0,
|
||||||
|
radius = 2
|
||||||
|
}, %)
|
||||||
|> sweep(path = sweepPath)
|
|> sweep(path = sweepPath)
|
||||||
|> appearance(
|
|> appearance(
|
||||||
color = "#bb00ff",
|
color = "#bb00ff",
|
||||||
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 63 KiB |