Compare commits

...

9 Commits

Author SHA1 Message Date
b5c8ca05a5 Fix whitespace in updater toast (#7331)
pierremtb/adhoc/whitespace-fix-updater-toast
2025-06-03 10:15:42 -04:00
33f7badf41 point and click-ify mounting plate (#7287)
* point and click-ify mounting plate

* Update kcl-samples simulation test output

* Update public/kcl-samples/mounting-plate/main.kcl

* Update public/kcl-samples/mounting-plate/main.kcl

* fix

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-06-03 08:10:37 -04:00
569935c21f Move segment functions to KCL (#7333)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-06-03 15:15:51 +12:00
7680605085 KCL: Fix 'cryptic' error when referencing a variable in its own declaration (#7325)
Previously, `x = cos(x)` would just say "`x` is undefined". Now it says that `x` cannot be referenced in its own definition, try using a different variable instead.

To do this, I've added a new `Option<String>` field to the mod-local executor context, tracking the current variable declaration. This means cloning some strings, implying a small performance hit. I think it's fine, for the better diagnostics.

In the future we could refactor this to use a &str or store variable labels in stack-allocated strings like docs.rs/compact_str or something.

Closes https://github.com/KittyCAD/modeling-app/issues/6072
2025-06-02 18:25:55 -04:00
2bb6c74f42 Update error message after engine change (#7330) 2025-06-02 18:05:46 -04:00
faf4d42b6a Update getSketchExprsFromSelection to use codeRef.pathToNode (#6737) 2025-06-02 16:49:41 -04:00
8dd2a86191 Make sweep tests more point-and-click like and clean up pathToNode retrieval (#6963)
WIP: udpate sweep point-and-click tests and mess with pathToNode
Fixes #6952
2025-06-02 16:49:20 -04:00
13c4de77c3 Fix broken WASM test (#7324)
Previous PR (#7321) was set to automerge, but apparently the npm-unit-test
CI target doesn't block merges if it fails. Fixed now.
2025-06-02 15:56:49 -04:00
e29ee9d1ca KCL: Use named fields for KclError (#7321)
We've changed the unnamed field of `KclError` variants to a named called `details`.

To clarify: previously KCL errors looked like this:

```rust
pub enum KclError {
    Lexical(KclErrorDetails),
    Syntax(KclErrorDetails),
```

Now they look like this:

```rust
pub enum KclError {
    Lexical { details: KclErrorDetails },
    Syntax { details: KclErrorDetails },
}
```

This lets us more easily add fields to the errors. For example, in the UndefinedValue case, adding a field for what the undefined name was. This PR refactors the code to make my PR in https://github.com/KittyCAD/modeling-app/pull/7309 much easier.

Pure refactor, should not change any behaviour.
2025-06-02 14:30:57 -04:00
123 changed files with 4260 additions and 8150 deletions

View File

@ -8,7 +8,7 @@ layout: manual
Extract the 'x' axis value of the last line segment in the provided 2-d sketch. Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegX(@sketch: Sketch): number lastSegX(@sketch: Sketch): number(Length)
``` ```
@ -17,11 +17,11 @@ lastSegX(@sketch: Sketch): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Extract the 'y' axis value of the last line segment in the provided 2-d sketch. Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
```kcl ```kcl
lastSegY(@sketch: Sketch): number lastSegY(@sketch: Sketch): number(Length)
``` ```
@ -17,11 +17,11 @@ lastSegY(@sketch: Sketch): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried | Yes | | `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch whose line segment is being queried. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Compute the angle (in degrees) of the provided line segment. Compute the angle (in degrees) of the provided line segment.
```kcl ```kcl
segAng(@tag: TagIdentifier): number segAng(@tag: tag): number(Angle)
``` ```
@ -17,11 +17,11 @@ segAng(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment. Compute the ending point of the provided line segment.
```kcl ```kcl
segEnd(@tag: TagIdentifier): Point2d segEnd(@tag: tag): Point2d
``` ```
@ -17,7 +17,7 @@ segEnd(@tag: TagIdentifier): Point2d
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
@ -39,9 +39,9 @@ cube = startSketchOn(XY)
fn cylinder(radius, tag) { fn cylinder(radius, tag) {
return startSketchOn(XY) return startSketchOn(XY)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> circle(radius = radius, center = segEnd(tag)) |> circle(radius = radius, center = segEnd(tag) )
|> extrude(length = radius) |> extrude(length = radius)
} }
cylinder(radius = 1, tag = line1) cylinder(radius = 1, tag = line1)

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'x' axis. Compute the ending point of the provided line segment along the 'x' axis.
```kcl ```kcl
segEndX(@tag: TagIdentifier): number segEndX(@tag: tag): number(Length)
``` ```
@ -17,11 +17,11 @@ segEndX(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Compute the ending point of the provided line segment along the 'y' axis. Compute the ending point of the provided line segment along the 'y' axis.
```kcl ```kcl
segEndY(@tag: TagIdentifier): number segEndY(@tag: tag): number(Length)
``` ```
@ -17,11 +17,11 @@ segEndY(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Compute the length of the provided line segment. Compute the length of the provided line segment.
```kcl ```kcl
segLen(@tag: TagIdentifier): number segLen(@tag: tag): number(Length)
``` ```
@ -17,11 +17,11 @@ segLen(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
@ -29,9 +29,16 @@ segLen(@tag: TagIdentifier): number
```kcl ```kcl
exampleSketch = startSketchOn(XZ) exampleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> angledLine(angle = 60, length = 10, tag = $thing) |> angledLine(
angle = 60,
length = 10,
tag = $thing,
)
|> tangentialArc(angle = -120, radius = 5) |> tangentialArc(angle = -120, radius = 5)
|> angledLine(angle = -60, length = segLen(thing)) |> angledLine(
angle = -60,
length = segLen(thing),
)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment. Compute the starting point of the provided line segment.
```kcl ```kcl
segStart(@tag: TagIdentifier): Point2d segStart(@tag: tag): Point2d
``` ```
@ -17,7 +17,7 @@ segStart(@tag: TagIdentifier): Point2d
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
@ -39,9 +39,9 @@ cube = startSketchOn(XY)
fn cylinder(radius, tag) { fn cylinder(radius, tag) {
return startSketchOn(XY) return startSketchOn(XY)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> circle(radius = radius, center = segStart(tag)) |> circle( radius = radius, center = segStart(tag) )
|> extrude(length = radius) |> extrude(length = radius)
} }
cylinder(radius = 1, tag = line1) cylinder(radius = 1, tag = line1)

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'x' axis. Compute the starting point of the provided line segment along the 'x' axis.
```kcl ```kcl
segStartX(@tag: TagIdentifier): number segStartX(@tag: tag): number(Length)
``` ```
@ -17,11 +17,11 @@ segStartX(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples

View File

@ -8,7 +8,7 @@ layout: manual
Compute the starting point of the provided line segment along the 'y' axis. Compute the starting point of the provided line segment along the 'y' axis.
```kcl ```kcl
segStartY(@tag: TagIdentifier): number segStartY(@tag: tag): number(Length)
``` ```
@ -17,11 +17,11 @@ segStartY(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Length)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
@ -32,7 +32,7 @@ exampleSketch = startSketchOn(XZ)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 3], tag = $thing) |> line(end = [0, 3], tag = $thing)
|> line(end = [-10, 0]) |> line(end = [-10, 0])
|> line(end = [0, 20 - segStartY(thing)]) |> line(end = [0, 20-segStartY(thing)])
|> line(end = [-10, 0]) |> line(end = [-10, 0])
|> close() |> close()

View File

@ -8,7 +8,7 @@ layout: manual
Returns the angle coming out of the end of the segment in degrees. Returns the angle coming out of the end of the segment in degrees.
```kcl ```kcl
tangentToEnd(@tag: TagIdentifier): number tangentToEnd(@tag: tag): number(Angle)
``` ```
@ -17,11 +17,11 @@ tangentToEnd(@tag: TagIdentifier): number
| Name | Type | Description | Required | | Name | Type | Description | Required |
|----------|------|-------------|----------| |----------|------|-------------|----------|
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The line segment being queried by its tag | Yes | | [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
### Returns ### Returns
[`number`](/docs/kcl-std/types/std-types-number) - A number. [`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples ### Examples
@ -32,7 +32,10 @@ pillSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> line(end = [20, 0]) |> line(end = [20, 0])
|> tangentialArc(end = [0, 10], tag = $arc1) |> tangentialArc(end = [0, 10], tag = $arc1)
|> angledLine(angle = tangentToEnd(arc1), length = 20) |> angledLine(
angle = tangentToEnd(arc1),
length = 20,
)
|> tangentialArc(end = [0, -10]) |> tangentialArc(end = [0, -10])
|> close() |> close()
@ -47,7 +50,10 @@ pillSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> tangentialArc(endAbsolute = [10, 20], tag = $arc1) |> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
|> angledLine(angle = tangentToEnd(arc1), length = 20) |> angledLine(
angle = tangentToEnd(arc1),
length = 20,
)
|> tangentialArc(end = [-10, 0]) |> tangentialArc(end = [-10, 0])
|> close() |> close()
@ -60,7 +66,10 @@ pillExtrude = extrude(pillSketch, length = 10)
rectangleSketch = startSketchOn(XZ) rectangleSketch = startSketchOn(XZ)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> line(end = [10, 0], tag = $seg1) |> line(end = [10, 0], tag = $seg1)
|> angledLine(angle = tangentToEnd(seg1), length = 10) |> angledLine(
angle = tangentToEnd(seg1),
length = 10,
)
|> line(end = [0, 10]) |> line(end = [0, 10])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close() |> close()
@ -73,7 +82,11 @@ rectangleExtrude = extrude(rectangleSketch, length = 10)
```kcl ```kcl
bottom = startSketchOn(XY) bottom = startSketchOn(XY)
|> startProfile(at = [0, 0]) |> startProfile(at = [0, 0])
|> arc(endAbsolute = [10, 10], interiorAbsolute = [5, 1], tag = $arc1) |> arc(
endAbsolute = [10, 10],
interiorAbsolute = [5, 1],
tag = $arc1,
)
|> angledLine(angle = tangentToEnd(arc1), length = 20) |> angledLine(angle = tangentToEnd(arc1), length = 20)
|> close() |> close()
``` ```
@ -82,7 +95,7 @@ bottom = startSketchOn(XY)
```kcl ```kcl
circSketch = startSketchOn(XY) circSketch = startSketchOn(XY)
|> circle(center = [0, 0], radius = 3, tag = $circ) |> circle(center = [0, 0], radius= 3, tag = $circ)
triangleSketch = startSketchOn(XY) triangleSketch = startSketchOn(XY)
|> startProfile(at = [-5, 0]) |> startProfile(at = [-5, 0])

View File

@ -60,8 +60,8 @@ layout: manual
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge) * [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)
* [`getPreviousAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge) * [`getPreviousAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge)
* [`involuteCircular`](/docs/kcl-std/involuteCircular) * [`involuteCircular`](/docs/kcl-std/involuteCircular)
* [`lastSegX`](/docs/kcl-std/lastSegX) * [`lastSegX`](/docs/kcl-std/functions/std-sketch-lastSegX)
* [`lastSegY`](/docs/kcl-std/lastSegY) * [`lastSegY`](/docs/kcl-std/functions/std-sketch-lastSegY)
* [`line`](/docs/kcl-std/line) * [`line`](/docs/kcl-std/line)
* [`loft`](/docs/kcl-std/functions/std-sketch-loft) * [`loft`](/docs/kcl-std/functions/std-sketch-loft)
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d) * [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
@ -72,19 +72,19 @@ layout: manual
* [`profileStartX`](/docs/kcl-std/profileStartX) * [`profileStartX`](/docs/kcl-std/profileStartX)
* [`profileStartY`](/docs/kcl-std/profileStartY) * [`profileStartY`](/docs/kcl-std/profileStartY)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve) * [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/segAng) * [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/segEnd) * [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)
* [`segEndX`](/docs/kcl-std/segEndX) * [`segEndX`](/docs/kcl-std/functions/std-sketch-segEndX)
* [`segEndY`](/docs/kcl-std/segEndY) * [`segEndY`](/docs/kcl-std/functions/std-sketch-segEndY)
* [`segLen`](/docs/kcl-std/segLen) * [`segLen`](/docs/kcl-std/functions/std-sketch-segLen)
* [`segStart`](/docs/kcl-std/segStart) * [`segStart`](/docs/kcl-std/functions/std-sketch-segStart)
* [`segStartX`](/docs/kcl-std/segStartX) * [`segStartX`](/docs/kcl-std/functions/std-sketch-segStartX)
* [`segStartY`](/docs/kcl-std/segStartY) * [`segStartY`](/docs/kcl-std/functions/std-sketch-segStartY)
* [`startProfile`](/docs/kcl-std/startProfile) * [`startProfile`](/docs/kcl-std/startProfile)
* [`startSketchOn`](/docs/kcl-std/startSketchOn) * [`startSketchOn`](/docs/kcl-std/startSketchOn)
* [`subtract2d`](/docs/kcl-std/subtract2d) * [`subtract2d`](/docs/kcl-std/subtract2d)
* [`sweep`](/docs/kcl-std/functions/std-sketch-sweep) * [`sweep`](/docs/kcl-std/functions/std-sketch-sweep)
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd) * [`tangentToEnd`](/docs/kcl-std/functions/std-sketch-tangentToEnd)
* [`tangentialArc`](/docs/kcl-std/tangentialArc) * [`tangentialArc`](/docs/kcl-std/tangentialArc)
* [`xLine`](/docs/kcl-std/xLine) * [`xLine`](/docs/kcl-std/xLine)
* [`yLine`](/docs/kcl-std/yLine) * [`yLine`](/docs/kcl-std/yLine)

View File

@ -25,8 +25,8 @@ This module contains functions for creating and manipulating sketches, and makin
* [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge) * [`getOppositeEdge`](/docs/kcl-std/functions/std-sketch-getOppositeEdge)
* [`getPreviousAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge) * [`getPreviousAdjacentEdge`](/docs/kcl-std/functions/std-sketch-getPreviousAdjacentEdge)
* [`involuteCircular`](/docs/kcl-std/involuteCircular) * [`involuteCircular`](/docs/kcl-std/involuteCircular)
* [`lastSegX`](/docs/kcl-std/lastSegX) * [`lastSegX`](/docs/kcl-std/functions/std-sketch-lastSegX)
* [`lastSegY`](/docs/kcl-std/lastSegY) * [`lastSegY`](/docs/kcl-std/functions/std-sketch-lastSegY)
* [`line`](/docs/kcl-std/line) * [`line`](/docs/kcl-std/line)
* [`loft`](/docs/kcl-std/functions/std-sketch-loft) * [`loft`](/docs/kcl-std/functions/std-sketch-loft)
* [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d) * [`patternCircular2d`](/docs/kcl-std/functions/std-sketch-patternCircular2d)
@ -37,19 +37,19 @@ This module contains functions for creating and manipulating sketches, and makin
* [`profileStartX`](/docs/kcl-std/profileStartX) * [`profileStartX`](/docs/kcl-std/profileStartX)
* [`profileStartY`](/docs/kcl-std/profileStartY) * [`profileStartY`](/docs/kcl-std/profileStartY)
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve) * [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
* [`segAng`](/docs/kcl-std/segAng) * [`segAng`](/docs/kcl-std/functions/std-sketch-segAng)
* [`segEnd`](/docs/kcl-std/segEnd) * [`segEnd`](/docs/kcl-std/functions/std-sketch-segEnd)
* [`segEndX`](/docs/kcl-std/segEndX) * [`segEndX`](/docs/kcl-std/functions/std-sketch-segEndX)
* [`segEndY`](/docs/kcl-std/segEndY) * [`segEndY`](/docs/kcl-std/functions/std-sketch-segEndY)
* [`segLen`](/docs/kcl-std/segLen) * [`segLen`](/docs/kcl-std/functions/std-sketch-segLen)
* [`segStart`](/docs/kcl-std/segStart) * [`segStart`](/docs/kcl-std/functions/std-sketch-segStart)
* [`segStartX`](/docs/kcl-std/segStartX) * [`segStartX`](/docs/kcl-std/functions/std-sketch-segStartX)
* [`segStartY`](/docs/kcl-std/segStartY) * [`segStartY`](/docs/kcl-std/functions/std-sketch-segStartY)
* [`startProfile`](/docs/kcl-std/startProfile) * [`startProfile`](/docs/kcl-std/startProfile)
* [`startSketchOn`](/docs/kcl-std/startSketchOn) * [`startSketchOn`](/docs/kcl-std/startSketchOn)
* [`subtract2d`](/docs/kcl-std/subtract2d) * [`subtract2d`](/docs/kcl-std/subtract2d)
* [`sweep`](/docs/kcl-std/functions/std-sketch-sweep) * [`sweep`](/docs/kcl-std/functions/std-sketch-sweep)
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd) * [`tangentToEnd`](/docs/kcl-std/functions/std-sketch-tangentToEnd)
* [`tangentialArc`](/docs/kcl-std/tangentialArc) * [`tangentialArc`](/docs/kcl-std/tangentialArc)
* [`xLine`](/docs/kcl-std/xLine) * [`xLine`](/docs/kcl-std/xLine)
* [`yLine`](/docs/kcl-std/yLine) * [`yLine`](/docs/kcl-std/yLine)

File diff suppressed because it is too large Load Diff

View File

@ -1766,7 +1766,7 @@ loft001 = loft([sketch001, sketch002])
sketch001 = startSketchOn(YZ) sketch001 = startSketchOn(YZ)
profile001 = circle(sketch001, center = [0, 0], radius = 500) profile001 = circle(sketch001, center = [0, 0], radius = 500)
sketch002 = startSketchOn(XZ) sketch002 = startSketchOn(XZ)
|> startProfile(at = [0, 0]) profile002 = startProfile(sketch002, at = [0, 0])
|> xLine(length = -500) |> xLine(length = -500)
|> tangentialArc(endAbsolute = [-2000, 500])`, |> tangentialArc(endAbsolute = [-2000, 500])`,
}, },
@ -1782,7 +1782,7 @@ profile001 = startProfile(sketch001, at = [-400, -400])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
sketch002 = startSketchOn(XZ) sketch002 = startSketchOn(XZ)
|> startProfile(at = [0, 0]) profile002 = startProfile(sketch002, at = [0, 0])
|> xLine(length = -500) |> xLine(length = -500)
|> tangentialArc(endAbsolute = [-2000, 500])`, |> tangentialArc(endAbsolute = [-2000, 500])`,
}, },
@ -1810,9 +1810,9 @@ sketch002 = startSketchOn(XZ)
testPoint.x - 50, testPoint.x - 50,
testPoint.y testPoint.y
) )
const sweepDeclaration = 'sweep001 = sweep(profile001, path = sketch002)' const sweepDeclaration = 'sweep001 = sweep(profile001, path = profile002)'
const editedSweepDeclaration = const editedSweepDeclaration =
'sweep001 = sweep(profile001, path = sketch002, sectional = true)' 'sweep001 = sweep(profile001, path = profile002, sectional = true)'
await test.step(`Look for sketch001`, async () => { await test.step(`Look for sketch001`, async () => {
await toolbar.closePane('code') await toolbar.closePane('code')

View File

@ -11,24 +11,20 @@ filletRadius = 0.5
plateThickness = .5 plateThickness = .5
centerHoleDiameter = 2 centerHoleDiameter = 2
// Create a function that defines the body width and length of the mounting plate. Tag the corners so they can be passed through the fillet function.
fn rectShape(pos, w, l) {
rr = startSketchOn(XY)
|> startProfile(at = [pos[0] - (w / 2), pos[1] - (l / 2)])
|> line(endAbsolute = [pos[0] + w / 2, pos[1] - (l / 2)], tag = $edge1)
|> line(endAbsolute = [pos[0] + w / 2, pos[1] + l / 2], tag = $edge2)
|> line(endAbsolute = [pos[0] - (w / 2), pos[1] + l / 2], tag = $edge3)
|> close(tag = $edge4)
return rr
}
// Define the hole radius and x, y location constants // Define the hole radius and x, y location constants
holeRadius = .25 holeRadius = .25
holeIndex = .75 holeIndex = .75
sketch001 = startSketchOn(XY)
rectShape = startProfile(sketch001, at = [-plateWidth / 2, plateLength / 2])
|> angledLine(angle = 0, length = plateWidth, tag = $basePlateEdge1)
|> angledLine(angle = segAng(basePlateEdge1) - 90, length = plateLength, tag = $basePlateEdge2)
|> angledLine(angle = segAng(basePlateEdge1), length = -segLen(basePlateEdge1), tag = $basePlateEdge3)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $basePlateEdge4)
|> close()
// Create the mounting plate extrusion, holes, and fillets // Create the mounting plate extrusion, holes, and fillets
rs = rectShape(pos = [0, 0], w = plateWidth, l = plateLength) part = rectShape
part = rs
|> subtract2d(tool = circle( |> subtract2d(tool = circle(
center = [ center = [
-plateWidth / 2 + holeIndex, -plateWidth / 2 + holeIndex,
@ -62,9 +58,9 @@ part = rs
|> fillet( |> fillet(
radius = filletRadius, radius = filletRadius,
tags = [ tags = [
getPreviousAdjacentEdge(rs.tags.edge1), getCommonEdge(faces = [basePlateEdge3, basePlateEdge2]),
getPreviousAdjacentEdge(rs.tags.edge2), getCommonEdge(faces = [basePlateEdge4, basePlateEdge3]),
getPreviousAdjacentEdge(rs.tags.edge3), getCommonEdge(faces = [basePlateEdge4, basePlateEdge1]),
getPreviousAdjacentEdge(rs.tags.edge4) getCommonEdge(faces = [basePlateEdge2, basePlateEdge1])
], ],
) )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -134,6 +134,21 @@ pub const TEST_NAMES: &[&str] = &[
"std-sketch-patternLinear2d-1", "std-sketch-patternLinear2d-1",
"std-sketch-patternCircular2d-0", "std-sketch-patternCircular2d-0",
"std-sketch-circleThreePoint-0", "std-sketch-circleThreePoint-0",
"std-sketch-segStart-0",
"std-sketch-segStartX-0",
"std-sketch-segStartY-0",
"std-sketch-segEnd-0",
"std-sketch-segEndX-0",
"std-sketch-segEndY-0",
"std-sketch-lastSegX-0",
"std-sketch-lastSegY-0",
"std-sketch-segAng-0",
"std-sketch-segLen-0",
"std-sketch-tangentToEnd-0",
"std-sketch-tangentToEnd-1",
"std-sketch-tangentToEnd-2",
"std-sketch-tangentToEnd-3",
"std-sketch-tangentToEnd-4",
"std-solid-appearance-0", "std-solid-appearance-0",
"std-solid-appearance-1", "std-solid-appearance-1",
"std-solid-appearance-2", "std-solid-appearance-2",

View File

@ -439,7 +439,7 @@ impl EngineManager for EngineConnection {
request_sent: tx, request_sent: tx,
}) })
.await .await
.map_err(|e| KclError::Engine(KclErrorDetails::new(format!("Failed to send debug: {}", e), vec![])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(format!("Failed to send debug: {}", e), vec![])))?;
let _ = rx.await; let _ = rx.await;
Ok(()) Ok(())
@ -474,7 +474,7 @@ impl EngineManager for EngineConnection {
}) })
.await .await
.map_err(|e| { .map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to send modeling command: {}", e), format!("Failed to send modeling command: {}", e),
vec![source_range], vec![source_range],
)) ))
@ -483,13 +483,13 @@ impl EngineManager for EngineConnection {
// Wait for the request to be sent. // Wait for the request to be sent.
rx.await rx.await
.map_err(|e| { .map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("could not send request to the engine actor: {e}"), format!("could not send request to the engine actor: {e}"),
vec![source_range], vec![source_range],
)) ))
})? })?
.map_err(|e| { .map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("could not send request to the engine: {e}"), format!("could not send request to the engine: {e}"),
vec![source_range], vec![source_range],
)) ))
@ -516,12 +516,12 @@ impl EngineManager for EngineConnection {
// Check if we have any pending errors. // Check if we have any pending errors.
let pe = self.pending_errors.read().await; let pe = self.pending_errors.read().await;
if !pe.is_empty() { if !pe.is_empty() {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
pe.join(", ").to_string(), pe.join(", ").to_string(),
vec![source_range], vec![source_range],
))); )));
} else { } else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
"Modeling command failed: websocket closed early".to_string(), "Modeling command failed: websocket closed early".to_string(),
vec![source_range], vec![source_range],
))); )));
@ -543,7 +543,7 @@ impl EngineManager for EngineConnection {
} }
} }
Err(KclError::Engine(KclErrorDetails::new( Err(KclError::new_engine(KclErrorDetails::new(
format!("Modeling command timed out `{}`", id), format!("Modeling command timed out `{}`", id),
vec![source_range], vec![source_range],
))) )))

View File

@ -147,19 +147,19 @@ impl EngineConnection {
id_to_source_range: HashMap<uuid::Uuid, SourceRange>, id_to_source_range: HashMap<uuid::Uuid, SourceRange>,
) -> Result<(), KclError> { ) -> Result<(), KclError> {
let source_range_str = serde_json::to_string(&source_range).map_err(|e| { let source_range_str = serde_json::to_string(&source_range).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize source range: {:?}", e), format!("Failed to serialize source range: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let cmd_str = serde_json::to_string(&cmd).map_err(|e| { let cmd_str = serde_json::to_string(&cmd).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize modeling command: {:?}", e), format!("Failed to serialize modeling command: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let id_to_source_range_str = serde_json::to_string(&id_to_source_range).map_err(|e| { let id_to_source_range_str = serde_json::to_string(&id_to_source_range).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize id to source range: {:?}", e), format!("Failed to serialize id to source range: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -167,7 +167,7 @@ impl EngineConnection {
self.manager self.manager
.fire_modeling_cmd_from_wasm(id.to_string(), source_range_str, cmd_str, id_to_source_range_str) .fire_modeling_cmd_from_wasm(id.to_string(), source_range_str, cmd_str, id_to_source_range_str)
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
Ok(()) Ok(())
} }
@ -180,19 +180,19 @@ impl EngineConnection {
id_to_source_range: HashMap<uuid::Uuid, SourceRange>, id_to_source_range: HashMap<uuid::Uuid, SourceRange>,
) -> Result<WebSocketResponse, KclError> { ) -> Result<WebSocketResponse, KclError> {
let source_range_str = serde_json::to_string(&source_range).map_err(|e| { let source_range_str = serde_json::to_string(&source_range).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize source range: {:?}", e), format!("Failed to serialize source range: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let cmd_str = serde_json::to_string(&cmd).map_err(|e| { let cmd_str = serde_json::to_string(&cmd).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize modeling command: {:?}", e), format!("Failed to serialize modeling command: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let id_to_source_range_str = serde_json::to_string(&id_to_source_range).map_err(|e| { let id_to_source_range_str = serde_json::to_string(&id_to_source_range).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to serialize id to source range: {:?}", e), format!("Failed to serialize id to source range: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -201,7 +201,7 @@ impl EngineConnection {
let promise = self let promise = self
.manager .manager
.send_modeling_cmd_from_wasm(id.to_string(), source_range_str, cmd_str, id_to_source_range_str) .send_modeling_cmd_from_wasm(id.to_string(), source_range_str, cmd_str, id_to_source_range_str)
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
let value = crate::wasm::JsFuture::from(promise).await.map_err(|e| { let value = crate::wasm::JsFuture::from(promise).await.map_err(|e| {
// Try to parse the error as an engine error. // Try to parse the error as an engine error.
@ -209,7 +209,7 @@ impl EngineConnection {
if let Ok(kittycad_modeling_cmds::websocket::FailureWebSocketResponse { errors, .. }) = if let Ok(kittycad_modeling_cmds::websocket::FailureWebSocketResponse { errors, .. }) =
serde_json::from_str(&err_str) serde_json::from_str(&err_str)
{ {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
errors.iter().map(|e| e.message.clone()).collect::<Vec<_>>().join("\n"), errors.iter().map(|e| e.message.clone()).collect::<Vec<_>>().join("\n"),
vec![source_range], vec![source_range],
)) ))
@ -218,7 +218,7 @@ impl EngineConnection {
{ {
if let Some(data) = data.first() { if let Some(data) = data.first() {
// It could also be an array of responses. // It could also be an array of responses.
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
data.errors data.errors
.iter() .iter()
.map(|e| e.message.clone()) .map(|e| e.message.clone())
@ -227,13 +227,13 @@ impl EngineConnection {
vec![source_range], vec![source_range],
)) ))
} else { } else {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
"Received empty response from engine".into(), "Received empty response from engine".into(),
vec![source_range], vec![source_range],
)) ))
} }
} else { } else {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to wait for promise from send modeling command: {:?}", e), format!("Failed to wait for promise from send modeling command: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -241,7 +241,7 @@ impl EngineConnection {
})?; })?;
if value.is_null() || value.is_undefined() { if value.is_null() || value.is_undefined() {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
"Received null or undefined response from engine".into(), "Received null or undefined response from engine".into(),
vec![source_range], vec![source_range],
))); )));
@ -251,7 +251,7 @@ impl EngineConnection {
let data = js_sys::Uint8Array::from(value); let data = js_sys::Uint8Array::from(value);
let ws_result: WebSocketResponse = bson::from_slice(&data.to_vec()).map_err(|e| { let ws_result: WebSocketResponse = bson::from_slice(&data.to_vec()).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to deserialize bson response from engine: {:?}", e), format!("Failed to deserialize bson response from engine: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -308,10 +308,10 @@ impl crate::engine::EngineManager for EngineConnection {
let promise = self let promise = self
.manager .manager
.start_new_session() .start_new_session()
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
crate::wasm::JsFuture::from(promise).await.map_err(|e| { crate::wasm::JsFuture::from(promise).await.map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to wait for promise from start new session: {:?}", e), format!("Failed to wait for promise from start new session: {:?}", e),
vec![source_range], vec![source_range],
)) ))

View File

@ -276,7 +276,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
{ {
let duration = instant::Duration::from_millis(1); let duration = instant::Duration::from_millis(1);
wasm_timer::Delay::new(duration).await.map_err(|err| { wasm_timer::Delay::new(duration).await.map_err(|err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Failed to sleep: {:?}", err), format!("Failed to sleep: {:?}", err),
vec![source_range], vec![source_range],
)) ))
@ -293,7 +293,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
return Ok(response); return Ok(response);
} }
Err(KclError::Engine(KclErrorDetails::new( Err(KclError::new_engine(KclErrorDetails::new(
"async command timed out".to_string(), "async command timed out".to_string(),
vec![source_range], vec![source_range],
))) )))
@ -547,7 +547,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
id_to_source_range.insert(Uuid::from(*cmd_id), *range); id_to_source_range.insert(Uuid::from(*cmd_id), *range);
} }
_ => { _ => {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!("The request is not a modeling command: {:?}", req), format!("The request is not a modeling command: {:?}", req),
vec![*range], vec![*range],
))); )));
@ -595,7 +595,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
self.parse_batch_responses(last_id.into(), id_to_source_range, responses) self.parse_batch_responses(last_id.into(), id_to_source_range, responses)
} else { } else {
// We should never get here. // We should never get here.
Err(KclError::Engine(KclErrorDetails::new( Err(KclError::new_engine(KclErrorDetails::new(
format!("Failed to get batch response: {:?}", response), format!("Failed to get batch response: {:?}", response),
vec![source_range], vec![source_range],
))) )))
@ -610,7 +610,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
// request so we need the original request source range in case the engine returns // request so we need the original request source range in case the engine returns
// an error. // an error.
let source_range = id_to_source_range.get(cmd_id.as_ref()).cloned().ok_or_else(|| { let source_range = id_to_source_range.get(cmd_id.as_ref()).cloned().ok_or_else(|| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to get source range for command ID: {:?}", cmd_id), format!("Failed to get source range for command ID: {:?}", cmd_id),
vec![], vec![],
)) ))
@ -620,7 +620,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
.await?; .await?;
self.parse_websocket_response(ws_resp, source_range) self.parse_websocket_response(ws_resp, source_range)
} }
_ => Err(KclError::Engine(KclErrorDetails::new( _ => Err(KclError::new_engine(KclErrorDetails::new(
format!("The final request is not a modeling command: {:?}", final_req), format!("The final request is not a modeling command: {:?}", final_req),
vec![source_range], vec![source_range],
))), ))),
@ -729,7 +729,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
for (name, plane_id, color) in plane_settings { for (name, plane_id, color) in plane_settings {
let info = DEFAULT_PLANE_INFO.get(&name).ok_or_else(|| { let info = DEFAULT_PLANE_INFO.get(&name).ok_or_else(|| {
// We should never get here. // We should never get here.
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to get default plane info for: {:?}", name), format!("Failed to get default plane info for: {:?}", name),
vec![source_range], vec![source_range],
)) ))
@ -763,7 +763,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
WebSocketResponse::Success(success) => Ok(success.resp), WebSocketResponse::Success(success) => Ok(success.resp),
WebSocketResponse::Failure(fail) => { WebSocketResponse::Failure(fail) => {
let _request_id = fail.request_id; let _request_id = fail.request_id;
Err(KclError::Engine(KclErrorDetails::new( Err(KclError::new_engine(KclErrorDetails::new(
fail.errors fail.errors
.iter() .iter()
.map(|e| e.message.clone()) .map(|e| e.message.clone())
@ -805,12 +805,12 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
BatchResponse::Failure { errors } => { BatchResponse::Failure { errors } => {
// Get the source range for the command. // Get the source range for the command.
let source_range = id_to_source_range.get(cmd_id).cloned().ok_or_else(|| { let source_range = id_to_source_range.get(cmd_id).cloned().ok_or_else(|| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to get source range for command ID: {:?}", cmd_id), format!("Failed to get source range for command ID: {:?}", cmd_id),
vec![], vec![],
)) ))
})?; })?;
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
errors.iter().map(|e| e.message.clone()).collect::<Vec<_>>().join("\n"), errors.iter().map(|e| e.message.clone()).collect::<Vec<_>>().join("\n"),
vec![source_range], vec![source_range],
))); )));
@ -820,7 +820,7 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
// Return an error that we did not get an error or the response we wanted. // Return an error that we did not get an error or the response we wanted.
// This should never happen but who knows. // This should never happen but who knows.
Err(KclError::Engine(KclErrorDetails::new( Err(KclError::new_engine(KclErrorDetails::new(
format!("Failed to find response for command ID: {:?}", id), format!("Failed to find response for command ID: {:?}", id),
vec![], vec![],
))) )))

View File

@ -91,30 +91,33 @@ pub enum ConnectionError {
#[ts(export)] #[ts(export)]
#[serde(tag = "kind", rename_all = "snake_case")] #[serde(tag = "kind", rename_all = "snake_case")]
pub enum KclError { pub enum KclError {
#[error("lexical: {0:?}")] #[error("lexical: {details:?}")]
Lexical(KclErrorDetails), Lexical { details: KclErrorDetails },
#[error("syntax: {0:?}")] #[error("syntax: {details:?}")]
Syntax(KclErrorDetails), Syntax { details: KclErrorDetails },
#[error("semantic: {0:?}")] #[error("semantic: {details:?}")]
Semantic(KclErrorDetails), Semantic { details: KclErrorDetails },
#[error("import cycle: {0:?}")] #[error("import cycle: {details:?}")]
ImportCycle(KclErrorDetails), ImportCycle { details: KclErrorDetails },
#[error("type: {0:?}")] #[error("type: {details:?}")]
Type(KclErrorDetails), Type { details: KclErrorDetails },
#[error("i/o: {0:?}")] #[error("i/o: {details:?}")]
Io(KclErrorDetails), Io { details: KclErrorDetails },
#[error("unexpected: {0:?}")] #[error("unexpected: {details:?}")]
Unexpected(KclErrorDetails), Unexpected { details: KclErrorDetails },
#[error("value already defined: {0:?}")] #[error("value already defined: {details:?}")]
ValueAlreadyDefined(KclErrorDetails), ValueAlreadyDefined { details: KclErrorDetails },
#[error("undefined value: {0:?}")] #[error("undefined value: {details:?}")]
UndefinedValue(KclErrorDetails), UndefinedValue {
#[error("invalid expression: {0:?}")] details: KclErrorDetails,
InvalidExpression(KclErrorDetails), name: Option<String>,
#[error("engine: {0:?}")] },
Engine(KclErrorDetails), #[error("invalid expression: {details:?}")]
#[error("internal error, please report to KittyCAD team: {0:?}")] InvalidExpression { details: KclErrorDetails },
Internal(KclErrorDetails), #[error("engine: {details:?}")]
Engine { details: KclErrorDetails },
#[error("internal error, please report to KittyCAD team: {details:?}")]
Internal { details: KclErrorDetails },
} }
impl From<KclErrorWithOutputs> for KclError { impl From<KclErrorWithOutputs> for KclError {
@ -296,18 +299,18 @@ pub struct ReportWithOutputs {
impl miette::Diagnostic for ReportWithOutputs { impl miette::Diagnostic for ReportWithOutputs {
fn code<'a>(&'a self) -> Option<Box<dyn std::fmt::Display + 'a>> { fn code<'a>(&'a self) -> Option<Box<dyn std::fmt::Display + 'a>> {
let family = match self.error.error { let family = match self.error.error {
KclError::Lexical(_) => "Lexical", KclError::Lexical { .. } => "Lexical",
KclError::Syntax(_) => "Syntax", KclError::Syntax { .. } => "Syntax",
KclError::Semantic(_) => "Semantic", KclError::Semantic { .. } => "Semantic",
KclError::ImportCycle(_) => "ImportCycle", KclError::ImportCycle { .. } => "ImportCycle",
KclError::Type(_) => "Type", KclError::Type { .. } => "Type",
KclError::Io(_) => "I/O", KclError::Io { .. } => "I/O",
KclError::Unexpected(_) => "Unexpected", KclError::Unexpected { .. } => "Unexpected",
KclError::ValueAlreadyDefined(_) => "ValueAlreadyDefined", KclError::ValueAlreadyDefined { .. } => "ValueAlreadyDefined",
KclError::UndefinedValue(_) => "UndefinedValue", KclError::UndefinedValue { .. } => "UndefinedValue",
KclError::InvalidExpression(_) => "InvalidExpression", KclError::InvalidExpression { .. } => "InvalidExpression",
KclError::Engine(_) => "Engine", KclError::Engine { .. } => "Engine",
KclError::Internal(_) => "Internal", KclError::Internal { .. } => "Internal",
}; };
let error_string = format!("KCL {family} error"); let error_string = format!("KCL {family} error");
Some(Box::new(error_string)) Some(Box::new(error_string))
@ -346,18 +349,18 @@ pub struct Report {
impl miette::Diagnostic for Report { impl miette::Diagnostic for Report {
fn code<'a>(&'a self) -> Option<Box<dyn std::fmt::Display + 'a>> { fn code<'a>(&'a self) -> Option<Box<dyn std::fmt::Display + 'a>> {
let family = match self.error { let family = match self.error {
KclError::Lexical(_) => "Lexical", KclError::Lexical { .. } => "Lexical",
KclError::Syntax(_) => "Syntax", KclError::Syntax { .. } => "Syntax",
KclError::Semantic(_) => "Semantic", KclError::Semantic { .. } => "Semantic",
KclError::ImportCycle(_) => "ImportCycle", KclError::ImportCycle { .. } => "ImportCycle",
KclError::Type(_) => "Type", KclError::Type { .. } => "Type",
KclError::Io(_) => "I/O", KclError::Io { .. } => "I/O",
KclError::Unexpected(_) => "Unexpected", KclError::Unexpected { .. } => "Unexpected",
KclError::ValueAlreadyDefined(_) => "ValueAlreadyDefined", KclError::ValueAlreadyDefined { .. } => "ValueAlreadyDefined",
KclError::UndefinedValue(_) => "UndefinedValue", KclError::UndefinedValue { .. } => "UndefinedValue",
KclError::InvalidExpression(_) => "InvalidExpression", KclError::InvalidExpression { .. } => "InvalidExpression",
KclError::Engine(_) => "Engine", KclError::Engine { .. } => "Engine",
KclError::Internal(_) => "Internal", KclError::Internal { .. } => "Internal",
}; };
let error_string = format!("KCL {family} error"); let error_string = format!("KCL {family} error");
Some(Box::new(error_string)) Some(Box::new(error_string))
@ -410,11 +413,53 @@ impl KclErrorDetails {
impl KclError { impl KclError {
pub fn internal(message: String) -> KclError { pub fn internal(message: String) -> KclError {
KclError::Internal(KclErrorDetails { KclError::Internal {
source_ranges: Default::default(), details: KclErrorDetails {
backtrace: Default::default(), source_ranges: Default::default(),
message, backtrace: Default::default(),
}) message,
},
}
}
pub fn new_internal(details: KclErrorDetails) -> KclError {
KclError::Internal { details }
}
pub fn new_import_cycle(details: KclErrorDetails) -> KclError {
KclError::ImportCycle { details }
}
pub fn new_semantic(details: KclErrorDetails) -> KclError {
KclError::Semantic { details }
}
pub fn new_value_already_defined(details: KclErrorDetails) -> KclError {
KclError::ValueAlreadyDefined { details }
}
pub fn new_syntax(details: KclErrorDetails) -> KclError {
KclError::Syntax { details }
}
pub fn new_io(details: KclErrorDetails) -> KclError {
KclError::Io { details }
}
pub fn new_engine(details: KclErrorDetails) -> KclError {
KclError::Engine { details }
}
pub fn new_lexical(details: KclErrorDetails) -> KclError {
KclError::Lexical { details }
}
pub fn new_undefined_value(details: KclErrorDetails, name: Option<String>) -> KclError {
KclError::UndefinedValue { details, name }
}
pub fn new_type(details: KclErrorDetails) -> KclError {
KclError::Type { details }
} }
/// Get the error message. /// Get the error message.
@ -424,88 +469,88 @@ impl KclError {
pub fn error_type(&self) -> &'static str { pub fn error_type(&self) -> &'static str {
match self { match self {
KclError::Lexical(_) => "lexical", KclError::Lexical { .. } => "lexical",
KclError::Syntax(_) => "syntax", KclError::Syntax { .. } => "syntax",
KclError::Semantic(_) => "semantic", KclError::Semantic { .. } => "semantic",
KclError::ImportCycle(_) => "import cycle", KclError::ImportCycle { .. } => "import cycle",
KclError::Type(_) => "type", KclError::Type { .. } => "type",
KclError::Io(_) => "i/o", KclError::Io { .. } => "i/o",
KclError::Unexpected(_) => "unexpected", KclError::Unexpected { .. } => "unexpected",
KclError::ValueAlreadyDefined(_) => "value already defined", KclError::ValueAlreadyDefined { .. } => "value already defined",
KclError::UndefinedValue(_) => "undefined value", KclError::UndefinedValue { .. } => "undefined value",
KclError::InvalidExpression(_) => "invalid expression", KclError::InvalidExpression { .. } => "invalid expression",
KclError::Engine(_) => "engine", KclError::Engine { .. } => "engine",
KclError::Internal(_) => "internal", KclError::Internal { .. } => "internal",
} }
} }
pub fn source_ranges(&self) -> Vec<SourceRange> { pub fn source_ranges(&self) -> Vec<SourceRange> {
match &self { match &self {
KclError::Lexical(e) => e.source_ranges.clone(), KclError::Lexical { details: e } => e.source_ranges.clone(),
KclError::Syntax(e) => e.source_ranges.clone(), KclError::Syntax { details: e } => e.source_ranges.clone(),
KclError::Semantic(e) => e.source_ranges.clone(), KclError::Semantic { details: e } => e.source_ranges.clone(),
KclError::ImportCycle(e) => e.source_ranges.clone(), KclError::ImportCycle { details: e } => e.source_ranges.clone(),
KclError::Type(e) => e.source_ranges.clone(), KclError::Type { details: e } => e.source_ranges.clone(),
KclError::Io(e) => e.source_ranges.clone(), KclError::Io { details: e } => e.source_ranges.clone(),
KclError::Unexpected(e) => e.source_ranges.clone(), KclError::Unexpected { details: e } => e.source_ranges.clone(),
KclError::ValueAlreadyDefined(e) => e.source_ranges.clone(), KclError::ValueAlreadyDefined { details: e } => e.source_ranges.clone(),
KclError::UndefinedValue(e) => e.source_ranges.clone(), KclError::UndefinedValue { details: e, .. } => e.source_ranges.clone(),
KclError::InvalidExpression(e) => e.source_ranges.clone(), KclError::InvalidExpression { details: e } => e.source_ranges.clone(),
KclError::Engine(e) => e.source_ranges.clone(), KclError::Engine { details: e } => e.source_ranges.clone(),
KclError::Internal(e) => e.source_ranges.clone(), KclError::Internal { details: e } => e.source_ranges.clone(),
} }
} }
/// Get the inner error message. /// Get the inner error message.
pub fn message(&self) -> &str { pub fn message(&self) -> &str {
match &self { match &self {
KclError::Lexical(e) => &e.message, KclError::Lexical { details: e } => &e.message,
KclError::Syntax(e) => &e.message, KclError::Syntax { details: e } => &e.message,
KclError::Semantic(e) => &e.message, KclError::Semantic { details: e } => &e.message,
KclError::ImportCycle(e) => &e.message, KclError::ImportCycle { details: e } => &e.message,
KclError::Type(e) => &e.message, KclError::Type { details: e } => &e.message,
KclError::Io(e) => &e.message, KclError::Io { details: e } => &e.message,
KclError::Unexpected(e) => &e.message, KclError::Unexpected { details: e } => &e.message,
KclError::ValueAlreadyDefined(e) => &e.message, KclError::ValueAlreadyDefined { details: e } => &e.message,
KclError::UndefinedValue(e) => &e.message, KclError::UndefinedValue { details: e, .. } => &e.message,
KclError::InvalidExpression(e) => &e.message, KclError::InvalidExpression { details: e } => &e.message,
KclError::Engine(e) => &e.message, KclError::Engine { details: e } => &e.message,
KclError::Internal(e) => &e.message, KclError::Internal { details: e } => &e.message,
} }
} }
pub fn backtrace(&self) -> Vec<BacktraceItem> { pub fn backtrace(&self) -> Vec<BacktraceItem> {
match self { match self {
KclError::Lexical(e) KclError::Lexical { details: e }
| KclError::Syntax(e) | KclError::Syntax { details: e }
| KclError::Semantic(e) | KclError::Semantic { details: e }
| KclError::ImportCycle(e) | KclError::ImportCycle { details: e }
| KclError::Type(e) | KclError::Type { details: e }
| KclError::Io(e) | KclError::Io { details: e }
| KclError::Unexpected(e) | KclError::Unexpected { details: e }
| KclError::ValueAlreadyDefined(e) | KclError::ValueAlreadyDefined { details: e }
| KclError::UndefinedValue(e) | KclError::UndefinedValue { details: e, .. }
| KclError::InvalidExpression(e) | KclError::InvalidExpression { details: e }
| KclError::Engine(e) | KclError::Engine { details: e }
| KclError::Internal(e) => e.backtrace.clone(), | KclError::Internal { details: e } => e.backtrace.clone(),
} }
} }
pub(crate) fn override_source_ranges(&self, source_ranges: Vec<SourceRange>) -> Self { pub(crate) fn override_source_ranges(&self, source_ranges: Vec<SourceRange>) -> Self {
let mut new = self.clone(); let mut new = self.clone();
match &mut new { match &mut new {
KclError::Lexical(e) KclError::Lexical { details: e }
| KclError::Syntax(e) | KclError::Syntax { details: e }
| KclError::Semantic(e) | KclError::Semantic { details: e }
| KclError::ImportCycle(e) | KclError::ImportCycle { details: e }
| KclError::Type(e) | KclError::Type { details: e }
| KclError::Io(e) | KclError::Io { details: e }
| KclError::Unexpected(e) | KclError::Unexpected { details: e }
| KclError::ValueAlreadyDefined(e) | KclError::ValueAlreadyDefined { details: e }
| KclError::UndefinedValue(e) | KclError::UndefinedValue { details: e, .. }
| KclError::InvalidExpression(e) | KclError::InvalidExpression { details: e }
| KclError::Engine(e) | KclError::Engine { details: e }
| KclError::Internal(e) => { | KclError::Internal { details: e } => {
e.backtrace = source_ranges e.backtrace = source_ranges
.iter() .iter()
.map(|s| BacktraceItem { .map(|s| BacktraceItem {
@ -523,18 +568,18 @@ impl KclError {
pub(crate) fn set_last_backtrace_fn_name(&self, last_fn_name: Option<String>) -> Self { pub(crate) fn set_last_backtrace_fn_name(&self, last_fn_name: Option<String>) -> Self {
let mut new = self.clone(); let mut new = self.clone();
match &mut new { match &mut new {
KclError::Lexical(e) KclError::Lexical { details: e }
| KclError::Syntax(e) | KclError::Syntax { details: e }
| KclError::Semantic(e) | KclError::Semantic { details: e }
| KclError::ImportCycle(e) | KclError::ImportCycle { details: e }
| KclError::Type(e) | KclError::Type { details: e }
| KclError::Io(e) | KclError::Io { details: e }
| KclError::Unexpected(e) | KclError::Unexpected { details: e }
| KclError::ValueAlreadyDefined(e) | KclError::ValueAlreadyDefined { details: e }
| KclError::UndefinedValue(e) | KclError::UndefinedValue { details: e, .. }
| KclError::InvalidExpression(e) | KclError::InvalidExpression { details: e }
| KclError::Engine(e) | KclError::Engine { details: e }
| KclError::Internal(e) => { | KclError::Internal { details: e } => {
if let Some(item) = e.backtrace.last_mut() { if let Some(item) = e.backtrace.last_mut() {
item.fn_name = last_fn_name; item.fn_name = last_fn_name;
} }
@ -547,18 +592,18 @@ impl KclError {
pub(crate) fn add_unwind_location(&self, last_fn_name: Option<String>, source_range: SourceRange) -> Self { pub(crate) fn add_unwind_location(&self, last_fn_name: Option<String>, source_range: SourceRange) -> Self {
let mut new = self.clone(); let mut new = self.clone();
match &mut new { match &mut new {
KclError::Lexical(e) KclError::Lexical { details: e }
| KclError::Syntax(e) | KclError::Syntax { details: e }
| KclError::Semantic(e) | KclError::Semantic { details: e }
| KclError::ImportCycle(e) | KclError::ImportCycle { details: e }
| KclError::Type(e) | KclError::Type { details: e }
| KclError::Io(e) | KclError::Io { details: e }
| KclError::Unexpected(e) | KclError::Unexpected { details: e }
| KclError::ValueAlreadyDefined(e) | KclError::ValueAlreadyDefined { details: e }
| KclError::UndefinedValue(e) | KclError::UndefinedValue { details: e, .. }
| KclError::InvalidExpression(e) | KclError::InvalidExpression { details: e }
| KclError::Engine(e) | KclError::Engine { details: e }
| KclError::Internal(e) => { | KclError::Internal { details: e } => {
if let Some(item) = e.backtrace.last_mut() { if let Some(item) = e.backtrace.last_mut() {
item.fn_name = last_fn_name; item.fn_name = last_fn_name;
} }
@ -645,7 +690,7 @@ impl From<String> for KclError {
#[cfg(feature = "pyo3")] #[cfg(feature = "pyo3")]
impl From<pyo3::PyErr> for KclError { impl From<pyo3::PyErr> for KclError {
fn from(error: pyo3::PyErr) -> Self { fn from(error: pyo3::PyErr) -> Self {
KclError::Internal(KclErrorDetails { KclError::new_internal(KclErrorDetails {
source_ranges: vec![], source_ranges: vec![],
backtrace: Default::default(), backtrace: Default::default(),
message: error.to_string(), message: error.to_string(),

View File

@ -70,7 +70,7 @@ pub(super) fn expect_properties<'a>(
) -> Result<&'a [Node<ObjectProperty>], KclError> { ) -> Result<&'a [Node<ObjectProperty>], KclError> {
assert_eq!(annotation.name().unwrap(), for_key); assert_eq!(annotation.name().unwrap(), for_key);
Ok(&**annotation.properties.as_ref().ok_or_else(|| { Ok(&**annotation.properties.as_ref().ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Empty `{for_key}` annotation"), format!("Empty `{for_key}` annotation"),
vec![annotation.as_source_range()], vec![annotation.as_source_range()],
)) ))
@ -84,7 +84,7 @@ pub(super) fn expect_ident(expr: &Expr) -> Result<&str, KclError> {
} }
} }
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
"Unexpected settings value, expected a simple name, e.g., `mm`".to_owned(), "Unexpected settings value, expected a simple name, e.g., `mm`".to_owned(),
vec![expr.into()], vec![expr.into()],
))) )))
@ -98,7 +98,7 @@ pub(super) fn expect_number(expr: &Expr) -> Result<String, KclError> {
} }
} }
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
"Unexpected settings value, expected a number, e.g., `1.0`".to_owned(), "Unexpected settings value, expected a number, e.g., `1.0`".to_owned(),
vec![expr.into()], vec![expr.into()],
))) )))
@ -113,7 +113,7 @@ pub(super) fn get_impl(annotations: &[Node<Annotation>], source_range: SourceRan
if &*p.key.name == IMPL { if &*p.key.name == IMPL {
if let Some(s) = p.value.ident_name() { if let Some(s) = p.value.ident_name() {
return Impl::from_str(s).map(Some).map_err(|_| { return Impl::from_str(s).map(Some).map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Invalid value for {} attribute, expected one of: {}", "Invalid value for {} attribute, expected one of: {}",
IMPL, IMPL,
@ -139,7 +139,7 @@ impl UnitLen {
"inch" | "in" => Ok(UnitLen::Inches), "inch" | "in" => Ok(UnitLen::Inches),
"ft" => Ok(UnitLen::Feet), "ft" => Ok(UnitLen::Feet),
"yd" => Ok(UnitLen::Yards), "yd" => Ok(UnitLen::Yards),
value => Err(KclError::Semantic(KclErrorDetails::new( value => Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Unexpected value for length units: `{value}`; expected one of `mm`, `cm`, `m`, `in`, `ft`, `yd`" "Unexpected value for length units: `{value}`; expected one of `mm`, `cm`, `m`, `in`, `ft`, `yd`"
), ),
@ -154,7 +154,7 @@ impl UnitAngle {
match s { match s {
"deg" => Ok(UnitAngle::Degrees), "deg" => Ok(UnitAngle::Degrees),
"rad" => Ok(UnitAngle::Radians), "rad" => Ok(UnitAngle::Radians),
value => Err(KclError::Semantic(KclErrorDetails::new( value => Err(KclError::new_semantic(KclErrorDetails::new(
format!("Unexpected value for angle units: `{value}`; expected one of `deg`, `rad`"), format!("Unexpected value for angle units: `{value}`; expected one of `deg`, `rad`"),
vec![source_range], vec![source_range],
))), ))),

View File

@ -24,7 +24,7 @@ macro_rules! internal_error {
($range:expr, $($rest:tt)*) => {{ ($range:expr, $($rest:tt)*) => {{
let message = format!($($rest)*); let message = format!($($rest)*);
debug_assert!(false, "{}", &message); debug_assert!(false, "{}", &message);
return Err(KclError::Internal(KclErrorDetails::new(message, vec![$range]))); return Err(KclError::new_internal(KclErrorDetails::new(message, vec![$range])));
}}; }};
} }
@ -949,7 +949,7 @@ fn artifacts_to_update(
ModelingCmd::StartPath(_) => { ModelingCmd::StartPath(_) => {
let mut return_arr = Vec::new(); let mut return_arr = Vec::new();
let current_plane_id = path_to_plane_id_map.get(&artifact_command.cmd_id).ok_or_else(|| { let current_plane_id = path_to_plane_id_map.get(&artifact_command.cmd_id).ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Expected a current plane ID when processing StartPath command, but we have none: {id:?}"), format!("Expected a current plane ID when processing StartPath command, but we have none: {id:?}"),
vec![range], vec![range],
)) ))
@ -1137,7 +1137,7 @@ fn artifacts_to_update(
// TODO: Using the first one. Make sure to revisit this // TODO: Using the first one. Make sure to revisit this
// choice, don't think it matters for now. // choice, don't think it matters for now.
path_id: ArtifactId::new(*loft_cmd.section_ids.first().ok_or_else(|| { path_id: ArtifactId::new(*loft_cmd.section_ids.first().ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Expected at least one section ID in Loft command: {id:?}; cmd={cmd:?}"), format!("Expected at least one section ID in Loft command: {id:?}; cmd={cmd:?}"),
vec![range], vec![range],
)) ))
@ -1180,7 +1180,7 @@ fn artifacts_to_update(
}; };
last_path = Some(path); last_path = Some(path);
let path_sweep_id = path.sweep_id.ok_or_else(|| { let path_sweep_id = path.sweep_id.ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!( format!(
"Expected a sweep ID on the path when processing Solid3dGetExtrusionFaceInfo command, but we have none: {id:?}, {path:?}" "Expected a sweep ID on the path when processing Solid3dGetExtrusionFaceInfo command, but we have none: {id:?}, {path:?}"
), ),
@ -1234,7 +1234,7 @@ fn artifacts_to_update(
continue; continue;
}; };
let path_sweep_id = path.sweep_id.ok_or_else(|| { let path_sweep_id = path.sweep_id.ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!( format!(
"Expected a sweep ID on the path when processing last path's Solid3dGetExtrusionFaceInfo command, but we have none: {id:?}, {path:?}" "Expected a sweep ID on the path when processing last path's Solid3dGetExtrusionFaceInfo command, but we have none: {id:?}, {path:?}"
), ),

View File

@ -131,7 +131,7 @@ impl ExecutorContext {
match statement { match statement {
BodyItem::ImportStatement(import_stmt) => { BodyItem::ImportStatement(import_stmt) => {
if !matches!(body_type, BodyType::Root) { if !matches!(body_type, BodyType::Root) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Imports are only supported at the top-level of a file.".to_owned(), "Imports are only supported at the top-level of a file.".to_owned(),
vec![import_stmt.into()], vec![import_stmt.into()],
))); )));
@ -164,15 +164,18 @@ impl ExecutorContext {
let mut mod_value = mem.get_from(&mod_name, env_ref, import_item.into(), 0).cloned(); let mut mod_value = mem.get_from(&mod_name, env_ref, import_item.into(), 0).cloned();
if value.is_err() && ty.is_err() && mod_value.is_err() { if value.is_err() && ty.is_err() && mod_value.is_err() {
return Err(KclError::UndefinedValue(KclErrorDetails::new( return Err(KclError::new_undefined_value(
format!("{} is not defined in module", import_item.name.name), KclErrorDetails::new(
vec![SourceRange::from(&import_item.name)], format!("{} is not defined in module", import_item.name.name),
))); vec![SourceRange::from(&import_item.name)],
),
None,
));
} }
// Check that the item is allowed to be imported (in at least one namespace). // Check that the item is allowed to be imported (in at least one namespace).
if value.is_ok() && !module_exports.contains(&import_item.name.name) { if value.is_ok() && !module_exports.contains(&import_item.name.name) {
value = Err(KclError::Semantic(KclErrorDetails::new( value = Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.", "Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.",
import_item.name.name import_item.name.name
@ -182,7 +185,7 @@ impl ExecutorContext {
} }
if ty.is_ok() && !module_exports.contains(&ty_name) { if ty.is_ok() && !module_exports.contains(&ty_name) {
ty = Err(KclError::Semantic(KclErrorDetails::new(format!( ty = Err(KclError::new_semantic(KclErrorDetails::new(format!(
"Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.", "Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.",
import_item.name.name import_item.name.name
), ),
@ -190,7 +193,7 @@ impl ExecutorContext {
} }
if mod_value.is_ok() && !module_exports.contains(&mod_name) { if mod_value.is_ok() && !module_exports.contains(&mod_name) {
mod_value = Err(KclError::Semantic(KclErrorDetails::new(format!( mod_value = Err(KclError::new_semantic(KclErrorDetails::new(format!(
"Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.", "Cannot import \"{}\" from module because it is not exported. Add \"export\" before the definition to export it.",
import_item.name.name import_item.name.name
), ),
@ -253,7 +256,7 @@ impl ExecutorContext {
.memory .memory
.get_from(name, env_ref, source_range, 0) .get_from(name, env_ref, source_range, 0)
.map_err(|_err| { .map_err(|_err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("{} is not defined in module (but was exported?)", name), format!("{} is not defined in module (but was exported?)", name),
vec![source_range], vec![source_range],
)) ))
@ -301,7 +304,10 @@ impl ExecutorContext {
let annotations = &variable_declaration.outer_attrs; let annotations = &variable_declaration.outer_attrs;
let value = self // During the evaluation of the variable's LHS, set context that this is all happening inside a variable
// declaration, for the given name. This helps improve user-facing error messages.
exec_state.mod_local.being_declared = Some(variable_declaration.inner.name().to_owned());
let rhs_result = self
.execute_expr( .execute_expr(
&variable_declaration.declaration.init, &variable_declaration.declaration.init,
exec_state, exec_state,
@ -309,10 +315,14 @@ impl ExecutorContext {
annotations, annotations,
StatementKind::Declaration { name: &var_name }, StatementKind::Declaration { name: &var_name },
) )
.await?; .await;
// Declaration over, so unset this context.
exec_state.mod_local.being_declared = None;
let rhs = rhs_result?;
exec_state exec_state
.mut_stack() .mut_stack()
.add(var_name.clone(), value.clone(), source_range)?; .add(var_name.clone(), rhs.clone(), source_range)?;
// Track exports. // Track exports.
if let ItemVisibility::Export = variable_declaration.visibility { if let ItemVisibility::Export = variable_declaration.visibility {
@ -326,7 +336,7 @@ impl ExecutorContext {
} }
} }
// Variable declaration can be the return value of a module. // Variable declaration can be the return value of a module.
last_expr = matches!(body_type, BodyType::Root).then_some(value); last_expr = matches!(body_type, BodyType::Root).then_some(rhs);
} }
BodyItem::TypeDeclaration(ty) => { BodyItem::TypeDeclaration(ty) => {
let metadata = Metadata::from(&**ty); let metadata = Metadata::from(&**ty);
@ -336,7 +346,7 @@ impl ExecutorContext {
let std_path = match &exec_state.mod_local.path { let std_path = match &exec_state.mod_local.path {
ModulePath::Std { value } => value, ModulePath::Std { value } => value,
ModulePath::Local { .. } | ModulePath::Main => { ModulePath::Local { .. } | ModulePath::Main => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"User-defined types are not yet supported.".to_owned(), "User-defined types are not yet supported.".to_owned(),
vec![metadata.source_range], vec![metadata.source_range],
))); )));
@ -352,7 +362,7 @@ impl ExecutorContext {
.mut_stack() .mut_stack()
.add(name_in_mem.clone(), value, metadata.source_range) .add(name_in_mem.clone(), value, metadata.source_range)
.map_err(|_| { .map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Redefinition of type {}.", ty.name.name), format!("Redefinition of type {}.", ty.name.name),
vec![metadata.source_range], vec![metadata.source_range],
)) ))
@ -373,7 +383,7 @@ impl ExecutorContext {
exec_state, exec_state,
metadata.source_range, metadata.source_range,
) )
.map_err(|e| KclError::Semantic(e.into()))?, .map_err(|e| KclError::new_semantic(e.into()))?,
), ),
meta: vec![metadata], meta: vec![metadata],
}; };
@ -382,7 +392,7 @@ impl ExecutorContext {
.mut_stack() .mut_stack()
.add(name_in_mem.clone(), value, metadata.source_range) .add(name_in_mem.clone(), value, metadata.source_range)
.map_err(|_| { .map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Redefinition of type {}.", ty.name.name), format!("Redefinition of type {}.", ty.name.name),
vec![metadata.source_range], vec![metadata.source_range],
)) ))
@ -393,7 +403,7 @@ impl ExecutorContext {
} }
} }
None => { None => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"User-defined types are not yet supported.".to_owned(), "User-defined types are not yet supported.".to_owned(),
vec![metadata.source_range], vec![metadata.source_range],
))) )))
@ -407,7 +417,7 @@ impl ExecutorContext {
let metadata = Metadata::from(return_statement); let metadata = Metadata::from(return_statement);
if matches!(body_type, BodyType::Root) { if matches!(body_type, BodyType::Root) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Cannot return from outside a function.".to_owned(), "Cannot return from outside a function.".to_owned(),
vec![metadata.source_range], vec![metadata.source_range],
))); )));
@ -426,7 +436,7 @@ impl ExecutorContext {
.mut_stack() .mut_stack()
.add(memory::RETURN_NAME.to_owned(), value, metadata.source_range) .add(memory::RETURN_NAME.to_owned(), value, metadata.source_range)
.map_err(|_| { .map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
"Multiple returns from a single function.".to_owned(), "Multiple returns from a single function.".to_owned(),
vec![metadata.source_range], vec![metadata.source_range],
)) ))
@ -531,7 +541,7 @@ impl ExecutorContext {
*cache = Some((val, er, items.clone())); *cache = Some((val, er, items.clone()));
(er, items) (er, items)
}), }),
ModuleRepr::Foreign(geom, _) => Err(KclError::Semantic(KclErrorDetails::new( ModuleRepr::Foreign(geom, _) => Err(KclError::new_semantic(KclErrorDetails::new(
"Cannot import items from foreign modules".to_owned(), "Cannot import items from foreign modules".to_owned(),
vec![geom.source_range], vec![geom.source_range],
))), ))),
@ -605,12 +615,12 @@ impl ExecutorContext {
exec_state.global.mod_loader.leave_module(path); exec_state.global.mod_loader.leave_module(path);
result.map_err(|err| { result.map_err(|err| {
if let KclError::ImportCycle(_) = err { if let KclError::ImportCycle { .. } = err {
// It was an import cycle. Keep the original message. // It was an import cycle. Keep the original message.
err.override_source_ranges(vec![source_range]) err.override_source_ranges(vec![source_range])
} else { } else {
// TODO would be great to have line/column for the underlying error here // TODO would be great to have line/column for the underlying error here
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Error loading imported file ({path}). Open it to view more details.\n {}", "Error loading imported file ({path}). Open it to view more details.\n {}",
err.message() err.message()
@ -677,7 +687,7 @@ impl ExecutorContext {
meta: vec![metadata.to_owned()], meta: vec![metadata.to_owned()],
} }
} else { } else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Rust implementation of functions is restricted to the standard library".to_owned(), "Rust implementation of functions is restricted to the standard library".to_owned(),
vec![metadata.source_range], vec![metadata.source_range],
))); )));
@ -704,7 +714,7 @@ impl ExecutorContext {
"you cannot declare variable {name} as %, because % can only be used in function calls" "you cannot declare variable {name} as %, because % can only be used in function calls"
); );
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
message, message,
vec![pipe_substitution.into()], vec![pipe_substitution.into()],
))); )));
@ -712,7 +722,7 @@ impl ExecutorContext {
StatementKind::Expression => match exec_state.mod_local.pipe_value.clone() { StatementKind::Expression => match exec_state.mod_local.pipe_value.clone() {
Some(x) => x, Some(x) => x,
None => { None => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"cannot use % outside a pipe expression".to_owned(), "cannot use % outside a pipe expression".to_owned(),
vec![pipe_substitution.into()], vec![pipe_substitution.into()],
))); )));
@ -761,7 +771,7 @@ fn apply_ascription(
source_range: SourceRange, source_range: SourceRange,
) -> Result<KclValue, KclError> { ) -> Result<KclValue, KclError> {
let ty = RuntimeType::from_parsed(ty.inner.clone(), exec_state, value.into()) let ty = RuntimeType::from_parsed(ty.inner.clone(), exec_state, value.into())
.map_err(|e| KclError::Semantic(e.into()))?; .map_err(|e| KclError::new_semantic(e.into()))?;
value.coerce(&ty, false, exec_state).map_err(|_| { value.coerce(&ty, false, exec_state).map_err(|_| {
let suggestion = if ty == RuntimeType::length() { let suggestion = if ty == RuntimeType::length() {
@ -771,7 +781,7 @@ fn apply_ascription(
} else { } else {
"" ""
}; };
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"could not coerce value of type {} to type {ty}{suggestion}", "could not coerce value of type {} to type {ty}{suggestion}",
value.human_friendly_type() value.human_friendly_type()
@ -804,7 +814,7 @@ impl Node<Name> {
ctx: &ExecutorContext, ctx: &ExecutorContext,
) -> Result<&'a KclValue, KclError> { ) -> Result<&'a KclValue, KclError> {
if self.abs_path { if self.abs_path {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Absolute paths (names beginning with `::` are not yet supported)".to_owned(), "Absolute paths (names beginning with `::` are not yet supported)".to_owned(),
self.as_source_ranges(), self.as_source_ranges(),
))); )));
@ -825,7 +835,7 @@ impl Node<Name> {
let value = match mem_spec { let value = match mem_spec {
Some((env, exports)) => { Some((env, exports)) => {
if !exports.contains(&p.name) { if !exports.contains(&p.name) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Item {} not found in module's exported items", p.name), format!("Item {} not found in module's exported items", p.name),
p.as_source_ranges(), p.as_source_ranges(),
))); )));
@ -842,7 +852,7 @@ impl Node<Name> {
}; };
let KclValue::Module { value: module_id, .. } = value else { let KclValue::Module { value: module_id, .. } = value else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Identifier in path must refer to a module, found {}", "Identifier in path must refer to a module, found {}",
value.human_friendly_type() value.human_friendly_type()
@ -888,7 +898,7 @@ impl Node<Name> {
// Either item or module is defined, but not exported. // Either item or module is defined, but not exported.
debug_assert!((item_value.is_ok() && !item_exported) || (mod_value.is_ok() && !mod_exported)); debug_assert!((item_value.is_ok() && !item_exported) || (mod_value.is_ok() && !mod_exported));
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("Item {} not found in module's exported items", self.name.name), format!("Item {} not found in module's exported items", self.name.name),
self.name.as_source_ranges(), self.name.as_source_ranges(),
))) )))
@ -913,14 +923,17 @@ impl Node<MemberExpression> {
if let Some(value) = map.get(&property) { if let Some(value) = map.get(&property) {
Ok(value.to_owned()) Ok(value.to_owned())
} else { } else {
Err(KclError::UndefinedValue(KclErrorDetails::new( Err(KclError::new_undefined_value(
format!("Property '{property}' not found in object"), KclErrorDetails::new(
vec![self.clone().into()], format!("Property '{property}' not found in object"),
))) vec![self.clone().into()],
),
None,
))
} }
} }
(KclValue::Object { .. }, Property::String(property), true) => { (KclValue::Object { .. }, Property::String(property), true) => {
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("Cannot index object with string; use dot notation instead, e.g. `obj.{property}`"), format!("Cannot index object with string; use dot notation instead, e.g. `obj.{property}`"),
vec![self.clone().into()], vec![self.clone().into()],
))) )))
@ -928,7 +941,7 @@ impl Node<MemberExpression> {
(KclValue::Object { .. }, p, _) => { (KclValue::Object { .. }, p, _) => {
let t = p.type_name(); let t = p.type_name();
let article = article_for(t); let article = article_for(t);
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("Only strings can be used as the property of an object, but you're using {article} {t}",), format!("Only strings can be used as the property of an object, but you're using {article} {t}",),
vec![self.clone().into()], vec![self.clone().into()],
))) )))
@ -938,10 +951,13 @@ impl Node<MemberExpression> {
if let Some(value) = value_of_arr { if let Some(value) = value_of_arr {
Ok(value.to_owned()) Ok(value.to_owned())
} else { } else {
Err(KclError::UndefinedValue(KclErrorDetails::new( Err(KclError::new_undefined_value(
format!("The array doesn't have any item at index {index}"), KclErrorDetails::new(
vec![self.clone().into()], format!("The array doesn't have any item at index {index}"),
))) vec![self.clone().into()],
),
None,
))
} }
} }
// Singletons and single-element arrays should be interchangeable, but only indexing by 0 should work. // Singletons and single-element arrays should be interchangeable, but only indexing by 0 should work.
@ -950,7 +966,7 @@ impl Node<MemberExpression> {
(KclValue::HomArray { .. }, p, _) => { (KclValue::HomArray { .. }, p, _) => {
let t = p.type_name(); let t = p.type_name();
let article = article_for(t); let article = article_for(t);
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("Only integers >= 0 can be used as the index of an array, but you're using {article} {t}",), format!("Only integers >= 0 can be used as the index of an array, but you're using {article} {t}",),
vec![self.clone().into()], vec![self.clone().into()],
))) )))
@ -971,7 +987,7 @@ impl Node<MemberExpression> {
(being_indexed, _, _) => { (being_indexed, _, _) => {
let t = being_indexed.human_friendly_type(); let t = being_indexed.human_friendly_type();
let article = article_for(&t); let article = article_for(&t);
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("Only arrays can be indexed, but you're trying to index {article} {t}"), format!("Only arrays can be indexed, but you're trying to index {article} {t}"),
vec![self.clone().into()], vec![self.clone().into()],
))) )))
@ -1049,7 +1065,7 @@ impl Node<BinaryExpression> {
meta: _, meta: _,
} = left_value } = left_value
else { else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Cannot apply logical operator to non-boolean value: {}", "Cannot apply logical operator to non-boolean value: {}",
left_value.human_friendly_type() left_value.human_friendly_type()
@ -1062,7 +1078,7 @@ impl Node<BinaryExpression> {
meta: _, meta: _,
} = right_value } = right_value
else { else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Cannot apply logical operator to non-boolean value: {}", "Cannot apply logical operator to non-boolean value: {}",
right_value.human_friendly_type() right_value.human_friendly_type()
@ -1168,7 +1184,7 @@ impl Node<UnaryExpression> {
meta: _, meta: _,
} = value } = value
else { else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Cannot apply unary operator ! to non-boolean value: {}", "Cannot apply unary operator ! to non-boolean value: {}",
value.human_friendly_type() value.human_friendly_type()
@ -1189,7 +1205,7 @@ impl Node<UnaryExpression> {
let value = &self.argument.get_result(exec_state, ctx).await?; let value = &self.argument.get_result(exec_state, ctx).await?;
let err = || { let err = || {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"You can only negate numbers, planes, or lines, but this is a {}", "You can only negate numbers, planes, or lines, but this is a {}",
value.human_friendly_type() value.human_friendly_type()
@ -1292,7 +1308,7 @@ pub(crate) async fn execute_pipe_body(
ctx: &ExecutorContext, ctx: &ExecutorContext,
) -> Result<KclValue, KclError> { ) -> Result<KclValue, KclError> {
let Some((first, body)) = body.split_first() else { let Some((first, body)) = body.split_first() else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Pipe expressions cannot be empty".to_owned(), "Pipe expressions cannot be empty".to_owned(),
vec![source_range], vec![source_range],
))); )));
@ -1330,7 +1346,7 @@ async fn inner_execute_pipe_body(
) -> Result<KclValue, KclError> { ) -> Result<KclValue, KclError> {
for expression in body { for expression in body {
if let Expr::TagDeclarator(_) = expression { if let Expr::TagDeclarator(_) = expression {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("This cannot be in a PipeExpression: {:?}", expression), format!("This cannot be in a PipeExpression: {:?}", expression),
vec![expression.into()], vec![expression.into()],
))); )));
@ -1404,7 +1420,7 @@ impl Node<ArrayRangeExpression> {
.await?; .await?;
let (start, start_ty) = start_val let (start, start_ty) = start_val
.as_int_with_ty() .as_int_with_ty()
.ok_or(KclError::Semantic(KclErrorDetails::new( .ok_or(KclError::new_semantic(KclErrorDetails::new(
format!("Expected int but found {}", start_val.human_friendly_type()), format!("Expected int but found {}", start_val.human_friendly_type()),
vec![self.into()], vec![self.into()],
)))?; )))?;
@ -1412,24 +1428,26 @@ impl Node<ArrayRangeExpression> {
let end_val = ctx let end_val = ctx
.execute_expr(&self.end_element, exec_state, &metadata, &[], StatementKind::Expression) .execute_expr(&self.end_element, exec_state, &metadata, &[], StatementKind::Expression)
.await?; .await?;
let (end, end_ty) = end_val.as_int_with_ty().ok_or(KclError::Semantic(KclErrorDetails::new( let (end, end_ty) = end_val
format!("Expected int but found {}", end_val.human_friendly_type()), .as_int_with_ty()
vec![self.into()], .ok_or(KclError::new_semantic(KclErrorDetails::new(
)))?; format!("Expected int but found {}", end_val.human_friendly_type()),
vec![self.into()],
)))?;
if start_ty != end_ty { if start_ty != end_ty {
let start = start_val.as_ty_f64().unwrap_or(TyF64 { n: 0.0, ty: start_ty }); let start = start_val.as_ty_f64().unwrap_or(TyF64 { n: 0.0, ty: start_ty });
let start = fmt::human_display_number(start.n, start.ty); let start = fmt::human_display_number(start.n, start.ty);
let end = end_val.as_ty_f64().unwrap_or(TyF64 { n: 0.0, ty: end_ty }); let end = end_val.as_ty_f64().unwrap_or(TyF64 { n: 0.0, ty: end_ty });
let end = fmt::human_display_number(end.n, end.ty); let end = fmt::human_display_number(end.n, end.ty);
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Range start and end must be of the same type, but found {start} and {end}"), format!("Range start and end must be of the same type, but found {start} and {end}"),
vec![self.into()], vec![self.into()],
))); )));
} }
if end < start { if end < start {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Range start is greater than range end: {start} .. {end}"), format!("Range start is greater than range end: {start} .. {end}"),
vec![self.into()], vec![self.into()],
))); )));
@ -1493,7 +1511,7 @@ fn article_for<S: AsRef<str>>(s: S) -> &'static str {
fn number_as_f64(v: &KclValue, source_range: SourceRange) -> Result<TyF64, KclError> { fn number_as_f64(v: &KclValue, source_range: SourceRange) -> Result<TyF64, KclError> {
v.as_ty_f64().ok_or_else(|| { v.as_ty_f64().ok_or_else(|| {
let actual_type = v.human_friendly_type(); let actual_type = v.human_friendly_type();
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Expected a number, but found {actual_type}",), format!("Expected a number, but found {actual_type}",),
vec![source_range], vec![source_range],
)) ))
@ -1585,13 +1603,13 @@ impl Property {
if let Some(x) = crate::try_f64_to_usize(value) { if let Some(x) = crate::try_f64_to_usize(value) {
Ok(Property::UInt(x)) Ok(Property::UInt(x))
} else { } else {
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
format!("{value} is not a valid index, indices must be whole numbers >= 0"), format!("{value} is not a valid index, indices must be whole numbers >= 0"),
property_sr, property_sr,
))) )))
} }
} }
_ => Err(KclError::Semantic(KclErrorDetails::new( _ => Err(KclError::new_semantic(KclErrorDetails::new(
"Only numbers (>= 0) can be indexes".to_owned(), "Only numbers (>= 0) can be indexes".to_owned(),
vec![sr], vec![sr],
))), ))),
@ -1602,7 +1620,8 @@ impl Property {
} }
fn jvalue_to_prop(value: &KclValue, property_sr: Vec<SourceRange>, name: &str) -> Result<Property, KclError> { fn jvalue_to_prop(value: &KclValue, property_sr: Vec<SourceRange>, name: &str) -> Result<Property, KclError> {
let make_err = |message: String| Err::<Property, _>(KclError::Semantic(KclErrorDetails::new(message, property_sr))); let make_err =
|message: String| Err::<Property, _>(KclError::new_semantic(KclErrorDetails::new(message, property_sr)));
match value { match value {
KclValue::Number{value: num, .. } => { KclValue::Number{value: num, .. } => {
let num = *num; let num = *num;
@ -1846,7 +1865,7 @@ d = b + c
crate::engine::conn_mock::EngineConnection::new() crate::engine::conn_mock::EngineConnection::new()
.await .await
.map_err(|err| { .map_err(|err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Failed to create mock engine connection: {}", err), format!("Failed to create mock engine connection: {}", err),
vec![SourceRange::default()], vec![SourceRange::default()],
)) ))

View File

@ -295,7 +295,7 @@ impl Node<CallExpressionKw> {
let func = fn_name.get_result(exec_state, ctx).await?.clone(); let func = fn_name.get_result(exec_state, ctx).await?.clone();
let Some(fn_src) = func.as_function() else { let Some(fn_src) = func.as_function() else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"cannot call this because it isn't a function".to_string(), "cannot call this because it isn't a function".to_string(),
vec![callsite], vec![callsite],
))); )));
@ -318,10 +318,13 @@ impl Node<CallExpressionKw> {
if let KclValue::Function { meta, .. } = func { if let KclValue::Function { meta, .. } = func {
source_ranges = meta.iter().map(|m| m.source_range).collect(); source_ranges = meta.iter().map(|m| m.source_range).collect();
}; };
KclError::UndefinedValue(KclErrorDetails::new( KclError::new_undefined_value(
format!("Result of user-defined function {} is undefined", fn_name), KclErrorDetails::new(
source_ranges, format!("Result of user-defined function {} is undefined", fn_name),
)) source_ranges,
),
None,
)
})?; })?;
Ok(result) Ok(result)
@ -500,7 +503,7 @@ fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut Ex
let tag_id = if let Some(t) = value.sketch.tags.get(&tag.name) { let tag_id = if let Some(t) = value.sketch.tags.get(&tag.name) {
let mut t = t.clone(); let mut t = t.clone();
let Some(info) = t.get_cur_info() else { let Some(info) = t.get_cur_info() else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
format!("Tag {} does not have path info", tag.name), format!("Tag {} does not have path info", tag.name),
vec![tag.into()], vec![tag.into()],
))); )));
@ -605,7 +608,7 @@ fn type_check_params_kw(
arg.value = arg arg.value = arg
.value .value
.coerce( .coerce(
&RuntimeType::from_parsed(ty.clone(), exec_state, arg.source_range).map_err(|e| KclError::Semantic(e.into()))?, &RuntimeType::from_parsed(ty.clone(), exec_state, arg.source_range).map_err(|e| KclError::new_semantic(e.into()))?,
true, true,
exec_state, exec_state,
) )
@ -619,7 +622,7 @@ fn type_check_params_kw(
// TODO if we have access to the AST for the argument we could choose which example to suggest. // TODO if we have access to the AST for the argument we could choose which example to suggest.
message = format!("{message}\n\nYou may need to add information about the type of the argument, for example:\n using a numeric suffix: `42{ty}`\n or using type ascription: `foo(): number({ty})`"); message = format!("{message}\n\nYou may need to add information about the type of the argument, for example:\n using a numeric suffix: `42{ty}`\n or using type ascription: `foo(): number({ty})`");
} }
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
message, message,
vec![arg.source_range], vec![arg.source_range],
)) ))
@ -670,7 +673,7 @@ fn type_check_params_kw(
let first = errors.next().unwrap(); let first = errors.next().unwrap();
errors.for_each(|e| exec_state.err(e)); errors.for_each(|e| exec_state.err(e));
return Err(KclError::Semantic(first.into())); return Err(KclError::new_semantic(first.into()));
} }
if let Some(arg) = &mut args.unlabeled { if let Some(arg) = &mut args.unlabeled {
@ -680,12 +683,12 @@ fn type_check_params_kw(
.value .value
.coerce( .coerce(
&RuntimeType::from_parsed(ty.clone(), exec_state, arg.1.source_range) &RuntimeType::from_parsed(ty.clone(), exec_state, arg.1.source_range)
.map_err(|e| KclError::Semantic(e.into()))?, .map_err(|e| KclError::new_semantic(e.into()))?,
true, true,
exec_state, exec_state,
) )
.map_err(|_| { .map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"The input argument of {} requires a value with type `{}`, but found {}", "The input argument of {} requires a value with type `{}`, but found {}",
fn_name fn_name
@ -742,7 +745,7 @@ fn assign_args_to_params_kw(
.add(name.clone(), value, default_val.source_range())?; .add(name.clone(), value, default_val.source_range())?;
} }
None => { None => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"This function requires a parameter {}, but you haven't passed it one.", "This function requires a parameter {}, but you haven't passed it one.",
name name
@ -759,12 +762,12 @@ fn assign_args_to_params_kw(
let Some(unlabeled) = unlabelled else { let Some(unlabeled) = unlabelled else {
return Err(if args.kw_args.labeled.contains_key(param_name) { return Err(if args.kw_args.labeled.contains_key(param_name) {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("The function does declare a parameter named '{param_name}', but this parameter doesn't use a label. Try removing the `{param_name}:`"), format!("The function does declare a parameter named '{param_name}', but this parameter doesn't use a label. Try removing the `{param_name}:`"),
source_ranges, source_ranges,
)) ))
} else { } else {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
"This function expects an unlabeled first parameter, but you haven't passed it one.".to_owned(), "This function expects an unlabeled first parameter, but you haven't passed it one.".to_owned(),
source_ranges, source_ranges,
)) ))
@ -788,9 +791,9 @@ fn coerce_result_type(
if let Ok(Some(val)) = result { if let Ok(Some(val)) = result {
if let Some(ret_ty) = &fn_def.return_type { if let Some(ret_ty) = &fn_def.return_type {
let ty = RuntimeType::from_parsed(ret_ty.inner.clone(), exec_state, ret_ty.as_source_range()) let ty = RuntimeType::from_parsed(ret_ty.inner.clone(), exec_state, ret_ty.as_source_range())
.map_err(|e| KclError::Semantic(e.into()))?; .map_err(|e| KclError::new_semantic(e.into()))?;
let val = val.coerce(&ty, true, exec_state).map_err(|_| { let val = val.coerce(&ty, true, exec_state).map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"This function requires its result to be of type `{}`, but found {}", "This function requires its result to be of type `{}`, but found {}",
ty.human_friendly_type(), ty.human_friendly_type(),
@ -874,7 +877,7 @@ mod test {
"all params required, none given, should error", "all params required, none given, should error",
vec![req_param("x")], vec![req_param("x")],
vec![], vec![],
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
"This function requires a parameter x, but you haven't passed it one.".to_owned(), "This function requires a parameter x, but you haven't passed it one.".to_owned(),
vec![SourceRange::default()], vec![SourceRange::default()],
))), ))),
@ -889,7 +892,7 @@ mod test {
"mixed params, too few given", "mixed params, too few given",
vec![req_param("x"), opt_param("y")], vec![req_param("x"), opt_param("y")],
vec![], vec![],
Err(KclError::Semantic(KclErrorDetails::new( Err(KclError::new_semantic(KclErrorDetails::new(
"This function requires a parameter x, but you haven't passed it one.".to_owned(), "This function requires a parameter x, but you haven't passed it one.".to_owned(),
vec![SourceRange::default()], vec![SourceRange::default()],
))), ))),

View File

@ -469,7 +469,7 @@ impl TryFrom<PlaneData> for PlaneInfo {
PlaneData::NegYZ => PlaneName::NegYz, PlaneData::NegYZ => PlaneName::NegYz,
PlaneData::Plane(_) => { PlaneData::Plane(_) => {
// We will never get here since we already checked for PlaneData::Plane. // We will never get here since we already checked for PlaneData::Plane.
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
format!("PlaneData {:?} not found", value), format!("PlaneData {:?} not found", value),
Default::default(), Default::default(),
))); )));
@ -477,7 +477,7 @@ impl TryFrom<PlaneData> for PlaneInfo {
}; };
let info = DEFAULT_PLANE_INFO.get(&name).ok_or_else(|| { let info = DEFAULT_PLANE_INFO.get(&name).ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Plane {} not found", name), format!("Plane {} not found", name),
Default::default(), Default::default(),
)) ))

View File

@ -37,25 +37,25 @@ pub async fn import_foreign(
) -> Result<PreImportedGeometry, KclError> { ) -> Result<PreImportedGeometry, KclError> {
// Make sure the file exists. // Make sure the file exists.
if !ctxt.fs.exists(file_path, source_range).await? { if !ctxt.fs.exists(file_path, source_range).await? {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("File `{}` does not exist.", file_path.display()), format!("File `{}` does not exist.", file_path.display()),
vec![source_range], vec![source_range],
))); )));
} }
let ext_format = get_import_format_from_extension(file_path.extension().ok_or_else(|| { let ext_format = get_import_format_from_extension(file_path.extension().ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("No file extension found for `{}`", file_path.display()), format!("No file extension found for `{}`", file_path.display()),
vec![source_range], vec![source_range],
)) ))
})?) })?)
.map_err(|e| KclError::Semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?; .map_err(|e| KclError::new_semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?;
// Get the format type from the extension of the file. // Get the format type from the extension of the file.
let format = if let Some(format) = format { let format = if let Some(format) = format {
// Validate the given format with the extension format. // Validate the given format with the extension format.
validate_extension_format(ext_format, format.clone()) validate_extension_format(ext_format, format.clone())
.map_err(|e| KclError::Semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?; .map_err(|e| KclError::new_semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?;
format format
} else { } else {
ext_format ext_format
@ -66,11 +66,11 @@ pub async fn import_foreign(
.fs .fs
.read(file_path, source_range) .read(file_path, source_range)
.await .await
.map_err(|e| KclError::Semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?; .map_err(|e| KclError::new_semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?;
// We want the file_path to be without the parent. // We want the file_path to be without the parent.
let file_name = file_path.file_name().map(|p| p.to_string()).ok_or_else(|| { let file_name = file_path.file_name().map(|p| p.to_string()).ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Could not get the file name from the path `{}`", file_path.display()), format!("Could not get the file name from the path `{}`", file_path.display()),
vec![source_range], vec![source_range],
)) ))
@ -87,7 +87,7 @@ pub async fn import_foreign(
// file. // file.
if !file_contents.starts_with(b"glTF") { if !file_contents.starts_with(b"glTF") {
let json = gltf_json::Root::from_slice(&file_contents) let json = gltf_json::Root::from_slice(&file_contents)
.map_err(|e| KclError::Semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?; .map_err(|e| KclError::new_semantic(KclErrorDetails::new(e.to_string(), vec![source_range])))?;
// Read the gltf file and check if there is a bin file. // Read the gltf file and check if there is a bin file.
for buffer in json.buffers.iter() { for buffer in json.buffers.iter() {
@ -95,16 +95,15 @@ pub async fn import_foreign(
if !uri.starts_with("data:") { if !uri.starts_with("data:") {
// We want this path relative to the file_path given. // We want this path relative to the file_path given.
let bin_path = file_path.parent().map(|p| p.join(uri)).ok_or_else(|| { let bin_path = file_path.parent().map(|p| p.join(uri)).ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Could not get the parent path of the file `{}`", file_path.display()), format!("Could not get the parent path of the file `{}`", file_path.display()),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let bin_contents = let bin_contents = ctxt.fs.read(&bin_path, source_range).await.map_err(|e| {
ctxt.fs.read(&bin_path, source_range).await.map_err(|e| { KclError::new_semantic(KclErrorDetails::new(e.to_string(), vec![source_range]))
KclError::Semantic(KclErrorDetails::new(e.to_string(), vec![source_range])) })?;
})?;
import_files.push(ImportFile { import_files.push(ImportFile {
path: uri.to_string(), path: uri.to_string(),
@ -141,7 +140,7 @@ pub(super) fn format_from_annotations(
if p.key.name == annotations::IMPORT_FORMAT { if p.key.name == annotations::IMPORT_FORMAT {
result = Some( result = Some(
get_import_format_from_extension(annotations::expect_ident(&p.value)?).map_err(|_| { get_import_format_from_extension(annotations::expect_ident(&p.value)?).map_err(|_| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Unknown format for import, expected one of: {}", "Unknown format for import, expected one of: {}",
crate::IMPORT_FILE_EXTENSIONS.join(", ") crate::IMPORT_FILE_EXTENSIONS.join(", ")
@ -159,7 +158,7 @@ pub(super) fn format_from_annotations(
path.extension() path.extension()
.and_then(|ext| get_import_format_from_extension(ext).ok()) .and_then(|ext| get_import_format_from_extension(ext).ok())
}) })
.ok_or(KclError::Semantic(KclErrorDetails::new( .ok_or(KclError::new_semantic(KclErrorDetails::new(
"Unknown or missing extension, and no specified format for imported file".to_owned(), "Unknown or missing extension, and no specified format for imported file".to_owned(),
vec![import_source_range], vec![import_source_range],
)))?; )))?;
@ -174,7 +173,7 @@ pub(super) fn format_from_annotations(
} }
annotations::IMPORT_FORMAT => {} annotations::IMPORT_FORMAT => {}
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Unexpected annotation for import, expected one of: {}, {}, {}", "Unexpected annotation for import, expected one of: {}, {}, {}",
annotations::IMPORT_FORMAT, annotations::IMPORT_FORMAT,
@ -199,7 +198,7 @@ fn set_coords(fmt: &mut InputFormat3d, coords_str: &str, source_range: SourceRan
} }
let Some(coords) = coords else { let Some(coords) = coords else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Unknown coordinate system: {coords_str}, expected one of: {}", "Unknown coordinate system: {coords_str}, expected one of: {}",
annotations::IMPORT_COORDS_VALUES annotations::IMPORT_COORDS_VALUES
@ -217,7 +216,7 @@ fn set_coords(fmt: &mut InputFormat3d, coords_str: &str, source_range: SourceRan
InputFormat3d::Ply(opts) => opts.coords = coords, InputFormat3d::Ply(opts) => opts.coords = coords,
InputFormat3d::Stl(opts) => opts.coords = coords, InputFormat3d::Stl(opts) => opts.coords = coords,
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"`{}` option cannot be applied to the specified format", "`{}` option cannot be applied to the specified format",
annotations::IMPORT_COORDS annotations::IMPORT_COORDS
@ -238,7 +237,7 @@ fn set_length_unit(fmt: &mut InputFormat3d, units_str: &str, source_range: Sourc
InputFormat3d::Ply(opts) => opts.units = units.into(), InputFormat3d::Ply(opts) => opts.units = units.into(),
InputFormat3d::Stl(opts) => opts.units = units.into(), InputFormat3d::Stl(opts) => opts.units = units.into(),
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"`{}` option cannot be applied to the specified format", "`{}` option cannot be applied to the specified format",
annotations::IMPORT_LENGTH_UNIT annotations::IMPORT_LENGTH_UNIT

View File

@ -574,7 +574,7 @@ impl KclValue {
pub fn get_tag_identifier(&self) -> Result<TagIdentifier, KclError> { pub fn get_tag_identifier(&self) -> Result<TagIdentifier, KclError> {
match self { match self {
KclValue::TagIdentifier(t) => Ok(*t.clone()), KclValue::TagIdentifier(t) => Ok(*t.clone()),
_ => Err(KclError::Semantic(KclErrorDetails::new( _ => Err(KclError::new_semantic(KclErrorDetails::new(
format!("Not a tag identifier: {:?}", self), format!("Not a tag identifier: {:?}", self),
self.clone().into(), self.clone().into(),
))), ))),
@ -585,7 +585,7 @@ impl KclValue {
pub fn get_tag_declarator(&self) -> Result<TagNode, KclError> { pub fn get_tag_declarator(&self) -> Result<TagNode, KclError> {
match self { match self {
KclValue::TagDeclarator(t) => Ok((**t).clone()), KclValue::TagDeclarator(t) => Ok((**t).clone()),
_ => Err(KclError::Semantic(KclErrorDetails::new( _ => Err(KclError::new_semantic(KclErrorDetails::new(
format!("Not a tag declarator: {:?}", self), format!("Not a tag declarator: {:?}", self),
self.clone().into(), self.clone().into(),
))), ))),
@ -595,7 +595,7 @@ impl KclValue {
/// If this KCL value is a bool, retrieve it. /// If this KCL value is a bool, retrieve it.
pub fn get_bool(&self) -> Result<bool, KclError> { pub fn get_bool(&self) -> Result<bool, KclError> {
self.as_bool().ok_or_else(|| { self.as_bool().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected bool, found {}", self.human_friendly_type()), format!("Expected bool, found {}", self.human_friendly_type()),
self.into(), self.into(),
)) ))

View File

@ -367,10 +367,10 @@ impl ProgramMemory {
let name = var.trim_start_matches(TYPE_PREFIX).trim_start_matches(MODULE_PREFIX); let name = var.trim_start_matches(TYPE_PREFIX).trim_start_matches(MODULE_PREFIX);
Err(KclError::UndefinedValue(KclErrorDetails::new( Err(KclError::new_undefined_value(
format!("`{name}` is not defined"), KclErrorDetails::new(format!("`{name}` is not defined"), vec![source_range]),
vec![source_range], Some(name.to_owned()),
))) ))
} }
/// Iterate over all key/value pairs in the specified environment which satisfy the provided /// Iterate over all key/value pairs in the specified environment which satisfy the provided
@ -488,10 +488,10 @@ impl ProgramMemory {
}; };
} }
Err(KclError::UndefinedValue(KclErrorDetails::new( Err(KclError::new_undefined_value(
format!("`{}` is not defined", var), KclErrorDetails::new(format!("`{}` is not defined", var), vec![]),
vec![], Some(var.to_owned()),
))) ))
} }
} }
@ -646,7 +646,7 @@ impl Stack {
pub fn add(&mut self, key: String, value: KclValue, source_range: SourceRange) -> Result<(), KclError> { pub fn add(&mut self, key: String, value: KclValue, source_range: SourceRange) -> Result<(), KclError> {
let env = self.memory.get_env(self.current_env.index()); let env = self.memory.get_env(self.current_env.index());
if env.contains_key(&key) { if env.contains_key(&key) {
return Err(KclError::ValueAlreadyDefined(KclErrorDetails::new( return Err(KclError::new_value_already_defined(KclErrorDetails::new(
format!("Cannot redefine `{}`", key), format!("Cannot redefine `{}`", key),
vec![source_range], vec![source_range],
))); )));

View File

@ -858,7 +858,7 @@ impl ExecutorContext {
for module in modules { for module in modules {
let Some((import_stmt, module_id, module_path, repr)) = universe.get(&module) else { let Some((import_stmt, module_id, module_path, repr)) = universe.get(&module) else {
return Err(KclErrorWithOutputs::no_outputs(KclError::Internal( return Err(KclErrorWithOutputs::no_outputs(KclError::new_internal(
KclErrorDetails::new(format!("Module {module} not found in universe"), Default::default()), KclErrorDetails::new(format!("Module {module} not found in universe"), Default::default()),
))); )));
}; };
@ -920,7 +920,7 @@ impl ExecutorContext {
result.map(|val| ModuleRepr::Foreign(geom.clone(), val)) result.map(|val| ModuleRepr::Foreign(geom.clone(), val))
} }
ModuleRepr::Dummy | ModuleRepr::Root => Err(KclError::Internal(KclErrorDetails::new( ModuleRepr::Dummy | ModuleRepr::Root => Err(KclError::new_internal(KclErrorDetails::new(
format!("Module {module_path} not found in universe"), format!("Module {module_path} not found in universe"),
vec![source_range], vec![source_range],
))), ))),
@ -1283,7 +1283,7 @@ impl ExecutorContext {
.await?; .await?;
let kittycad_modeling_cmds::websocket::OkWebSocketResponseData::Export { files } = resp else { let kittycad_modeling_cmds::websocket::OkWebSocketResponseData::Export { files } = resp else {
return Err(KclError::Internal(crate::errors::KclErrorDetails::new( return Err(KclError::new_internal(crate::errors::KclErrorDetails::new(
format!("Expected Export response, got {resp:?}",), format!("Expected Export response, got {resp:?}",),
vec![SourceRange::default()], vec![SourceRange::default()],
))); )));
@ -1303,7 +1303,7 @@ impl ExecutorContext {
coords: *kittycad_modeling_cmds::coord::KITTYCAD, coords: *kittycad_modeling_cmds::coord::KITTYCAD,
created: if deterministic_time { created: if deterministic_time {
Some("2021-01-01T00:00:00Z".parse().map_err(|e| { Some("2021-01-01T00:00:00Z".parse().map_err(|e| {
KclError::Internal(crate::errors::KclErrorDetails::new( KclError::new_internal(crate::errors::KclErrorDetails::new(
format!("Failed to parse date: {}", e), format!("Failed to parse date: {}", e),
vec![SourceRange::default()], vec![SourceRange::default()],
)) ))
@ -1383,7 +1383,7 @@ pub(crate) async fn parse_execute_with_project_dir(
let exec_ctxt = ExecutorContext { let exec_ctxt = ExecutorContext {
engine: Arc::new(Box::new( engine: Arc::new(Box::new(
crate::engine::conn_mock::EngineConnection::new().await.map_err(|err| { crate::engine::conn_mock::EngineConnection::new().await.map_err(|err| {
KclError::Internal(crate::errors::KclErrorDetails::new( KclError::new_internal(crate::errors::KclErrorDetails::new(
format!("Failed to create mock engine connection: {}", err), format!("Failed to create mock engine connection: {}", err),
vec![SourceRange::default()], vec![SourceRange::default()],
)) ))
@ -1799,7 +1799,7 @@ foo
let err = result.unwrap_err(); let err = result.unwrap_err();
assert_eq!( assert_eq!(
err, err,
KclError::Syntax(KclErrorDetails::new( KclError::new_syntax(KclErrorDetails::new(
"Unexpected token: #".to_owned(), "Unexpected token: #".to_owned(),
vec![SourceRange::new(14, 15, ModuleId::default())], vec![SourceRange::new(14, 15, ModuleId::default())],
)), )),
@ -2058,7 +2058,7 @@ notTagIdentifier = !myTag";
// TODO: We don't currently parse this, but we should. It should be // TODO: We don't currently parse this, but we should. It should be
// a runtime error instead. // a runtime error instead.
parse_execute(code10).await.unwrap_err(), parse_execute(code10).await.unwrap_err(),
KclError::Syntax(KclErrorDetails::new( KclError::new_syntax(KclErrorDetails::new(
"Unexpected token: !".to_owned(), "Unexpected token: !".to_owned(),
vec![SourceRange::new(10, 11, ModuleId::default())], vec![SourceRange::new(10, 11, ModuleId::default())],
)) ))
@ -2071,7 +2071,7 @@ notPipeSub = 1 |> identity(!%))";
// TODO: We don't currently parse this, but we should. It should be // TODO: We don't currently parse this, but we should. It should be
// a runtime error instead. // a runtime error instead.
parse_execute(code11).await.unwrap_err(), parse_execute(code11).await.unwrap_err(),
KclError::Syntax(KclErrorDetails::new( KclError::new_syntax(KclErrorDetails::new(
"There was an unexpected !. Try removing it.".to_owned(), "There was an unexpected !. Try removing it.".to_owned(),
vec![SourceRange::new(56, 57, ModuleId::default())], vec![SourceRange::new(56, 57, ModuleId::default())],
)) ))

View File

@ -80,6 +80,11 @@ pub(super) struct ModuleState {
/// The current value of the pipe operator returned from the previous /// The current value of the pipe operator returned from the previous
/// expression. If we're not currently in a pipeline, this will be None. /// expression. If we're not currently in a pipeline, this will be None.
pub pipe_value: Option<KclValue>, pub pipe_value: Option<KclValue>,
/// The closest variable declaration being executed in any parent node in the AST.
/// This is used to provide better error messages, e.g. noticing when the user is trying
/// to use the variable `length` inside the RHS of its own definition, like `length = tan(length)`.
/// TODO: Make this a reference.
pub being_declared: Option<String>,
/// Identifiers that have been exported from the current module. /// Identifiers that have been exported from the current module.
pub module_exports: Vec<String>, pub module_exports: Vec<String>,
/// Settings specified from annotations. /// Settings specified from annotations.
@ -276,7 +281,7 @@ impl ExecState {
} }
pub(super) fn circular_import_error(&self, path: &ModulePath, source_range: SourceRange) -> KclError { pub(super) fn circular_import_error(&self, path: &ModulePath, source_range: SourceRange) -> KclError {
KclError::ImportCycle(KclErrorDetails::new( KclError::new_import_cycle(KclErrorDetails::new(
format!( format!(
"circular import of modules is not allowed: {} -> {}", "circular import of modules is not allowed: {} -> {}",
self.global self.global
@ -342,6 +347,7 @@ impl ModuleState {
id_generator: IdGenerator::new(module_id), id_generator: IdGenerator::new(module_id),
stack: memory.new_stack(), stack: memory.new_stack(),
pipe_value: Default::default(), pipe_value: Default::default(),
being_declared: Default::default(),
module_exports: Default::default(), module_exports: Default::default(),
explicit_length_units: false, explicit_length_units: false,
path, path,
@ -389,7 +395,7 @@ impl MetaSettings {
self.kcl_version = value; self.kcl_version = value;
} }
name => { name => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Unexpected settings key: `{name}`; expected one of `{}`, `{}`", "Unexpected settings key: `{name}`; expected one of `{}`, `{}`",
annotations::SETTINGS_UNIT_LENGTH, annotations::SETTINGS_UNIT_LENGTH,

View File

@ -28,7 +28,7 @@ impl Default for FileManager {
impl FileSystem for FileManager { impl FileSystem for FileManager {
async fn read(&self, path: &TypedPath, source_range: SourceRange) -> Result<Vec<u8>, KclError> { async fn read(&self, path: &TypedPath, source_range: SourceRange) -> Result<Vec<u8>, KclError> {
tokio::fs::read(&path.0).await.map_err(|e| { tokio::fs::read(&path.0).await.map_err(|e| {
KclError::Io(KclErrorDetails::new( KclError::new_io(KclErrorDetails::new(
format!("Failed to read file `{}`: {}", path.display(), e), format!("Failed to read file `{}`: {}", path.display(), e),
vec![source_range], vec![source_range],
)) ))
@ -37,7 +37,7 @@ impl FileSystem for FileManager {
async fn read_to_string(&self, path: &TypedPath, source_range: SourceRange) -> Result<String, KclError> { async fn read_to_string(&self, path: &TypedPath, source_range: SourceRange) -> Result<String, KclError> {
tokio::fs::read_to_string(&path.0).await.map_err(|e| { tokio::fs::read_to_string(&path.0).await.map_err(|e| {
KclError::Io(KclErrorDetails::new( KclError::new_io(KclErrorDetails::new(
format!("Failed to read file `{}`: {}", path.display(), e), format!("Failed to read file `{}`: {}", path.display(), e),
vec![source_range], vec![source_range],
)) ))
@ -49,7 +49,7 @@ impl FileSystem for FileManager {
if e.kind() == std::io::ErrorKind::NotFound { if e.kind() == std::io::ErrorKind::NotFound {
Ok(false) Ok(false)
} else { } else {
Err(KclError::Io(KclErrorDetails::new( Err(KclError::new_io(KclErrorDetails::new(
format!("Failed to check if file `{}` exists: {}", path.display(), e), format!("Failed to check if file `{}` exists: {}", path.display(), e),
vec![source_range], vec![source_range],
))) )))
@ -71,7 +71,7 @@ impl FileSystem for FileManager {
} }
let mut read_dir = tokio::fs::read_dir(&path).await.map_err(|e| { let mut read_dir = tokio::fs::read_dir(&path).await.map_err(|e| {
KclError::Io(KclErrorDetails::new( KclError::new_io(KclErrorDetails::new(
format!("Failed to read directory `{}`: {}", path.display(), e), format!("Failed to read directory `{}`: {}", path.display(), e),
vec![source_range], vec![source_range],
)) ))

View File

@ -49,10 +49,10 @@ impl FileSystem for FileManager {
let promise = self let promise = self
.manager .manager
.read_file(path.to_string_lossy()) .read_file(path.to_string_lossy())
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
let value = JsFuture::from(promise).await.map_err(|e| { let value = JsFuture::from(promise).await.map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to wait for promise from engine: {:?}", e), format!("Failed to wait for promise from engine: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -67,7 +67,7 @@ impl FileSystem for FileManager {
async fn read_to_string(&self, path: &TypedPath, source_range: SourceRange) -> Result<String, KclError> { async fn read_to_string(&self, path: &TypedPath, source_range: SourceRange) -> Result<String, KclError> {
let bytes = self.read(path, source_range).await?; let bytes = self.read(path, source_range).await?;
let string = String::from_utf8(bytes).map_err(|e| { let string = String::from_utf8(bytes).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to convert bytes to string: {:?}", e), format!("Failed to convert bytes to string: {:?}", e),
vec![source_range], vec![source_range],
)) ))
@ -80,17 +80,17 @@ impl FileSystem for FileManager {
let promise = self let promise = self
.manager .manager
.exists(path.to_string_lossy()) .exists(path.to_string_lossy())
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
let value = JsFuture::from(promise).await.map_err(|e| { let value = JsFuture::from(promise).await.map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to wait for promise from engine: {:?}", e), format!("Failed to wait for promise from engine: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let it_exists = value.as_bool().ok_or_else(|| { let it_exists = value.as_bool().ok_or_else(|| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
"Failed to convert value to bool".to_string(), "Failed to convert value to bool".to_string(),
vec![source_range], vec![source_range],
)) ))
@ -107,24 +107,24 @@ impl FileSystem for FileManager {
let promise = self let promise = self
.manager .manager
.get_all_files(path.to_string_lossy()) .get_all_files(path.to_string_lossy())
.map_err(|e| KclError::Engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?; .map_err(|e| KclError::new_engine(KclErrorDetails::new(e.to_string().into(), vec![source_range])))?;
let value = JsFuture::from(promise).await.map_err(|e| { let value = JsFuture::from(promise).await.map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to wait for promise from javascript: {:?}", e), format!("Failed to wait for promise from javascript: {:?}", e),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let s = value.as_string().ok_or_else(|| { let s = value.as_string().ok_or_else(|| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to get string from response from javascript: `{:?}`", value), format!("Failed to get string from response from javascript: `{:?}`", value),
vec![source_range], vec![source_range],
)) ))
})?; })?;
let files: Vec<String> = serde_json::from_str(&s).map_err(|e| { let files: Vec<String> = serde_json::from_str(&s).map_err(|e| {
KclError::Engine(KclErrorDetails::new( KclError::new_engine(KclErrorDetails::new(
format!("Failed to parse json from javascript: `{}` `{:?}`", s, e), format!("Failed to parse json from javascript: `{}` `{:?}`", s, e),
vec![source_range], vec![source_range],
)) ))

View File

@ -58,7 +58,7 @@ impl ModuleLoader {
} }
pub(crate) fn import_cycle_error(&self, path: &ModulePath, source_range: SourceRange) -> KclError { pub(crate) fn import_cycle_error(&self, path: &ModulePath, source_range: SourceRange) -> KclError {
KclError::ImportCycle(KclErrorDetails::new( KclError::new_import_cycle(KclErrorDetails::new(
format!( format!(
"circular import of modules is not allowed: {} -> {}", "circular import of modules is not allowed: {} -> {}",
self.import_stack self.import_stack
@ -163,7 +163,7 @@ impl ModulePath {
ModulePath::Std { value: name } => Ok(ModuleSource { ModulePath::Std { value: name } => Ok(ModuleSource {
source: read_std(name) source: read_std(name)
.ok_or_else(|| { .ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Cannot find standard library module to import: std::{name}."), format!("Cannot find standard library module to import: std::{name}."),
vec![source_range], vec![source_range],
)) ))
@ -202,7 +202,7 @@ impl ModulePath {
ModulePath::Std { .. } => { ModulePath::Std { .. } => {
let message = format!("Cannot import a non-std KCL file from std: {path}."); let message = format!("Cannot import a non-std KCL file from std: {path}.");
debug_assert!(false, "{}", &message); debug_assert!(false, "{}", &message);
return Err(KclError::Internal(KclErrorDetails::new(message, vec![]))); return Err(KclError::new_internal(KclErrorDetails::new(message, vec![])));
} }
}; };
@ -217,7 +217,7 @@ impl ModulePath {
if path.len() != 2 || path[0] != "std" { if path.len() != 2 || path[0] != "std" {
let message = format!("Invalid std import path: {path:?}."); let message = format!("Invalid std import path: {path:?}.");
debug_assert!(false, "{}", &message); debug_assert!(false, "{}", &message);
return Err(KclError::Internal(KclErrorDetails::new(message, vec![]))); return Err(KclError::new_internal(KclErrorDetails::new(message, vec![])));
} }
Ok(ModulePath::Std { value: path[1].clone() }) Ok(ModulePath::Std { value: path[1].clone() })

View File

@ -51,7 +51,7 @@ pub fn parse_tokens(mut tokens: TokenStream) -> ParseResult {
} else { } else {
format!("found unknown tokens [{}]", token_list.join(", ")) format!("found unknown tokens [{}]", token_list.join(", "))
}; };
return KclError::Lexical(KclErrorDetails::new(message, source_ranges)).into(); return KclError::new_lexical(KclErrorDetails::new(message, source_ranges)).into();
} }
// Important, to not call this before the unknown tokens check. // Important, to not call this before the unknown tokens check.
@ -110,7 +110,7 @@ impl ParseResult {
let (p, errs) = self.0?; let (p, errs) = self.0?;
if let Some(err) = errs.iter().find(|e| e.severity.is_err()) { if let Some(err) = errs.iter().find(|e| e.severity.is_err()) {
return Err(KclError::Syntax(err.clone().into())); return Err(KclError::new_syntax(err.clone().into()));
} }
match p { match p {
Some(p) => Ok(p), Some(p) => Ok(p),

View File

@ -4412,7 +4412,7 @@ secondExtrude = startSketchOn(XY)
#[test] #[test]
fn test_parse_parens_unicode() { fn test_parse_parens_unicode() {
let result = crate::parsing::top_level_parse(""); let result = crate::parsing::top_level_parse("");
let KclError::Lexical(details) = result.0.unwrap_err() else { let KclError::Lexical { details } = result.0.unwrap_err() else {
panic!(); panic!();
}; };
// TODO: Better errors when program cannot tokenize. // TODO: Better errors when program cannot tokenize.

View File

@ -597,7 +597,7 @@ impl From<ParseError<Input<'_>, winnow::error::ContextError>> for KclError {
// This is an offset, not an index, and may point to // This is an offset, not an index, and may point to
// the end of input (input.len()) on eof errors. // the end of input (input.len()) on eof errors.
return KclError::Lexical(crate::errors::KclErrorDetails::new( return KclError::new_lexical(crate::errors::KclErrorDetails::new(
"unexpected EOF while parsing".to_owned(), "unexpected EOF while parsing".to_owned(),
vec![SourceRange::new(offset, offset, module_id)], vec![SourceRange::new(offset, offset, module_id)],
)); ));
@ -608,7 +608,7 @@ impl From<ParseError<Input<'_>, winnow::error::ContextError>> for KclError {
let bad_token = &input[offset]; let bad_token = &input[offset];
// TODO: Add the Winnow parser context to the error. // TODO: Add the Winnow parser context to the error.
// See https://github.com/KittyCAD/modeling-app/issues/784 // See https://github.com/KittyCAD/modeling-app/issues/784
KclError::Lexical(crate::errors::KclErrorDetails::new( KclError::new_lexical(crate::errors::KclErrorDetails::new(
format!("found unknown token '{}'", bad_token), format!("found unknown token '{}'", bad_token),
vec![SourceRange::new(offset, offset + 1, module_id)], vec![SourceRange::new(offset, offset + 1, module_id)],
)) ))

View File

@ -3483,3 +3483,24 @@ mod spheres {
super::execute(TEST_NAME, true).await super::execute(TEST_NAME, true).await
} }
} }
mod var_ref_in_own_def {
const TEST_NAME: &str = "var_ref_in_own_def";
/// Test parsing KCL.
#[test]
fn parse() {
super::parse(TEST_NAME)
}
/// Test that parsing and unparsing KCL produces the original KCL input.
#[tokio::test(flavor = "multi_thread")]
async fn unparse() {
super::unparse(TEST_NAME).await
}
/// Test that KCL is executed correctly.
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_execute() {
super::execute(TEST_NAME, true).await
}
}

View File

@ -30,7 +30,7 @@ pub async fn hex_string(exec_state: &mut ExecState, args: Args) -> Result<KclVal
// Make sure the color if set is valid. // Make sure the color if set is valid.
if let Some(component) = rgb.iter().find(|component| component.n < 0.0 || component.n > 255.0) { if let Some(component) = rgb.iter().find(|component| component.n < 0.0 || component.n > 255.0) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Colors are given between 0 and 255, so {} is invalid", component.n), format!("Colors are given between 0 and 255, so {} is invalid", component.n),
vec![args.source_range], vec![args.source_range],
))); )));
@ -62,7 +62,7 @@ pub async fn appearance(exec_state: &mut ExecState, args: Args) -> Result<KclVal
// Make sure the color if set is valid. // Make sure the color if set is valid.
if !HEX_REGEX.is_match(&color) { if !HEX_REGEX.is_match(&color) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Invalid hex color (`{}`), try something like `#fff000`", color), format!("Invalid hex color (`{}`), try something like `#fff000`", color),
vec![args.source_range], vec![args.source_range],
))); )));
@ -93,7 +93,7 @@ async fn inner_appearance(
for solid_id in solids.ids(&args.ctx).await? { for solid_id in solids.ids(&args.ctx).await? {
// Set the material properties. // Set the material properties.
let rgb = rgba_simple::RGB::<f32>::from_hex(&color).map_err(|err| { let rgb = rgba_simple::RGB::<f32>::from_hex(&color).map_err(|err| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Invalid hex color (`{color}`): {err}"), format!("Invalid hex color (`{color}`): {err}"),
vec![args.source_range], vec![args.source_range],
)) ))

View File

@ -123,7 +123,7 @@ impl Args {
} }
T::from_kcl_val(&arg.value).map(Some).ok_or_else(|| { T::from_kcl_val(&arg.value).map(Some).ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!( format!(
"The arg {label} was given, but it was the wrong type. It should be type {} but it was {}", "The arg {label} was given, but it was the wrong type. It should be type {} but it was {}",
tynm::type_name::<T>(), tynm::type_name::<T>(),
@ -156,7 +156,7 @@ impl Args {
T: FromKclValue<'a>, T: FromKclValue<'a>,
{ {
self.get_kw_arg_opt(label)?.ok_or_else(|| { self.get_kw_arg_opt(label)?.ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("This function requires a keyword argument '{label}'"), format!("This function requires a keyword argument '{label}'"),
vec![self.source_range], vec![self.source_range],
)) ))
@ -173,7 +173,7 @@ impl Args {
T: for<'a> FromKclValue<'a>, T: for<'a> FromKclValue<'a>,
{ {
let Some(arg) = self.kw_args.labeled.get(label) else { let Some(arg) = self.kw_args.labeled.get(label) else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("This function requires a keyword argument '{label}'"), format!("This function requires a keyword argument '{label}'"),
vec![self.source_range], vec![self.source_range],
))); )));
@ -207,7 +207,7 @@ impl Args {
if message.contains("one or more Solids or imported geometry but it's actually of type Sketch") { if message.contains("one or more Solids or imported geometry but it's actually of type Sketch") {
message = format!("{message}. {ERROR_STRING_SKETCH_TO_SOLID_HELPER}"); message = format!("{message}. {ERROR_STRING_SKETCH_TO_SOLID_HELPER}");
} }
KclError::Semantic(KclErrorDetails::new(message, arg.source_ranges())) KclError::new_semantic(KclErrorDetails::new(message, arg.source_ranges()))
})?; })?;
// TODO unnecessary cloning // TODO unnecessary cloning
@ -221,7 +221,7 @@ impl Args {
label: &str, label: &str,
) -> Result<Vec<(EdgeReference, SourceRange)>, KclError> { ) -> Result<Vec<(EdgeReference, SourceRange)>, KclError> {
let Some(arg) = self.kw_args.labeled.get(label) else { let Some(arg) = self.kw_args.labeled.get(label) else {
let err = KclError::Semantic(KclErrorDetails::new( let err = KclError::new_semantic(KclErrorDetails::new(
format!("This function requires a keyword argument '{label}'"), format!("This function requires a keyword argument '{label}'"),
vec![self.source_range], vec![self.source_range],
)); ));
@ -234,7 +234,7 @@ impl Args {
.map(|item| { .map(|item| {
let source = SourceRange::from(item); let source = SourceRange::from(item);
let val = FromKclValue::from_kcl_val(item).ok_or_else(|| { let val = FromKclValue::from_kcl_val(item).ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!("Expected an Edge but found {}", arg.value.human_friendly_type()), format!("Expected an Edge but found {}", arg.value.human_friendly_type()),
arg.source_ranges(), arg.source_ranges(),
)) ))
@ -270,7 +270,7 @@ impl Args {
{ {
let arg = self let arg = self
.unlabeled_kw_arg_unconverted() .unlabeled_kw_arg_unconverted()
.ok_or(KclError::Semantic(KclErrorDetails::new( .ok_or(KclError::new_semantic(KclErrorDetails::new(
format!("This function requires a value for the special unlabeled first parameter, '{label}'"), format!("This function requires a value for the special unlabeled first parameter, '{label}'"),
vec![self.source_range], vec![self.source_range],
)))?; )))?;
@ -304,11 +304,11 @@ impl Args {
if message.contains("one or more Solids or imported geometry but it's actually of type Sketch") { if message.contains("one or more Solids or imported geometry but it's actually of type Sketch") {
message = format!("{message}. {ERROR_STRING_SKETCH_TO_SOLID_HELPER}"); message = format!("{message}. {ERROR_STRING_SKETCH_TO_SOLID_HELPER}");
} }
KclError::Semantic(KclErrorDetails::new(message, arg.source_ranges())) KclError::new_semantic(KclErrorDetails::new(message, arg.source_ranges()))
})?; })?;
T::from_kcl_val(&arg).ok_or_else(|| { T::from_kcl_val(&arg).ok_or_else(|| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Mismatch between type coercion and value extraction (this isn't your fault).\nTo assist in bug-reporting, expected type: {ty:?}; actual value: {arg:?}"), format!("Mismatch between type coercion and value extraction (this isn't your fault).\nTo assist in bug-reporting, expected type: {ty:?}; actual value: {arg:?}"),
vec![self.source_range], vec![self.source_range],
)) ))
@ -354,14 +354,14 @@ impl Args {
exec_state.stack().get_from_call_stack(&tag.value, self.source_range)? exec_state.stack().get_from_call_stack(&tag.value, self.source_range)?
{ {
let info = t.get_info(epoch).ok_or_else(|| { let info = t.get_info(epoch).ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Tag `{}` does not have engine info", tag.value), format!("Tag `{}` does not have engine info", tag.value),
vec![self.source_range], vec![self.source_range],
)) ))
})?; })?;
Ok(info) Ok(info)
} else { } else {
Err(KclError::Type(KclErrorDetails::new( Err(KclError::new_type(KclErrorDetails::new(
format!("Tag `{}` does not exist", tag.value), format!("Tag `{}` does not exist", tag.value),
vec![self.source_range], vec![self.source_range],
))) )))
@ -493,7 +493,7 @@ impl Args {
must_be_planar: bool, must_be_planar: bool,
) -> Result<uuid::Uuid, KclError> { ) -> Result<uuid::Uuid, KclError> {
if tag.value.is_empty() { if tag.value.is_empty() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Expected a non-empty tag for the face".to_string(), "Expected a non-empty tag for the face".to_string(),
vec![self.source_range], vec![self.source_range],
))); )));
@ -502,7 +502,7 @@ impl Args {
let engine_info = self.get_tag_engine_info_check_surface(exec_state, tag)?; let engine_info = self.get_tag_engine_info_check_surface(exec_state, tag)?;
let surface = engine_info.surface.as_ref().ok_or_else(|| { let surface = engine_info.surface.as_ref().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Tag `{}` does not have a surface", tag.value), format!("Tag `{}` does not have a surface", tag.value),
vec![self.source_range], vec![self.source_range],
)) ))
@ -521,7 +521,7 @@ impl Args {
} }
} }
// The must be planar check must be called before the arc check. // The must be planar check must be called before the arc check.
ExtrudeSurface::ExtrudeArc(_) if must_be_planar => Some(Err(KclError::Type(KclErrorDetails::new( ExtrudeSurface::ExtrudeArc(_) if must_be_planar => Some(Err(KclError::new_type(KclErrorDetails::new(
format!("Tag `{}` is a non-planar surface", tag.value), format!("Tag `{}` is a non-planar surface", tag.value),
vec![self.source_range], vec![self.source_range],
)))), )))),
@ -548,7 +548,7 @@ impl Args {
} }
} }
// The must be planar check must be called before the fillet check. // The must be planar check must be called before the fillet check.
ExtrudeSurface::Fillet(_) if must_be_planar => Some(Err(KclError::Type(KclErrorDetails::new( ExtrudeSurface::Fillet(_) if must_be_planar => Some(Err(KclError::new_type(KclErrorDetails::new(
format!("Tag `{}` is a non-planar surface", tag.value), format!("Tag `{}` is a non-planar surface", tag.value),
vec![self.source_range], vec![self.source_range],
)))), )))),
@ -568,7 +568,7 @@ impl Args {
} }
// If we still haven't found the face, return an error. // If we still haven't found the face, return an error.
Err(KclError::Type(KclErrorDetails::new( Err(KclError::new_type(KclErrorDetails::new(
format!("Expected a face with the tag `{}`", tag.value), format!("Expected a face with the tag `{}`", tag.value),
vec![self.source_range], vec![self.source_range],
))) )))
@ -593,13 +593,13 @@ where
{ {
fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError> { fn from_args(args: &'a Args, i: usize) -> Result<Self, KclError> {
let Some(arg) = args.args.get(i) else { let Some(arg) = args.args.get(i) else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected an argument at index {i}"), format!("Expected an argument at index {i}"),
vec![args.source_range], vec![args.source_range],
))); )));
}; };
let Some(val) = T::from_kcl_val(&arg.value) else { let Some(val) = T::from_kcl_val(&arg.value) else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Argument at index {i} was supposed to be type {} but found {}", "Argument at index {i} was supposed to be type {} but found {}",
tynm::type_name::<T>(), tynm::type_name::<T>(),
@ -622,7 +622,7 @@ where
return Ok(None); return Ok(None);
} }
let Some(val) = T::from_kcl_val(&arg.value) else { let Some(val) = T::from_kcl_val(&arg.value) else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Argument at index {i} was supposed to be type Option<{}> but found {}", "Argument at index {i} was supposed to be type Option<{}> but found {}",
tynm::type_name::<T>(), tynm::type_name::<T>(),

View File

@ -58,7 +58,7 @@ async fn call_map_closure(
let output = map_fn.call_kw(None, exec_state, ctxt, args, source_range).await?; let output = map_fn.call_kw(None, exec_state, ctxt, args, source_range).await?;
let source_ranges = vec![source_range]; let source_ranges = vec![source_range];
let output = output.ok_or_else(|| { let output = output.ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
"Map function must return a value".to_owned(), "Map function must return a value".to_owned(),
source_ranges, source_ranges,
)) ))
@ -118,7 +118,7 @@ async fn call_reduce_closure(
// Unpack the returned transform object. // Unpack the returned transform object.
let source_ranges = vec![source_range]; let source_ranges = vec![source_range];
let out = transform_fn_return.ok_or_else(|| { let out = transform_fn_return.ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
"Reducer function must return a value".to_string(), "Reducer function must return a value".to_string(),
source_ranges.clone(), source_ranges.clone(),
)) ))
@ -138,7 +138,7 @@ pub async fn push(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
pub async fn pop(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn pop(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (mut array, ty) = args.get_unlabeled_kw_arg_array_and_type("array", exec_state)?; let (mut array, ty) = args.get_unlabeled_kw_arg_array_and_type("array", exec_state)?;
if array.is_empty() { if array.is_empty() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Cannot pop from an empty array".to_string(), "Cannot pop from an empty array".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -11,7 +11,7 @@ use crate::{
async fn _assert(value: bool, message: &str, args: &Args) -> Result<(), KclError> { async fn _assert(value: bool, message: &str, args: &Args) -> Result<(), KclError> {
if !value { if !value {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
format!("assert failed: {}", message), format!("assert failed: {}", message),
vec![args.source_range], vec![args.source_range],
))); )));
@ -72,14 +72,14 @@ async fn inner_assert(
.iter() .iter()
.all(|cond| cond.is_none()); .all(|cond| cond.is_none());
if no_condition_given { if no_condition_given {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"You must provide at least one condition in this assert (for example, isEqualTo)".to_owned(), "You must provide at least one condition in this assert (for example, isEqualTo)".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if tolerance.is_some() && is_equal_to.is_none() { if tolerance.is_some() && is_equal_to.is_none() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"The `tolerance` arg is only used with `isEqualTo`. Either remove `tolerance` or add an `isEqualTo` arg." "The `tolerance` arg is only used with `isEqualTo`. Either remove `tolerance` or add an `isEqualTo` arg."
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],

View File

@ -41,7 +41,7 @@ async fn inner_chamfer(
// If you try and tag multiple edges with a tagged chamfer, we want to return an // If you try and tag multiple edges with a tagged chamfer, we want to return an
// error to the user that they can only tag one edge at a time. // error to the user that they can only tag one edge at a time.
if tag.is_some() && tags.len() > 1 { if tag.is_some() && tags.len() > 1 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"You can only tag one edge at a time with a tagged chamfer. Either delete the tag for the chamfer fn if you don't need it OR separate into individual chamfer functions for each tag.".to_string(), "You can only tag one edge at a time with a tagged chamfer. Either delete the tag for the chamfer fn if you don't need it OR separate into individual chamfer functions for each tag.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -84,7 +84,7 @@ async fn inner_clone(
fix_tags_and_references(&mut new_geometry, old_id, exec_state, &args) fix_tags_and_references(&mut new_geometry, old_id, exec_state, &args)
.await .await
.map_err(|e| { .map_err(|e| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("failed to fix tags and references: {:?}", e), format!("failed to fix tags and references: {:?}", e),
vec![args.source_range], vec![args.source_range],
)) ))

View File

@ -23,7 +23,7 @@ pub async fn union(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
let tolerance: Option<TyF64> = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?; let tolerance: Option<TyF64> = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?;
if solids.len() < 2 { if solids.len() < 2 {
return Err(KclError::UndefinedValue(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"At least two solids are required for a union operation.".to_string(), "At least two solids are required for a union operation.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -66,7 +66,7 @@ pub(crate) async fn inner_union(
modeling_response: OkModelingCmdResponse::BooleanUnion(BooleanUnion { extra_solid_ids }), modeling_response: OkModelingCmdResponse::BooleanUnion(BooleanUnion { extra_solid_ids }),
} = result } = result
else { else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
"Failed to get the result of the union operation.".to_string(), "Failed to get the result of the union operation.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -88,7 +88,7 @@ pub async fn intersect(exec_state: &mut ExecState, args: Args) -> Result<KclValu
let tolerance: Option<TyF64> = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?; let tolerance: Option<TyF64> = args.get_kw_arg_opt_typed("tolerance", &RuntimeType::length(), exec_state)?;
if solids.len() < 2 { if solids.len() < 2 {
return Err(KclError::UndefinedValue(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"At least two solids are required for an intersect operation.".to_string(), "At least two solids are required for an intersect operation.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -131,7 +131,7 @@ pub(crate) async fn inner_intersect(
modeling_response: OkModelingCmdResponse::BooleanIntersection(BooleanIntersection { extra_solid_ids }), modeling_response: OkModelingCmdResponse::BooleanIntersection(BooleanIntersection { extra_solid_ids }),
} = result } = result
else { else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
"Failed to get the result of the intersection operation.".to_string(), "Failed to get the result of the intersection operation.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -193,7 +193,7 @@ pub(crate) async fn inner_subtract(
modeling_response: OkModelingCmdResponse::BooleanSubtract(BooleanSubtract { extra_solid_ids }), modeling_response: OkModelingCmdResponse::BooleanSubtract(BooleanSubtract { extra_solid_ids }),
} = result } = result
else { else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
"Failed to get the result of the subtract operation.".to_string(), "Failed to get the result of the subtract operation.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -52,7 +52,7 @@ async fn inner_get_opposite_edge(
modeling_response: OkModelingCmdResponse::Solid3dGetOppositeEdge(opposite_edge), modeling_response: OkModelingCmdResponse::Solid3dGetOppositeEdge(opposite_edge),
} = &resp } = &resp
else { else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!("mcmd::Solid3dGetOppositeEdge response was not as expected: {:?}", resp), format!("mcmd::Solid3dGetOppositeEdge response was not as expected: {:?}", resp),
vec![args.source_range], vec![args.source_range],
))); )));
@ -100,7 +100,7 @@ async fn inner_get_next_adjacent_edge(
modeling_response: OkModelingCmdResponse::Solid3dGetNextAdjacentEdge(adjacent_edge), modeling_response: OkModelingCmdResponse::Solid3dGetNextAdjacentEdge(adjacent_edge),
} = &resp } = &resp
else { else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!( format!(
"mcmd::Solid3dGetNextAdjacentEdge response was not as expected: {:?}", "mcmd::Solid3dGetNextAdjacentEdge response was not as expected: {:?}",
resp resp
@ -110,7 +110,7 @@ async fn inner_get_next_adjacent_edge(
}; };
adjacent_edge.edge.ok_or_else(|| { adjacent_edge.edge.ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("No edge found next adjacent to tag: `{}`", edge.value), format!("No edge found next adjacent to tag: `{}`", edge.value),
vec![args.source_range], vec![args.source_range],
)) ))
@ -155,7 +155,7 @@ async fn inner_get_previous_adjacent_edge(
modeling_response: OkModelingCmdResponse::Solid3dGetPrevAdjacentEdge(adjacent_edge), modeling_response: OkModelingCmdResponse::Solid3dGetPrevAdjacentEdge(adjacent_edge),
} = &resp } = &resp
else { else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!( format!(
"mcmd::Solid3dGetPrevAdjacentEdge response was not as expected: {:?}", "mcmd::Solid3dGetPrevAdjacentEdge response was not as expected: {:?}",
resp resp
@ -165,7 +165,7 @@ async fn inner_get_previous_adjacent_edge(
}; };
adjacent_edge.edge.ok_or_else(|| { adjacent_edge.edge.ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("No edge found previous adjacent to tag: `{}`", edge.value), format!("No edge found previous adjacent to tag: `{}`", edge.value),
vec![args.source_range], vec![args.source_range],
)) ))
@ -198,7 +198,7 @@ async fn inner_get_common_edge(
} }
if faces.len() != 2 { if faces.len() != 2 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"getCommonEdge requires exactly two tags for faces".to_string(), "getCommonEdge requires exactly two tags for faces".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -210,7 +210,7 @@ async fn inner_get_common_edge(
let second_tagged_path = args.get_tag_engine_info(exec_state, &faces[1])?; let second_tagged_path = args.get_tag_engine_info(exec_state, &faces[1])?;
if first_tagged_path.sketch != second_tagged_path.sketch { if first_tagged_path.sketch != second_tagged_path.sketch {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"getCommonEdge requires the faces to be in the same original sketch".to_string(), "getCommonEdge requires the faces to be in the same original sketch".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -239,14 +239,14 @@ async fn inner_get_common_edge(
modeling_response: OkModelingCmdResponse::Solid3dGetCommonEdge(common_edge), modeling_response: OkModelingCmdResponse::Solid3dGetCommonEdge(common_edge),
} = &resp } = &resp
else { else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!("mcmd::Solid3dGetCommonEdge response was not as expected: {:?}", resp), format!("mcmd::Solid3dGetCommonEdge response was not as expected: {:?}", resp),
vec![args.source_range], vec![args.source_range],
))); )));
}; };
common_edge.edge.ok_or_else(|| { common_edge.edge.ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!( format!(
"No common edge was found between `{}` and `{}`", "No common edge was found between `{}` and `{}`",
faces[0].value, faces[1].value faces[0].value, faces[1].value

View File

@ -66,7 +66,7 @@ async fn inner_extrude(
let mut solids = Vec::new(); let mut solids = Vec::new();
if symmetric.unwrap_or(false) && bidirectional_length.is_some() { if symmetric.unwrap_or(false) && bidirectional_length.is_some() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"You cannot give both `symmetric` and `bidirectional` params, you have to choose one or the other" "You cannot give both `symmetric` and `bidirectional` params, you have to choose one or the other"
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -153,7 +153,7 @@ pub(crate) async fn do_post_extrude<'a>(
// The "get extrusion face info" API call requires *any* edge on the sketch being extruded. // The "get extrusion face info" API call requires *any* edge on the sketch being extruded.
// So, let's just use the first one. // So, let's just use the first one.
let Some(any_edge_id) = sketch.paths.first().map(|edge| edge.get_base().geo_meta.id) else { let Some(any_edge_id) = sketch.paths.first().map(|edge| edge.get_base().geo_meta.id) else {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Expected a non-empty sketch".to_owned(), "Expected a non-empty sketch".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -278,7 +278,7 @@ pub(crate) async fn do_post_extrude<'a>(
// Add the tags for the start or end caps. // Add the tags for the start or end caps.
if let Some(tag_start) = named_cap_tags.start { if let Some(tag_start) = named_cap_tags.start {
let Some(start_cap_id) = start_cap_id else { let Some(start_cap_id) = start_cap_id else {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
format!( format!(
"Expected a start cap ID for tag `{}` for extrusion of sketch {:?}", "Expected a start cap ID for tag `{}` for extrusion of sketch {:?}",
tag_start.name, sketch.id tag_start.name, sketch.id
@ -298,7 +298,7 @@ pub(crate) async fn do_post_extrude<'a>(
} }
if let Some(tag_end) = named_cap_tags.end { if let Some(tag_end) = named_cap_tags.end {
let Some(end_cap_id) = end_cap_id else { let Some(end_cap_id) = end_cap_id else {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
format!( format!(
"Expected an end cap ID for tag `{}` for extrusion of sketch {:?}", "Expected an end cap ID for tag `{}` for extrusion of sketch {:?}",
tag_end.name, sketch.id tag_end.name, sketch.id

View File

@ -49,7 +49,7 @@ pub(super) fn validate_unique<T: Eq + std::hash::Hash>(tags: &[(T, SourceRange)]
} }
} }
if !duplicate_tags_source.is_empty() { if !duplicate_tags_source.is_empty() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"The same edge ID is being referenced multiple times, which is not allowed. Please select a different edge" "The same edge ID is being referenced multiple times, which is not allowed. Please select a different edge"
.to_string(), .to_string(),
duplicate_tags_source, duplicate_tags_source,
@ -85,14 +85,14 @@ async fn inner_fillet(
// If you try and tag multiple edges with a tagged fillet, we want to return an // If you try and tag multiple edges with a tagged fillet, we want to return an
// error to the user that they can only tag one edge at a time. // error to the user that they can only tag one edge at a time.
if tag.is_some() && tags.len() > 1 { if tag.is_some() && tags.len() > 1 {
return Err(KclError::Type(KclErrorDetails { return Err(KclError::new_type(KclErrorDetails {
message: "You can only tag one edge at a time with a tagged fillet. Either delete the tag for the fillet fn if you don't need it OR separate into individual fillet functions for each tag.".to_string(), message: "You can only tag one edge at a time with a tagged fillet. Either delete the tag for the fillet fn if you don't need it OR separate into individual fillet functions for each tag.".to_string(),
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
backtrace: Default::default(), backtrace: Default::default(),
})); }));
} }
if tags.is_empty() { if tags.is_empty() {
return Err(KclError::Semantic(KclErrorDetails { return Err(KclError::new_semantic(KclErrorDetails {
source_ranges: vec![args.source_range], source_ranges: vec![args.source_range],
message: "You must fillet at least one tag".to_owned(), message: "You must fillet at least one tag".to_owned(),
backtrace: Default::default(), backtrace: Default::default(),

View File

@ -33,7 +33,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we have a radius if we don't have a cylinder. // Make sure we have a radius if we don't have a cylinder.
if radius.is_none() && cylinder.is_none() { if radius.is_none() && cylinder.is_none() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Radius is required when creating a helix without a cylinder.".to_string(), "Radius is required when creating a helix without a cylinder.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -41,7 +41,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we don't have a radius if we have a cylinder. // Make sure we don't have a radius if we have a cylinder.
if radius.is_some() && cylinder.is_some() { if radius.is_some() && cylinder.is_some() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Radius is not allowed when creating a helix with a cylinder.".to_string(), "Radius is not allowed when creating a helix with a cylinder.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -49,7 +49,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we have an axis if we don't have a cylinder. // Make sure we have an axis if we don't have a cylinder.
if axis.is_none() && cylinder.is_none() { if axis.is_none() && cylinder.is_none() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Axis is required when creating a helix without a cylinder.".to_string(), "Axis is required when creating a helix without a cylinder.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -57,7 +57,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we don't have an axis if we have a cylinder. // Make sure we don't have an axis if we have a cylinder.
if axis.is_some() && cylinder.is_some() { if axis.is_some() && cylinder.is_some() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Axis is not allowed when creating a helix with a cylinder.".to_string(), "Axis is not allowed when creating a helix with a cylinder.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -65,7 +65,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we have a radius if we have an axis. // Make sure we have a radius if we have an axis.
if radius.is_none() && axis.is_some() { if radius.is_none() && axis.is_some() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Radius is required when creating a helix around an axis.".to_string(), "Radius is required when creating a helix around an axis.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -73,7 +73,7 @@ pub async fn helix(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Make sure we have an axis if we have a radius. // Make sure we have an axis if we have a radius.
if axis.is_none() && radius.is_some() { if axis.is_none() && radius.is_some() {
return Err(KclError::Semantic(crate::errors::KclErrorDetails::new( return Err(KclError::new_semantic(crate::errors::KclErrorDetails::new(
"Axis is required when creating a helix around an axis.".to_string(), "Axis is required when creating a helix around an axis.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -140,7 +140,7 @@ async fn inner_helix(
Axis3dOrEdgeReference::Axis { direction, origin } => { Axis3dOrEdgeReference::Axis { direction, origin } => {
// Make sure they gave us a length. // Make sure they gave us a length.
let Some(length) = length else { let Some(length) = length else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Length is required when creating a helix around an axis.".to_owned(), "Length is required when creating a helix around an axis.".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -68,7 +68,7 @@ async fn inner_loft(
) -> Result<Box<Solid>, KclError> { ) -> Result<Box<Solid>, KclError> {
// Make sure we have at least two sketches. // Make sure we have at least two sketches.
if sketches.len() < 2 { if sketches.len() < 2 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Loft requires at least two sketches, but only {} were provided.", "Loft requires at least two sketches, but only {} were provided.",
sketches.len() sketches.len()

View File

@ -56,7 +56,7 @@ pub async fn sqrt(exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
let input: TyF64 = args.get_unlabeled_kw_arg_typed("input", &RuntimeType::num_any(), exec_state)?; let input: TyF64 = args.get_unlabeled_kw_arg_typed("input", &RuntimeType::num_any(), exec_state)?;
if input.n < 0.0 { if input.n < 0.0 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Attempt to take square root (`sqrt`) of a number less than zero ({})", "Attempt to take square root (`sqrt`) of a number less than zero ({})",
input.n input.n

View File

@ -101,7 +101,7 @@ async fn inner_mirror_2d(
OkModelingCmdResponse::EntityGetAllChildUuids(EntityGetAllChildUuids { entity_ids: child_ids }), OkModelingCmdResponse::EntityGetAllChildUuids(EntityGetAllChildUuids { entity_ids: child_ids }),
} = response } = response
else { else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
"Expected a successful response from EntityGetAllChildUuids".to_string(), "Expected a successful response from EntityGetAllChildUuids".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -112,7 +112,7 @@ async fn inner_mirror_2d(
let child_id = child_ids[1]; let child_id = child_ids[1];
sketch.mirror = Some(child_id); sketch.mirror = Some(child_id);
} else { } else {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Expected child uuids to be >= 2".to_string(), "Expected child uuids to be >= 2".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -45,17 +45,6 @@ pub type StdFn = fn(
lazy_static! { lazy_static! {
static ref CORE_FNS: Vec<Box<dyn StdLibFn>> = vec![ static ref CORE_FNS: Vec<Box<dyn StdLibFn>> = vec![
Box::new(crate::std::segment::SegEnd),
Box::new(crate::std::segment::SegEndX),
Box::new(crate::std::segment::SegEndY),
Box::new(crate::std::segment::SegStart),
Box::new(crate::std::segment::SegStartX),
Box::new(crate::std::segment::SegStartY),
Box::new(crate::std::segment::LastSegX),
Box::new(crate::std::segment::LastSegY),
Box::new(crate::std::segment::SegLen),
Box::new(crate::std::segment::SegAng),
Box::new(crate::std::segment::TangentToEnd),
Box::new(crate::std::sketch::InvoluteCircular), Box::new(crate::std::sketch::InvoluteCircular),
Box::new(crate::std::sketch::Line), Box::new(crate::std::sketch::Line),
Box::new(crate::std::sketch::XLine), Box::new(crate::std::sketch::XLine),
@ -352,6 +341,50 @@ pub(crate) fn std_fn(path: &str, fn_name: &str) -> (crate::std::StdFn, StdFnProp
|e, a| Box::pin(crate::std::patterns::pattern_circular_2d(e, a)), |e, a| Box::pin(crate::std::patterns::pattern_circular_2d(e, a)),
StdFnProps::default("std::sketch::patternCircular2d"), StdFnProps::default("std::sketch::patternCircular2d"),
), ),
("sketch", "segEnd") => (
|e, a| Box::pin(crate::std::segment::segment_end(e, a)),
StdFnProps::default("std::sketch::segEnd"),
),
("sketch", "segEndX") => (
|e, a| Box::pin(crate::std::segment::segment_end_x(e, a)),
StdFnProps::default("std::sketch::segEndX"),
),
("sketch", "segEndY") => (
|e, a| Box::pin(crate::std::segment::segment_end_y(e, a)),
StdFnProps::default("std::sketch::segEndY"),
),
("sketch", "segStart") => (
|e, a| Box::pin(crate::std::segment::segment_start(e, a)),
StdFnProps::default("std::sketch::segStart"),
),
("sketch", "segStartX") => (
|e, a| Box::pin(crate::std::segment::segment_start_x(e, a)),
StdFnProps::default("std::sketch::segStartX"),
),
("sketch", "segStartY") => (
|e, a| Box::pin(crate::std::segment::segment_start_y(e, a)),
StdFnProps::default("std::sketch::segStartY"),
),
("sketch", "lastSegX") => (
|e, a| Box::pin(crate::std::segment::last_segment_x(e, a)),
StdFnProps::default("std::sketch::lastSegX"),
),
("sketch", "lastSegY") => (
|e, a| Box::pin(crate::std::segment::last_segment_y(e, a)),
StdFnProps::default("std::sketch::lastSegY"),
),
("sketch", "segLen") => (
|e, a| Box::pin(crate::std::segment::segment_length(e, a)),
StdFnProps::default("std::sketch::segLen"),
),
("sketch", "segAng") => (
|e, a| Box::pin(crate::std::segment::segment_angle(e, a)),
StdFnProps::default("std::sketch::segAng"),
),
("sketch", "tangentToEnd") => (
|e, a| Box::pin(crate::std::segment::tangent_to_end(e, a)),
StdFnProps::default("std::sketch::tangentToEnd"),
),
("appearance", "hexString") => ( ("appearance", "hexString") => (
|e, a| Box::pin(crate::std::appearance::hex_string(e, a)), |e, a| Box::pin(crate::std::appearance::hex_string(e, a)),
StdFnProps::default("std::appearance::hexString"), StdFnProps::default("std::appearance::hexString"),

View File

@ -66,7 +66,7 @@ async fn inner_pattern_transform<'a>(
// Build the vec of transforms, one for each repetition. // Build the vec of transforms, one for each repetition.
let mut transform_vec = Vec::with_capacity(usize::try_from(instances).unwrap()); let mut transform_vec = Vec::with_capacity(usize::try_from(instances).unwrap());
if instances < 1 { if instances < 1 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
MUST_HAVE_ONE_INSTANCE.to_owned(), MUST_HAVE_ONE_INSTANCE.to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -96,7 +96,7 @@ async fn inner_pattern_transform_2d<'a>(
// Build the vec of transforms, one for each repetition. // Build the vec of transforms, one for each repetition.
let mut transform_vec = Vec::with_capacity(usize::try_from(instances).unwrap()); let mut transform_vec = Vec::with_capacity(usize::try_from(instances).unwrap());
if instances < 1 { if instances < 1 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
MUST_HAVE_ONE_INSTANCE.to_owned(), MUST_HAVE_ONE_INSTANCE.to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -176,7 +176,7 @@ async fn send_pattern_transform<T: GeometryTrait>(
} }
&mock_ids &mock_ids
} else { } else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!("EntityLinearPattern response was not as expected: {:?}", resp), format!("EntityLinearPattern response was not as expected: {:?}", resp),
vec![args.source_range], vec![args.source_range],
))); )));
@ -222,7 +222,7 @@ async fn make_transform<T: GeometryTrait>(
// Unpack the returned transform object. // Unpack the returned transform object.
let source_ranges = vec![source_range]; let source_ranges = vec![source_range];
let transform_fn_return = transform_fn_return.ok_or_else(|| { let transform_fn_return = transform_fn_return.ok_or_else(|| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
"Transform function must return a value".to_string(), "Transform function must return a value".to_string(),
source_ranges.clone(), source_ranges.clone(),
)) ))
@ -233,7 +233,7 @@ async fn make_transform<T: GeometryTrait>(
let transforms: Vec<_> = value let transforms: Vec<_> = value
.into_iter() .into_iter()
.map(|val| { .map(|val| {
val.into_object().ok_or(KclError::Semantic(KclErrorDetails::new( val.into_object().ok_or(KclError::new_semantic(KclErrorDetails::new(
"Transform function must return a transform object".to_string(), "Transform function must return a transform object".to_string(),
source_ranges.clone(), source_ranges.clone(),
))) )))
@ -242,7 +242,7 @@ async fn make_transform<T: GeometryTrait>(
transforms transforms
} }
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Transform function must return a transform object".to_string(), "Transform function must return a transform object".to_string(),
source_ranges.clone(), source_ranges.clone(),
))) )))
@ -265,7 +265,7 @@ fn transform_from_obj_fields<T: GeometryTrait>(
Some(KclValue::Bool { value: true, .. }) => true, Some(KclValue::Bool { value: true, .. }) => true,
Some(KclValue::Bool { value: false, .. }) => false, Some(KclValue::Bool { value: false, .. }) => false,
Some(_) => { Some(_) => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"The 'replicate' key must be a bool".to_string(), "The 'replicate' key must be a bool".to_string(),
source_ranges.clone(), source_ranges.clone(),
))); )));
@ -297,7 +297,7 @@ fn transform_from_obj_fields<T: GeometryTrait>(
let mut rotation = Rotation::default(); let mut rotation = Rotation::default();
if let Some(rot) = transform.get("rotation") { if let Some(rot) = transform.get("rotation") {
let KclValue::Object { value: rot, meta: _ } = rot else { let KclValue::Object { value: rot, meta: _ } = rot else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"The 'rotation' key must be an object (with optional fields 'angle', 'axis' and 'origin')".to_owned(), "The 'rotation' key must be an object (with optional fields 'angle', 'axis' and 'origin')".to_owned(),
source_ranges.clone(), source_ranges.clone(),
))); )));
@ -311,7 +311,7 @@ fn transform_from_obj_fields<T: GeometryTrait>(
rotation.angle = Angle::from_degrees(*number); rotation.angle = Angle::from_degrees(*number);
} }
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"The 'rotation.angle' key must be a number (of degrees)".to_owned(), "The 'rotation.angle' key must be a number (of degrees)".to_owned(),
source_ranges.clone(), source_ranges.clone(),
))); )));
@ -345,7 +345,7 @@ fn array_to_point3d(
) -> Result<[TyF64; 3], KclError> { ) -> Result<[TyF64; 3], KclError> {
val.coerce(&RuntimeType::point3d(), true, exec_state) val.coerce(&RuntimeType::point3d(), true, exec_state)
.map_err(|e| { .map_err(|e| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Expected an array of 3 numbers (i.e., a 3D point), found {}", "Expected an array of 3 numbers (i.e., a 3D point), found {}",
e.found e.found
@ -365,7 +365,7 @@ fn array_to_point2d(
) -> Result<[TyF64; 2], KclError> { ) -> Result<[TyF64; 2], KclError> {
val.coerce(&RuntimeType::point2d(), true, exec_state) val.coerce(&RuntimeType::point2d(), true, exec_state)
.map_err(|e| { .map_err(|e| {
KclError::Semantic(KclErrorDetails::new( KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Expected an array of 2 numbers (i.e., a 2D point), found {}", "Expected an array of 2 numbers (i.e., a 2D point), found {}",
e.found e.found
@ -534,7 +534,7 @@ pub async fn pattern_linear_2d(exec_state: &mut ExecState, args: Args) -> Result
let axis = axis.to_point2d(); let axis = axis.to_point2d();
if axis[0].n == 0.0 && axis[1].n == 0.0 { if axis[0].n == 0.0 && axis[1].n == 0.0 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"The axis of the linear pattern cannot be the zero vector. Otherwise they will just duplicate in place." "The axis of the linear pattern cannot be the zero vector. Otherwise they will just duplicate in place."
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -594,7 +594,7 @@ pub async fn pattern_linear_3d(exec_state: &mut ExecState, args: Args) -> Result
let axis = axis.to_point3d(); let axis = axis.to_point3d();
if axis[0].n == 0.0 && axis[1].n == 0.0 && axis[2].n == 0.0 { if axis[0].n == 0.0 && axis[1].n == 0.0 && axis[2].n == 0.0 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"The axis of the linear pattern cannot be the zero vector. Otherwise they will just duplicate in place." "The axis of the linear pattern cannot be the zero vector. Otherwise they will just duplicate in place."
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -803,7 +803,7 @@ async fn inner_pattern_circular_2d(
.await?; .await?;
let Geometries::Sketches(new_sketches) = geometries else { let Geometries::Sketches(new_sketches) = geometries else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected a vec of sketches".to_string(), "Expected a vec of sketches".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -901,7 +901,7 @@ async fn inner_pattern_circular_3d(
.await?; .await?;
let Geometries::Solids(new_solids) = geometries else { let Geometries::Solids(new_solids) = geometries else {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected a vec of solids".to_string(), "Expected a vec of solids".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -926,7 +926,7 @@ async fn pattern_circular(
return Ok(Geometries::from(geometry)); return Ok(Geometries::from(geometry));
} }
RepetitionsNeeded::Invalid => { RepetitionsNeeded::Invalid => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
MUST_HAVE_ONE_INSTANCE.to_owned(), MUST_HAVE_ONE_INSTANCE.to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -971,7 +971,7 @@ async fn pattern_circular(
} }
&mock_ids &mock_ids
} else { } else {
return Err(KclError::Engine(KclErrorDetails::new( return Err(KclError::new_engine(KclErrorDetails::new(
format!("EntityCircularPattern response was not as expected: {:?}", resp), format!("EntityCircularPattern response was not as expected: {:?}", resp),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -75,7 +75,7 @@ async fn inner_revolve(
// We don't use validate() here because we want to return a specific error message that is // We don't use validate() here because we want to return a specific error message that is
// nice and we use the other data in the docs, so we still need use the derive above for the json schema. // nice and we use the other data in the docs, so we still need use the derive above for the json schema.
if !(-360.0..=360.0).contains(&angle) || angle == 0.0 { if !(-360.0..=360.0).contains(&angle) || angle == 0.0 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected angle to be between -360 and 360 and not 0, found `{}`", angle), format!("Expected angle to be between -360 and 360 and not 0, found `{}`", angle),
vec![args.source_range], vec![args.source_range],
))); )));
@ -87,7 +87,7 @@ async fn inner_revolve(
// We don't use validate() here because we want to return a specific error message that is // We don't use validate() here because we want to return a specific error message that is
// nice and we use the other data in the docs, so we still need use the derive above for the json schema. // nice and we use the other data in the docs, so we still need use the derive above for the json schema.
if !(-360.0..=360.0).contains(&bidirectional_angle) || bidirectional_angle == 0.0 { if !(-360.0..=360.0).contains(&bidirectional_angle) || bidirectional_angle == 0.0 {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Expected bidirectional angle to be between -360 and 360 and not 0, found `{}`", "Expected bidirectional angle to be between -360 and 360 and not 0, found `{}`",
bidirectional_angle bidirectional_angle
@ -99,7 +99,7 @@ async fn inner_revolve(
if let Some(angle) = angle { if let Some(angle) = angle {
let ang = angle.signum() * bidirectional_angle + angle; let ang = angle.signum() * bidirectional_angle + angle;
if !(-360.0..=360.0).contains(&ang) { if !(-360.0..=360.0).contains(&ang) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!( format!(
"Combined angle and bidirectional must be between -360 and 360, found '{}'", "Combined angle and bidirectional must be between -360 and 360, found '{}'",
ang ang
@ -111,7 +111,7 @@ async fn inner_revolve(
} }
if symmetric.unwrap_or(false) && bidirectional_angle.is_some() { if symmetric.unwrap_or(false) && bidirectional_angle.is_some() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"You cannot give both `symmetric` and `bidirectional` params, you have to choose one or the other" "You cannot give both `symmetric` and `bidirectional` params, you have to choose one or the other"
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],

View File

@ -1,7 +1,6 @@
//! Functions related to line segments. //! Functions related to line segments.
use anyhow::Result; use anyhow::Result;
use kcl_derive_docs::stdlib;
use kittycad_modeling_cmds::shared::Angle; use kittycad_modeling_cmds::shared::Angle;
use super::utils::untype_point; use super::utils::untype_point;
@ -22,43 +21,10 @@ pub async fn segment_end(exec_state: &mut ExecState, args: Args) -> Result<KclVa
args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone()) args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone())
} }
/// Compute the ending point of the provided line segment.
///
/// ```no_run
/// w = 15
/// cube = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> line(end = [w, 0], tag = $line1)
/// |> line(end = [0, w], tag = $line2)
/// |> line(end = [-w, 0], tag = $line3)
/// |> line(end = [0, -w], tag = $line4)
/// |> close()
/// |> extrude(length = 5)
///
/// fn cylinder(radius, tag) {
/// return startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> circle(radius = radius, center = segEnd(tag) )
/// |> extrude(length = radius)
/// }
///
/// cylinder(radius = 1, tag = line1)
/// cylinder(radius = 2, tag = line2)
/// cylinder(radius = 3, tag = line3)
/// cylinder(radius = 4, tag = line4)
/// ```
#[stdlib {
name = "segEnd",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> { fn inner_segment_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -78,31 +44,10 @@ pub async fn segment_end_x(exec_state: &mut ExecState, args: Args) -> Result<Kcl
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Compute the ending point of the provided line segment along the 'x' axis.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0], tag = $thing)
/// |> line(end = [0, 5])
/// |> line(end = [segEndX(thing), 0])
/// |> line(end = [-20, 10])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "segEndX",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_end_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> { fn inner_segment_end_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -119,32 +64,10 @@ pub async fn segment_end_y(exec_state: &mut ExecState, args: Args) -> Result<Kcl
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Compute the ending point of the provided line segment along the 'y' axis.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> line(end = [0, 3], tag = $thing)
/// |> line(end = [-10, 0])
/// |> line(end = [0, segEndY(thing)])
/// |> line(end = [-10, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "segEndY",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_end_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> { fn inner_segment_end_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -161,43 +84,10 @@ pub async fn segment_start(exec_state: &mut ExecState, args: Args) -> Result<Kcl
args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone()) args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone())
} }
/// Compute the starting point of the provided line segment.
///
/// ```no_run
/// w = 15
/// cube = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> line(end = [w, 0], tag = $line1)
/// |> line(end = [0, w], tag = $line2)
/// |> line(end = [-w, 0], tag = $line3)
/// |> line(end = [0, -w], tag = $line4)
/// |> close()
/// |> extrude(length = 5)
///
/// fn cylinder(radius, tag) {
/// return startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> circle( radius = radius, center = segStart(tag) )
/// |> extrude(length = radius)
/// }
///
/// cylinder(radius = 1, tag = line1)
/// cylinder(radius = 2, tag = line2)
/// cylinder(radius = 3, tag = line3)
/// cylinder(radius = 4, tag = line4)
/// ```
#[stdlib {
name = "segStart",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_start(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> { fn inner_segment_start(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<[TyF64; 2], KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -217,31 +107,10 @@ pub async fn segment_start_x(exec_state: &mut ExecState, args: Args) -> Result<K
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Compute the starting point of the provided line segment along the 'x' axis.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0], tag = $thing)
/// |> line(end = [0, 5])
/// |> line(end = [20 - segStartX(thing), 0])
/// |> line(end = [-20, 10])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "segStartX",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_start_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> { fn inner_segment_start_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -258,32 +127,10 @@ pub async fn segment_start_y(exec_state: &mut ExecState, args: Args) -> Result<K
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Compute the starting point of the provided line segment along the 'y' axis.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> line(end = [0, 3], tag = $thing)
/// |> line(end = [-10, 0])
/// |> line(end = [0, 20-segStartY(thing)])
/// |> line(end = [-10, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "segStartY",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_start_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> { fn inner_segment_start_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -300,34 +147,12 @@ pub async fn last_segment_x(exec_state: &mut ExecState, args: Args) -> Result<Kc
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Extract the 'x' axis value of the last line segment in the provided 2-d
/// sketch.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [5, 0])
/// |> line(end = [20, 5])
/// |> line(end = [lastSegX(%), 0])
/// |> line(end = [-15, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "lastSegX",
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
},
tags = ["sketch"]
}]
fn inner_last_segment_x(sketch: Sketch, args: Args) -> Result<TyF64, KclError> { fn inner_last_segment_x(sketch: Sketch, args: Args) -> Result<TyF64, KclError> {
let last_line = sketch let last_line = sketch
.paths .paths
.last() .last()
.ok_or_else(|| { .ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a Sketch with at least one segment, found `{:?}`", sketch), format!("Expected a Sketch with at least one segment, found `{:?}`", sketch),
vec![args.source_range], vec![args.source_range],
)) ))
@ -346,34 +171,12 @@ pub async fn last_segment_y(exec_state: &mut ExecState, args: Args) -> Result<Kc
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Extract the 'y' axis value of the last line segment in the provided 2-d
/// sketch.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [5, 0])
/// |> line(end = [20, 5])
/// |> line(end = [0, lastSegY(%)])
/// |> line(end = [-15, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "lastSegY",
unlabeled_first = true,
args = {
sketch = { docs = "The sketch whose line segment is being queried"},
},
tags = ["sketch"]
}]
fn inner_last_segment_y(sketch: Sketch, args: Args) -> Result<TyF64, KclError> { fn inner_last_segment_y(sketch: Sketch, args: Args) -> Result<TyF64, KclError> {
let last_line = sketch let last_line = sketch
.paths .paths
.last() .last()
.ok_or_else(|| { .ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a Sketch with at least one segment, found `{:?}`", sketch), format!("Expected a Sketch with at least one segment, found `{:?}`", sketch),
vec![args.source_range], vec![args.source_range],
)) ))
@ -390,37 +193,10 @@ pub async fn segment_length(exec_state: &mut ExecState, args: Args) -> Result<Kc
Ok(args.make_user_val_from_f64_with_type(result)) Ok(args.make_user_val_from_f64_with_type(result))
} }
/// Compute the length of the provided line segment.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> angledLine(
/// angle = 60,
/// length = 10,
/// tag = $thing,
/// )
/// |> tangentialArc(angle = -120, radius = 5)
/// |> angledLine(
/// angle = -60,
/// length = segLen(thing),
/// )
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "segLen",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_length(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> { fn inner_segment_length(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<TyF64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -437,33 +213,10 @@ pub async fn segment_angle(exec_state: &mut ExecState, args: Args) -> Result<Kcl
Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees()))) Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees())))
} }
/// Compute the angle (in degrees) of the provided line segment.
///
/// ```no_run
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [10, 0])
/// |> line(end = [5, 10], tag = $seg01)
/// |> line(end = [-10, 0])
/// |> angledLine(angle = segAng(seg01), length = 10)
/// |> line(end = [-10, 0])
/// |> angledLine(angle = segAng(seg01), length = -15)
/// |> close()
///
/// example = extrude(exampleSketch, length = 4)
/// ```
#[stdlib {
name = "segAng",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
fn inner_segment_angle(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> { fn inner_segment_angle(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))
@ -482,89 +235,10 @@ pub async fn tangent_to_end(exec_state: &mut ExecState, args: Args) -> Result<Kc
Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees()))) Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees())))
} }
/// Returns the angle coming out of the end of the segment in degrees.
///
/// ```no_run
/// // Horizontal pill.
/// pillSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> tangentialArc(end = [0, 10], tag = $arc1)
/// |> angledLine(
/// angle = tangentToEnd(arc1),
/// length = 20,
/// )
/// |> tangentialArc(end = [0, -10])
/// |> close()
///
/// pillExtrude = extrude(pillSketch, length = 10)
/// ```
///
/// ```no_run
/// // Vertical pill. Use absolute coordinate for arc.
/// pillSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [0, 20])
/// |> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
/// |> angledLine(
/// angle = tangentToEnd(arc1),
/// length = 20,
/// )
/// |> tangentialArc(end = [-10, 0])
/// |> close()
///
/// pillExtrude = extrude(pillSketch, length = 10)
/// ```
///
/// ```no_run
/// rectangleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [10, 0], tag = $seg1)
/// |> angledLine(
/// angle = tangentToEnd(seg1),
/// length = 10,
/// )
/// |> line(end = [0, 10])
/// |> line(end = [-20, 0])
/// |> close()
///
/// rectangleExtrude = extrude(rectangleSketch, length = 10)
/// ```
///
/// ```no_run
/// bottom = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> arc(
/// endAbsolute = [10, 10],
/// interiorAbsolute = [5, 1],
/// tag = $arc1,
/// )
/// |> angledLine(angle = tangentToEnd(arc1), length = 20)
/// |> close()
/// ```
///
/// ```no_run
/// circSketch = startSketchOn(XY)
/// |> circle( center= [0, 0], radius= 3 , tag= $circ)
///
/// triangleSketch = startSketchOn(XY)
/// |> startProfile(at = [-5, 0])
/// |> angledLine(angle = tangentToEnd(circ), length = 10)
/// |> line(end = [-15, 0])
/// |> close()
/// ```
#[stdlib {
name = "tangentToEnd",
unlabeled_first = true,
args = {
tag = { docs = "The line segment being queried by its tag"},
},
tags = ["sketch"]
}]
async fn inner_tangent_to_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> { async fn inner_tangent_to_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args) -> Result<f64, KclError> {
let line = args.get_tag_engine_info(exec_state, tag)?; let line = args.get_tag_engine_info(exec_state, tag)?;
let path = line.path.clone().ok_or_else(|| { let path = line.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected a line segment with a path, found `{:?}`", line), format!("Expected a line segment with a path, found `{:?}`", line),
vec![args.source_range], vec![args.source_range],
)) ))

View File

@ -271,14 +271,14 @@ async fn inner_polygon(
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
if num_sides < 3 { if num_sides < 3 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Polygon must have at least 3 sides".to_string(), "Polygon must have at least 3 sides".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if radius.n <= 0.0 { if radius.n <= 0.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Radius must be greater than 0".to_string(), "Radius must be greater than 0".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -407,11 +407,11 @@ pub(crate) fn get_radius(
match (radius, diameter) { match (radius, diameter) {
(Some(radius), None) => Ok(radius), (Some(radius), None) => Ok(radius),
(None, Some(diameter)) => Ok(TyF64::new(diameter.n / 2.0, diameter.ty)), (None, Some(diameter)) => Ok(TyF64::new(diameter.n / 2.0, diameter.ty)),
(None, None) => Err(KclError::Type(KclErrorDetails::new( (None, None) => Err(KclError::new_type(KclErrorDetails::new(
"This function needs either `diameter` or `radius`".to_string(), "This function needs either `diameter` or `radius`".to_string(),
vec![source_range], vec![source_range],
))), ))),
(Some(_), Some(_)) => Err(KclError::Type(KclErrorDetails::new( (Some(_), Some(_)) => Err(KclError::new_type(KclErrorDetails::new(
"You cannot specify both `diameter` and `radius`, please remove one".to_string(), "You cannot specify both `diameter` and `radius`, please remove one".to_string(),
vec![source_range], vec![source_range],
))), ))),

View File

@ -36,14 +36,14 @@ async fn inner_shell(
args: Args, args: Args,
) -> Result<Vec<Solid>, KclError> { ) -> Result<Vec<Solid>, KclError> {
if faces.is_empty() { if faces.is_empty() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"You must shell at least one face".to_owned(), "You must shell at least one face".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if solids.is_empty() { if solids.is_empty() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"You must shell at least one solid".to_owned(), "You must shell at least one solid".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -63,7 +63,7 @@ async fn inner_shell(
} }
if face_ids.is_empty() { if face_ids.is_empty() {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Expected at least one valid face".to_owned(), "Expected at least one valid face".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -72,7 +72,7 @@ async fn inner_shell(
// Make sure all the solids have the same id, as we are going to shell them all at // Make sure all the solids have the same id, as we are going to shell them all at
// once. // once.
if !solids.iter().all(|eg| eg.id == solids[0].id) { if !solids.iter().all(|eg| eg.id == solids[0].id) {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"All solids stem from the same root object, like multiple sketch on face extrusions, etc.".to_owned(), "All solids stem from the same root object, like multiple sketch on face extrusions, etc.".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -65,13 +65,13 @@ impl FaceTag {
match self { match self {
FaceTag::Tag(ref t) => args.get_adjacent_face_to_tag(exec_state, t, must_be_planar).await, FaceTag::Tag(ref t) => args.get_adjacent_face_to_tag(exec_state, t, must_be_planar).await,
FaceTag::StartOrEnd(StartOrEnd::Start) => solid.start_cap_id.ok_or_else(|| { FaceTag::StartOrEnd(StartOrEnd::Start) => solid.start_cap_id.ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
"Expected a start face".to_string(), "Expected a start face".to_string(),
vec![args.source_range], vec![args.source_range],
)) ))
}), }),
FaceTag::StartOrEnd(StartOrEnd::End) => solid.end_cap_id.ok_or_else(|| { FaceTag::StartOrEnd(StartOrEnd::End) => solid.end_cap_id.ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
"Expected an end face".to_string(), "Expected an end face".to_string(),
vec![args.source_range], vec![args.source_range],
)) ))
@ -328,7 +328,7 @@ async fn straight_line(
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
let (point, is_absolute) = match (end_absolute, end) { let (point, is_absolute) = match (end_absolute, end) {
(Some(_), Some(_)) => { (Some(_), Some(_)) => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"You cannot give both `end` and `endAbsolute` params, you have to choose one or the other".to_owned(), "You cannot give both `end` and `endAbsolute` params, you have to choose one or the other".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -336,7 +336,7 @@ async fn straight_line(
(Some(end_absolute), None) => (end_absolute, true), (Some(end_absolute), None) => (end_absolute, true),
(None, Some(end)) => (end, false), (None, Some(end)) => (end, false),
(None, None) => { (None, None) => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("You must supply either `{relative_name}` or `endAbsolute` arguments"), format!("You must supply either `{relative_name}` or `endAbsolute` arguments"),
vec![args.source_range], vec![args.source_range],
))); )));
@ -603,7 +603,7 @@ async fn inner_angled_line(
.filter(|x| x.is_some()) .filter(|x| x.is_some())
.count(); .count();
if options_given > 1 { if options_given > 1 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
" one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given".to_string(), " one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -631,11 +631,11 @@ async fn inner_angled_line(
(None, None, None, None, Some(end_absolute_y)) => { (None, None, None, None, Some(end_absolute_y)) => {
inner_angled_line_to_y(angle_degrees, end_absolute_y, sketch, tag, exec_state, args).await inner_angled_line_to_y(angle_degrees, end_absolute_y, sketch, tag, exec_state, args).await
} }
(None, None, None, None, None) => Err(KclError::Type(KclErrorDetails::new( (None, None, None, None, None) => Err(KclError::new_type(KclErrorDetails::new(
"One of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` must be given".to_string(), "One of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` must be given".to_string(),
vec![args.source_range], vec![args.source_range],
))), ))),
_ => Err(KclError::Type(KclErrorDetails::new( _ => Err(KclError::new_type(KclErrorDetails::new(
"Only One of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given".to_owned(), "Only One of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given".to_owned(),
vec![args.source_range], vec![args.source_range],
))), ))),
@ -709,14 +709,14 @@ async fn inner_angled_line_of_x_length(
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
if angle_degrees.abs() == 270.0 { if angle_degrees.abs() == 270.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have an x constrained angle of 270 degrees".to_string(), "Cannot have an x constrained angle of 270 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if angle_degrees.abs() == 90.0 { if angle_degrees.abs() == 90.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have an x constrained angle of 90 degrees".to_string(), "Cannot have an x constrained angle of 90 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -741,14 +741,14 @@ async fn inner_angled_line_to_x(
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
if angle_degrees.abs() == 270.0 { if angle_degrees.abs() == 270.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have an x constrained angle of 270 degrees".to_string(), "Cannot have an x constrained angle of 270 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if angle_degrees.abs() == 90.0 { if angle_degrees.abs() == 90.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have an x constrained angle of 90 degrees".to_string(), "Cannot have an x constrained angle of 90 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -776,14 +776,14 @@ async fn inner_angled_line_of_y_length(
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
if angle_degrees.abs() == 0.0 { if angle_degrees.abs() == 0.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have a y constrained angle of 0 degrees".to_string(), "Cannot have a y constrained angle of 0 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if angle_degrees.abs() == 180.0 { if angle_degrees.abs() == 180.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have a y constrained angle of 180 degrees".to_string(), "Cannot have a y constrained angle of 180 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -808,14 +808,14 @@ async fn inner_angled_line_to_y(
let from = sketch.current_pen_position()?; let from = sketch.current_pen_position()?;
if angle_degrees.abs() == 0.0 { if angle_degrees.abs() == 0.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have a y constrained angle of 0 degrees".to_string(), "Cannot have a y constrained angle of 0 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if angle_degrees.abs() == 180.0 { if angle_degrees.abs() == 180.0 {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Cannot have a y constrained angle of 180 degrees".to_string(), "Cannot have a y constrained angle of 180 degrees".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -892,7 +892,7 @@ pub async fn inner_angled_line_that_intersects(
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
let intersect_path = args.get_tag_engine_info(exec_state, &intersect_tag)?; let intersect_path = args.get_tag_engine_info(exec_state, &intersect_tag)?;
let path = intersect_path.path.clone().ok_or_else(|| { let path = intersect_path.path.clone().ok_or_else(|| {
KclError::Type(KclErrorDetails::new( KclError::new_type(KclErrorDetails::new(
format!("Expected an intersect path with a path, found `{:?}`", intersect_path), format!("Expected an intersect path with a path, found `{:?}`", intersect_path),
vec![args.source_range], vec![args.source_range],
)) ))
@ -1169,7 +1169,7 @@ async fn inner_start_sketch_on(
SketchData::Plane(plane) => { SketchData::Plane(plane) => {
if plane.value == crate::exec::PlaneType::Uninit { if plane.value == crate::exec::PlaneType::Uninit {
if plane.info.origin.units == UnitLen::Unknown { if plane.info.origin.units == UnitLen::Unknown {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Origin of plane has unknown units".to_string(), "Origin of plane has unknown units".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -1193,7 +1193,7 @@ async fn inner_start_sketch_on(
} }
SketchData::Solid(solid) => { SketchData::Solid(solid) => {
let Some(tag) = face else { let Some(tag) = face else {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Expected a tag for the face to sketch on".to_string(), "Expected a tag for the face to sketch on".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -1717,7 +1717,7 @@ pub(crate) async fn inner_arc(
absolute_arc(&args, id, exec_state, sketch, from, interior_absolute, end_absolute, tag).await absolute_arc(&args, id, exec_state, sketch, from, interior_absolute, end_absolute, tag).await
} }
_ => { _ => {
Err(KclError::Type(KclErrorDetails::new( Err(KclError::new_type(KclErrorDetails::new(
"Invalid combination of arguments. Either provide (angleStart, angleEnd, radius) or (endAbsolute, interiorAbsolute)".to_owned(), "Invalid combination of arguments. Either provide (angleStart, angleEnd, radius) or (endAbsolute, interiorAbsolute)".to_owned(),
vec![args.source_range], vec![args.source_range],
))) )))
@ -1804,7 +1804,7 @@ pub async fn relative_arc(
let radius = radius.to_length_units(from.units); let radius = radius.to_length_units(from.units);
let (center, end) = arc_center_and_end(from.ignore_units(), a_start, a_end, radius); let (center, end) = arc_center_and_end(from.ignore_units(), a_start, a_end, radius);
if a_start == a_end { if a_start == a_end {
return Err(KclError::Type(KclErrorDetails::new( return Err(KclError::new_type(KclErrorDetails::new(
"Arc start and end angles must be different".to_string(), "Arc start and end angles must be different".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -1972,11 +1972,11 @@ async fn inner_tangential_arc(
let data = TangentialArcData::RadiusAndOffset { radius, offset: angle }; let data = TangentialArcData::RadiusAndOffset { radius, offset: angle };
inner_tangential_arc_radius_angle(data, sketch, tag, exec_state, args).await inner_tangential_arc_radius_angle(data, sketch, tag, exec_state, args).await
} }
(Some(_), Some(_), None, None, None) => Err(KclError::Semantic(KclErrorDetails::new( (Some(_), Some(_), None, None, None) => Err(KclError::new_semantic(KclErrorDetails::new(
"You cannot give both `end` and `endAbsolute` params, you have to choose one or the other".to_owned(), "You cannot give both `end` and `endAbsolute` params, you have to choose one or the other".to_owned(),
vec![args.source_range], vec![args.source_range],
))), ))),
(_, _, _, _, _) => Err(KclError::Semantic(KclErrorDetails::new( (_, _, _, _, _) => Err(KclError::new_semantic(KclErrorDetails::new(
"You must supply `end`, `endAbsolute`, or both `angle` and `radius`/`diameter` arguments".to_owned(), "You must supply `end`, `endAbsolute`, or both `angle` and `radius`/`diameter` arguments".to_owned(),
vec![args.source_range], vec![args.source_range],
))), ))),
@ -2130,13 +2130,13 @@ async fn inner_tangential_arc_to_point(
}); });
if result.center[0].is_infinite() { if result.center[0].is_infinite() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"could not sketch tangential arc, because its center would be infinitely far away in the X direction" "could not sketch tangential arc, because its center would be infinitely far away in the X direction"
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));
} else if result.center[1].is_infinite() { } else if result.center[1].is_infinite() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"could not sketch tangential arc, because its center would be infinitely far away in the Y direction" "could not sketch tangential arc, because its center would be infinitely far away in the Y direction"
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -2314,7 +2314,7 @@ async fn inner_bezier_curve(
to to
} }
_ => { _ => {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"You must either give `control1`, `control2` and `end`, or `control1Absolute`, `control2Absolute` and `endAbsolute`.".to_owned(), "You must either give `control1`, `control2` and `end`, or `control1Absolute`, `control2Absolute` and `endAbsolute`.".to_owned(),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -75,7 +75,7 @@ async fn inner_sweep(
Some("sketchPlane") => RelativeTo::SketchPlane, Some("sketchPlane") => RelativeTo::SketchPlane,
Some("trajectoryCurve") | None => RelativeTo::TrajectoryCurve, Some("trajectoryCurve") | None => RelativeTo::TrajectoryCurve,
Some(_) => { Some(_) => {
return Err(KclError::Syntax(crate::errors::KclErrorDetails::new( return Err(KclError::new_syntax(crate::errors::KclErrorDetails::new(
"If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(), "If you provide relativeTo, it must either be 'sketchPlane' or 'trajectoryCurve'".to_owned(),
vec![args.source_range], vec![args.source_range],
))) )))

View File

@ -37,7 +37,7 @@ pub async fn scale(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
// Ensure at least one scale value is provided. // Ensure at least one scale value is provided.
if scale_x.is_none() && scale_y.is_none() && scale_z.is_none() { if scale_x.is_none() && scale_y.is_none() && scale_z.is_none() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `x`, `y`, or `z` to be provided.".to_string(), "Expected `x`, `y`, or `z` to be provided.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -119,7 +119,7 @@ pub async fn translate(exec_state: &mut ExecState, args: Args) -> Result<KclValu
// Ensure at least one translation value is provided. // Ensure at least one translation value is provided.
if translate_x.is_none() && translate_y.is_none() && translate_z.is_none() { if translate_x.is_none() && translate_y.is_none() && translate_z.is_none() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `x`, `y`, or `z` to be provided.".to_string(), "Expected `x`, `y`, or `z` to be provided.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -202,7 +202,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
// Check if no rotation values are provided. // Check if no rotation values are provided.
if roll.is_none() && pitch.is_none() && yaw.is_none() && axis.is_none() && angle.is_none() { if roll.is_none() && pitch.is_none() && yaw.is_none() && axis.is_none() && angle.is_none() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `roll`, `pitch`, and `yaw` or `axis` and `angle` to be provided.".to_string(), "Expected `roll`, `pitch`, and `yaw` or `axis` and `angle` to be provided.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -212,7 +212,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
if roll.is_some() || pitch.is_some() || yaw.is_some() { if roll.is_some() || pitch.is_some() || yaw.is_some() {
// Ensure they didn't also provide an axis or angle. // Ensure they didn't also provide an axis or angle.
if axis.is_some() || angle.is_some() { if axis.is_some() || angle.is_some() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `axis` and `angle` to not be provided when `roll`, `pitch`, and `yaw` are provided." "Expected `axis` and `angle` to not be provided when `roll`, `pitch`, and `yaw` are provided."
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -223,13 +223,13 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
// If they give us an axis or angle, they must give us both. // If they give us an axis or angle, they must give us both.
if axis.is_some() || angle.is_some() { if axis.is_some() || angle.is_some() {
if axis.is_none() { if axis.is_none() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `axis` to be provided when `angle` is provided.".to_string(), "Expected `axis` to be provided when `angle` is provided.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
} }
if angle.is_none() { if angle.is_none() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `angle` to be provided when `axis` is provided.".to_string(), "Expected `angle` to be provided when `axis` is provided.".to_string(),
vec![args.source_range], vec![args.source_range],
))); )));
@ -237,7 +237,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
// Ensure they didn't also provide a roll, pitch, or yaw. // Ensure they didn't also provide a roll, pitch, or yaw.
if roll.is_some() || pitch.is_some() || yaw.is_some() { if roll.is_some() || pitch.is_some() || yaw.is_some() {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
"Expected `roll`, `pitch`, and `yaw` to not be provided when `axis` and `angle` are provided." "Expected `roll`, `pitch`, and `yaw` to not be provided when `axis` and `angle` are provided."
.to_owned(), .to_owned(),
vec![args.source_range], vec![args.source_range],
@ -248,7 +248,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
// Validate the roll, pitch, and yaw values. // Validate the roll, pitch, and yaw values.
if let Some(roll) = &roll { if let Some(roll) = &roll {
if !(-360.0..=360.0).contains(&roll.n) { if !(-360.0..=360.0).contains(&roll.n) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected roll to be between -360 and 360, found `{}`", roll.n), format!("Expected roll to be between -360 and 360, found `{}`", roll.n),
vec![args.source_range], vec![args.source_range],
))); )));
@ -256,7 +256,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
} }
if let Some(pitch) = &pitch { if let Some(pitch) = &pitch {
if !(-360.0..=360.0).contains(&pitch.n) { if !(-360.0..=360.0).contains(&pitch.n) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected pitch to be between -360 and 360, found `{}`", pitch.n), format!("Expected pitch to be between -360 and 360, found `{}`", pitch.n),
vec![args.source_range], vec![args.source_range],
))); )));
@ -264,7 +264,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
} }
if let Some(yaw) = &yaw { if let Some(yaw) = &yaw {
if !(-360.0..=360.0).contains(&yaw.n) { if !(-360.0..=360.0).contains(&yaw.n) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected yaw to be between -360 and 360, found `{}`", yaw.n), format!("Expected yaw to be between -360 and 360, found `{}`", yaw.n),
vec![args.source_range], vec![args.source_range],
))); )));
@ -274,7 +274,7 @@ pub async fn rotate(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
// Validate the axis and angle values. // Validate the axis and angle values.
if let Some(angle) = &angle { if let Some(angle) = &angle {
if !(-360.0..=360.0).contains(&angle.n) { if !(-360.0..=360.0).contains(&angle.n) {
return Err(KclError::Semantic(KclErrorDetails::new( return Err(KclError::new_semantic(KclErrorDetails::new(
format!("Expected angle to be between -360 and 360, found `{}`", angle.n), format!("Expected angle to be between -360 and 360, found `{}`", angle.n),
vec![args.source_range], vec![args.source_range],
))); )));

View File

@ -93,7 +93,7 @@ async fn do_execute_and_snapshot(
for e in exec_state.errors() { for e in exec_state.errors() {
if e.severity.is_err() { if e.severity.is_err() {
return Err(ExecErrorWithState::new( return Err(ExecErrorWithState::new(
KclErrorWithOutputs::no_outputs(KclError::Semantic(e.clone().into())).into(), KclErrorWithOutputs::no_outputs(KclError::new_semantic(e.clone().into())).into(),
exec_state.clone(), exec_state.clone(),
)); ));
} }
@ -164,7 +164,7 @@ pub async fn execute_and_export_step(
for e in exec_state.errors() { for e in exec_state.errors() {
if e.severity.is_err() { if e.severity.is_err() {
return Err(ExecErrorWithState::new( return Err(ExecErrorWithState::new(
KclErrorWithOutputs::no_outputs(KclError::Semantic(e.clone().into())).into(), KclErrorWithOutputs::no_outputs(KclError::new_semantic(e.clone().into())).into(),
exec_state.clone(), exec_state.clone(),
)); ));
} }

View File

@ -883,7 +883,7 @@ pub async fn walk_dir(dir: &std::path::PathBuf) -> Result<Vec<std::path::PathBuf
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
pub async fn recast_dir(dir: &std::path::Path, options: &crate::FormatOptions) -> Result<(), anyhow::Error> { pub async fn recast_dir(dir: &std::path::Path, options: &crate::FormatOptions) -> Result<(), anyhow::Error> {
let files = walk_dir(&dir.to_path_buf()).await.map_err(|err| { let files = walk_dir(&dir.to_path_buf()).await.map_err(|err| {
crate::KclError::Internal(crate::errors::KclErrorDetails::new( crate::KclError::new_internal(crate::errors::KclErrorDetails::new(
format!("Failed to walk directory `{}`: {:?}", dir.display(), err), format!("Failed to walk directory `{}`: {:?}", dir.display(), err),
vec![crate::SourceRange::default()], vec![crate::SourceRange::default()],
)) ))
@ -912,7 +912,7 @@ pub async fn recast_dir(dir: &std::path::Path, options: &crate::FormatOptions) -
if ce.severity != crate::errors::Severity::Warning { if ce.severity != crate::errors::Severity::Warning {
let report = crate::Report { let report = crate::Report {
kcl_source: contents.to_string(), kcl_source: contents.to_string(),
error: crate::KclError::Semantic(ce.clone().into()), error: crate::KclError::new_semantic(ce.clone().into()),
filename: file.to_string_lossy().to_string(), filename: file.to_string_lossy().to_string(),
}; };
let report = miette::Report::new(report); let report = miette::Report::new(report);

View File

@ -96,7 +96,7 @@ fn topsort(all_modules: &[&str], graph: Graph) -> Result<Vec<Vec<String>>, KclEr
if stage_modules.is_empty() { if stage_modules.is_empty() {
waiting_modules.sort(); waiting_modules.sort();
return Err(KclError::ImportCycle(KclErrorDetails::new( return Err(KclError::new_import_cycle(KclErrorDetails::new(
format!("circular import of modules not allowed: {}", waiting_modules.join(", ")), format!("circular import of modules not allowed: {}", waiting_modules.join(", ")),
// TODO: we can get the right import lines from the AST, but we don't // TODO: we can get the right import lines from the AST, but we don't
vec![SourceRange::default()], vec![SourceRange::default()],
@ -146,7 +146,7 @@ pub(crate) fn import_dependencies(
// This is a bit of a hack, but it works for now. // This is a bit of a hack, but it works for now.
ret.lock() ret.lock()
.map_err(|err| { .map_err(|err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Failed to lock mutex: {}", err), format!("Failed to lock mutex: {}", err),
Default::default(), Default::default(),
)) ))
@ -156,7 +156,7 @@ pub(crate) fn import_dependencies(
ImportPath::Foreign { path } => { ImportPath::Foreign { path } => {
ret.lock() ret.lock()
.map_err(|err| { .map_err(|err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Failed to lock mutex: {}", err), format!("Failed to lock mutex: {}", err),
Default::default(), Default::default(),
)) ))
@ -178,7 +178,7 @@ pub(crate) fn import_dependencies(
walk(ret.clone(), prog.into(), path, ctx)?; walk(ret.clone(), prog.into(), path, ctx)?;
let ret = ret.lock().map_err(|err| { let ret = ret.lock().map_err(|err| {
KclError::Internal(KclErrorDetails::new( KclError::new_internal(KclErrorDetails::new(
format!("Failed to lock mutex: {}", err), format!("Failed to lock mutex: {}", err),
Default::default(), Default::default(),
)) ))
@ -223,7 +223,7 @@ pub(crate) async fn import_universe(
let repr = { let repr = {
let Some(module_info) = exec_state.get_module(module_id) else { let Some(module_info) = exec_state.get_module(module_id) else {
return Err(KclError::Internal(KclErrorDetails::new( return Err(KclError::new_internal(KclErrorDetails::new(
format!("Module {} not found", module_id), format!("Module {} not found", module_id),
vec![import_stmt.into()], vec![import_stmt.into()],
))); )));

View File

@ -895,3 +895,304 @@ export fn patternCircular2d(
/// If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid. /// If the target was sketched on an extrusion, setting this will use the original sketch as the target, not the entire joined solid.
useOriginal?: bool = false, useOriginal?: bool = false,
): [Sketch; 1+] {} ): [Sketch; 1+] {}
/// Compute the ending point of the provided line segment.
///
/// ```kcl
/// w = 15
/// cube = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> line(end = [w, 0], tag = $line1)
/// |> line(end = [0, w], tag = $line2)
/// |> line(end = [-w, 0], tag = $line3)
/// |> line(end = [0, -w], tag = $line4)
/// |> close()
/// |> extrude(length = 5)
///
/// fn cylinder(radius, tag) {
/// return startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> circle(radius = radius, center = segEnd(tag) )
/// |> extrude(length = radius)
/// }
///
/// cylinder(radius = 1, tag = line1)
/// cylinder(radius = 2, tag = line2)
/// cylinder(radius = 3, tag = line3)
/// cylinder(radius = 4, tag = line4)
/// ```
@(impl = std_rust)
export fn segEnd(
/// The line segment being queried by its tag.
@tag: tag,
): Point2d {}
/// Compute the ending point of the provided line segment along the 'x' axis.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0], tag = $thing)
/// |> line(end = [0, 5])
/// |> line(end = [segEndX(thing), 0])
/// |> line(end = [-20, 10])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn segEndX(
/// The line segment being queried by its tag.
@tag: tag,
): number(Length) {}
/// Compute the ending point of the provided line segment along the 'y' axis.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> line(end = [0, 3], tag = $thing)
/// |> line(end = [-10, 0])
/// |> line(end = [0, segEndY(thing)])
/// |> line(end = [-10, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn segEndY(
/// The line segment being queried by its tag.
@tag: tag,
): number(Length) {}
/// Compute the starting point of the provided line segment.
///
/// ```kcl
/// w = 15
/// cube = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> line(end = [w, 0], tag = $line1)
/// |> line(end = [0, w], tag = $line2)
/// |> line(end = [-w, 0], tag = $line3)
/// |> line(end = [0, -w], tag = $line4)
/// |> close()
/// |> extrude(length = 5)
///
/// fn cylinder(radius, tag) {
/// return startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> circle( radius = radius, center = segStart(tag) )
/// |> extrude(length = radius)
/// }
///
/// cylinder(radius = 1, tag = line1)
/// cylinder(radius = 2, tag = line2)
/// cylinder(radius = 3, tag = line3)
/// cylinder(radius = 4, tag = line4)
/// ```
@(impl = std_rust)
export fn segStart(
/// The line segment being queried by its tag.
@tag: tag,
): Point2d {}
/// Compute the starting point of the provided line segment along the 'x' axis.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0], tag = $thing)
/// |> line(end = [0, 5])
/// |> line(end = [20 - segStartX(thing), 0])
/// |> line(end = [-20, 10])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn segStartX(
/// The line segment being queried by its tag.
@tag: tag,
): number(Length) {}
/// Compute the starting point of the provided line segment along the 'y' axis.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> line(end = [0, 3], tag = $thing)
/// |> line(end = [-10, 0])
/// |> line(end = [0, 20-segStartY(thing)])
/// |> line(end = [-10, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn segStartY(
/// The line segment being queried by its tag.
@tag: tag,
): number(Length) {}
/// Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [5, 0])
/// |> line(end = [20, 5])
/// |> line(end = [lastSegX(%), 0])
/// |> line(end = [-15, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn lastSegX(
/// The sketch whose line segment is being queried.
@sketch: Sketch,
): number(Length) {}
/// Extract the 'y' axis value of the last line segment in the provided 2-d sketch.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [5, 0])
/// |> line(end = [20, 5])
/// |> line(end = [0, lastSegY(%)])
/// |> line(end = [-15, 0])
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn lastSegY(
/// The sketch whose line segment is being queried.
@sketch: Sketch,
): number(Length) {}
/// Compute the length of the provided line segment.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> angledLine(
/// angle = 60,
/// length = 10,
/// tag = $thing,
/// )
/// |> tangentialArc(angle = -120, radius = 5)
/// |> angledLine(
/// angle = -60,
/// length = segLen(thing),
/// )
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
@(impl = std_rust)
export fn segLen(
/// The line segment being queried by its tag.
@tag: tag,
): number(Length) {}
/// Compute the angle (in degrees) of the provided line segment.
///
/// ```kcl
/// exampleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [10, 0])
/// |> line(end = [5, 10], tag = $seg01)
/// |> line(end = [-10, 0])
/// |> angledLine(angle = segAng(seg01), length = 10)
/// |> line(end = [-10, 0])
/// |> angledLine(angle = segAng(seg01), length = -15)
/// |> close()
///
/// example = extrude(exampleSketch, length = 4)
/// ```
@(impl = std_rust)
export fn segAng(
/// The line segment being queried by its tag.
@tag: tag,
): number(Angle) {}
/// Returns the angle coming out of the end of the segment in degrees.
///
/// ```kcl
/// // Horizontal pill.
/// pillSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [20, 0])
/// |> tangentialArc(end = [0, 10], tag = $arc1)
/// |> angledLine(
/// angle = tangentToEnd(arc1),
/// length = 20,
/// )
/// |> tangentialArc(end = [0, -10])
/// |> close()
///
/// pillExtrude = extrude(pillSketch, length = 10)
/// ```
///
/// ```kcl
/// // Vertical pill. Use absolute coordinate for arc.
/// pillSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [0, 20])
/// |> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
/// |> angledLine(
/// angle = tangentToEnd(arc1),
/// length = 20,
/// )
/// |> tangentialArc(end = [-10, 0])
/// |> close()
///
/// pillExtrude = extrude(pillSketch, length = 10)
/// ```
///
/// ```kcl
/// rectangleSketch = startSketchOn(XZ)
/// |> startProfile(at = [0, 0])
/// |> line(end = [10, 0], tag = $seg1)
/// |> angledLine(
/// angle = tangentToEnd(seg1),
/// length = 10,
/// )
/// |> line(end = [0, 10])
/// |> line(end = [-20, 0])
/// |> close()
///
/// rectangleExtrude = extrude(rectangleSketch, length = 10)
/// ```
///
/// ```kcl
/// bottom = startSketchOn(XY)
/// |> startProfile(at = [0, 0])
/// |> arc(
/// endAbsolute = [10, 10],
/// interiorAbsolute = [5, 1],
/// tag = $arc1,
/// )
/// |> angledLine(angle = tangentToEnd(arc1), length = 20)
/// |> close()
/// ```
///
/// ```kcl
/// circSketch = startSketchOn(XY)
/// |> circle(center = [0, 0], radius= 3, tag = $circ)
///
/// triangleSketch = startSketchOn(XY)
/// |> startProfile(at = [-5, 0])
/// |> angledLine(angle = tangentToEnd(circ), length = 10)
/// |> line(end = [-15, 0])
/// |> close()
/// ```
@(impl = std_rust)
export fn tangentToEnd(
/// The line segment being queried by its tag.
@tag: tag,
): number(Angle) {}

View File

@ -369,8 +369,9 @@ flowchart LR
264["SweepEdge Adjacent"] 264["SweepEdge Adjacent"]
265["SweepEdge Adjacent"] 265["SweepEdge Adjacent"]
266["SweepEdge Adjacent"] 266["SweepEdge Adjacent"]
267["EdgeCut Fillet<br>[5131, 5642, 1]"] 267["SweepEdge Adjacent"]
268["EdgeCut Fillet<br>[412, 470, 3]"] 268["EdgeCut Fillet<br>[5131, 5642, 1]"]
269["EdgeCut Fillet<br>[412, 470, 3]"]
1 --- 8 1 --- 8
1 --- 9 1 --- 9
1 --- 10 1 --- 10
@ -518,155 +519,155 @@ flowchart LR
41 --- 158 41 --- 158
41 x--> 184 41 x--> 184
41 --- 196 41 --- 196
41 --- 240 41 --- 241
42 --- 151 42 --- 151
42 x--> 184 42 x--> 184
42 --- 197 42 --- 197
42 --- 241 42 --- 242
43 --- 157 43 --- 157
43 x--> 184 43 x--> 184
43 --- 198 43 --- 198
43 --- 242 43 --- 243
44 --- 155 44 --- 155
44 x--> 184 44 x--> 184
44 --- 199 44 --- 199
44 --- 243 44 --- 244
45 --- 156 45 --- 156
45 x--> 184 45 x--> 184
45 --- 200 45 --- 200
45 --- 244 45 --- 245
46 --- 154 46 --- 154
46 x--> 184 46 x--> 184
46 --- 201 46 --- 201
46 --- 245 46 --- 246
47 --- 152 47 --- 152
47 x--> 184 47 x--> 184
47 --- 202 47 --- 202
47 --- 246 47 --- 247
48 --- 153 48 --- 153
48 x--> 184 48 x--> 184
48 --- 203 48 --- 203
48 --- 247 48 --- 248
50 --- 163 50 --- 163
50 x--> 184 50 x--> 184
50 --- 204 50 --- 204
50 --- 248 50 --- 249
51 --- 161 51 --- 161
51 x--> 184 51 x--> 184
51 --- 205 51 --- 205
51 --- 249 51 --- 250
52 --- 159 52 --- 159
52 x--> 184 52 x--> 184
52 --- 206 52 --- 206
52 --- 250 52 --- 251
53 --- 166 53 --- 166
53 x--> 184 53 x--> 184
53 --- 207 53 --- 207
53 --- 251 53 --- 252
54 --- 164 54 --- 164
54 x--> 184 54 x--> 184
54 --- 208 54 --- 208
54 --- 252 54 --- 253
55 --- 165 55 --- 165
55 x--> 184 55 x--> 184
55 --- 209 55 --- 209
55 --- 253 55 --- 254
56 --- 160 56 --- 160
56 x--> 184 56 x--> 184
56 --- 210 56 --- 210
56 --- 254 56 --- 255
57 --- 162 57 --- 162
57 x--> 184 57 x--> 184
57 --- 211 57 --- 211
57 --- 255 57 --- 256
58 --- 177 58 --- 177
58 x--> 185 58 x--> 185
58 --- 222 58 --- 222
58 --- 266 58 --- 267
59 --- 172 59 --- 172
59 x--> 180 59 x--> 180
59 --- 216 59 --- 216
59 --- 260 59 --- 261
60 --- 171 60 --- 171
60 x--> 180 60 x--> 180
60 --- 217 60 --- 217
60 --- 261 60 --- 262
61 --- 174 61 --- 174
61 x--> 180 61 x--> 180
61 --- 218 61 --- 218
61 --- 262 61 --- 263
62 --- 173 62 --- 173
62 x--> 180 62 x--> 180
62 --- 219 62 --- 219
62 --- 263 62 --- 264
69 --- 150 69 --- 150
69 x--> 184 69 x--> 184
69 --- 195 69 --- 195
69 --- 239 69 --- 240
70 --- 176 70 --- 176
70 x--> 183 70 x--> 183
70 --- 221 70 --- 221
70 --- 265 70 --- 266
71 --- 175 71 --- 175
71 x--> 178 71 x--> 178
71 --- 220 71 --- 220
71 --- 264 71 --- 265
72 --- 149 72 --- 149
72 x--> 181 72 x--> 181
72 --- 194 72 --- 194
72 --- 238 72 --- 239
131 <--x 73 131 <--x 73
73 --- 141 73 --- 141
73 x--> 227 73 --- 227
131 <--x 74 131 <--x 74
74 --- 137 74 --- 137
74 --- 227 74 --- 228
131 <--x 75 131 <--x 75
75 --- 145 75 --- 145
75 --- 228 75 --- 229
131 <--x 76 131 <--x 76
76 --- 139 76 --- 139
76 --- 229 76 --- 230
131 <--x 77 131 <--x 77
77 --- 146 77 --- 146
77 --- 230 77 --- 231
131 <--x 78 131 <--x 78
78 --- 138 78 --- 138
78 --- 231 78 --- 232
131 <--x 79 131 <--x 79
79 --- 147 79 --- 147
79 --- 232 79 --- 233
131 <--x 80 131 <--x 80
80 --- 148 80 --- 148
80 --- 233 80 --- 234
131 <--x 81 131 <--x 81
81 --- 140 81 --- 140
81 --- 234 81 --- 235
131 <--x 82 131 <--x 82
82 --- 143 82 --- 143
82 --- 235 82 --- 236
131 <--x 83 131 <--x 83
83 --- 142 83 --- 142
83 --- 236 83 --- 237
131 <--x 84 131 <--x 84
84 --- 144 84 --- 144
84 --- 237 84 --- 238
86 --- 168 86 --- 168
86 x--> 188 86 x--> 188
86 --- 212 86 --- 212
86 --- 256 86 --- 257
88 --- 169 88 --- 169
88 x--> 188 88 x--> 188
88 --- 213 88 --- 213
88 --- 257 88 --- 258
90 --- 167 90 --- 167
90 x--> 188 90 x--> 188
90 --- 214 90 --- 214
90 --- 258 90 --- 259
92 --- 170 92 --- 170
92 x--> 188 92 x--> 188
92 --- 215 92 --- 215
92 --- 259 92 --- 260
119 --- 133 119 --- 133
119 --- 134 119 --- 134
119 --- 135 119 --- 135
@ -697,7 +698,6 @@ flowchart LR
122 --- 201 122 --- 201
122 --- 202 122 --- 202
122 --- 203 122 --- 203
122 --- 240
122 --- 241 122 --- 241
122 --- 242 122 --- 242
122 --- 243 122 --- 243
@ -705,6 +705,7 @@ flowchart LR
122 --- 245 122 --- 245
122 --- 246 122 --- 246
122 --- 247 122 --- 247
122 --- 248
124 --- 159 124 --- 159
124 --- 160 124 --- 160
124 --- 161 124 --- 161
@ -722,7 +723,6 @@ flowchart LR
124 --- 209 124 --- 209
124 --- 210 124 --- 210
124 --- 211 124 --- 211
124 --- 248
124 --- 249 124 --- 249
124 --- 250 124 --- 250
124 --- 251 124 --- 251
@ -730,9 +730,10 @@ flowchart LR
124 --- 253 124 --- 253
124 --- 254 124 --- 254
124 --- 255 124 --- 255
124 --- 256
125 --- 177 125 --- 177
125 --- 222 125 --- 222
125 --- 266 125 --- 267
126 --- 171 126 --- 171
126 --- 172 126 --- 172
126 --- 173 126 --- 173
@ -743,27 +744,27 @@ flowchart LR
126 --- 217 126 --- 217
126 --- 218 126 --- 218
126 --- 219 126 --- 219
126 --- 260
126 --- 261 126 --- 261
126 --- 262 126 --- 262
126 --- 263 126 --- 263
126 --- 264
127 --- 150 127 --- 150
127 --- 183 127 --- 183
127 --- 195 127 --- 195
127 --- 239 127 --- 240
128 --- 176 128 --- 176
128 --- 221 128 --- 221
128 --- 265 128 --- 266
129 --- 175 129 --- 175
129 --- 178 129 --- 178
129 --- 182 129 --- 182
129 --- 220 129 --- 220
129 --- 264 129 --- 265
130 --- 149 130 --- 149
130 --- 181 130 --- 181
130 --- 187 130 --- 187
130 --- 194 130 --- 194
130 --- 238 130 --- 239
131 --- 137 131 --- 137
131 --- 138 131 --- 138
131 --- 139 131 --- 139
@ -787,6 +788,7 @@ flowchart LR
131 --- 235 131 --- 235
131 --- 236 131 --- 236
131 --- 237 131 --- 237
131 --- 238
132 --- 167 132 --- 167
132 --- 168 132 --- 168
132 --- 169 132 --- 169
@ -797,10 +799,10 @@ flowchart LR
132 --- 213 132 --- 213
132 --- 214 132 --- 214
132 --- 215 132 --- 215
132 --- 256
132 --- 257 132 --- 257
132 --- 258 132 --- 258
132 --- 259 132 --- 259
132 --- 260
133 --- 192 133 --- 192
224 <--x 133 224 <--x 133
133 --- 225 133 --- 225
@ -813,110 +815,112 @@ flowchart LR
136 --- 193 136 --- 193
225 <--x 136 225 <--x 136
136 --- 226 136 --- 226
137 --- 227 227 <--x 137
230 <--x 138 137 --- 228
138 --- 231 231 <--x 138
228 <--x 139 138 --- 232
139 --- 229 229 <--x 139
233 <--x 140 139 --- 230
140 --- 234 234 <--x 140
140 --- 235
141 --- 227 141 --- 227
237 <--x 141 238 <--x 141
235 <--x 142 236 <--x 142
142 --- 236 142 --- 237
234 <--x 143 235 <--x 143
143 --- 235 143 --- 236
236 <--x 144 237 <--x 144
144 --- 237 144 --- 238
145 --- 228 228 <--x 145
229 <--x 146 145 --- 229
146 --- 230 230 <--x 146
231 <--x 147 146 --- 231
147 --- 232 232 <--x 147
232 <--x 148 147 --- 233
148 --- 233 233 <--x 148
148 --- 234
149 --- 194 149 --- 194
149 --- 238 149 --- 239
150 --- 195 150 --- 195
150 --- 239 150 --- 240
151 --- 197 151 --- 197
151 --- 241 241 <--x 151
242 <--x 151 151 --- 242
152 --- 202 152 --- 202
152 --- 246 246 <--x 152
247 <--x 152 152 --- 247
153 --- 203 153 --- 203
240 <--x 153 247 <--x 153
153 --- 247 153 --- 248
154 --- 201 154 --- 201
154 --- 245 245 <--x 154
246 <--x 154 154 --- 246
155 --- 199 155 --- 199
155 --- 243 243 <--x 155
244 <--x 155 155 --- 244
156 --- 200 156 --- 200
156 --- 244 244 <--x 156
245 <--x 156 156 --- 245
157 --- 198 157 --- 198
157 --- 242 242 <--x 157
243 <--x 157 157 --- 243
158 --- 196 158 --- 196
158 --- 240 158 --- 241
241 <--x 158 248 <--x 158
159 --- 206 159 --- 206
249 <--x 159 250 <--x 159
159 --- 250 159 --- 251
160 --- 210 160 --- 210
253 <--x 160 254 <--x 160
160 --- 254 160 --- 255
161 --- 205 161 --- 205
248 <--x 161 249 <--x 161
161 --- 249 161 --- 250
162 --- 211 162 --- 211
254 <--x 162 255 <--x 162
162 --- 255 162 --- 256
163 --- 204 163 --- 204
163 --- 248 163 --- 249
255 <--x 163 256 <--x 163
164 --- 208 164 --- 208
251 <--x 164 252 <--x 164
164 --- 252 164 --- 253
165 --- 209 165 --- 209
252 <--x 165 253 <--x 165
165 --- 253 165 --- 254
166 --- 207 166 --- 207
250 <--x 166 251 <--x 166
166 --- 251 166 --- 252
167 --- 214 167 --- 214
167 --- 258 167 --- 259
259 <--x 167 260 <--x 167
168 --- 212 168 --- 212
168 --- 256 168 --- 257
257 <--x 168 258 <--x 168
169 --- 213 169 --- 213
169 --- 257 169 --- 258
258 <--x 169 259 <--x 169
170 --- 215 170 --- 215
256 <--x 170 257 <--x 170
170 --- 259 170 --- 260
171 --- 217 171 --- 217
260 <--x 171 261 <--x 171
171 --- 261 171 --- 262
172 --- 216 172 --- 216
172 --- 260 172 --- 261
263 <--x 172 264 <--x 172
173 --- 219 173 --- 219
262 <--x 173 263 <--x 173
173 --- 263 173 --- 264
174 --- 218 174 --- 218
261 <--x 174 262 <--x 174
174 --- 262 174 --- 263
175 --- 220 175 --- 220
175 --- 264 175 --- 265
176 --- 221 176 --- 221
176 --- 265 176 --- 266
177 --- 222 177 --- 222
177 --- 266 177 --- 267
196 <--x 179 196 <--x 179
197 <--x 179 197 <--x 179
198 <--x 179 198 <--x 179
@ -950,6 +954,6 @@ flowchart LR
213 <--x 189 213 <--x 189
214 <--x 189 214 <--x 189
215 <--x 189 215 <--x 189
220 <--x 268 220 <--x 269
223 <--x 267 223 <--x 268
``` ```

View File

@ -122,6 +122,7 @@ flowchart LR
61["SweepEdge Adjacent"] 61["SweepEdge Adjacent"]
62["SweepEdge Adjacent"] 62["SweepEdge Adjacent"]
63["SweepEdge Adjacent"] 63["SweepEdge Adjacent"]
64["SweepEdge Adjacent"]
1 <--x 6 1 <--x 6
1 --- 8 1 --- 8
1 --- 9 1 --- 9
@ -157,25 +158,25 @@ flowchart LR
15 --- 41 15 --- 41
15 x--> 47 15 x--> 47
15 --- 54 15 --- 54
15 --- 58 15 --- 59
34 <--x 17 34 <--x 17
17 --- 40 17 --- 40
17 x--> 57 17 --- 57
34 <--x 18 34 <--x 18
18 --- 39 18 --- 39
18 --- 57 18 --- 58
35 <--x 19 35 <--x 19
19 --- 45 19 --- 45
19 --- 59 19 --- 60
35 <--x 20 35 <--x 20
20 --- 43 20 --- 43
20 --- 60 20 --- 61
35 <--x 21 35 <--x 21
21 --- 42 21 --- 42
21 --- 61 21 --- 62
35 <--x 22 35 <--x 22
22 --- 44 22 --- 44
22 --- 62 22 --- 63
23 --- 38 23 --- 38
23 x--> 49 23 x--> 49
23 --- 53 23 --- 53
@ -183,23 +184,24 @@ flowchart LR
24 --- 46 24 --- 46
24 x--> 48 24 x--> 48
24 --- 55 24 --- 55
24 --- 63 24 --- 64
33 --- 41 33 --- 41
33 --- 47 33 --- 47
33 --- 50 33 --- 50
33 --- 54 33 --- 54
33 --- 58 33 --- 59
34 --- 39 34 --- 39
34 --- 40 34 --- 40
34 --- 57 34 --- 57
34 --- 58
35 --- 42 35 --- 42
35 --- 43 35 --- 43
35 --- 44 35 --- 44
35 --- 45 35 --- 45
35 --- 59
35 --- 60 35 --- 60
35 --- 61 35 --- 61
35 --- 62 35 --- 62
35 --- 63
36 --- 38 36 --- 38
36 --- 49 36 --- 49
36 --- 52 36 --- 52
@ -209,23 +211,25 @@ flowchart LR
37 --- 48 37 --- 48
37 --- 51 37 --- 51
37 --- 55 37 --- 55
37 --- 63 37 --- 64
38 --- 53 38 --- 53
38 --- 56 38 --- 56
39 --- 57 57 <--x 39
39 --- 58
40 --- 57 40 --- 57
58 <--x 40
41 --- 54 41 --- 54
41 --- 58 41 --- 59
60 <--x 42 61 <--x 42
42 --- 61 42 --- 62
59 <--x 43 60 <--x 43
43 --- 60 43 --- 61
61 <--x 44 62 <--x 44
44 --- 62 44 --- 63
45 --- 59 45 --- 60
62 <--x 45 63 <--x 45
46 --- 55 46 --- 55
46 --- 63 46 --- 64
54 <--x 50 54 <--x 50
55 <--x 51 55 <--x 51
53 <--x 52 53 <--x 52

View File

@ -210,9 +210,10 @@ flowchart LR
116["SweepEdge Adjacent"] 116["SweepEdge Adjacent"]
117["SweepEdge Adjacent"] 117["SweepEdge Adjacent"]
118["SweepEdge Adjacent"] 118["SweepEdge Adjacent"]
119["EdgeCut Fillet<br>[3993, 4061, 0]"] 119["SweepEdge Adjacent"]
120["EdgeCut Fillet<br>[3993, 4061, 0]"]
%% [ProgramBodyItem { index: 31 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] %% [ProgramBodyItem { index: 31 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
120["EdgeCut Fillet<br>[4067, 4135, 0]"] 121["EdgeCut Fillet<br>[4067, 4135, 0]"]
%% [ProgramBodyItem { index: 31 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 31 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
1 --- 8 1 --- 8
2 --- 9 2 --- 9
@ -268,75 +269,75 @@ flowchart LR
13 --- 54 13 --- 54
48 <--x 14 48 <--x 14
14 --- 63 14 --- 63
14 x--> 100 14 --- 100
48 <--x 15 48 <--x 15
15 --- 61 15 --- 61
15 --- 100 15 --- 101
48 <--x 16 48 <--x 16
16 --- 60 16 --- 60
16 --- 101 16 --- 102
48 <--x 17 48 <--x 17
17 --- 62 17 --- 62
17 --- 102 17 --- 103
49 <--x 19 49 <--x 19
19 --- 75 19 --- 75
19 --- 112 19 --- 113
49 <--x 20 49 <--x 20
20 --- 74 20 --- 74
20 --- 113 20 --- 114
49 <--x 21 49 <--x 21
21 --- 76 21 --- 76
21 --- 114 21 --- 115
49 <--x 22 49 <--x 22
22 --- 73 22 --- 73
22 --- 115 22 --- 116
50 <--x 24 50 <--x 24
24 --- 80 24 --- 80
24 --- 116 24 --- 117
50 <--x 25 50 <--x 25
25 --- 78 25 --- 78
25 --- 117 25 --- 118
50 <--x 26 50 <--x 26
26 --- 77 26 --- 77
26 --- 118 26 --- 119
50 <--x 27 50 <--x 27
27 --- 79 27 --- 79
30 --- 71 30 --- 71
30 x--> 82 30 x--> 82
30 --- 89 30 --- 89
30 --- 103 30 --- 104
31 --- 69 31 --- 69
31 x--> 82 31 x--> 82
31 --- 90 31 --- 90
31 --- 104 31 --- 105
32 --- 64 32 --- 64
32 x--> 82 32 x--> 82
32 --- 91 32 --- 91
32 --- 105 32 --- 106
33 --- 66 33 --- 66
33 x--> 82 33 x--> 82
33 --- 92 33 --- 92
33 --- 106 33 --- 107
34 --- 68 34 --- 68
34 x--> 82 34 x--> 82
34 --- 93 34 --- 93
34 --- 107 34 --- 108
35 --- 65 35 --- 65
35 x--> 82 35 x--> 82
35 --- 94 35 --- 94
35 --- 108 35 --- 109
36 --- 67 36 --- 67
36 x--> 82 36 x--> 82
36 --- 95 36 --- 95
36 --- 109 36 --- 110
37 --- 70 37 --- 70
37 x--> 82 37 x--> 82
37 --- 96 37 --- 96
37 --- 110 37 --- 111
38 --- 72 38 --- 72
38 x--> 82 38 x--> 82
38 --- 97 38 --- 97
38 --- 111 38 --- 112
40 --- 58 40 --- 58
40 x--> 81 40 x--> 81
40 --- 87 40 --- 87
@ -352,21 +353,22 @@ flowchart LR
48 --- 100 48 --- 100
48 --- 101 48 --- 101
48 --- 102 48 --- 102
48 --- 103
49 --- 73 49 --- 73
49 --- 74 49 --- 74
49 --- 75 49 --- 75
49 --- 76 49 --- 76
49 --- 112
49 --- 113 49 --- 113
49 --- 114 49 --- 114
49 --- 115 49 --- 115
49 --- 116
50 --- 77 50 --- 77
50 --- 78 50 --- 78
50 --- 79 50 --- 79
50 --- 80 50 --- 80
50 --- 116
50 --- 117 50 --- 117
50 --- 118 50 --- 118
50 --- 119
51 --- 64 51 --- 64
51 --- 65 51 --- 65
51 --- 66 51 --- 66
@ -387,7 +389,6 @@ flowchart LR
51 --- 95 51 --- 95
51 --- 96 51 --- 96
51 --- 97 51 --- 97
51 --- 103
51 --- 104 51 --- 104
51 --- 105 51 --- 105
51 --- 106 51 --- 106
@ -396,6 +397,7 @@ flowchart LR
51 --- 109 51 --- 109
51 --- 110 51 --- 110
51 --- 111 51 --- 111
51 --- 112
52 --- 58 52 --- 58
52 --- 81 52 --- 81
52 --- 84 52 --- 84
@ -413,53 +415,55 @@ flowchart LR
58 --- 98 58 --- 98
59 --- 88 59 --- 88
59 --- 99 59 --- 99
60 --- 101 101 <--x 60
61 --- 100 60 --- 102
101 <--x 62 100 <--x 61
62 --- 102 61 --- 101
102 <--x 62
62 --- 103
63 --- 100 63 --- 100
102 <--x 63 103 <--x 63
64 --- 91 64 --- 91
104 <--x 64 105 <--x 64
64 --- 105 64 --- 106
65 --- 94 65 --- 94
107 <--x 65 108 <--x 65
65 --- 108 65 --- 109
66 --- 92 66 --- 92
105 <--x 66 106 <--x 66
66 --- 106 66 --- 107
67 --- 95 67 --- 95
108 <--x 67 109 <--x 67
67 --- 109 67 --- 110
68 --- 93 68 --- 93
106 <--x 68 107 <--x 68
68 --- 107 68 --- 108
69 --- 90 69 --- 90
103 <--x 69 104 <--x 69
69 --- 104 69 --- 105
70 --- 96 70 --- 96
109 <--x 70 110 <--x 70
70 --- 110 70 --- 111
71 --- 89 71 --- 89
71 --- 103 71 --- 104
111 <--x 71 112 <--x 71
72 --- 97 72 --- 97
110 <--x 72 111 <--x 72
72 --- 111 72 --- 112
114 <--x 73 115 <--x 73
73 --- 115 73 --- 116
112 <--x 74 113 <--x 74
74 --- 113 74 --- 114
75 --- 112 75 --- 113
115 <--x 75 116 <--x 75
113 <--x 76 114 <--x 76
76 --- 114 76 --- 115
117 <--x 77 118 <--x 77
77 --- 118 77 --- 119
116 <--x 78 117 <--x 78
78 --- 117 78 --- 118
118 <--x 79 119 <--x 79
80 --- 116 80 --- 117
87 <--x 84 87 <--x 84
89 <--x 85 89 <--x 85
90 <--x 85 90 <--x 85
@ -471,6 +475,6 @@ flowchart LR
96 <--x 85 96 <--x 85
97 <--x 85 97 <--x 85
88 <--x 86 88 <--x 86
105 <--x 119 106 <--x 120
108 <--x 120 109 <--x 121
``` ```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -87,20 +87,20 @@ flowchart LR
27 --- 4 27 --- 4
8 --- 20 8 --- 20
8 x--> 25 8 x--> 25
8 --- 29 8 --- 31
8 --- 35 8 --- 37
9 --- 21 9 --- 21
9 x--> 25 9 x--> 25
9 --- 33 9 --- 33
9 --- 39 9 --- 39
10 --- 22 10 --- 22
10 x--> 25 10 x--> 25
10 --- 30 10 --- 29
10 --- 36 10 --- 35
11 --- 23 11 --- 23
11 x--> 25 11 x--> 25
11 --- 31 11 --- 30
11 --- 37 11 --- 36
12 --- 24 12 --- 24
12 x--> 25 12 x--> 25
12 --- 32 12 --- 32
@ -132,18 +132,18 @@ flowchart LR
18 --- 34 18 --- 34
19 --- 28 19 --- 28
19 --- 34 19 --- 34
20 --- 29 20 --- 31
20 --- 35 20 --- 37
36 <--x 20 38 <--x 20
21 --- 33 21 --- 33
35 <--x 21 35 <--x 21
21 --- 39 21 --- 39
22 --- 30 22 --- 29
22 --- 36 22 --- 35
37 <--x 22 36 <--x 22
23 --- 31 23 --- 30
23 --- 37 23 --- 36
38 <--x 23 37 <--x 23
24 --- 32 24 --- 32
24 --- 38 24 --- 38
39 <--x 24 39 <--x 24

View File

@ -213,7 +213,8 @@ flowchart LR
109["SweepEdge Adjacent"] 109["SweepEdge Adjacent"]
110["SweepEdge Adjacent"] 110["SweepEdge Adjacent"]
111["SweepEdge Adjacent"] 111["SweepEdge Adjacent"]
112["EdgeCut Fillet<br>[3014, 3304, 0]"] 112["SweepEdge Adjacent"]
113["EdgeCut Fillet<br>[3014, 3304, 0]"]
%% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] %% [ProgramBodyItem { index: 26 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
1 --- 8 1 --- 8
1 --- 9 1 --- 9
@ -277,7 +278,7 @@ flowchart LR
27 --- 83 27 --- 83
27 x--> 86 27 x--> 86
27 --- 96 27 --- 96
27 --- 111 27 --- 112
28 --- 68 28 --- 68
28 x--> 85 28 x--> 85
28 --- 90 28 --- 90
@ -300,31 +301,31 @@ flowchart LR
34 --- 98 34 --- 98
62 <--x 36 62 <--x 36
36 --- 78 36 --- 78
36 x--> 103 36 --- 103
62 <--x 37 62 <--x 37
37 --- 77 37 --- 77
37 --- 103 37 --- 104
62 <--x 38 62 <--x 38
38 --- 82 38 --- 82
38 --- 104 38 --- 105
62 <--x 39 62 <--x 39
39 --- 79 39 --- 79
39 --- 105 39 --- 106
62 <--x 40 62 <--x 40
40 --- 74 40 --- 74
40 --- 106 40 --- 107
62 <--x 41 62 <--x 41
41 --- 81 41 --- 81
41 --- 107 41 --- 108
62 <--x 42 62 <--x 42
42 --- 76 42 --- 76
42 --- 108 42 --- 109
62 <--x 43 62 <--x 43
43 --- 75 43 --- 75
43 --- 109 43 --- 110
62 <--x 44 62 <--x 44
44 --- 80 44 --- 80
44 --- 110 44 --- 111
45 --- 73 45 --- 73
45 x--> 82 45 x--> 82
45 --- 95 45 --- 95
@ -338,7 +339,7 @@ flowchart LR
60 --- 86 60 --- 86
60 --- 89 60 --- 89
60 --- 96 60 --- 96
60 --- 111 60 --- 112
61 --- 69 61 --- 69
61 --- 70 61 --- 70
61 --- 71 61 --- 71
@ -370,6 +371,7 @@ flowchart LR
62 --- 108 62 --- 108
62 --- 109 62 --- 109
62 --- 110 62 --- 110
62 --- 111
64 --- 73 64 --- 73
64 --- 95 64 --- 95
64 --- 102 64 --- 102
@ -390,29 +392,31 @@ flowchart LR
73 --- 95 73 --- 95
73 --- 102 73 --- 102
95 <--x 74 95 <--x 74
105 <--x 74 106 <--x 74
74 --- 106 74 --- 107
108 <--x 75 109 <--x 75
75 --- 109 75 --- 110
107 <--x 76 108 <--x 76
76 --- 108 76 --- 109
77 --- 103 103 <--x 77
77 --- 104
78 --- 103 78 --- 103
110 <--x 78 111 <--x 78
104 <--x 79 105 <--x 79
79 --- 105 79 --- 106
109 <--x 80 110 <--x 80
80 --- 110 80 --- 111
106 <--x 81 107 <--x 81
81 --- 107 81 --- 108
82 --- 104 104 <--x 82
82 --- 105
83 --- 96 83 --- 96
83 --- 111 83 --- 112
91 <--x 87 91 <--x 87
92 <--x 87 92 <--x 87
93 <--x 87 93 <--x 87
94 <--x 87 94 <--x 87
90 <--x 88 90 <--x 88
96 <--x 89 96 <--x 89
98 <--x 112 98 <--x 113
``` ```

View File

@ -647,6 +647,7 @@ flowchart LR
481["SweepEdge Adjacent"] 481["SweepEdge Adjacent"]
482["SweepEdge Adjacent"] 482["SweepEdge Adjacent"]
483["SweepEdge Adjacent"] 483["SweepEdge Adjacent"]
484["SweepEdge Adjacent"]
1 --- 11 1 --- 11
1 --- 12 1 --- 12
2 --- 17 2 --- 17
@ -828,7 +829,7 @@ flowchart LR
36 --- 286 36 --- 286
36 x--> 330 36 x--> 330
36 --- 373 36 --- 373
36 --- 447 36 --- 448
38 --- 224 38 --- 224
38 x--> 341 38 x--> 341
38 --- 342 38 --- 342
@ -836,7 +837,7 @@ flowchart LR
39 --- 317 39 --- 317
39 x--> 332 39 x--> 332
39 --- 380 39 --- 380
39 --- 478 39 --- 479
176 <--x 40 176 <--x 40
40 --- 247 40 --- 247
40 --- 408 40 --- 408
@ -864,167 +865,167 @@ flowchart LR
50 --- 264 50 --- 264
50 x--> 339 50 x--> 339
50 --- 366 50 --- 366
50 --- 426 50 --- 427
51 --- 291 51 --- 291
51 x--> 326 51 x--> 326
51 --- 378 51 --- 378
51 --- 452 51 --- 453
52 --- 290 52 --- 290
52 x--> 326 52 x--> 326
52 --- 377 52 --- 377
52 --- 451 52 --- 452
53 --- 265 53 --- 265
53 x--> 339 53 x--> 339
53 --- 365 53 --- 365
53 --- 425 53 --- 426
54 --- 288 54 --- 288
54 x--> 326 54 x--> 326
54 --- 376 54 --- 376
54 --- 450 54 --- 451
55 --- 263 55 --- 263
55 x--> 339 55 x--> 339
55 --- 364 55 --- 364
55 --- 424 55 --- 425
56 --- 262 56 --- 262
56 x--> 339 56 x--> 339
56 --- 363 56 --- 363
56 --- 423 56 --- 424
57 --- 289 57 --- 289
57 x--> 326 57 x--> 326
57 --- 375 57 --- 375
57 --- 449 57 --- 450
180 <--x 60 180 <--x 60
60 --- 308 60 --- 308
60 --- 454 60 --- 455
180 <--x 61 180 <--x 61
61 --- 310 61 --- 310
61 --- 455 61 --- 456
180 <--x 62 180 <--x 62
62 --- 311 62 --- 311
62 --- 456 62 --- 457
180 <--x 63 180 <--x 63
63 --- 301 63 --- 301
63 --- 457 63 --- 458
180 <--x 64 180 <--x 64
64 --- 316 64 --- 316
64 --- 458 64 --- 459
180 <--x 65 180 <--x 65
65 --- 315 65 --- 315
65 --- 459 65 --- 460
180 <--x 66 180 <--x 66
66 --- 295 66 --- 295
66 --- 460 66 --- 461
180 <--x 67 180 <--x 67
67 --- 303 67 --- 303
67 --- 461 67 --- 462
180 <--x 68 180 <--x 68
68 --- 297 68 --- 297
68 --- 462 68 --- 463
180 <--x 69 180 <--x 69
69 --- 300 69 --- 300
69 --- 463 69 --- 464
180 <--x 70 180 <--x 70
70 --- 309 70 --- 309
70 --- 464 70 --- 465
180 <--x 71 180 <--x 71
71 --- 298 71 --- 298
71 --- 465 71 --- 466
180 <--x 72 180 <--x 72
72 --- 293 72 --- 293
72 --- 466 72 --- 467
180 <--x 73 180 <--x 73
73 --- 294 73 --- 294
73 --- 467 73 --- 468
180 <--x 74 180 <--x 74
74 --- 305 74 --- 305
74 --- 468 74 --- 469
180 <--x 75 180 <--x 75
75 --- 306 75 --- 306
75 --- 469 75 --- 470
180 <--x 76 180 <--x 76
76 --- 307 76 --- 307
76 --- 470 76 --- 471
180 <--x 77 180 <--x 77
77 --- 296 77 --- 296
77 --- 471 77 --- 472
180 <--x 78 180 <--x 78
78 --- 302 78 --- 302
78 --- 472 78 --- 473
180 <--x 79 180 <--x 79
79 --- 304 79 --- 304
79 --- 473 79 --- 474
180 <--x 80 180 <--x 80
80 --- 313 80 --- 313
80 --- 474 80 --- 475
180 <--x 81 180 <--x 81
81 --- 299 81 --- 299
81 --- 475 81 --- 476
180 <--x 82 180 <--x 82
82 --- 312 82 --- 312
82 --- 476 82 --- 477
180 <--x 83 180 <--x 83
83 --- 314 83 --- 314
83 --- 477 83 --- 478
84 --- 285 84 --- 285
84 x--> 324 84 x--> 324
84 --- 372 84 --- 372
84 --- 446 84 --- 447
85 --- 280 85 --- 280
85 x--> 333 85 x--> 333
85 --- 367 85 --- 367
85 --- 441 85 --- 442
86 --- 260 86 --- 260
86 x--> 338 86 x--> 338
86 --- 361 86 --- 361
86 --- 421 86 --- 422
87 --- 292 87 --- 292
87 x--> 324 87 x--> 324
87 --- 379 87 --- 379
87 --- 453 87 --- 454
88 --- 322 88 --- 322
88 x--> 329 88 x--> 329
88 --- 385 88 --- 385
88 --- 483 88 --- 484
89 --- 261 89 --- 261
89 x--> 340 89 x--> 340
89 --- 362 89 --- 362
89 --- 422 89 --- 423
90 --- 287 90 --- 287
90 x--> 324 90 x--> 324
90 --- 374 90 --- 374
90 --- 448 90 --- 449
91 --- 282 91 --- 282
91 x--> 324 91 x--> 324
91 --- 368 91 --- 368
91 --- 442 91 --- 443
92 --- 281 92 --- 281
92 x--> 324 92 x--> 324
92 --- 369 92 --- 369
92 --- 443 92 --- 444
93 --- 283 93 --- 283
93 x--> 324 93 x--> 324
93 --- 370 93 --- 370
93 --- 444 93 --- 445
94 --- 284 94 --- 284
94 x--> 324 94 x--> 324
94 --- 371 94 --- 371
94 --- 445 94 --- 446
96 --- 318 96 --- 318
96 x--> 340 96 x--> 340
96 --- 384 96 --- 384
96 --- 482 96 --- 483
97 --- 321 97 --- 321
97 x--> 340 97 x--> 340
97 --- 383 97 --- 383
97 --- 481 97 --- 482
98 --- 320 98 --- 320
98 x--> 340 98 x--> 340
98 --- 382 98 --- 382
98 --- 480 98 --- 481
99 --- 319 99 --- 319
99 x--> 340 99 x--> 340
99 --- 381 99 --- 381
99 --- 479 99 --- 480
101 --- 233 101 --- 233
101 x--> 337 101 x--> 337
101 --- 343 101 --- 343
@ -1095,73 +1096,73 @@ flowchart LR
117 --- 403 117 --- 403
222 <--x 118 222 <--x 118
118 --- 252 118 --- 252
118 x--> 413 118 --- 413
222 <--x 119 222 <--x 119
119 --- 255 119 --- 255
119 --- 413 119 --- 414
222 <--x 120 222 <--x 120
120 --- 259 120 --- 259
120 --- 414 120 --- 415
222 <--x 121 222 <--x 121
121 --- 253 121 --- 253
121 --- 415 121 --- 416
222 <--x 122 222 <--x 122
122 --- 256 122 --- 256
122 --- 416 122 --- 417
222 <--x 123 222 <--x 123
123 --- 257 123 --- 257
123 --- 417 123 --- 418
222 <--x 124 222 <--x 124
124 --- 254 124 --- 254
124 --- 418 124 --- 419
222 <--x 125 222 <--x 125
125 --- 258 125 --- 258
125 --- 419 125 --- 420
222 <--x 126 222 <--x 126
126 --- 251 126 --- 251
126 --- 420 126 --- 421
223 <--x 127 223 <--x 127
127 --- 275 127 --- 275
127 --- 427 127 --- 428
223 <--x 128 223 <--x 128
128 --- 277 128 --- 277
128 --- 428 128 --- 429
223 <--x 129 223 <--x 129
129 --- 269 129 --- 269
129 --- 429 129 --- 430
223 <--x 130 223 <--x 130
130 --- 276 130 --- 276
130 --- 430 130 --- 431
223 <--x 131 223 <--x 131
131 --- 266 131 --- 266
131 --- 431 131 --- 432
223 <--x 132 223 <--x 132
132 --- 279 132 --- 279
132 --- 432 132 --- 433
223 <--x 133 223 <--x 133
133 --- 270 133 --- 270
133 --- 433 133 --- 434
223 <--x 134 223 <--x 134
134 --- 278 134 --- 278
134 --- 434 134 --- 435
223 <--x 135 223 <--x 135
135 --- 267 135 --- 267
135 --- 435 135 --- 436
223 <--x 136 223 <--x 136
136 --- 271 136 --- 271
136 --- 436 136 --- 437
223 <--x 137 223 <--x 137
137 --- 268 137 --- 268
137 --- 437 137 --- 438
223 <--x 138 223 <--x 138
138 --- 273 138 --- 273
138 --- 438 138 --- 439
223 <--x 139 223 <--x 139
139 --- 274 139 --- 274
139 --- 439 139 --- 440
223 <--x 140 223 <--x 140
140 --- 272 140 --- 272
140 --- 440 140 --- 441
164 --- 250 164 --- 250
164 --- 323 164 --- 323
164 --- 332 164 --- 332
@ -1171,13 +1172,13 @@ flowchart LR
165 --- 330 165 --- 330
165 --- 341 165 --- 341
165 --- 373 165 --- 373
165 --- 447 165 --- 448
166 --- 224 166 --- 224
166 --- 342 166 --- 342
166 --- 386 166 --- 386
174 --- 317 174 --- 317
174 --- 380 174 --- 380
174 --- 478 174 --- 479
176 --- 246 176 --- 246
176 --- 247 176 --- 247
176 --- 248 176 --- 248
@ -1204,10 +1205,10 @@ flowchart LR
178 --- 364 178 --- 364
178 --- 365 178 --- 365
178 --- 366 178 --- 366
178 --- 423
178 --- 424 178 --- 424
178 --- 425 178 --- 425
178 --- 426 178 --- 426
178 --- 427
179 --- 288 179 --- 288
179 --- 289 179 --- 289
179 --- 290 179 --- 290
@ -1218,10 +1219,10 @@ flowchart LR
179 --- 376 179 --- 376
179 --- 377 179 --- 377
179 --- 378 179 --- 378
179 --- 449
179 --- 450 179 --- 450
179 --- 451 179 --- 451
179 --- 452 179 --- 452
179 --- 453
180 --- 293 180 --- 293
180 --- 294 180 --- 294
180 --- 295 180 --- 295
@ -1246,7 +1247,6 @@ flowchart LR
180 --- 314 180 --- 314
180 --- 315 180 --- 315
180 --- 316 180 --- 316
180 --- 454
180 --- 455 180 --- 455
180 --- 456 180 --- 456
180 --- 457 180 --- 457
@ -1270,34 +1270,35 @@ flowchart LR
180 --- 475 180 --- 475
180 --- 476 180 --- 476
180 --- 477 180 --- 477
180 --- 478
181 --- 285 181 --- 285
181 --- 324 181 --- 324
181 --- 333 181 --- 333
181 --- 372 181 --- 372
181 --- 446 181 --- 447
182 --- 280 182 --- 280
182 --- 338 182 --- 338
182 --- 367 182 --- 367
182 --- 441 182 --- 442
185 --- 260 185 --- 260
185 --- 361 185 --- 361
185 --- 421 185 --- 422
188 --- 292 188 --- 292
188 --- 336 188 --- 336
188 --- 379 188 --- 379
188 --- 453 188 --- 454
189 --- 322 189 --- 322
189 --- 329 189 --- 329
189 --- 340 189 --- 340
189 --- 385 189 --- 385
189 --- 483 189 --- 484
191 --- 261 191 --- 261
191 --- 362 191 --- 362
191 --- 422 191 --- 423
205 --- 287 205 --- 287
205 --- 334 205 --- 334
205 --- 374 205 --- 374
205 --- 448 205 --- 449
213 --- 281 213 --- 281
213 --- 282 213 --- 282
213 --- 283 213 --- 283
@ -1307,10 +1308,10 @@ flowchart LR
213 --- 369 213 --- 369
213 --- 370 213 --- 370
213 --- 371 213 --- 371
213 --- 442
213 --- 443 213 --- 443
213 --- 444 213 --- 444
213 --- 445 213 --- 445
213 --- 446
218 --- 318 218 --- 318
218 --- 319 218 --- 319
218 --- 320 218 --- 320
@ -1320,10 +1321,10 @@ flowchart LR
218 --- 382 218 --- 382
218 --- 383 218 --- 383
218 --- 384 218 --- 384
218 --- 479
218 --- 480 218 --- 480
218 --- 481 218 --- 481
218 --- 482 218 --- 482
218 --- 483
221 --- 225 221 --- 225
221 --- 226 221 --- 226
221 --- 227 221 --- 227
@ -1394,6 +1395,7 @@ flowchart LR
222 --- 418 222 --- 418
222 --- 419 222 --- 419
222 --- 420 222 --- 420
222 --- 421
223 --- 266 223 --- 266
223 --- 267 223 --- 267
223 --- 268 223 --- 268
@ -1408,7 +1410,6 @@ flowchart LR
223 --- 277 223 --- 277
223 --- 278 223 --- 278
223 --- 279 223 --- 279
223 --- 427
223 --- 428 223 --- 428
223 --- 429 223 --- 429
223 --- 430 223 --- 430
@ -1422,59 +1423,60 @@ flowchart LR
223 --- 438 223 --- 438
223 --- 439 223 --- 439
223 --- 440 223 --- 440
223 --- 441
224 --- 342 224 --- 342
224 --- 386 224 --- 386
225 --- 356 225 --- 356
399 <--x 225
225 --- 400 225 --- 400
401 <--x 225
226 --- 344 226 --- 344
387 <--x 226
226 --- 388 226 --- 388
389 <--x 226
227 --- 348 227 --- 348
391 <--x 227
227 --- 392 227 --- 392
393 <--x 227
228 --- 355 228 --- 355
398 <--x 228
228 --- 399 228 --- 399
400 <--x 228
229 --- 346 229 --- 346
389 <--x 229
229 --- 390 229 --- 390
391 <--x 229
230 --- 351 230 --- 351
394 <--x 230
230 --- 395 230 --- 395
396 <--x 230
231 --- 359 231 --- 359
387 <--x 231 402 <--x 231
231 --- 403 231 --- 403
232 --- 358 232 --- 358
401 <--x 232
232 --- 402 232 --- 402
403 <--x 232
233 --- 343 233 --- 343
233 --- 387 233 --- 387
388 <--x 233 403 <--x 233
234 --- 357 234 --- 357
400 <--x 234
234 --- 401 234 --- 401
402 <--x 234
235 --- 353 235 --- 353
396 <--x 235
235 --- 397 235 --- 397
398 <--x 235
236 --- 352 236 --- 352
395 <--x 236
236 --- 396 236 --- 396
397 <--x 236
237 --- 354 237 --- 354
397 <--x 237
237 --- 398 237 --- 398
399 <--x 237
238 --- 345 238 --- 345
388 <--x 238
238 --- 389 238 --- 389
390 <--x 238
239 --- 347 239 --- 347
390 <--x 239
239 --- 391 239 --- 391
392 <--x 239
240 --- 349 240 --- 349
392 <--x 240
240 --- 393 240 --- 393
394 <--x 240
241 --- 350 241 --- 350
393 <--x 241
241 --- 394 241 --- 394
395 <--x 241
406 <--x 242 406 <--x 242
242 --- 407 242 --- 407
243 --- 404 243 --- 404
@ -1493,164 +1495,166 @@ flowchart LR
249 --- 411 249 --- 411
250 --- 360 250 --- 360
250 --- 412 250 --- 412
419 <--x 251 420 <--x 251
251 --- 420 251 --- 421
252 --- 413 252 --- 413
420 <--x 252 421 <--x 252
414 <--x 253 415 <--x 253
253 --- 415 253 --- 416
417 <--x 254 418 <--x 254
254 --- 418 254 --- 419
255 --- 413 413 <--x 255
415 <--x 256 255 --- 414
256 --- 416 416 <--x 256
416 <--x 257 256 --- 417
257 --- 417 417 <--x 257
418 <--x 258 257 --- 418
258 --- 419 419 <--x 258
259 --- 414 258 --- 420
414 <--x 259
259 --- 415
260 --- 361 260 --- 361
260 --- 421 260 --- 422
261 --- 362 261 --- 362
261 --- 422 261 --- 423
262 --- 363 262 --- 363
262 --- 423 262 --- 424
424 <--x 262 425 <--x 262
263 --- 364 263 --- 364
263 --- 424 263 --- 425
425 <--x 263 426 <--x 263
264 --- 366 264 --- 366
423 <--x 264 424 <--x 264
264 --- 426 264 --- 427
265 --- 365 265 --- 365
265 --- 425 265 --- 426
426 <--x 265 427 <--x 265
430 <--x 266 431 <--x 266
266 --- 431 266 --- 432
434 <--x 267 435 <--x 267
267 --- 435 267 --- 436
436 <--x 268 437 <--x 268
268 --- 437 268 --- 438
428 <--x 269 429 <--x 269
269 --- 429 269 --- 430
432 <--x 270 433 <--x 270
270 --- 433 270 --- 434
435 <--x 271 436 <--x 271
271 --- 436 271 --- 437
439 <--x 272 440 <--x 272
272 --- 440 272 --- 441
437 <--x 273 438 <--x 273
273 --- 438 273 --- 439
438 <--x 274 439 <--x 274
274 --- 439 274 --- 440
275 --- 427 275 --- 428
440 <--x 275 441 <--x 275
429 <--x 276 430 <--x 276
276 --- 430 276 --- 431
427 <--x 277 428 <--x 277
277 --- 428 277 --- 429
433 <--x 278 434 <--x 278
278 --- 434 278 --- 435
431 <--x 279 432 <--x 279
279 --- 432 279 --- 433
280 --- 367 280 --- 367
280 --- 441 280 --- 442
281 --- 369 281 --- 369
281 --- 443 443 <--x 281
444 <--x 281 281 --- 444
282 --- 368 282 --- 368
282 --- 442 282 --- 443
443 <--x 282 446 <--x 282
283 --- 370 283 --- 370
283 --- 444 444 <--x 283
445 <--x 283 283 --- 445
284 --- 371 284 --- 371
442 <--x 284 445 <--x 284
284 --- 445 284 --- 446
285 --- 372 285 --- 372
285 --- 446 285 --- 447
286 --- 373 286 --- 373
286 --- 447 286 --- 448
287 --- 374 287 --- 374
287 --- 448 287 --- 449
288 --- 376 288 --- 376
449 <--x 288 288 --- 451
288 --- 450 452 <--x 288
289 --- 375 289 --- 375
289 --- 449 289 --- 450
452 <--x 289 451 <--x 289
290 --- 377 290 --- 377
450 <--x 290 290 --- 452
290 --- 451 453 <--x 290
291 --- 378 291 --- 378
451 <--x 291 450 <--x 291
291 --- 452 291 --- 453
292 --- 379 292 --- 379
292 --- 453 292 --- 454
465 <--x 293 466 <--x 293
293 --- 466 293 --- 467
466 <--x 294 467 <--x 294
294 --- 467 294 --- 468
459 <--x 295 460 <--x 295
295 --- 460 295 --- 461
470 <--x 296 471 <--x 296
296 --- 471 296 --- 472
461 <--x 297 462 <--x 297
297 --- 462 297 --- 463
464 <--x 298 465 <--x 298
298 --- 465 298 --- 466
474 <--x 299 475 <--x 299
299 --- 475 299 --- 476
462 <--x 300 463 <--x 300
300 --- 463 300 --- 464
456 <--x 301 457 <--x 301
301 --- 457 301 --- 458
471 <--x 302 472 <--x 302
302 --- 472 302 --- 473
460 <--x 303 461 <--x 303
303 --- 461 303 --- 462
472 <--x 304 473 <--x 304
304 --- 473 304 --- 474
467 <--x 305 468 <--x 305
305 --- 468 305 --- 469
468 <--x 306 469 <--x 306
306 --- 469 306 --- 470
469 <--x 307 470 <--x 307
307 --- 470 307 --- 471
308 --- 454 308 --- 455
477 <--x 308 478 <--x 308
463 <--x 309 464 <--x 309
309 --- 464 309 --- 465
454 <--x 310 455 <--x 310
310 --- 455 310 --- 456
455 <--x 311 456 <--x 311
311 --- 456 311 --- 457
475 <--x 312 476 <--x 312
312 --- 476 312 --- 477
473 <--x 313 474 <--x 313
313 --- 474 313 --- 475
476 <--x 314 477 <--x 314
314 --- 477 314 --- 478
458 <--x 315 459 <--x 315
315 --- 459 315 --- 460
457 <--x 316 458 <--x 316
316 --- 458 316 --- 459
317 --- 380 317 --- 380
317 --- 478 317 --- 479
318 --- 384 318 --- 384
479 <--x 318 480 <--x 318
318 --- 482 318 --- 483
319 --- 381 319 --- 381
319 --- 479 319 --- 480
480 <--x 319 481 <--x 319
320 --- 382 320 --- 382
320 --- 480 320 --- 481
481 <--x 320 482 <--x 320
321 --- 383 321 --- 383
321 --- 481 321 --- 482
482 <--x 321 483 <--x 321
322 --- 385 322 --- 385
322 --- 483 322 --- 484
380 <--x 323 380 <--x 323
361 <--x 324 361 <--x 324
368 <--x 325 368 <--x 325

View File

@ -366,114 +366,114 @@ flowchart LR
11 ---- 74 11 ---- 74
26 --- 75 26 --- 75
26 x--> 108 26 x--> 108
26 --- 130 26 --- 139
26 --- 162 26 --- 171
27 --- 76 27 --- 76
27 x--> 108 27 x--> 108
27 --- 116 27 --- 114
27 --- 148 27 --- 146
28 --- 77 28 --- 77
28 x--> 108 28 x--> 108
28 --- 139 28 --- 115
28 --- 171 28 --- 147
29 --- 78 29 --- 78
29 x--> 108 29 x--> 108
29 --- 135 29 --- 132
29 --- 167 29 --- 164
30 --- 79 30 --- 79
30 x--> 108 30 x--> 108
30 --- 128 30 --- 124
30 --- 160 30 --- 156
31 --- 80 31 --- 80
31 x--> 108 31 x--> 108
31 --- 123 31 --- 138
31 --- 155 31 --- 170
32 --- 81 32 --- 81
32 x--> 108 32 x--> 108
32 --- 127 32 --- 129
32 --- 159 32 --- 161
33 --- 82 33 --- 82
33 x--> 108 33 x--> 108
33 --- 132 33 --- 119
33 --- 164 33 --- 151
34 --- 83 34 --- 83
34 x--> 108 34 x--> 108
34 --- 133 34 --- 123
34 --- 165 34 --- 155
35 --- 84 35 --- 84
35 x--> 108 35 x--> 108
35 --- 121 35 --- 135
35 --- 153 35 --- 167
36 --- 85 36 --- 85
36 x--> 108 36 x--> 108
36 --- 137 36 --- 125
36 --- 169 36 --- 157
37 --- 86 37 --- 86
37 x--> 108 37 x--> 108
37 --- 115 37 --- 116
37 --- 147 37 --- 148
38 --- 87 38 --- 87
38 x--> 108 38 x--> 108
38 --- 120 38 --- 131
38 --- 152 38 --- 163
39 --- 88 39 --- 88
39 x--> 108 39 x--> 108
39 --- 124 39 --- 127
39 --- 156 39 --- 159
40 --- 89 40 --- 89
40 x--> 108 40 x--> 108
40 --- 134 40 --- 134
40 --- 166 40 --- 166
41 --- 90 41 --- 90
41 x--> 108 41 x--> 108
41 --- 136 41 --- 130
41 --- 168 41 --- 162
42 --- 91 42 --- 91
42 x--> 108 42 x--> 108
42 --- 122 42 --- 136
42 --- 154 42 --- 168
43 --- 92 43 --- 92
43 x--> 108 43 x--> 108
43 --- 114 43 --- 126
43 --- 146 43 --- 158
44 --- 93 44 --- 93
44 x--> 108 44 x--> 108
44 --- 113 44 --- 113
44 --- 145 44 --- 145
45 --- 94 45 --- 94
45 x--> 108 45 x--> 108
45 --- 131 45 --- 133
45 --- 163 45 --- 165
46 --- 95 46 --- 95
46 x--> 108 46 x--> 108
46 --- 117 46 --- 137
46 --- 149 46 --- 169
47 --- 96 47 --- 96
47 x--> 108 47 x--> 108
47 --- 125 47 --- 128
47 --- 157 47 --- 160
48 --- 97 48 --- 97
48 x--> 108 48 x--> 108
48 --- 119 48 --- 118
48 --- 151 48 --- 150
49 --- 98 49 --- 98
49 x--> 108 49 x--> 108
49 --- 126 49 --- 121
49 --- 158 49 --- 153
50 --- 99 50 --- 99
50 x--> 108 50 x--> 108
50 --- 118 50 --- 120
50 --- 150 50 --- 152
51 --- 100 51 --- 100
51 x--> 108 51 x--> 108
51 --- 129 51 --- 117
51 --- 161 51 --- 149
52 --- 101 52 --- 101
52 x--> 108 52 x--> 108
52 --- 138 52 --- 122
52 --- 170 52 --- 154
61 --- 102 61 --- 102
61 x--> 110 61 x--> 109
61 --- 140 61 --- 140
61 --- 172 61 --- 172
63 --- 103 63 --- 103
@ -594,87 +594,87 @@ flowchart LR
74 --- 174 74 --- 174
74 --- 175 74 --- 175
74 --- 176 74 --- 176
75 --- 130 75 --- 139
75 --- 162 145 <--x 75
163 <--x 75 75 --- 171
76 --- 116 76 --- 114
76 --- 148 76 --- 146
149 <--x 76 147 <--x 76
77 --- 139 77 --- 115
145 <--x 77 77 --- 147
77 --- 171 148 <--x 77
78 --- 135 78 --- 132
78 --- 167 78 --- 164
168 <--x 78 165 <--x 78
79 --- 128 79 --- 124
79 --- 160 79 --- 156
161 <--x 79 157 <--x 79
80 --- 123 80 --- 138
80 --- 155 80 --- 170
156 <--x 80 171 <--x 80
81 --- 127 81 --- 129
81 --- 159 81 --- 161
160 <--x 81 162 <--x 81
82 --- 132 82 --- 119
82 --- 164 82 --- 151
165 <--x 82 152 <--x 82
83 --- 133 83 --- 123
83 --- 165 83 --- 155
166 <--x 83 156 <--x 83
84 --- 121 84 --- 135
84 --- 153 84 --- 167
154 <--x 84 168 <--x 84
85 --- 137 85 --- 125
85 --- 169 85 --- 157
170 <--x 85 158 <--x 85
86 --- 115 86 --- 116
86 --- 147 86 --- 148
148 <--x 86 149 <--x 86
87 --- 120 87 --- 131
87 --- 152 87 --- 163
153 <--x 87 164 <--x 87
88 --- 124 88 --- 127
88 --- 156 88 --- 159
157 <--x 88 160 <--x 88
89 --- 134 89 --- 134
89 --- 166 89 --- 166
167 <--x 89 167 <--x 89
90 --- 136 90 --- 130
90 --- 168 90 --- 162
169 <--x 90 163 <--x 90
91 --- 122 91 --- 136
91 --- 154 91 --- 168
155 <--x 91 169 <--x 91
92 --- 114 92 --- 126
92 --- 146 92 --- 158
147 <--x 92 159 <--x 92
93 --- 113 93 --- 113
93 --- 145 93 --- 145
146 <--x 93 146 <--x 93
94 --- 131 94 --- 133
94 --- 163 94 --- 165
164 <--x 94 166 <--x 94
95 --- 117 95 --- 137
95 --- 149 95 --- 169
150 <--x 95 170 <--x 95
96 --- 125 96 --- 128
96 --- 157 96 --- 160
158 <--x 96 161 <--x 96
97 --- 119 97 --- 118
97 --- 151 97 --- 150
152 <--x 97 151 <--x 97
98 --- 126 98 --- 121
98 --- 158 98 --- 153
159 <--x 98 154 <--x 98
99 --- 118 99 --- 120
99 --- 150 99 --- 152
151 <--x 99 153 <--x 99
100 --- 129 100 --- 117
100 --- 161 100 --- 149
162 <--x 100 150 <--x 100
101 --- 138 101 --- 122
101 --- 170 101 --- 154
171 <--x 101 155 <--x 101
102 --- 140 102 --- 140
102 --- 172 102 --- 172
103 --- 144 103 --- 144
@ -689,7 +689,7 @@ flowchart LR
106 --- 141 106 --- 141
106 --- 173 106 --- 173
174 <--x 106 174 <--x 106
140 <--x 109 140 <--x 110
141 <--x 111 141 <--x 111
142 <--x 111 142 <--x 111
143 <--x 111 143 <--x 111

View File

@ -191,7 +191,8 @@ flowchart LR
100["SweepEdge Adjacent"] 100["SweepEdge Adjacent"]
101["SweepEdge Adjacent"] 101["SweepEdge Adjacent"]
102["SweepEdge Adjacent"] 102["SweepEdge Adjacent"]
103["EdgeCut Chamfer<br>[2565, 2678, 0]"] 103["SweepEdge Adjacent"]
104["EdgeCut Chamfer<br>[2565, 2678, 0]"]
%% [ProgramBodyItem { index: 19 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 19 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
1 --- 11 1 --- 11
2 <--x 3 2 <--x 3
@ -246,25 +247,25 @@ flowchart LR
78 --- 19 78 --- 19
45 <--x 20 45 <--x 20
20 --- 68 20 --- 68
20 x--> 97 20 --- 97
45 <--x 21 45 <--x 21
21 --- 65 21 --- 65
21 --- 97 21 --- 98
45 <--x 22 45 <--x 22
22 --- 64 22 --- 64
22 --- 98 22 --- 99
45 <--x 23 45 <--x 23
23 --- 66 23 --- 66
23 --- 99 23 --- 100
45 <--x 24 45 <--x 24
24 --- 63 24 --- 63
24 --- 100 24 --- 101
45 <--x 25 45 <--x 25
25 --- 62 25 --- 62
25 --- 101 25 --- 102
45 <--x 26 45 <--x 26
26 --- 67 26 --- 67
26 --- 102 26 --- 103
28 --- 57 28 --- 57
28 x--> 70 28 x--> 70
28 --- 84 28 --- 84
@ -310,6 +311,7 @@ flowchart LR
45 --- 100 45 --- 100
45 --- 101 45 --- 101
45 --- 102 45 --- 102
45 --- 103
46 --- 57 46 --- 57
46 --- 70 46 --- 70
46 --- 75 46 --- 75
@ -362,18 +364,20 @@ flowchart LR
60 --- 95 60 --- 95
61 --- 88 61 --- 88
61 --- 96 61 --- 96
100 <--x 62 101 <--x 62
62 --- 101 62 --- 102
99 <--x 63 100 <--x 63
63 --- 100 63 --- 101
64 --- 98 98 <--x 64
65 --- 97 64 --- 99
98 <--x 66 97 <--x 65
66 --- 99 65 --- 98
101 <--x 67 99 <--x 66
67 --- 102 66 --- 100
102 <--x 67
67 --- 103
68 --- 97 68 --- 97
102 <--x 68 103 <--x 68
86 <--x 73 86 <--x 73
81 <--x 74 81 <--x 74
84 <--x 75 84 <--x 75
@ -382,5 +386,5 @@ flowchart LR
87 <--x 78 87 <--x 78
88 <--x 79 88 <--x 79
85 <--x 80 85 <--x 80
81 <--x 103 81 <--x 104
``` ```

View File

@ -514,6 +514,7 @@ flowchart LR
296["SweepEdge Adjacent"] 296["SweepEdge Adjacent"]
297["SweepEdge Adjacent"] 297["SweepEdge Adjacent"]
298["SweepEdge Adjacent"] 298["SweepEdge Adjacent"]
299["SweepEdge Adjacent"]
1 --- 16 1 --- 16
2 --- 17 2 --- 17
3 <--x 12 3 <--x 12
@ -628,16 +629,16 @@ flowchart LR
28 ---- 133 28 ---- 133
110 <--x 29 110 <--x 29
29 --- 153 29 --- 153
29 x--> 256 29 --- 256
110 <--x 30 110 <--x 30
30 --- 151 30 --- 151
30 --- 256 30 --- 257
110 <--x 31 110 <--x 31
31 --- 150 31 --- 150
31 --- 257 31 --- 258
110 <--x 32 110 <--x 32
32 --- 152 32 --- 152
32 --- 258 32 --- 259
34 --- 137 34 --- 137
34 x--> 197 34 x--> 197
34 --- 219 34 --- 219
@ -705,143 +706,143 @@ flowchart LR
51 --- 187 51 --- 187
51 x--> 198 51 x--> 198
51 --- 239 51 --- 239
51 --- 292 51 --- 293
52 --- 178 52 --- 178
52 x--> 203 52 x--> 203
52 --- 237 52 --- 237
52 --- 283 52 --- 284
53 --- 176 53 --- 176
53 x--> 203 53 x--> 203
53 --- 236 53 --- 236
53 --- 282 53 --- 283
54 --- 177 54 --- 177
54 x--> 203 54 x--> 203
54 --- 235 54 --- 235
54 --- 281 54 --- 282
116 <--x 56 116 <--x 56
56 --- 192 56 --- 192
56 --- 293 56 --- 294
116 <--x 57 116 <--x 57
57 --- 191 57 --- 191
57 --- 294 57 --- 295
116 <--x 58 116 <--x 58
58 --- 189 58 --- 189
58 --- 295 58 --- 296
116 <--x 59 116 <--x 59
59 --- 190 59 --- 190
59 --- 296 59 --- 297
116 <--x 60 116 <--x 60
60 --- 188 60 --- 188
60 --- 297 60 --- 298
116 <--x 61 116 <--x 61
61 --- 193 61 --- 193
61 --- 298 61 --- 299
117 <--x 63 117 <--x 63
63 --- 185 63 --- 185
63 --- 284 63 --- 285
117 <--x 64 117 <--x 64
64 --- 179 64 --- 179
64 --- 285 64 --- 286
117 <--x 65 117 <--x 65
65 --- 184 65 --- 184
65 --- 286 65 --- 287
117 <--x 66 117 <--x 66
66 --- 182 66 --- 182
66 --- 287 66 --- 288
117 <--x 67 117 <--x 67
67 --- 181 67 --- 181
67 --- 288 67 --- 289
117 <--x 68 117 <--x 68
68 --- 180 68 --- 180
68 --- 289 68 --- 290
117 <--x 69 117 <--x 69
69 --- 183 69 --- 183
69 --- 290 69 --- 291
71 --- 186 71 --- 186
71 x--> 194 71 x--> 194
71 --- 238 71 --- 238
71 --- 291 71 --- 292
73 --- 154 73 --- 154
73 x--> 199 73 x--> 199
73 --- 220 73 --- 220
73 --- 259 73 --- 260
74 --- 155 74 --- 155
74 x--> 199 74 x--> 199
74 --- 221 74 --- 221
74 --- 260 74 --- 261
75 --- 168 75 --- 168
75 x--> 195 75 x--> 195
75 --- 234 75 --- 234
75 --- 273 75 --- 274
132 <--x 76 132 <--x 76
76 --- 170 76 --- 170
76 --- 274 76 --- 275
132 <--x 77 132 <--x 77
77 --- 171 77 --- 171
77 --- 275 77 --- 276
132 <--x 78 132 <--x 78
78 --- 169 78 --- 169
78 --- 276 78 --- 277
132 <--x 79 132 <--x 79
79 --- 173 79 --- 173
79 --- 277 79 --- 278
132 <--x 80 132 <--x 80
80 --- 175 80 --- 175
80 --- 278 80 --- 279
132 <--x 81 132 <--x 81
81 --- 174 81 --- 174
81 --- 279 81 --- 280
132 <--x 82 132 <--x 82
82 --- 172 82 --- 172
82 --- 280 82 --- 281
84 --- 166 84 --- 166
84 x--> 201 84 x--> 201
84 --- 233 84 --- 233
84 --- 272 84 --- 273
85 --- 163 85 --- 163
85 x--> 201 85 x--> 201
85 --- 232 85 --- 232
85 --- 271 85 --- 272
86 --- 156 86 --- 156
86 x--> 201 86 x--> 201
86 --- 231 86 --- 231
86 --- 270 86 --- 271
87 --- 161 87 --- 161
87 x--> 201 87 x--> 201
87 --- 230 87 --- 230
87 --- 269 87 --- 270
88 --- 167 88 --- 167
88 x--> 201 88 x--> 201
88 --- 229 88 --- 229
88 --- 268 88 --- 269
89 --- 158 89 --- 158
89 x--> 201 89 x--> 201
89 --- 228 89 --- 228
89 --- 267 89 --- 268
90 --- 160 90 --- 160
90 x--> 201 90 x--> 201
90 --- 227 90 --- 227
90 --- 266 90 --- 267
91 --- 157 91 --- 157
91 x--> 201 91 x--> 201
91 --- 226 91 --- 226
91 --- 265 91 --- 266
92 --- 162 92 --- 162
92 x--> 201 92 x--> 201
92 --- 225 92 --- 225
92 --- 264 92 --- 265
93 --- 165 93 --- 165
93 x--> 201 93 x--> 201
93 --- 224 93 --- 224
93 --- 263 93 --- 264
94 --- 159 94 --- 159
94 x--> 201 94 x--> 201
94 --- 223 94 --- 223
94 --- 262 94 --- 263
95 --- 164 95 --- 164
95 x--> 201 95 x--> 201
95 --- 222 95 --- 222
95 --- 261 95 --- 262
110 --- 150 110 --- 150
110 --- 151 110 --- 151
110 --- 152 110 --- 152
@ -849,6 +850,7 @@ flowchart LR
110 --- 256 110 --- 256
110 --- 257 110 --- 257
110 --- 258 110 --- 258
110 --- 259
111 --- 134 111 --- 134
111 --- 135 111 --- 135
111 --- 136 111 --- 136
@ -903,28 +905,28 @@ flowchart LR
112 --- 198 112 --- 198
112 --- 203 112 --- 203
112 --- 239 112 --- 239
112 --- 292 112 --- 293
114 --- 176 114 --- 176
114 --- 177 114 --- 177
114 --- 178 114 --- 178
114 --- 235 114 --- 235
114 --- 236 114 --- 236
114 --- 237 114 --- 237
114 --- 281
114 --- 282 114 --- 282
114 --- 283 114 --- 283
114 --- 284
116 --- 188 116 --- 188
116 --- 189 116 --- 189
116 --- 190 116 --- 190
116 --- 191 116 --- 191
116 --- 192 116 --- 192
116 --- 193 116 --- 193
116 --- 293
116 --- 294 116 --- 294
116 --- 295 116 --- 295
116 --- 296 116 --- 296
116 --- 297 116 --- 297
116 --- 298 116 --- 298
116 --- 299
117 --- 179 117 --- 179
117 --- 180 117 --- 180
117 --- 181 117 --- 181
@ -932,29 +934,29 @@ flowchart LR
117 --- 183 117 --- 183
117 --- 184 117 --- 184
117 --- 185 117 --- 185
117 --- 284
117 --- 285 117 --- 285
117 --- 286 117 --- 286
117 --- 287 117 --- 287
117 --- 288 117 --- 288
117 --- 289 117 --- 289
117 --- 290 117 --- 290
117 --- 291
118 --- 186 118 --- 186
118 --- 194 118 --- 194
118 --- 199 118 --- 199
118 --- 238 118 --- 238
118 --- 291 118 --- 292
122 --- 154 122 --- 154
122 --- 220 122 --- 220
122 --- 259 122 --- 260
129 --- 155 129 --- 155
129 --- 221 129 --- 221
129 --- 260 129 --- 261
131 --- 168 131 --- 168
131 --- 195 131 --- 195
131 --- 200 131 --- 200
131 --- 234 131 --- 234
131 --- 273 131 --- 274
132 --- 169 132 --- 169
132 --- 170 132 --- 170
132 --- 171 132 --- 171
@ -962,13 +964,13 @@ flowchart LR
132 --- 173 132 --- 173
132 --- 174 132 --- 174
132 --- 175 132 --- 175
132 --- 274
132 --- 275 132 --- 275
132 --- 276 132 --- 276
132 --- 277 132 --- 277
132 --- 278 132 --- 278
132 --- 279 132 --- 279
132 --- 280 132 --- 280
132 --- 281
133 --- 156 133 --- 156
133 --- 157 133 --- 157
133 --- 158 133 --- 158
@ -995,7 +997,6 @@ flowchart LR
133 --- 231 133 --- 231
133 --- 232 133 --- 232
133 --- 233 133 --- 233
133 --- 261
133 --- 262 133 --- 262
133 --- 263 133 --- 263
133 --- 264 133 --- 264
@ -1007,155 +1008,158 @@ flowchart LR
133 --- 270 133 --- 270
133 --- 271 133 --- 271
133 --- 272 133 --- 272
133 --- 273
134 --- 209 134 --- 209
244 <--x 134
134 --- 245 134 --- 245
246 <--x 134
135 --- 207 135 --- 207
242 <--x 135
135 --- 243 135 --- 243
244 <--x 135
136 --- 217 136 --- 217
252 <--x 136
136 --- 253 136 --- 253
254 <--x 136
137 --- 219 137 --- 219
254 <--x 137 240 <--x 137
137 --- 255 137 --- 255
138 --- 211 138 --- 211
246 <--x 138
138 --- 247 138 --- 247
248 <--x 138
139 --- 204 139 --- 204
139 --- 240 139 --- 240
255 <--x 139 241 <--x 139
140 --- 210 140 --- 210
245 <--x 140
140 --- 246 140 --- 246
247 <--x 140
141 --- 205 141 --- 205
240 <--x 141
141 --- 241 141 --- 241
242 <--x 141
142 --- 212 142 --- 212
247 <--x 142
142 --- 248 142 --- 248
249 <--x 142
143 --- 214 143 --- 214
249 <--x 143
143 --- 250 143 --- 250
251 <--x 143
144 --- 213 144 --- 213
248 <--x 144
144 --- 249 144 --- 249
250 <--x 144
145 --- 216 145 --- 216
251 <--x 145
145 --- 252 145 --- 252
253 <--x 145
146 --- 215 146 --- 215
250 <--x 146
146 --- 251 146 --- 251
252 <--x 146
147 --- 206 147 --- 206
241 <--x 147
147 --- 242 147 --- 242
243 <--x 147
148 --- 208 148 --- 208
243 <--x 148
148 --- 244 148 --- 244
245 <--x 148
149 --- 218 149 --- 218
253 <--x 149
149 --- 254 149 --- 254
150 --- 257 255 <--x 149
151 --- 256 257 <--x 150
257 <--x 152 150 --- 258
152 --- 258 256 <--x 151
151 --- 257
258 <--x 152
152 --- 259
153 --- 256 153 --- 256
258 <--x 153 259 <--x 153
154 --- 220 154 --- 220
154 --- 259 154 --- 260
155 --- 221 155 --- 221
155 --- 260 155 --- 261
156 --- 231 156 --- 231
156 --- 270 156 --- 271
271 <--x 156 272 <--x 156
157 --- 226 157 --- 226
157 --- 265 157 --- 266
266 <--x 157 267 <--x 157
158 --- 228 158 --- 228
158 --- 267 158 --- 268
268 <--x 158 269 <--x 158
159 --- 223 159 --- 223
159 --- 262 159 --- 263
263 <--x 159 264 <--x 159
160 --- 227 160 --- 227
160 --- 266 160 --- 267
267 <--x 160 268 <--x 160
161 --- 230 161 --- 230
161 --- 269 161 --- 270
270 <--x 161 271 <--x 161
162 --- 225 162 --- 225
162 --- 264 162 --- 265
265 <--x 162 266 <--x 162
163 --- 232 163 --- 232
163 --- 271 163 --- 272
272 <--x 163 273 <--x 163
164 --- 222 164 --- 222
164 --- 261 164 --- 262
262 <--x 164 263 <--x 164
165 --- 224 165 --- 224
165 --- 263 165 --- 264
264 <--x 165 265 <--x 165
166 --- 233 166 --- 233
261 <--x 166 262 <--x 166
166 --- 272 166 --- 273
167 --- 229 167 --- 229
167 --- 268 167 --- 269
269 <--x 167 270 <--x 167
168 --- 234 168 --- 234
168 --- 273 168 --- 274
275 <--x 169 276 <--x 169
169 --- 276 169 --- 277
170 --- 274 170 --- 275
280 <--x 170 281 <--x 170
274 <--x 171 275 <--x 171
171 --- 275 171 --- 276
279 <--x 172 280 <--x 172
172 --- 280 172 --- 281
276 <--x 173 277 <--x 173
173 --- 277 173 --- 278
278 <--x 174 279 <--x 174
174 --- 279 174 --- 280
277 <--x 175 278 <--x 175
175 --- 278 175 --- 279
176 --- 236 176 --- 236
176 --- 282 176 --- 283
283 <--x 176 284 <--x 176
177 --- 235 177 --- 235
177 --- 281 177 --- 282
282 <--x 177 283 <--x 177
178 --- 237 178 --- 237
281 <--x 178 282 <--x 178
178 --- 283 178 --- 284
284 <--x 179 285 <--x 179
179 --- 285 179 --- 286
288 <--x 180 289 <--x 180
180 --- 289 180 --- 290
287 <--x 181 288 <--x 181
181 --- 288 181 --- 289
286 <--x 182 287 <--x 182
182 --- 287 182 --- 288
289 <--x 183 290 <--x 183
183 --- 290 183 --- 291
285 <--x 184 286 <--x 184
184 --- 286 184 --- 287
185 --- 284 185 --- 285
290 <--x 185 291 <--x 185
186 --- 238 186 --- 238
186 --- 291 186 --- 292
187 --- 239 187 --- 239
187 --- 292 187 --- 293
296 <--x 188 297 <--x 188
188 --- 297 188 --- 298
294 <--x 189 295 <--x 189
189 --- 295 189 --- 296
295 <--x 190 296 <--x 190
190 --- 296 190 --- 297
293 <--x 191 294 <--x 191
191 --- 294 191 --- 295
192 --- 293 192 --- 294
298 <--x 192 299 <--x 192
297 <--x 193 298 <--x 193
193 --- 298 193 --- 299
220 <--x 194 220 <--x 194
221 <--x 194 221 <--x 194
222 <--x 196 222 <--x 196

View File

@ -408,7 +408,8 @@ flowchart LR
246["SweepEdge Adjacent"] 246["SweepEdge Adjacent"]
247["SweepEdge Adjacent"] 247["SweepEdge Adjacent"]
248["SweepEdge Adjacent"] 248["SweepEdge Adjacent"]
249["EdgeCut Fillet<br>[3438, 3552, 0]"] 249["SweepEdge Adjacent"]
250["EdgeCut Fillet<br>[3438, 3552, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
1 --- 8 1 --- 8
2 <--x 6 2 <--x 6
@ -676,25 +677,25 @@ flowchart LR
64 x--> 143 64 x--> 143
64 --- 186 64 --- 186
64 --- 231 64 --- 231
64 --- 249 64 --- 250
85 <--x 65 85 <--x 65
65 --- 136 65 --- 136
65 x--> 244 65 --- 244
85 <--x 66 85 <--x 66
66 --- 141 66 --- 141
66 --- 244 66 --- 245
85 <--x 67 85 <--x 67
67 --- 138 67 --- 138
67 --- 245 67 --- 246
85 <--x 68 85 <--x 68
68 --- 137 68 --- 137
68 --- 246 68 --- 247
85 <--x 69 85 <--x 69
69 --- 139 69 --- 139
69 --- 247 69 --- 248
85 <--x 70 85 <--x 70
70 --- 140 70 --- 140
70 --- 248 70 --- 249
79 --- 98 79 --- 98
79 --- 99 79 --- 99
79 --- 100 79 --- 100
@ -853,6 +854,7 @@ flowchart LR
85 --- 246 85 --- 246
85 --- 247 85 --- 247
85 --- 248 85 --- 248
85 --- 249
90 --- 86 90 --- 86
88 --- 87 88 --- 87
87 --- 89 87 --- 89
@ -992,15 +994,17 @@ flowchart LR
135 --- 239 135 --- 239
240 <--x 135 240 <--x 135
136 --- 244 136 --- 244
248 <--x 136 249 <--x 136
245 <--x 137 246 <--x 137
137 --- 246 137 --- 247
138 --- 245 245 <--x 138
246 <--x 139 138 --- 246
139 --- 247 247 <--x 139
247 <--x 140 139 --- 248
140 --- 248 248 <--x 140
141 --- 244 140 --- 249
244 <--x 141
141 --- 245
154 <--x 142 154 <--x 142
155 <--x 142 155 <--x 142
156 <--x 142 156 <--x 142

View File

@ -582,16 +582,16 @@ flowchart LR
46 --- 226 46 --- 226
72 --- 112 72 --- 112
72 x--> 151 72 x--> 151
72 --- 167 72 --- 164
72 --- 201 72 --- 198
73 --- 113 73 --- 113
73 x--> 151 73 x--> 151
73 --- 169 73 --- 160
73 --- 203 73 --- 194
74 --- 114 74 --- 114
74 x--> 151 74 x--> 151
74 --- 168 74 --- 163
74 --- 202 74 --- 197
75 --- 115 75 --- 115
75 x--> 151 75 x--> 151
75 --- 166 75 --- 166
@ -602,28 +602,28 @@ flowchart LR
76 --- 199 76 --- 199
77 --- 117 77 --- 117
77 x--> 151 77 x--> 151
77 --- 161 77 --- 170
77 --- 195 77 --- 204
78 --- 118 78 --- 118
78 x--> 151 78 x--> 151
78 --- 162 78 --- 169
78 --- 196 78 --- 203
79 --- 119 79 --- 119
79 x--> 151 79 x--> 151
79 --- 163 79 --- 161
79 --- 197 79 --- 195
80 --- 120 80 --- 120
80 x--> 151 80 x--> 151
80 --- 170 80 --- 167
80 --- 204 80 --- 201
81 --- 121 81 --- 121
81 x--> 151 81 x--> 151
81 --- 160 81 --- 162
81 --- 194 81 --- 196
82 --- 122 82 --- 122
82 x--> 151 82 x--> 151
82 --- 164 82 --- 168
82 --- 198 82 --- 202
84 --- 123 84 --- 123
84 x--> 145 84 x--> 145
84 --- 171 84 --- 171
@ -756,39 +756,39 @@ flowchart LR
109 --- 107 109 --- 107
111 --- 159 111 --- 159
111 --- 193 111 --- 193
112 --- 167 112 --- 164
112 --- 201 112 --- 198
202 <--x 112 199 <--x 112
113 --- 169 113 --- 160
113 --- 203 113 --- 194
204 <--x 113 195 <--x 113
114 --- 168 114 --- 163
114 --- 202 114 --- 197
203 <--x 114 198 <--x 114
115 --- 166 115 --- 166
115 --- 200 115 --- 200
201 <--x 115 201 <--x 115
116 --- 165 116 --- 165
116 --- 199 116 --- 199
200 <--x 116 200 <--x 116
117 --- 161 117 --- 170
117 --- 195 194 <--x 117
196 <--x 117 117 --- 204
118 --- 162 118 --- 169
118 --- 196 118 --- 203
197 <--x 118 204 <--x 118
119 --- 163 119 --- 161
119 --- 197 119 --- 195
198 <--x 119 196 <--x 119
120 --- 170 120 --- 167
194 <--x 120 120 --- 201
120 --- 204 202 <--x 120
121 --- 160 121 --- 162
121 --- 194 121 --- 196
195 <--x 121 197 <--x 121
122 --- 164 122 --- 168
122 --- 198 122 --- 202
199 <--x 122 203 <--x 122
123 --- 171 123 --- 171
123 --- 205 123 --- 205
124 --- 186 124 --- 186

View File

@ -177,72 +177,72 @@ flowchart LR
2 ---- 34 2 ---- 34
17 --- 35 17 --- 35
17 x--> 52 17 x--> 52
17 --- 58 17 --- 67
17 --- 75 17 --- 84
18 --- 36 18 --- 36
18 x--> 52 18 x--> 52
18 --- 66 18 --- 58
18 --- 83 18 --- 75
19 --- 37 19 --- 37
19 x--> 52 19 x--> 52
19 --- 60 19 --- 56
19 --- 77 19 --- 73
20 --- 38 20 --- 38
20 x--> 52 20 x--> 52
20 --- 61 20 --- 68
20 --- 78 20 --- 85
21 --- 39 21 --- 39
21 x--> 52 21 x--> 52
21 --- 67 21 --- 63
21 --- 84 21 --- 80
22 --- 40 22 --- 40
22 x--> 52 22 x--> 52
22 --- 63 22 --- 54
22 --- 80 22 --- 71
23 --- 41 23 --- 41
23 x--> 52 23 x--> 52
23 --- 56 23 --- 60
23 --- 73 23 --- 77
24 --- 42 24 --- 42
24 x--> 52 24 x--> 52
24 --- 54 24 --- 57
24 --- 71 24 --- 74
25 --- 43 25 --- 43
25 x--> 52 25 x--> 52
25 --- 70 25 --- 64
25 --- 87 25 --- 81
26 --- 44 26 --- 44
26 x--> 52 26 x--> 52
26 --- 68 26 --- 59
26 --- 85 26 --- 76
27 --- 45 27 --- 45
27 x--> 52 27 x--> 52
27 --- 65 27 --- 69
27 --- 82 27 --- 86
28 --- 46 28 --- 46
28 x--> 52 28 x--> 52
28 --- 62 28 --- 66
28 --- 79 28 --- 83
29 --- 47 29 --- 47
29 x--> 52 29 x--> 52
29 --- 57 29 --- 55
29 --- 74 29 --- 72
30 --- 48 30 --- 48
30 x--> 52 30 x--> 52
30 --- 55 30 --- 61
30 --- 72 30 --- 78
31 --- 49 31 --- 49
31 x--> 52 31 x--> 52
31 --- 64 31 --- 70
31 --- 81 31 --- 87
32 --- 50 32 --- 50
32 x--> 52 32 x--> 52
32 --- 69 32 --- 65
32 --- 86 32 --- 82
33 --- 51 33 --- 51
33 x--> 52 33 x--> 52
33 --- 59 33 --- 62
33 --- 76 33 --- 79
34 --- 35 34 --- 35
34 --- 36 34 --- 36
34 --- 37 34 --- 37
@ -296,57 +296,57 @@ flowchart LR
34 --- 85 34 --- 85
34 --- 86 34 --- 86
34 --- 87 34 --- 87
35 --- 58 35 --- 67
74 <--x 35 83 <--x 35
35 --- 75 35 --- 84
36 --- 66 36 --- 58
82 <--x 36 74 <--x 36
36 --- 83 36 --- 75
37 --- 60 37 --- 56
76 <--x 37 72 <--x 37
37 --- 77 37 --- 73
38 --- 61 38 --- 68
77 <--x 38 84 <--x 38
38 --- 78 38 --- 85
39 --- 67 39 --- 63
83 <--x 39 79 <--x 39
39 --- 84 39 --- 80
40 --- 63 40 --- 54
79 <--x 40 40 --- 71
40 --- 80 87 <--x 40
41 --- 56 41 --- 60
72 <--x 41 76 <--x 41
41 --- 73 41 --- 77
42 --- 54 42 --- 57
42 --- 71 73 <--x 42
87 <--x 42 42 --- 74
43 --- 70 43 --- 64
86 <--x 43 80 <--x 43
43 --- 87 43 --- 81
44 --- 68 44 --- 59
84 <--x 44 75 <--x 44
44 --- 85 44 --- 76
45 --- 65 45 --- 69
81 <--x 45 85 <--x 45
45 --- 82 45 --- 86
46 --- 62 46 --- 66
78 <--x 46 82 <--x 46
46 --- 79 46 --- 83
47 --- 57 47 --- 55
73 <--x 47 71 <--x 47
47 --- 74 47 --- 72
48 --- 55 48 --- 61
71 <--x 48 77 <--x 48
48 --- 72 48 --- 78
49 --- 64 49 --- 70
80 <--x 49 86 <--x 49
49 --- 81 49 --- 87
50 --- 69 50 --- 65
85 <--x 50 81 <--x 50
50 --- 86 50 --- 82
51 --- 59 51 --- 62
75 <--x 51 78 <--x 51
51 --- 76 51 --- 79
54 <--x 53 54 <--x 53
55 <--x 53 55 <--x 53
56 <--x 53 56 <--x 53

View File

@ -78,7 +78,7 @@ description: Artifact commands mounting-plate.kcl
"path": "[uuid]", "path": "[uuid]",
"to": { "to": {
"x": -76.2, "x": -76.2,
"y": -127.0, "y": 127.0,
"z": 0.0 "z": 0.0
} }
} }
@ -106,11 +106,11 @@ description: Artifact commands mounting-plate.kcl
"segment": { "segment": {
"type": "line", "type": "line",
"end": { "end": {
"x": 76.2, "x": 152.4,
"y": -127.0, "y": 0.0,
"z": 0.0 "z": 0.0
}, },
"relative": false "relative": true
} }
} }
}, },
@ -123,11 +123,28 @@ description: Artifact commands mounting-plate.kcl
"segment": { "segment": {
"type": "line", "type": "line",
"end": { "end": {
"x": 76.2, "x": 0.0,
"y": 127.0, "y": -254.0,
"z": 0.0 "z": 0.0
}, },
"relative": false "relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -152.4,
"y": -0.0,
"z": 0.0
},
"relative": true
} }
} }
}, },
@ -714,40 +731,48 @@ description: Artifact commands mounting-plate.kcl
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [], "range": [],
"command": { "command": {
"type": "solid3d_get_prev_adjacent_edge", "type": "solid3d_get_common_edge",
"object_id": "[uuid]", "object_id": "[uuid]",
"edge_id": "[uuid]", "face_ids": [
"face_id": "[uuid]" "[uuid]",
"[uuid]"
]
} }
}, },
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [], "range": [],
"command": { "command": {
"type": "solid3d_get_prev_adjacent_edge", "type": "solid3d_get_common_edge",
"object_id": "[uuid]", "object_id": "[uuid]",
"edge_id": "[uuid]", "face_ids": [
"face_id": "[uuid]" "[uuid]",
"[uuid]"
]
} }
}, },
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [], "range": [],
"command": { "command": {
"type": "solid3d_get_prev_adjacent_edge", "type": "solid3d_get_common_edge",
"object_id": "[uuid]", "object_id": "[uuid]",
"edge_id": "[uuid]", "face_ids": [
"face_id": "[uuid]" "[uuid]",
"[uuid]"
]
} }
}, },
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [], "range": [],
"command": { "command": {
"type": "solid3d_get_prev_adjacent_edge", "type": "solid3d_get_common_edge",
"object_id": "[uuid]", "object_id": "[uuid]",
"edge_id": "[uuid]", "face_ids": [
"face_id": "[uuid]" "[uuid]",
"[uuid]"
]
} }
} }
] ]

View File

@ -1,78 +1,80 @@
```mermaid ```mermaid
flowchart LR flowchart LR
subgraph path2 [Path] subgraph path2 [Path]
2["Path<br>[584, 639, 0]"] 2["Path<br>[506, 570, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
8["Segment<br>[647, 715, 0]"] 8["Segment<br>[576, 641, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }] %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
9["Segment<br>[723, 789, 0]"] 9["Segment<br>[647, 739, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
10["Segment<br>[797, 865, 0]"] 10["Segment<br>[745, 844, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }] %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
11["Segment<br>[873, 892, 0]"] 11["Segment<br>[850, 929, 0]"]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }] %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
20[Solid2d] 12["Segment<br>[935, 942, 0]"]
end %% [ProgramBodyItem { index: 8 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
subgraph path3 [Path]
3["Path<br>[1150, 1295, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }, CallKwArg { index: 0 }]
12["Segment<br>[1150, 1295, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }, CallKwArg { index: 0 }]
19[Solid2d] 19[Solid2d]
end end
subgraph path3 [Path]
3["Path<br>[1043, 1188, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }, CallKwArg { index: 0 }]
13["Segment<br>[1043, 1188, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }, CallKwArg { index: 0 }]
23[Solid2d]
end
subgraph path4 [Path] subgraph path4 [Path]
4["Path<br>[1320, 1464, 0]"] 4["Path<br>[1213, 1357, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }] %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }]
13["Segment<br>[1320, 1464, 0]"] 14["Segment<br>[1213, 1357, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }] %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }, CallKwArg { index: 0 }]
22[Solid2d]
end
subgraph path5 [Path]
5["Path<br>[1489, 1635, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
14["Segment<br>[1489, 1635, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
21[Solid2d]
end
subgraph path6 [Path]
6["Path<br>[1660, 1805, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }, CallKwArg { index: 0 }]
15["Segment<br>[1660, 1805, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }, CallKwArg { index: 0 }]
17[Solid2d]
end
subgraph path7 [Path]
7["Path<br>[1830, 1882, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }, CallKwArg { index: 0 }]
16["Segment<br>[1830, 1882, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }, CallKwArg { index: 0 }]
18[Solid2d] 18[Solid2d]
end end
1["Plane<br>[559, 576, 0]"] subgraph path5 [Path]
%% [ProgramBodyItem { index: 5 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }] 5["Path<br>[1382, 1528, 0]"]
23["Sweep Extrusion<br>[1889, 1921, 0]"] %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
15["Segment<br>[1382, 1528, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }, CallKwArg { index: 0 }]
20[Solid2d]
end
subgraph path6 [Path]
6["Path<br>[1553, 1698, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }, CallKwArg { index: 0 }]
16["Segment<br>[1553, 1698, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }, CallKwArg { index: 0 }]
22[Solid2d]
end
subgraph path7 [Path]
7["Path<br>[1723, 1775, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }, CallKwArg { index: 0 }]
17["Segment<br>[1723, 1775, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }, CallKwArg { index: 0 }]
21[Solid2d]
end
1["Plane<br>[476, 493, 0]"]
%% [ProgramBodyItem { index: 7 }, VariableDeclarationDeclaration, VariableDeclarationInit]
24["Sweep Extrusion<br>[1782, 1814, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }] %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
24[Wall]
%% face_code_ref=Missing NodePath
25[Wall] 25[Wall]
%% face_code_ref=Missing NodePath %% face_code_ref=Missing NodePath
26[Wall] 26[Wall]
%% face_code_ref=Missing NodePath %% face_code_ref=Missing NodePath
27[Wall] 27[Wall]
%% face_code_ref=Missing NodePath %% face_code_ref=Missing NodePath
28["Cap Start"] 28[Wall]
%% face_code_ref=Missing NodePath %% face_code_ref=Missing NodePath
29["Cap End"] 29["Cap Start"]
%% face_code_ref=Missing NodePath
30["Cap End"]
%% face_code_ref=Missing NodePath %% face_code_ref=Missing NodePath
30["SweepEdge Opposite"]
31["SweepEdge Opposite"] 31["SweepEdge Opposite"]
32["SweepEdge Opposite"] 32["SweepEdge Opposite"]
33["SweepEdge Opposite"] 33["SweepEdge Opposite"]
34["SweepEdge Adjacent"] 34["SweepEdge Opposite"]
35["SweepEdge Adjacent"] 35["SweepEdge Adjacent"]
36["SweepEdge Adjacent"] 36["SweepEdge Adjacent"]
37["SweepEdge Adjacent"] 37["SweepEdge Adjacent"]
38["EdgeCut Fillet<br>[1927, 2192, 0]"] 38["SweepEdge Adjacent"]
39["EdgeCut Fillet<br>[1820, 2153, 0]"]
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }] %% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
1 --- 2 1 --- 2
1 --- 3 1 --- 3
@ -84,63 +86,64 @@ flowchart LR
2 --- 9 2 --- 9
2 --- 10 2 --- 10
2 --- 11 2 --- 11
2 --- 20 2 --- 12
2 ---- 23 2 --- 19
3 --- 12 2 ---- 24
3 --- 19 3 --- 13
4 --- 13 3 --- 23
4 --- 22 4 --- 14
5 --- 14 4 --- 18
5 --- 21 5 --- 15
6 --- 15 5 --- 20
6 --- 17 6 --- 16
7 --- 16 6 --- 22
7 --- 18 7 --- 17
8 --- 27 7 --- 21
8 x--> 28 8 --- 28
8 --- 30 8 x--> 29
8 --- 34 8 --- 34
9 --- 25 8 --- 38
9 x--> 28 9 --- 26
9 --- 31 9 x--> 29
9 --- 35 9 --- 33
10 --- 24 9 --- 37
10 x--> 28 10 --- 25
10 x--> 29
10 --- 32 10 --- 32
10 --- 36 10 --- 36
11 --- 26 11 --- 27
11 x--> 28 11 x--> 29
11 --- 33 11 --- 31
11 --- 37 11 --- 35
23 --- 24 24 --- 25
23 --- 25 24 --- 26
23 --- 26 24 --- 27
23 --- 27 24 --- 28
23 --- 28 24 --- 29
23 --- 29 24 --- 30
23 --- 30 24 --- 31
23 --- 31
23 --- 32
23 --- 33
23 --- 34
23 --- 35
23 --- 36
23 --- 37
24 --- 32 24 --- 32
35 <--x 24 24 --- 33
24 --- 34
24 --- 35
24 --- 36 24 --- 36
25 --- 31 24 --- 37
34 <--x 25 24 --- 38
25 --- 35 25 --- 32
25 --- 36
37 <--x 25
26 --- 33 26 --- 33
36 <--x 26
26 --- 37 26 --- 37
27 --- 30 38 <--x 26
27 --- 34 27 --- 31
37 <--x 27 27 --- 35
30 <--x 29 36 <--x 27
31 <--x 29 28 --- 34
32 <--x 29 35 <--x 28
33 <--x 29 28 --- 38
37 <--x 38 31 <--x 30
32 <--x 30
33 <--x 30
34 <--x 30
37 <--x 39
``` ```

File diff suppressed because it is too large Load Diff

View File

@ -16,84 +16,6 @@ description: Operations executed mounting-plate.kcl
"labeledArgs": {}, "labeledArgs": {},
"sourceRange": [] "sourceRange": []
}, },
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "rectShape",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {
"l": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"pos": {
"value": {
"type": "Array",
"value": [
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
{
"type": "Number",
"value": 0.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
}
]
},
"sourceRange": []
},
"w": {
"value": {
"type": "Number",
"value": 6.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
}
},
"sourceRange": []
},
{ {
"type": "StdLibCall", "type": "StdLibCall",
"name": "subtract2d", "name": "subtract2d",
@ -306,8 +228,5 @@ description: Operations executed mounting-plate.kcl
} }
}, },
"sourceRange": [] "sourceRange": []
},
{
"type": "GroupEnd"
} }
] ]

View File

@ -3,6 +3,26 @@ source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing mounting-plate.kcl description: Variables in memory after executing mounting-plate.kcl
--- ---
{ {
"basePlateEdge1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "basePlateEdge1"
},
"basePlateEdge2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "basePlateEdge2"
},
"basePlateEdge3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "basePlateEdge3"
},
"basePlateEdge4": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "basePlateEdge4"
},
"centerHoleDiameter": { "centerHoleDiameter": {
"type": "Number", "type": "Number",
"value": 2.0, "value": 2.0,
@ -16,26 +36,6 @@ description: Variables in memory after executing mounting-plate.kcl
} }
} }
}, },
"edge1": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge1"
},
"edge2": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge2"
},
"edge3": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge3"
},
"edge4": {
"type": "TagIdentifier",
"type": "TagIdentifier",
"value": "edge4"
},
"filletRadius": { "filletRadius": {
"type": "Number", "type": "Number",
"value": 0.5, "value": 0.5,
@ -87,11 +87,11 @@ description: Variables in memory after executing mounting-plate.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [], "sourceRange": [],
"tag": { "tag": {
"commentStart": 708, "commentStart": 625,
"end": 714, "end": 640,
"start": 708, "start": 625,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge1" "value": "basePlateEdge1"
}, },
"type": "extrudePlane" "type": "extrudePlane"
}, },
@ -100,11 +100,11 @@ description: Variables in memory after executing mounting-plate.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [], "sourceRange": [],
"tag": { "tag": {
"commentStart": 782, "commentStart": 723,
"end": 788, "end": 738,
"start": 782, "start": 723,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge2" "value": "basePlateEdge2"
}, },
"type": "extrudePlane" "type": "extrudePlane"
}, },
@ -113,11 +113,11 @@ description: Variables in memory after executing mounting-plate.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [], "sourceRange": [],
"tag": { "tag": {
"commentStart": 858, "commentStart": 828,
"end": 864, "end": 843,
"start": 858, "start": 828,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge3" "value": "basePlateEdge3"
}, },
"type": "extrudePlane" "type": "extrudePlane"
}, },
@ -126,11 +126,11 @@ description: Variables in memory after executing mounting-plate.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [], "sourceRange": [],
"tag": { "tag": {
"commentStart": 885, "commentStart": 913,
"end": 891, "end": 928,
"start": 885, "start": 913,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge4" "value": "basePlateEdge4"
}, },
"type": "extrudePlane" "type": "extrudePlane"
} }
@ -146,39 +146,14 @@ description: Variables in memory after executing mounting-plate.kcl
}, },
"from": [ "from": [
-3.0, -3.0,
-5.0 5.0
], ],
"tag": { "tag": {
"commentStart": 708, "commentStart": 625,
"end": 714, "end": 640,
"start": 708, "start": 625,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge1" "value": "basePlateEdge1"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
3.0,
-5.0
],
"tag": {
"commentStart": 782,
"end": 788,
"start": 782,
"type": "TagDeclarator",
"value": "edge2"
}, },
"to": [ "to": [
3.0, 3.0,
@ -199,11 +174,61 @@ description: Variables in memory after executing mounting-plate.kcl
5.0 5.0
], ],
"tag": { "tag": {
"commentStart": 858, "commentStart": 723,
"end": 864, "end": 738,
"start": 858, "start": 723,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge3" "value": "basePlateEdge2"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
3.0,
-5.0
],
"tag": {
"commentStart": 828,
"end": 843,
"start": 828,
"type": "TagDeclarator",
"value": "basePlateEdge3"
},
"to": [
-3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-3.0,
-5.0
],
"tag": {
"commentStart": 913,
"end": 928,
"start": 913,
"type": "TagDeclarator",
"value": "basePlateEdge4"
}, },
"to": [ "to": [
-3.0, -3.0,
@ -223,16 +248,10 @@ description: Variables in memory after executing mounting-plate.kcl
-3.0, -3.0,
5.0 5.0
], ],
"tag": { "tag": null,
"commentStart": 885,
"end": 891,
"start": 885,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [ "to": [
-3.0, -3.0,
-5.0 5.0
], ],
"type": "ToPoint", "type": "ToPoint",
"units": { "units": {
@ -273,11 +292,11 @@ description: Variables in memory after executing mounting-plate.kcl
"start": { "start": {
"from": [ "from": [
-3.0, -3.0,
-5.0 5.0
], ],
"to": [ "to": [
-3.0, -3.0,
-5.0 5.0
], ],
"units": { "units": {
"type": "Inches" "type": "Inches"
@ -289,21 +308,21 @@ description: Variables in memory after executing mounting-plate.kcl
} }
}, },
"tags": { "tags": {
"edge1": { "basePlateEdge1": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge1" "value": "basePlateEdge1"
}, },
"edge2": { "basePlateEdge2": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge2" "value": "basePlateEdge2"
}, },
"edge3": { "basePlateEdge3": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge3" "value": "basePlateEdge3"
}, },
"edge4": { "basePlateEdge4": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge4" "value": "basePlateEdge4"
} }
}, },
"artifactId": "[uuid]", "artifactId": "[uuid]",
@ -435,10 +454,6 @@ description: Variables in memory after executing mounting-plate.kcl
} }
}, },
"rectShape": { "rectShape": {
"type": "Function",
"value": null
},
"rs": {
"type": "Sketch", "type": "Sketch",
"value": { "value": {
"type": "Sketch", "type": "Sketch",
@ -451,39 +466,14 @@ description: Variables in memory after executing mounting-plate.kcl
}, },
"from": [ "from": [
-3.0, -3.0,
-5.0 5.0
], ],
"tag": { "tag": {
"commentStart": 708, "commentStart": 625,
"end": 714, "end": 640,
"start": 708, "start": 625,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge1" "value": "basePlateEdge1"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
3.0,
-5.0
],
"tag": {
"commentStart": 782,
"end": 788,
"start": 782,
"type": "TagDeclarator",
"value": "edge2"
}, },
"to": [ "to": [
3.0, 3.0,
@ -504,11 +494,61 @@ description: Variables in memory after executing mounting-plate.kcl
5.0 5.0
], ],
"tag": { "tag": {
"commentStart": 858, "commentStart": 723,
"end": 864, "end": 738,
"start": 858, "start": 723,
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "edge3" "value": "basePlateEdge2"
},
"to": [
3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
3.0,
-5.0
],
"tag": {
"commentStart": 828,
"end": 843,
"start": 828,
"type": "TagDeclarator",
"value": "basePlateEdge3"
},
"to": [
-3.0,
-5.0
],
"type": "ToPoint",
"units": {
"type": "Inches"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": []
},
"from": [
-3.0,
-5.0
],
"tag": {
"commentStart": 913,
"end": 928,
"start": 913,
"type": "TagDeclarator",
"value": "basePlateEdge4"
}, },
"to": [ "to": [
-3.0, -3.0,
@ -528,16 +568,10 @@ description: Variables in memory after executing mounting-plate.kcl
-3.0, -3.0,
5.0 5.0
], ],
"tag": { "tag": null,
"commentStart": 885,
"end": 891,
"start": 885,
"type": "TagDeclarator",
"value": "edge4"
},
"to": [ "to": [
-3.0, -3.0,
-5.0 5.0
], ],
"type": "ToPoint", "type": "ToPoint",
"units": { "units": {
@ -578,11 +612,11 @@ description: Variables in memory after executing mounting-plate.kcl
"start": { "start": {
"from": [ "from": [
-3.0, -3.0,
-5.0 5.0
], ],
"to": [ "to": [
-3.0, -3.0,
-5.0 5.0
], ],
"units": { "units": {
"type": "Inches" "type": "Inches"
@ -594,21 +628,21 @@ description: Variables in memory after executing mounting-plate.kcl
} }
}, },
"tags": { "tags": {
"edge1": { "basePlateEdge1": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge1" "value": "basePlateEdge1"
}, },
"edge2": { "basePlateEdge2": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge2" "value": "basePlateEdge2"
}, },
"edge3": { "basePlateEdge3": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge3" "value": "basePlateEdge3"
}, },
"edge4": { "basePlateEdge4": {
"type": "TagIdentifier", "type": "TagIdentifier",
"value": "edge4" "value": "basePlateEdge4"
} }
}, },
"artifactId": "[uuid]", "artifactId": "[uuid]",
@ -617,5 +651,37 @@ description: Variables in memory after executing mounting-plate.kcl
"type": "Inches" "type": "Inches"
} }
} }
},
"sketch001": {
"type": "Plane",
"value": {
"artifactId": "[uuid]",
"id": "[uuid]",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Mm"
}
},
"value": "XY",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0,
"units": {
"type": "Unknown"
}
}
}
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -259,7 +259,8 @@ flowchart LR
182["SweepEdge Adjacent"] 182["SweepEdge Adjacent"]
183["SweepEdge Adjacent"] 183["SweepEdge Adjacent"]
184["SweepEdge Adjacent"] 184["SweepEdge Adjacent"]
185["EdgeCut Fillet<br>[1308, 1593, 3]"] 185["SweepEdge Adjacent"]
186["EdgeCut Fillet<br>[1308, 1593, 3]"]
1 --- 6 1 --- 6
2 --- 7 2 --- 7
3 --- 8 3 --- 8
@ -347,44 +348,44 @@ flowchart LR
129 --- 20 129 --- 20
77 <--x 21 77 <--x 21
21 --- 103 21 --- 103
21 x--> 161 21 --- 161
77 <--x 22 77 <--x 22
22 --- 104 22 --- 104
22 --- 161 22 --- 162
78 <--x 23 78 <--x 23
23 --- 124 23 --- 124
23 --- 181 23 --- 182
78 <--x 24 78 <--x 24
24 --- 125 24 --- 125
24 --- 182 24 --- 183
78 <--x 25 78 <--x 25
25 --- 126 25 --- 126
25 --- 183 25 --- 184
78 <--x 26 78 <--x 26
26 --- 127 26 --- 127
26 --- 184 26 --- 185
27 --- 107 27 --- 107
27 x--> 133 27 x--> 133
27 --- 138 27 --- 138
27 --- 164 27 --- 165
79 <--x 28 79 <--x 28
28 --- 114 28 --- 114
28 --- 166 28 --- 167
79 <--x 29 79 <--x 29
29 --- 113 29 --- 113
29 --- 167 29 --- 168
79 <--x 30 79 <--x 30
30 --- 111 30 --- 111
30 --- 168 30 --- 169
79 <--x 31 79 <--x 31
31 --- 112 31 --- 112
31 --- 169 31 --- 170
79 <--x 32 79 <--x 32
32 --- 109 32 --- 109
32 --- 170 32 --- 171
79 <--x 33 79 <--x 33
33 --- 110 33 --- 110
33 --- 171 33 --- 172
80 <--x 35 80 <--x 35
35 --- 101 35 --- 101
35 --- 149 35 --- 149
@ -424,74 +425,75 @@ flowchart LR
48 --- 116 48 --- 116
48 x--> 128 48 x--> 128
48 --- 140 48 --- 140
48 --- 172 48 --- 173
49 --- 117 49 --- 117
49 x--> 128 49 x--> 128
49 --- 141 49 --- 141
49 --- 173 49 --- 174
50 --- 118 50 --- 118
50 x--> 128 50 x--> 128
50 --- 142 50 --- 142
50 --- 174 50 --- 175
51 --- 115 51 --- 115
51 x--> 128 51 x--> 128
51 --- 143 51 --- 143
51 --- 175 51 --- 176
54 --- 122 54 --- 122
54 x--> 134 54 x--> 134
54 --- 147 54 --- 147
54 --- 179 54 --- 180
55 --- 123 55 --- 123
55 x--> 134 55 x--> 134
55 --- 148 55 --- 148
55 --- 180 55 --- 181
56 --- 106 56 --- 106
56 x--> 134 56 x--> 134
56 --- 137 56 --- 137
56 --- 163 56 --- 164
57 --- 119 57 --- 119
57 x--> 134 57 x--> 134
57 --- 144 57 --- 144
57 --- 176 57 --- 177
58 --- 108 58 --- 108
58 x--> 130 58 x--> 130
58 --- 139 58 --- 139
58 --- 165 58 --- 166
59 --- 120 59 --- 120
59 x--> 131 59 x--> 131
59 --- 145 59 --- 145
59 --- 177 59 --- 178
60 --- 105 60 --- 105
60 x--> 129 60 x--> 129
60 --- 136 60 --- 136
60 --- 162 60 --- 163
61 --- 121 61 --- 121
61 x--> 132 61 x--> 132
61 --- 146 61 --- 146
61 --- 178 61 --- 179
77 --- 103 77 --- 103
77 --- 104 77 --- 104
77 --- 161 77 --- 161
77 --- 162
78 --- 124 78 --- 124
78 --- 125 78 --- 125
78 --- 126 78 --- 126
78 --- 127 78 --- 127
78 --- 181
78 --- 182 78 --- 182
78 --- 183 78 --- 183
78 --- 184 78 --- 184
78 --- 185
79 --- 109 79 --- 109
79 --- 110 79 --- 110
79 --- 111 79 --- 111
79 --- 112 79 --- 112
79 --- 113 79 --- 113
79 --- 114 79 --- 114
79 --- 166
79 --- 167 79 --- 167
79 --- 168 79 --- 168
79 --- 169 79 --- 169
79 --- 170 79 --- 170
79 --- 171 79 --- 171
79 --- 172
80 --- 91 80 --- 91
80 --- 92 80 --- 92
80 --- 93 80 --- 93
@ -520,7 +522,7 @@ flowchart LR
81 --- 133 81 --- 133
81 --- 135 81 --- 135
81 --- 138 81 --- 138
81 --- 164 81 --- 165
82 --- 115 82 --- 115
82 --- 116 82 --- 116
82 --- 117 82 --- 117
@ -531,38 +533,38 @@ flowchart LR
82 --- 141 82 --- 141
82 --- 142 82 --- 142
82 --- 143 82 --- 143
82 --- 172
82 --- 173 82 --- 173
82 --- 174 82 --- 174
82 --- 175 82 --- 175
82 --- 176
83 --- 106 83 --- 106
83 --- 131 83 --- 131
83 --- 137 83 --- 137
83 --- 163 83 --- 164
84 --- 119 84 --- 119
84 --- 130 84 --- 130
84 --- 144 84 --- 144
84 --- 176 84 --- 177
85 --- 122 85 --- 122
85 --- 129 85 --- 129
85 --- 147 85 --- 147
85 --- 179 85 --- 180
86 --- 123 86 --- 123
86 --- 132 86 --- 132
86 --- 148 86 --- 148
86 --- 180 86 --- 181
87 --- 105 87 --- 105
87 --- 136 87 --- 136
87 --- 162 87 --- 163
88 --- 108 88 --- 108
88 --- 139 88 --- 139
88 --- 165 88 --- 166
89 --- 120 89 --- 120
89 --- 145 89 --- 145
89 --- 177 89 --- 178
90 --- 121 90 --- 121
90 --- 146 90 --- 146
90 --- 178 90 --- 179
155 <--x 91 155 <--x 91
91 --- 156 91 --- 156
154 <--x 92 154 <--x 92
@ -588,57 +590,59 @@ flowchart LR
153 <--x 102 153 <--x 102
102 --- 154 102 --- 154
103 --- 161 103 --- 161
104 --- 161 162 <--x 103
161 <--x 104
104 --- 162
105 --- 136 105 --- 136
105 --- 162 105 --- 163
106 --- 137 106 --- 137
106 --- 163 106 --- 164
107 --- 138 107 --- 138
107 --- 164 107 --- 165
108 --- 139 108 --- 139
108 --- 165 108 --- 166
169 <--x 109 170 <--x 109
109 --- 170 109 --- 171
170 <--x 110 171 <--x 110
110 --- 171 110 --- 172
167 <--x 111 168 <--x 111
111 --- 168 111 --- 169
168 <--x 112 169 <--x 112
112 --- 169 112 --- 170
166 <--x 113 167 <--x 113
113 --- 167 113 --- 168
114 --- 166 114 --- 167
171 <--x 114 172 <--x 114
115 --- 143 115 --- 143
174 <--x 115 175 <--x 115
115 --- 175 115 --- 176
116 --- 140 116 --- 140
116 --- 172 116 --- 173
175 <--x 116 176 <--x 116
117 --- 141 117 --- 141
172 <--x 117 173 <--x 117
117 --- 173 117 --- 174
118 --- 142 118 --- 142
173 <--x 118 174 <--x 118
118 --- 174 118 --- 175
119 --- 144 119 --- 144
119 --- 176 119 --- 177
120 --- 145 120 --- 145
120 --- 177 120 --- 178
121 --- 146 121 --- 146
121 --- 178 121 --- 179
122 --- 147 122 --- 147
122 --- 179 122 --- 180
123 --- 148 123 --- 148
123 --- 180 123 --- 181
124 --- 181 124 --- 182
184 <--x 124 185 <--x 124
181 <--x 125 182 <--x 125
125 --- 182 125 --- 183
182 <--x 126 183 <--x 126
126 --- 183 126 --- 184
183 <--x 127 184 <--x 127
127 --- 184 127 --- 185
136 <--x 128 136 <--x 128
139 <--x 128 139 <--x 128
145 <--x 128 145 <--x 128
@ -652,5 +656,5 @@ flowchart LR
142 <--x 134 142 <--x 134
143 <--x 134 143 <--x 134
138 <--x 135 138 <--x 135
173 <--x 185 174 <--x 186
``` ```

View File

@ -300,6 +300,7 @@ flowchart LR
164["SweepEdge Adjacent"] 164["SweepEdge Adjacent"]
165["SweepEdge Adjacent"] 165["SweepEdge Adjacent"]
166["SweepEdge Adjacent"] 166["SweepEdge Adjacent"]
167["SweepEdge Adjacent"]
1 --- 11 1 --- 11
2 <--x 10 2 <--x 10
2 --- 12 2 --- 12
@ -441,22 +442,22 @@ flowchart LR
54 --- 138 54 --- 138
89 <--x 56 89 <--x 56
56 --- 115 56 --- 115
56 x--> 156 56 --- 156
89 <--x 57 89 <--x 57
57 --- 114 57 --- 114
57 --- 156 57 --- 157
89 <--x 58 89 <--x 58
58 --- 110 58 --- 110
58 --- 157 58 --- 158
89 <--x 59 89 <--x 59
59 --- 113 59 --- 113
59 --- 158 59 --- 159
89 <--x 60 89 <--x 60
60 --- 112 60 --- 112
60 --- 159 60 --- 160
89 <--x 61 89 <--x 61
61 --- 111 61 --- 111
61 --- 160 61 --- 161
90 <--x 63 90 <--x 63
63 --- 102 63 --- 102
63 --- 144 63 --- 144
@ -477,22 +478,22 @@ flowchart LR
68 --- 149 68 --- 149
91 <--x 70 91 <--x 70
70 --- 118 70 --- 118
70 --- 161 70 --- 162
91 <--x 71 91 <--x 71
71 --- 121 71 --- 121
71 --- 162 71 --- 163
91 <--x 72 91 <--x 72
72 --- 120 72 --- 120
72 --- 163 72 --- 164
91 <--x 73 91 <--x 73
73 --- 116 73 --- 116
73 --- 164 73 --- 165
91 <--x 74 91 <--x 74
74 --- 119 74 --- 119
74 --- 165 74 --- 166
91 <--x 75 91 <--x 75
75 --- 117 75 --- 117
75 --- 166 75 --- 167
86 --- 104 86 --- 104
86 --- 105 86 --- 105
86 --- 106 86 --- 106
@ -544,6 +545,7 @@ flowchart LR
89 --- 158 89 --- 158
89 --- 159 89 --- 159
89 --- 160 89 --- 160
89 --- 161
90 --- 98 90 --- 98
90 --- 99 90 --- 99
90 --- 100 90 --- 100
@ -562,12 +564,12 @@ flowchart LR
91 --- 119 91 --- 119
91 --- 120 91 --- 120
91 --- 121 91 --- 121
91 --- 161
91 --- 162 91 --- 162
91 --- 163 91 --- 163
91 --- 164 91 --- 164
91 --- 165 91 --- 165
91 --- 166 91 --- 166
91 --- 167
92 --- 127 92 --- 127
92 --- 139 92 --- 139
140 <--x 92 140 <--x 92
@ -616,28 +618,30 @@ flowchart LR
109 --- 132 109 --- 132
109 --- 150 109 --- 150
151 <--x 109 151 <--x 109
110 --- 157 157 <--x 110
159 <--x 111 110 --- 158
111 --- 160 160 <--x 111
158 <--x 112 111 --- 161
112 --- 159 159 <--x 112
157 <--x 113 112 --- 160
113 --- 158 158 <--x 113
114 --- 156 113 --- 159
156 <--x 114
114 --- 157
115 --- 156 115 --- 156
160 <--x 115 161 <--x 115
163 <--x 116 164 <--x 116
116 --- 164 116 --- 165
165 <--x 117 166 <--x 117
117 --- 166 117 --- 167
118 --- 161 118 --- 162
166 <--x 118 167 <--x 118
164 <--x 119 165 <--x 119
119 --- 165 119 --- 166
162 <--x 120 163 <--x 120
120 --- 163 120 --- 164
161 <--x 121 162 <--x 121
121 --- 162 121 --- 163
132 <--x 124 132 <--x 124
133 <--x 124 133 <--x 124
134 <--x 124 134 <--x 124

View File

@ -595,28 +595,28 @@ flowchart LR
75 --- 137 75 --- 137
76 --- 115 76 --- 115
76 --- 146 76 --- 146
149 <--x 76 147 <--x 76
77 --- 116 77 --- 116
146 <--x 77
77 --- 147 77 --- 147
148 <--x 77
78 --- 118 78 --- 118
148 <--x 78 146 <--x 78
78 --- 149 78 --- 149
79 --- 117 79 --- 117
147 <--x 79
79 --- 148 79 --- 148
149 <--x 79
80 --- 120 80 --- 120
150 <--x 80
80 --- 151 80 --- 151
152 <--x 80
81 --- 122 81 --- 122
152 <--x 81 150 <--x 81
81 --- 153 81 --- 153
82 --- 119 82 --- 119
82 --- 150 82 --- 150
153 <--x 82 151 <--x 82
83 --- 121 83 --- 121
151 <--x 83
83 --- 152 83 --- 152
153 <--x 83
115 <--x 88 115 <--x 88
116 <--x 88 116 <--x 88
117 <--x 88 117 <--x 88

View File

@ -213,31 +213,31 @@ flowchart LR
11 --- 38 11 --- 38
11 x--> 57 11 x--> 57
11 --- 67 11 --- 67
11 --- 85 11 x--> 86
13 --- 42 13 --- 42
13 x--> 57 13 x--> 57
13 --- 66 13 --- 66
13 --- 84 13 --- 85
14 --- 45 14 --- 45
14 x--> 57 14 x--> 57
14 --- 65 14 --- 65
14 --- 83 14 --- 84
15 --- 44 15 --- 44
15 x--> 57 15 x--> 57
15 --- 64 15 --- 64
15 --- 82 15 --- 83
16 --- 36 16 --- 36
16 x--> 57 16 x--> 57
16 --- 63 16 --- 63
16 --- 81 16 --- 82
17 --- 37 17 --- 37
17 x--> 57 17 x--> 57
17 --- 62 17 --- 62
17 --- 80 17 --- 81
18 --- 46 18 --- 46
18 x--> 57 18 x--> 57
18 --- 61 18 --- 61
18 x--> 89 18 --- 80
20 --- 48 20 --- 48
20 x--> 55 20 x--> 55
20 --- 72 20 --- 72
@ -333,36 +333,36 @@ flowchart LR
35 --- 96 35 --- 96
35 --- 97 35 --- 97
36 --- 63 36 --- 63
36 --- 81 36 --- 82
82 <--x 36 83 <--x 36
37 --- 62 37 --- 62
37 --- 80 37 --- 81
81 <--x 37 82 <--x 37
38 --- 67 38 --- 67
38 --- 85 38 --- 86
39 --- 69 39 --- 69
86 <--x 39
39 --- 87 39 --- 87
88 <--x 39
40 --- 70 40 --- 70
87 <--x 40
40 --- 88 40 --- 88
89 <--x 40
41 --- 68 41 --- 68
85 <--x 41
41 --- 86 41 --- 86
87 <--x 41
42 --- 66 42 --- 66
42 --- 84 42 --- 85
43 --- 71 43 --- 71
88 <--x 43 80 <--x 43
43 --- 89 43 --- 89
44 --- 64 44 --- 64
44 --- 82 44 --- 83
83 <--x 44 84 <--x 44
45 --- 65 45 --- 65
45 --- 83 45 --- 84
84 <--x 45 85 <--x 45
46 --- 61 46 --- 61
80 <--x 46 46 --- 80
46 --- 89 81 <--x 46
47 --- 74 47 --- 74
91 <--x 47 91 <--x 47
47 --- 92 47 --- 92
@ -376,16 +376,16 @@ flowchart LR
92 <--x 50 92 <--x 50
50 --- 93 50 --- 93
51 --- 78 51 --- 78
95 <--x 51
51 --- 96 51 --- 96
97 <--x 51
52 --- 76 52 --- 76
52 --- 94 52 --- 94
97 <--x 52 95 <--x 52
53 --- 77 53 --- 77
94 <--x 53
53 --- 95 53 --- 95
96 <--x 53
54 --- 79 54 --- 79
96 <--x 54 94 <--x 54
54 --- 97 54 --- 97
72 <--x 58 72 <--x 58
73 <--x 58 73 <--x 58

View File

@ -87,7 +87,8 @@ flowchart LR
42["SweepEdge Adjacent"] 42["SweepEdge Adjacent"]
43["SweepEdge Adjacent"] 43["SweepEdge Adjacent"]
44["SweepEdge Adjacent"] 44["SweepEdge Adjacent"]
45["EdgeCut Fillet<br>[2297, 2422, 0]"] 45["SweepEdge Adjacent"]
46["EdgeCut Fillet<br>[2297, 2422, 0]"]
%% [ProgramBodyItem { index: 22 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }] %% [ProgramBodyItem { index: 22 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
1 --- 5 1 --- 5
2 --- 6 2 --- 6
@ -117,22 +118,22 @@ flowchart LR
13 --- 31 13 --- 31
13 x--> 35 13 x--> 35
13 --- 39 13 --- 39
13 --- 44 13 --- 45
25 <--x 14 25 <--x 14
14 --- 28 14 --- 28
14 x--> 40 14 --- 40
25 <--x 15 25 <--x 15
15 --- 29 15 --- 29
15 --- 40 15 --- 41
25 <--x 16 25 <--x 16
16 --- 26 16 --- 26
16 --- 41 16 --- 42
25 <--x 17 25 <--x 17
17 --- 27 17 --- 27
17 --- 42 17 --- 43
25 <--x 18 25 <--x 18
18 --- 30 18 --- 30
18 --- 43 18 --- 44
23 --- 32 23 --- 32
23 --- 33 23 --- 33
23 --- 34 23 --- 34
@ -142,7 +143,7 @@ flowchart LR
24 --- 35 24 --- 35
24 --- 37 24 --- 37
24 --- 39 24 --- 39
24 --- 44 24 --- 45
25 --- 26 25 --- 26
25 --- 27 25 --- 27
25 --- 28 25 --- 28
@ -152,16 +153,18 @@ flowchart LR
25 --- 41 25 --- 41
25 --- 42 25 --- 42
25 --- 43 25 --- 43
26 --- 41 25 --- 44
41 <--x 27 26 --- 42
27 --- 42 42 <--x 27
27 --- 43
28 --- 40 28 --- 40
43 <--x 28 44 <--x 28
29 --- 40 40 <--x 29
42 <--x 30 29 --- 41
30 --- 43 43 <--x 30
30 --- 44
31 --- 39 31 --- 39
31 --- 44 31 --- 45
39 <--x 37 39 <--x 37
39 <--x 45 39 <--x 46
``` ```

View File

@ -189,8 +189,7 @@ flowchart LR
103["SweepEdge Adjacent"] 103["SweepEdge Adjacent"]
104["SweepEdge Adjacent"] 104["SweepEdge Adjacent"]
105["SweepEdge Adjacent"] 105["SweepEdge Adjacent"]
106["EdgeCut Chamfer<br>[1930, 1969, 0]"] 106["SweepEdge Adjacent"]
%% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
107["EdgeCut Chamfer<br>[1930, 1969, 0]"] 107["EdgeCut Chamfer<br>[1930, 1969, 0]"]
%% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
108["EdgeCut Chamfer<br>[1930, 1969, 0]"] 108["EdgeCut Chamfer<br>[1930, 1969, 0]"]
@ -201,6 +200,8 @@ flowchart LR
%% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
111["EdgeCut Chamfer<br>[1930, 1969, 0]"] 111["EdgeCut Chamfer<br>[1930, 1969, 0]"]
%% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }] %% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
112["EdgeCut Chamfer<br>[1930, 1969, 0]"]
%% [ProgramBodyItem { index: 12 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
1 --- 8 1 --- 8
74 x--> 2 74 x--> 2
74 x--> 3 74 x--> 3
@ -255,87 +256,87 @@ flowchart LR
74 --- 14 74 --- 14
47 <--x 15 47 <--x 15
15 --- 69 15 --- 69
15 x--> 87 15 --- 87
47 <--x 16 47 <--x 16
16 --- 74 16 --- 74
16 --- 87 16 --- 88
47 <--x 17 47 <--x 17
17 --- 64 17 --- 64
17 --- 88 17 --- 89
47 <--x 18 47 <--x 18
18 --- 65 18 --- 65
18 --- 89 18 --- 90
47 <--x 19 47 <--x 19
19 --- 62 19 --- 62
47 <--x 21 47 <--x 21
21 --- 68 21 --- 68
21 --- 90 21 --- 91
47 <--x 22 47 <--x 22
22 --- 72 22 --- 72
22 --- 91 22 --- 92
47 <--x 23 47 <--x 23
23 --- 71 23 --- 71
23 --- 92 23 --- 93
47 <--x 24 47 <--x 24
24 --- 60 24 --- 60
24 --- 93 24 --- 94
47 <--x 25 47 <--x 25
25 --- 61 25 --- 61
25 --- 94 25 --- 95
47 <--x 26 47 <--x 26
26 --- 73 26 --- 73
26 --- 95 26 --- 96
47 <--x 27 47 <--x 27
27 --- 66 27 --- 66
27 --- 96 27 --- 97
47 <--x 28 47 <--x 28
28 --- 63 28 --- 63
28 --- 97 28 --- 98
47 <--x 29 47 <--x 29
29 --- 58 29 --- 58
29 --- 98 29 --- 99
47 <--x 30 47 <--x 30
30 --- 67 30 --- 67
30 --- 99 30 --- 100
47 <--x 31 47 <--x 31
31 --- 59 31 --- 59
31 --- 100 31 --- 101
47 <--x 32 47 <--x 32
32 --- 70 32 --- 70
32 --- 101 32 --- 102
47 <--x 33 47 <--x 33
33 --- 57 33 --- 57
33 --- 102 33 --- 103
34 --- 56 34 --- 56
34 x--> 74 34 x--> 74
34 --- 80 34 --- 80
34 --- 86 34 --- 86
34 --- 106 34 --- 107
35 x--> 74 35 x--> 74
35 --- 76 35 --- 76
35 --- 82 35 --- 82
35 --- 104 35 --- 105
35 --- 111 35 --- 112
36 --- 54 36 --- 54
36 x--> 74 36 x--> 74
36 --- 78 36 --- 78
36 --- 84 36 --- 84
36 --- 107 36 --- 108
37 x--> 74 37 x--> 74
37 --- 77 37 --- 77
37 --- 83 37 --- 83
37 --- 105 37 --- 106
37 --- 108 37 --- 109
38 x--> 74 38 x--> 74
38 --- 75 38 --- 75
38 --- 81 38 --- 81
38 --- 103 38 --- 104
38 --- 110 38 --- 111
39 --- 55 39 --- 55
39 x--> 74 39 x--> 74
39 --- 79 39 --- 79
39 --- 85 39 --- 85
39 --- 109 39 --- 110
47 --- 57 47 --- 57
47 --- 58 47 --- 58
47 --- 59 47 --- 59
@ -370,6 +371,7 @@ flowchart LR
47 --- 100 47 --- 100
47 --- 101 47 --- 101
47 --- 102 47 --- 102
47 --- 103
48 --- 54 48 --- 54
48 --- 78 48 --- 78
48 --- 84 48 --- 84
@ -381,13 +383,13 @@ flowchart LR
50 --- 86 50 --- 86
51 --- 75 51 --- 75
51 --- 81 51 --- 81
51 --- 103 51 --- 104
52 --- 76 52 --- 76
52 --- 82 52 --- 82
52 --- 104 52 --- 105
53 --- 77 53 --- 77
53 --- 83 53 --- 83
53 --- 105 53 --- 106
54 --- 78 54 --- 78
54 --- 84 54 --- 84
55 --- 79 55 --- 79
@ -400,53 +402,55 @@ flowchart LR
81 <--x 57 81 <--x 57
82 <--x 57 82 <--x 57
83 <--x 57 83 <--x 57
100 <--x 57
101 <--x 57 101 <--x 57
57 x--> 102 102 <--x 57
96 <--x 58 57 x--> 103
97 <--x 58 97 <--x 58
58 x--> 98 98 <--x 58
98 <--x 59 58 x--> 99
99 <--x 59 99 <--x 59
59 x--> 100 100 <--x 59
91 <--x 60 59 x--> 101
92 <--x 60 92 <--x 60
60 x--> 93 93 <--x 60
92 <--x 61 60 x--> 94
93 <--x 61 93 <--x 61
61 x--> 94 94 <--x 61
89 <--x 62 61 x--> 95
95 <--x 63 90 <--x 62
96 <--x 63 96 <--x 63
63 x--> 97 97 <--x 63
64 --- 88 63 x--> 98
88 <--x 65 88 <--x 64
65 --- 89 64 --- 89
94 <--x 66 89 <--x 65
65 --- 90
95 <--x 66 95 <--x 66
66 x--> 96 96 <--x 66
97 <--x 67 66 x--> 97
98 <--x 67 98 <--x 67
67 x--> 99 99 <--x 67
68 x--> 90 67 x--> 100
68 x--> 91
69 --- 87 69 --- 87
101 <--x 69 102 <--x 69
99 <--x 70
100 <--x 70 100 <--x 70
70 x--> 101 101 <--x 70
90 <--x 71 70 x--> 102
91 <--x 71 91 <--x 71
71 x--> 92 92 <--x 71
90 <--x 72 71 x--> 93
72 x--> 91 91 <--x 72
93 <--x 73 72 x--> 92
94 <--x 73 94 <--x 73
73 x--> 95 95 <--x 73
74 --- 87 73 x--> 96
87 <--x 74
74 --- 88
75 --- 81 75 --- 81
75 --- 103 75 --- 104
76 --- 82 76 --- 82
76 --- 104 76 --- 105
77 --- 83 77 --- 83
77 --- 105 77 --- 106
``` ```

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

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