Compare commits

...

8 Commits

Author SHA1 Message Date
1b7126b9f3 More units of measure work
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-11 15:14:56 +12:00
a63e51e2ad Remove import function from std (#6241)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-11 03:11:59 +00:00
1b8eee86a1 Fix vscode lsp bugs (#6271)
* start of shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* untitled test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-11 12:53:05 +10:00
6d50278d34 bump kcl friends (#6272)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-10 19:01:30 -07:00
35844842de Bump modeling api & pull thru csg endpoints (#6245)
* csg-upts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* base

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* do the id shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* tried to run

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* csg-upts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* use bens samples

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* use bens samples

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* gen std

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* gen std

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-10 18:30:57 -07:00
843e772094 Franknoirot/adhoc/improve e2e (#6265)
* fix: increasing timeout to reduce failures..?

* fix: removing debugging code

* Remove unnecessary pixel color check

* Only close the command palette on disconnection events

This code closes the palette on *any* network event, including it
getting established. This made tests like "Create a few projects using
the default project name" unreliable.

Also adds a block comment about how we should do something more
sophisticated than bail out in the future.

* Show a toast to explain why the user just lost their command flow

* Remove unnecessary click in test. `fill` focuses already

* Oop don't spam this disconnection toast if the palette isn't open

Honoring exhausting hook dependency checks

* Skip circle snapshot test, it's being weird

* Disable the export button if engine connection is unavailable

* Refactor useDemoCode to hopefully be more reliable

* allow weak connections to receive demo code

* revert Refactor useDemoCode to hopefully be more reliable
Commit:
2625c14783 [2625c1478]

---------

Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Andrew Varga <grizzly33@gmail.com>
2025-04-11 00:08:39 +00:00
9d0518dfeb Fix URL encoded names after rename to Zoo Design Studio (#6269) 2025-04-10 17:20:37 -04:00
d33d399c31 Repetitive structs removed for import file extensions (#6211)
* get rid of repetitive structs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

get rid of more

Signed-off-by: Jess Frazelle <github@jessfraz.com>

add more

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

await the shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

put it at the root

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix;es

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* kcl-language-server flake

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-10 13:57:12 -07:00
518 changed files with 67875 additions and 36216 deletions

View File

@ -378,7 +378,7 @@ jobs:
NOTES: ${{ needs.prepare-files.outputs.notes }}
PUB_DATE: ${{ github.event.repository.updated_at }}
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
run: |
RELEASE_DIR=https://${WEBSITE_DIR}
jq --null-input \

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ yarn-error.log*
.idea
.vscode
.helix
result
# rust
rust/target

View File

@ -24,8 +24,8 @@ atan2(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
| `y` | [`number`](/docs/kcl/types/number) | Y | Yes |
| `x` | [`number`](/docs/kcl/types/number) | X | Yes |
### Returns
@ -37,7 +37,7 @@ atan2(
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine(angle = toDegrees(atan2(1.25, 2)), length = 20)
|> angledLine(angle = toDegrees(atan2(y = 1.25, x = 2)), length = 20)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -80,7 +80,7 @@ part001 = cube([0, 0], 20)
// We tag the chamfer to reference it later.
|> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
sketch001 = startSketchOn(part001, chamfer1)
sketch001 = startSketchOn(part001, face = chamfer1)
|> startProfileAt([10, 10], %)
|> line(end = [2, 0])
|> line(end = [0, 2])

View File

@ -69,11 +69,11 @@ case = startSketchOn(-XZ)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

File diff suppressed because one or more lines are too long

View File

@ -77,6 +77,7 @@ layout: manual
* [`helix`](kcl/std-helix)
* [`hole`](kcl/hole)
* [`hollow`](kcl/hollow)
* [`intersect`](kcl/intersect)
* [`lastSegX`](kcl/lastSegX)
* [`lastSegY`](kcl/lastSegY)
* [`legAngX`](kcl/legAngX)
@ -123,6 +124,7 @@ layout: manual
* [`sqrt`](kcl/sqrt)
* [`startProfileAt`](kcl/startProfileAt)
* [`startSketchOn`](kcl/startSketchOn)
* [`subtract`](kcl/subtract)
* [`sweep`](kcl/sweep)
* [`tangentToEnd`](kcl/tangentToEnd)
* [`tangentialArc`](kcl/tangentialArc)
@ -131,6 +133,7 @@ layout: manual
* [`toDegrees`](kcl/toDegrees)
* [`toRadians`](kcl/toRadians)
* [`translate`](kcl/translate)
* [`union`](kcl/union)
* [`xLine`](kcl/xLine)
* [`yLine`](kcl/yLine)
* **std::math**

File diff suppressed because one or more lines are too long

View File

@ -20,7 +20,7 @@ offsetPlane(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. XY) which this new plane is created from. | Yes |
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
### Returns

View File

@ -61,11 +61,11 @@ case = startSketchOn(XY)
|> close(%)
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -92,7 +92,7 @@ case = startSketchOn(XY)
|> close(%)
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

View File

@ -107,11 +107,11 @@ case = startSketchOn(-XZ)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -132,11 +132,11 @@ case = startSketchOn(XY)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -160,11 +160,11 @@ case = startSketchOn(XY)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

View File

@ -18,8 +18,8 @@ The point is if you want to export the result of a sketch on a face, you only ne
```js
startSketchOn(
data: SketchData,
tag?: FaceTag,
planeOrSolid: SketchData,
face?: FaceTag,
): SketchSurface
```
@ -28,8 +28,8 @@ startSketchOn(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`SketchData`](/docs/kcl/types/SketchData) | Data for start sketch on. You can start a sketch on a plane or an solid. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`FaceTag`](/docs/kcl/types/FaceTag) | A tag for a face. | No |
| `planeOrSolid` | [`SketchData`](/docs/kcl/types/SketchData) | The plane or solid to sketch on | Yes |
| `face` | [`FaceTag`](/docs/kcl/types/FaceTag) | Identify a face of a solid if a solid is specified as the input argument (`plane_or_solid`) | No |
### Returns
@ -48,7 +48,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5)
exampleSketch002 = startSketchOn(example, 'end')
exampleSketch002 = startSketchOn(example, face = 'end')
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -57,7 +57,7 @@ exampleSketch002 = startSketchOn(example, 'end')
example002 = extrude(exampleSketch002, length = 5)
exampleSketch003 = startSketchOn(example002, 'end')
exampleSketch003 = startSketchOn(example002, face = 'end')
|> startProfileAt([2, 2], %)
|> line(end = [6, 0])
|> line(end = [0, 6])
@ -82,7 +82,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5, tagEnd = $end01)
exampleSketch002 = startSketchOn(example, end01)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -91,7 +91,7 @@ exampleSketch002 = startSketchOn(example, end01)
example002 = extrude(exampleSketch002, length = 5, tagEnd = $end02)
exampleSketch003 = startSketchOn(example002, end02)
exampleSketch003 = startSketchOn(example002, face = end02)
|> startProfileAt([2, 2], %)
|> line(end = [6, 0])
|> line(end = [0, 6])
@ -113,7 +113,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 10)
exampleSketch002 = startSketchOn(example, sketchingFace)
exampleSketch002 = startSketchOn(example, face = sketchingFace)
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -122,7 +122,7 @@ exampleSketch002 = startSketchOn(example, sketchingFace)
example002 = extrude(exampleSketch002, length = 10)
exampleSketch003 = startSketchOn(example002, sketchingFace002)
exampleSketch003 = startSketchOn(example002, face = sketchingFace002)
|> startProfileAt([-8, 12], %)
|> line(end = [0, 6])
|> line(end = [6, 0])
@ -148,7 +148,7 @@ exampleSketch = startSketchOn(XY)
example = revolve(exampleSketch, axis = Y, angle = 180)
exampleSketch002 = startSketchOn(example, 'end')
exampleSketch002 = startSketchOn(example, face = 'end')
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -182,7 +182,7 @@ example = revolve(
tagEnd = $end01,
)
exampleSketch002 = startSketchOn(example, end01)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -196,12 +196,10 @@ example002 = extrude(exampleSketch002, length = 5)
```js
a1 = startSketchOn({
plane = {
origin = { x = 0, y = 0, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = { x = 0, y = 0, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
})
|> startProfileAt([0, 0], %)
|> line(end = [100.0, 0])

View File

@ -11,11 +11,11 @@ Create a helix.
```js
helix(
revolutions: number(_),
angleStart: number(deg),
angleStart: number(Angle),
ccw?: bool,
radius?: number(mm),
radius?: number(Length),
axis?: Axis3d | Edge,
length?: number(mm),
length?: number(Length),
cylinder?: Solid,
): Helix
```
@ -26,11 +26,11 @@ helix(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `revolutions` | `number(_)` | Number of revolutions. | Yes |
| `angleStart` | `number(deg)` | Start angle (in degrees). | Yes |
| `angleStart` | `number(Angle)` | Start angle (in degrees). | Yes |
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
| `radius` | `number(mm)` | Radius of the helix. | No |
| `radius` | `number(Length)` | Radius of the helix. | No |
| `axis` | `Axis3d | Edge` | Axis to use for the helix. | No |
| `length` | `number(mm)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `length` | `number(Length)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `cylinder` | [`Solid`](/docs/kcl/types/Solid) | Cylinder to create the helix on. | No |
### Returns

View File

@ -9,7 +9,7 @@ Compute the cosine of a number (in radians).
```js
cos(@num: number(rad)): number(_)
cos(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ cos(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -11,9 +11,9 @@ cartesian (x/y/z grid) coordinates.
```js
polar(
angle: number(deg),
length: number(mm),
): [number(mm); 2]
angle: number(Angle),
length: number(Length),
): Point2d
```
@ -21,12 +21,12 @@ polar(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` | `number(deg)` | | Yes |
| `length` | `number(mm)` | | Yes |
| `angle` | `number(Angle)` | | Yes |
| `length` | `number(Length)` | | Yes |
### Returns
`[number(mm); 2]`
[`Point2d`](/docs/kcl/types/Point2d)
### Examples

View File

@ -9,7 +9,7 @@ Compute the sine of a number (in radians).
```js
sin(@num: number(rad)): number(_)
sin(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ sin(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -9,7 +9,7 @@ Compute the tangent of a number (in radians).
```js
tan(@num: number(rad)): number(_)
tan(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ tan(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -21,10 +21,10 @@ revolved around the same axis.
revolve(
@sketches: [Sketch; 1+],
axis: Axis2d | Edge,
angle?: number(deg),
tolerance?: number(mm),
angle?: number(Angle),
tolerance?: number(Length),
symmetric?: bool,
bidirectionalAngle?: number(deg),
bidirectionalAngle?: number(Angle),
tagStart?: tag,
tagEnd?: tag,
): Solid
@ -37,10 +37,10 @@ revolve(
|----------|------|-------------|----------|
| `sketches` | `[Sketch; 1+]` | The sketch or set of sketches that should be revolved | Yes |
| `axis` | `Axis2d | Edge` | Axis of revolution. | Yes |
| `angle` | `number(deg)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(mm)` | Tolerance for the revolve operation. | No |
| `angle` | `number(Angle)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No |
| `symmetric` | [`bool`](/docs/kcl/types/bool) | If true, the extrusion will happen symmetrically around the sketch. Otherwise, the extrusion will happen on only one side of the sketch. | No |
| `bidirectionalAngle` | `number(deg)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
| `bidirectionalAngle` | `number(Angle)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
| `tagStart` | [`tag`](/docs/kcl/types/tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`tag`](/docs/kcl/types/tag) | A named tag for the face at the end of the revolve. | No |
@ -108,7 +108,7 @@ part001 = startSketchOn(XY)
|> close()
|> revolve(axis = Y, angle = 180)
part002 = startSketchOn(part001, 'end')
part002 = startSketchOn(part001, face = 'end')
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -128,7 +128,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = -90,
@ -147,7 +147,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = 90,
@ -166,7 +166,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = 90,

View File

@ -13,7 +13,7 @@ the provided (x, y) origin point.
circle(
@sketch_or_surface: Sketch | Plane | Face,
center: Point2d,
radius: number,
radius: number(Length),
tag?: tag,
): Sketch
```
@ -25,7 +25,7 @@ circle(
|----------|------|-------------|----------|
| `sketch_or_surface` | [`Sketch`](/docs/kcl/types/Sketch) OR [`Plane`](/docs/kcl/types/Plane) OR [`Face`](/docs/kcl/types/Face) | Sketch to extend, or plane or surface to sketch on. | Yes |
| `center` | [`Point2d`](/docs/kcl/types/Point2d) | The center of the circle. | Yes |
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the circle. | Yes |
| `radius` | `number(Length)` | The radius of the circle. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`tag`](/docs/kcl/types/tag) | Create a new tag which refers to this circle. | No |
### Returns

View File

@ -110,7 +110,7 @@ sketch0011 = startSketchOn(XY)
|> mirror2d( axis = X )
|> extrude(length = 10)
sketch002 = startSketchOn(sketch0011, 'END')
sketch002 = startSketchOn(sketch0011, face = 'END')
|> circle( center = [-0.01, 1.58], radius = 1.2 )
|> extrude(length = 1.2)

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,46 +0,0 @@
---
title: "AngledLineData"
excerpt: "Data to draw an angled line."
layout: manual
---
Data to draw an angled line.
**This schema accepts any of the following:**
An angle and length with explicitly named parameters
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line (in degrees). | No |
| `length` |[`number`](/docs/kcl/types/number)| The length of the line. | No |
----
An angle and length given as a pair
**Type:** `array`
`[number, number]`
----

View File

@ -16,8 +16,8 @@ Data for drawing an angled line that intersects with a given line.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line. | No |
| `angle` |`TyF64`| The angle of the line. | No |
| `intersectTag` |[`TagIdentifier`](/docs/kcl/types#tag-identifier)| The tag of the line to intersect with. | No |
| `offset` |[`number`](/docs/kcl/types/number)| The offset from the intersecting line. | No |
| `offset` |`TyF64`| The offset from the intersecting line. | No |

View File

@ -1,22 +0,0 @@
---
title: "AngledLineToData"
excerpt: "Data to draw an angled line to a point."
layout: manual
---
Data to draw an angled line to a point.
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line. | No |
| `to` |[`number`](/docs/kcl/types/number)| The point to draw to. | No |

View File

@ -23,9 +23,9 @@ Angles and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angleStart` |[`number`](/docs/kcl/types/number) (**maximum:** 360.0) (**minimum:** -360.0)| The start angle. | No |
| `angleEnd` |[`number`](/docs/kcl/types/number) (**maximum:** 360.0) (**minimum:** -360.0)| The end angle. | No |
| `radius` |[`number`](/docs/kcl/types/number)| The radius. | No |
| `angleStart` |`TyF64`| The start angle. | No |
| `angleEnd` |`TyF64`| The end angle. | No |
| `radius` |`TyF64`| The radius. | No |
----
@ -41,9 +41,9 @@ Center, to and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `center` |`[number, number]`| The center. | No |
| `to` |`[number, number]`| The to point. | No |
| `radius` |[`number`](/docs/kcl/types/number)| The radius. | No |
| `center` |`[, `TyF64`, `TyF64`]`| The center. | No |
| `to` |`[, `TyF64`, `TyF64`]`| The to point. | No |
| `radius` |`TyF64`| The radius. | No |
----

View File

@ -16,7 +16,7 @@ Data to draw a three point arc (arcTo).
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `end` |`[number, number]`| End point of the arc. A point in 3D space | No |
| `interior` |`[number, number]`| Interior point of the arc. A point in 3D space | No |
| `end` |`[, `TyF64`, `TyF64`]`| End point of the arc. A point in 3D space | No |
| `interior` |`[, `TyF64`, `TyF64`]`| Interior point of the arc. A point in 3D space | No |

View File

@ -16,8 +16,8 @@ Data to draw a bezier curve.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `to` |`[number, number]`| The to point. | No |
| `control1` |`[number, number]`| The first control point. | No |
| `control2` |`[number, number]`| The second control point. | No |
| `to` |`[, `TyF64`, `TyF64`]`| The to point. | No |
| `control1` |`[, `TyF64`, `TyF64`]`| The first control point. | No |
| `control2` |`[, `TyF64`, `TyF64`]`| The second control point. | No |

View File

@ -26,7 +26,7 @@ A fillet.
|----------|------|-------------|----------|
| `type` |enum: `fillet`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The id of the engine command that called this fillet. | No |
| `radius` |[`number`](/docs/kcl/types/number)| | No |
| `radius` |`TyF64`| | No |
| `edgeId` |[`string`](/docs/kcl/types/string)| The engine id of the edge to fillet. | No |
| [`tag`](/docs/kcl/types/tag) |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| | No |
@ -46,7 +46,7 @@ A chamfer.
|----------|------|-------------|----------|
| `type` |enum: `chamfer`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The id of the engine command that called this chamfer. | No |
| `length` |[`number`](/docs/kcl/types/number)| | No |
| `length` |`TyF64`| | No |
| `edgeId` |[`string`](/docs/kcl/types/string)| The engine id of the edge to chamfer. | No |
| [`tag`](/docs/kcl/types/tag) |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| | No |

View File

@ -252,7 +252,7 @@ Data for an imported geometry.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: [`ImportedGeometry`](/docs/kcl/types/ImportedGeometry)| | No |
| `type` |enum: `ImportedGeometry`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The ID of the imported geometry. | No |
| `value` |`[` [`string`](/docs/kcl/types/string) `]`| The original file paths. | No |

View File

@ -130,6 +130,21 @@ A unit of length.
| `type` |enum: `Yards`| | No |
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----
@ -178,6 +193,21 @@ A unit of angle.
| `type` |enum: `Radians`| | No |
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

View File

@ -7,7 +7,7 @@ layout: manual
A point in two dimensional space.
```kcl
type Point2d = [number; 2]
type Point2d = [number(Length); 2]
```
[`Point2d`](/docs/kcl/types/Point2d) is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value

View File

@ -7,7 +7,7 @@ layout: manual
A point in three dimensional space.
```kcl
type Point3d = [number; 3]
type Point3d = [number(Length); 3]
```
[`Point3d`](/docs/kcl/types/Point3d) is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value

View File

@ -16,9 +16,9 @@ Data for drawing a polygon
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `radius` |[`number`](/docs/kcl/types/number)| The radius of the polygon | No |
| `radius` |`TyF64`| The radius of the polygon | No |
| `numSides` |`integer`| The number of sides in the polygon | No |
| `center` |`[number, number]`| The center point of the polygon | No |
| `center` |`[, `TyF64`, `TyF64`]`| The center point of the polygon | No |
| `inscribed` |`boolean`| Whether the polygon is inscribed (true) or circumscribed (false) about a circle with the specified radius | No |

View File

@ -16,7 +16,7 @@ Data to draw a tangential arc.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `radius` |[`number`](/docs/kcl/types/number)| Radius of the arc. Not to be confused with Raiders of the Lost Ark. | No |
| `offset` |[`number`](/docs/kcl/types/number)| Offset of the arc, in degrees. | No |
| `radius` |`TyF64`| Radius of the arc. Not to be confused with Raiders of the Lost Ark. | No |
| `offset` |`TyF64`| Offset of the arc, in degrees. | No |

View File

@ -43,6 +43,21 @@ A unit of angle.
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

View File

@ -103,6 +103,21 @@ A unit of length.
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

File diff suppressed because one or more lines are too long

View File

@ -731,7 +731,7 @@ sketch_001 = startSketchOn(XY)
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn(box, face = revolveAxis)
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])
@ -1144,7 +1144,7 @@ sketch001 = startSketchOn(XZ)
)
test(
`Can use the import stdlib function on a local OBJ file`,
`Can import a local OBJ file`,
{ tag: '@electron' },
async ({ page, context }, testInfo) => {
test.fixme(orRunWhenFullSuiteEnabled())
@ -1194,7 +1194,7 @@ sketch001 = startSketchOn(XZ)
.toBeLessThan(15)
})
await test.step(`Write the import function line`, async () => {
await u.codeLocator.fill(`import('cube.obj')`)
await u.codeLocator.fill(`import 'cube.obj'\ncube`)
await page.waitForTimeout(800)
})
await test.step(`Reset the camera before checking`, async () => {

View File

@ -44,7 +44,7 @@ const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)
extrude001 = extrude(sketch001, length = 10)
sketch002 = startSketchOn(extrude001, rectangleSegmentB001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentB001)
|> circle(
center = [-1, 2],
radius = .5
@ -194,7 +194,7 @@ test.describe('Feature Tree pane', () => {
highlightedCode: '',
diagnostics: [],
activeLines: [
'sketch002=startSketchOn(extrude001,rectangleSegmentB001)',
'sketch002=startSketchOn(extrude001,face=rectangleSegmentB001)',
],
})
await toolbar.exitSketchBtn.click()

View File

@ -99,7 +99,6 @@ export class HomePageFixture {
createAndGoToProject = async (projectTitle = 'untitled') => {
await this.projectsLoaded()
await this.projectButtonNew.click()
await this.projectTextName.click()
await this.projectTextName.fill(projectTitle)
await this.projectButtonContinue.click()
}

View File

@ -233,7 +233,7 @@ export class SceneFixture {
settled = async (cmdBar: CmdBarFixture) => {
const u = await getUtils(this.page)
await expect(this.startEditSketchBtn).not.toBeDisabled()
await expect(this.startEditSketchBtn).not.toBeDisabled({ timeout: 15_000 })
await expect(this.startEditSketchBtn).toBeVisible()
await cmdBar.openCmdBar()

View File

@ -44,8 +44,8 @@ profile001 = startProfileAt([-134.53, -56.17], sketch001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close()
extrude001 = extrude(profile001, length = 100)
sketch003 = startSketchOn(extrude001, seg02)
sketch002 = startSketchOn(extrude001, seg01)`
sketch003 = startSketchOn(extrude001, face = seg02)
sketch002 = startSketchOn(extrude001, face = seg01)`
)
})

View File

@ -220,7 +220,7 @@ test.describe('Point-and-click tests', () => {
)`,
afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)',
'sketch002 = startSketchOn(extrude001, face = seg03)',
afterRectangle1stClickSnippet:
'startProfileAt([205.96, 254.59], sketch002)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.39,tag=$rectangleSegmentA002)
@ -244,7 +244,7 @@ test.describe('Point-and-click tests', () => {
)`,
afterChamferSelectSnippet:
'sketch003 = startSketchOn(extrude001, seg04)',
'sketch003 = startSketchOn(extrude001, face = seg04)',
afterRectangle1stClickSnippet:
'startProfileAt([-209.64, 255.28], sketch003)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.56,tag=$rectangleSegmentA003)
@ -266,7 +266,7 @@ test.describe('Point-and-click tests', () => {
]
)`,
afterChamferSelectSnippet:
'sketch004 = startSketchOn(extrude001, seg05)',
'sketch004 = startSketchOn(extrude001, face = seg05)',
afterRectangle1stClickSnippet:
'startProfileAt([82.57, 322.96], sketch004)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.16,tag=$rectangleSegmentA004)
@ -284,7 +284,7 @@ test.describe('Point-and-click tests', () => {
beforeChamferSnippetEnd:
'|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)])',
afterChamferSelectSnippet:
'sketch005 = startSketchOn(extrude001, seg06)',
'sketch005 = startSketchOn(extrude001, face = seg06)',
afterRectangle1stClickSnippet:
'startProfileAt([-23.43, 19.69], sketch005)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=9.1,tag=$rectangleSegmentA005)
@ -309,28 +309,28 @@ extrude001 = extrude(sketch001, length = 100)
|> chamfer(length = 30, tags = [seg01], tag = $seg04)
|> chamfer(length = 30, tags = [getNextAdjacentEdge(seg02)], tag = $seg05)
|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)], tag = $seg06)
sketch005 = startSketchOn(extrude001, seg06)
sketch005 = startSketchOn(extrude001, face = seg06)
profile004=startProfileAt([-23.43,19.69], sketch005)
|> angledLine(angle = 0, length = 9.1, tag = $rectangleSegmentA005)
|> angledLine(angle = segAng(rectangleSegmentA005) - 90, length = 84.07)
|> angledLine(angle = segAng(rectangleSegmentA005), length = -segLen(rectangleSegmentA005))
|> line(endAbsolute=[profileStartX(%), profileStartY(%)])
|> close()
sketch004 = startSketchOn(extrude001, seg05)
sketch004 = startSketchOn(extrude001, face = seg05)
profile003 = startProfileAt([82.57, 322.96], sketch004)
|> angledLine(angle = 0, length = 11.16, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) - 90, length = 103.07)
|> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch003 = startSketchOn(extrude001, seg04)
sketch003 = startSketchOn(extrude001, face = seg04)
profile002 = startProfileAt([-209.64, 255.28], sketch003)
|> angledLine(angle = 0, length = 11.56, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 106.84)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch002 = startSketchOn(extrude001, seg03)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfileAt([205.96, 254.59], sketch002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
@ -383,7 +383,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
])`,
beforeChamferSnippetEnd: ')',
afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)',
'sketch002 = startSketchOn(extrude001, face = seg03)',
afterRectangle1stClickSnippet:
'startProfileAt([205.96, 254.59], sketch002)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.39,tag=$rectangleSegmentA002)
@ -416,7 +416,7 @@ chamf = chamfer(
getNextAdjacentEdge(seg02)
],
)
sketch002 = startSketchOn(extrude001, seg03)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfileAt([205.96, 254.59], sketch002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
@ -3188,7 +3188,7 @@ sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100)
|> extrude(length = 100)
sketch002 = startSketchOn(sketch001, 'END')
sketch002 = startSketchOn(sketch001, face = 'END')
|> circle(center = [0, 0], radius = 50)
|> extrude(length = 50)
`,
@ -3197,7 +3197,7 @@ sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100)
extrude001 = extrude(sketch001, length = 100)
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|> circle(center = [0, 0], radius = 50)
extrude002 = extrude(sketch002, length = 50)
`,
@ -3447,7 +3447,7 @@ tag=$rectangleSegmentC001,
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 200)
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> startProfileAt([-66.77, 84.81], %)
|> angledLine(angle = 180, length = 27.08, tag = $rectangleSegmentA002)
|> angledLine(
@ -3535,7 +3535,7 @@ tag=$rectangleSegmentC002,
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 50)
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> circle(center = [-11.34, 10.0], radius = 8.69)
`
@ -3623,7 +3623,7 @@ sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 5)
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> circle(
center = [-0.69, 0.56],
radius = 0.28

View File

@ -68,12 +68,10 @@ test.describe('edit with AI example snapshots', () => {
body1CapCoords.x,
body1CapCoords.y
)
const yellow: [number, number, number] = [179, 179, 131]
const submittingToast = page.getByText('Submitting to Text-to-CAD API...')
await test.step('wait for scene to load select body and check selection came through', async () => {
await clickBody1Cap()
await scene.expectPixelColor(yellow, body1CapCoords, 20)
await editor.expectState({
highlightedCode: '',
activeLines: ['|>startProfileAt([-73.64,-42.89],%)'],

View File

@ -1099,7 +1099,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 5)
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|>
`.replace(/\s/g, '')
)
@ -2634,7 +2634,7 @@ profile001 = startProfileAt([6.71, -3.66], sketch001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(profile001, length = 20)
sketch002 = startSketchOn(extrude001, seg01)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfileAt([0.75, 13.46], sketch002)
|> line(end = [4.52, 3.79])
|> line(end = [5.98, -2.81])

View File

@ -588,6 +588,7 @@ test(
'Draft circle should look right',
{ tag: '@snapshot' },
async ({ page, context, cmdBar, scene }) => {
test.fixme(orRunWhenFullSuiteEnabled())
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
const PUR = 400 / 37.5 //pixeltoUnitRatio
@ -823,7 +824,7 @@ test(
|> line(end = [11.91, -10.42])
|> close()
|> extrude(length = ${KCL_DEFAULT_LENGTH})
part002 = startSketchOn(part001, seg01)
part002 = startSketchOn(part001, face = seg01)
|> startProfileAt([8, 8], %)
|> line(end = [4.68, 3.05])
|> line(end = [0, -7.79])

View File

@ -140,7 +140,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn(box, face = revolveAxis)
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])

View File

@ -0,0 +1,15 @@
import { createProject } from '@e2e/playwright/test-utils'
import { test } from '@e2e/playwright/zoo-test'
test.describe('Stress test', () => {
test('Create project and load stress test', async ({
cmdBar,
scene,
page,
}, testInfo) => {
const projectName = 'stress-test-project'
// Create and load project
await createProject({ name: projectName, page })
await scene.settled(cmdBar)
})
})

View File

@ -272,27 +272,27 @@ sketch001 = startSketchOn(XZ)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 50)
sketch005 = startSketchOn(extrude001, 'END')
sketch005 = startSketchOn(extrude001, face = 'END')
|> startProfileAt([23.24, 136.52], %)
|> line(end = [-8.44, 36.61])
|> line(end = [49.4, 2.05])
|> line(end = [29.69, -46.95])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch003 = startSketchOn(extrude001, seg01)
sketch003 = startSketchOn(extrude001, face = seg01)
|> startProfileAt([21.23, 17.81], %)
|> line(end = [51.97, 21.32])
|> line(end = [4.07, -22.75])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch002 = startSketchOn(extrude001, seg02)
sketch002 = startSketchOn(extrude001, face = seg02)
|> startProfileAt([-100.54, 16.99], %)
|> line(end = [0, 20.03])
|> line(end = [62.61, 0], tag = $seg03)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude002 = extrude(sketch002, length = 50)
sketch004 = startSketchOn(extrude002, seg03)
sketch004 = startSketchOn(extrude002, face = seg03)
|> startProfileAt([57.07, 134.77], %)
|> line(end = [-4.72, 22.84])
|> line(end = [28.8, 6.71])
@ -391,28 +391,22 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
// `extrude001 = extrude(sketch001, length = 50)`
// )
// await expect(u.codeLocator).toContainText(`sketch005 = startSketchOn({
// plane = {
// origin = { x = 0, y = -50, z = 0 },
// xAxis = { x = 1, y = 0, z = 0 },
// yAxis = { x = 0, y = 0, z = 1 },
// zAxis = { x = 0, y = -1, z = 0 }
// }
// })`)
// await expect(u.codeLocator).toContainText(`sketch003 = startSketchOn({
// plane = {
// origin = { x = 116.53, y = 0, z = 163.25 },
// xAxis = { x = -0.81, y = 0, z = 0.58 },
// yAxis = { x = 0, y = -1, z = 0 },
// zAxis = { x = 0.58, y = 0, z = 0.81 }
// }
// })`)
// await expect(u.codeLocator).toContainText(`sketch002 = startSketchOn({
// plane = {
// origin = { x = -91.74, y = 0, z = 80.89 },
// xAxis = { x = -0.66, y = 0, z = -0.75 },
// yAxis = { x = 0, y = -1, z = 0 },
// zAxis = { x = -0.75, y = 0, z = 0.66 }
// }
// })`)
// DELETE SOLID 2D
@ -463,8 +457,8 @@ yo = startProfileAt([4.83, 12.56], part001)
|> line(end = [-13.02, 10.03])
|> close()
yoo = extrude(yo, length = 4)
sketch002 = startSketchOn(yoo, seg02)
sketch001 = startSketchOn(yoo, 'END')
sketch002 = startSketchOn(yoo, face = seg02)
sketch001 = startSketchOn(yoo, face = 'END')
profile002 = startProfileAt([-11.08, 2.39], sketch002)
|> line(end = [4.89, 0.9])
|> line(end = [-0.61, -2.41])
@ -893,7 +887,7 @@ part001 = startSketchOn(XZ)
await expect(page.locator('.cm-activeLine')).toHaveText('')
const codeToAdd = `${await u.codeLocator.allInnerTexts()}
sketch002 = startSketchOn(extrude001, $seg01)
sketch002 = startSketchOn(extrude001, face = $seg01)
|> startProfileAt([-12.94, 6.6], %)
|> line(end = [2.45, -0.2])
|> line(end = [-2, -1.25])

View File

@ -546,7 +546,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)`
previousCodeContent = await page.locator('.cm-content').innerText()
await expect.poll(u.normalisedEditorCode).toContain(
u.normalisedCode(`sketch002 = startSketchOn(extrude001, seg01)
u.normalisedCode(`sketch002 = startSketchOn(extrude001, face = seg01)
profile001 = startProfileAt([-12.34, 12.34], sketch002)
|> line(end = [12.34, -12.34])
|> line(end = [-12.34, -12.34])
@ -583,7 +583,7 @@ profile001 = startProfileAt([-12.34, 12.34], sketch002)
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
previousCodeContent = await page.locator('.cm-content').innerText()
const result = makeTemplate`sketch002 = startSketchOn(extrude001, seg01)
const result = makeTemplate`sketch002 = startSketchOn(extrude001, face = seg01)
|> startProfileAt([-12.83, 6.7], %)
|> line(end = [${[2.28, 2.35]}, -${0.07}])
|> line(end = [-3.05, -1.47])

41
flake.lock generated
View File

@ -1,6 +1,40 @@
{
"nodes": {
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1743800763,
"narHash": "sha256-YFKV+fxEpMgP5VsUcM6Il28lI0NlpM7+oB1XxbBAYCw=",
"owner": "nix-community",
"repo": "naersk",
"rev": "ed0232117731a4c19d3ee93aa0c382a8fe754b01",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1744096231,
"narHash": "sha256-kUfx3FKU1Etnua3EaKvpeuXs7zoFiAcli1gBwkPvGSs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b2b0718004cc9a5bca610326de0a82e6ea75920b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1736320768,
"narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=",
@ -16,7 +50,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1728538411,
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
@ -34,13 +68,14 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1736476219,

142
flake.nix
View File

@ -1,84 +1,104 @@
{
description = "modeling-app development environment";
description = "zoo.dev modeling-app";
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
rust-overlay.url = "github:oxalica/rust-overlay";
naersk.url = "github:nix-community/naersk";
};
# Flake outputs
outputs = { self, nixpkgs, rust-overlay }:
let
# Overlays enable you to customize the Nixpkgs attribute set
overlays = [
# Makes a `rust-bin` attribute available in Nixpkgs
(import rust-overlay)
# Provides a `rustToolchain` attribute for Nixpkgs that we can use to
# create a Rust environment
(self: super: {
rustToolchain = super. rust-bin.stable.latest.default.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "rustfmt" "llvm-tools-preview" "rust-src" ];
outputs = {
self,
nixpkgs,
rust-overlay,
naersk,
}: let
overlays = [
(import rust-overlay)
(self: super: {
rustToolchain = super.rust-bin.stable.latest.default.override {
targets = ["wasm32-unknown-unknown"];
extensions = ["rustfmt" "llvm-tools-preview" "rust-src"];
};
})
(self: super: {
cargo-llvm-cov = super.cargo-llvm-cov.overrideAttrs (oa: {
doCheck = false;
doInstallCheck = false;
});
})
];
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f:
nixpkgs.lib.genAttrs allSystems (system:
f {
pkgs = import nixpkgs {
inherit overlays system;
config.allowBroken = true;
};
})
(self: super: {
cargo-llvm-cov = super.cargo-llvm-cov.overrideAttrs(oa: {
doCheck = false; doInstallCheck = false;
});
})
];
# Systems supported
allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS
];
# Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; config.allowBroken = true; };
});
in
{
# Development environment output
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = (with pkgs; [
# The package provided by our custom overlay. Includes cargo, Clippy, cargo-fmt,
# rustdoc, rustfmt, and other tools.
system = system;
});
in {
devShells = forAllSystems ({pkgs, ...}: {
default = pkgs.mkShell {
packages =
(with pkgs; [
rustToolchain
cargo-llvm-cov
cargo-nextest
just
postgresql.lib
openssl
pkg-config
nodejs_22
yarn
electron
playwright-driver.browsers
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
wasm-pack
python3Full
])
++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
libiconv
darwin.apple_sdk.frameworks.Security
]);
TARGET_CC = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
ELECTRON_OVERRIDE_DIST_PATH = "${pkgs.electron}/bin/";
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true;
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = "${pkgs.playwright-driver.browsers}/chromium-1091/chrome-linux/chrome";
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
NODE_ENV = "development";
};
});
};
TARGET_CC = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
ELECTRON_OVERRIDE_DIST_PATH = "${pkgs.electron}/bin/";
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true;
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = "${pkgs.playwright-driver.browsers}/chromium-1091/chrome-linux/chrome";
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
NODE_ENV = "development";
};
});
packages = forAllSystems ({
pkgs,
system,
}: let
naersk-lib = pkgs.callPackage naersk {
cargo = pkgs.rustToolchain;
rustc = pkgs.rustToolchain;
};
in {
kcl-language-server = naersk-lib.buildPackage {
pname = "kcl-language-server";
version = "0.1.0";
release = true;
src = ./rust;
cargoBuildOptions = opt: opt ++ ["-p" "kcl-language-server"];
buildInputs = [pkgs.openssl pkgs.pkg-config];
};
default = self.packages.${system}.kcl-language-server;
});
};
}

View File

@ -389,6 +389,13 @@ export class LanguageServerPlugin implements PluginValue {
}
if (insertText && insertTextFormat === 2) {
// We end with ${} so you can jump to the end of the snippet.
// After the last argument.
// This is not standard from the lsp so we add it here.
if (insertText.endsWith(')')) {
// We have a function its safe to insert the ${} at the end.
insertText = insertText + '${}'
}
return snippetCompletion(insertText, completion)
}

View File

@ -35,13 +35,13 @@ sketch001 = startSketchOn(XZ)
|> fillet(radius = filletRadius, tags = [seg02, getOppositeEdge(seg02)])
|> fillet(radius = filletRadius, tags = [seg05, getOppositeEdge(seg05)])
sketch002 = startSketchOn(sketch001, seg03)
sketch002 = startSketchOn(sketch001, face = seg03)
|> circle(center = [-1.25, 1], radius = mountingHoleDiameter / 2)
|> patternLinear2d(instances = 2, distance = 2.5, axis = [-1, 0])
|> patternLinear2d(instances = 2, distance = 4, axis = [0, 1])
|> extrude(%, length = -thickness - .01)
sketch003 = startSketchOn(sketch001, seg04)
sketch003 = startSketchOn(sketch001, face = seg04)
|> circle(center = [1, -1], radius = mountingHoleDiameter / 2)
|> patternLinear2d(instances = 2, distance = 4, axis = [1, 0])
|> extrude(%, length = -thickness - 0.1)

View File

@ -12,11 +12,11 @@ rotorSketch = startSketchOn(XZ)
rotor = extrude(rotorSketch, length = rotorSinglePlateThickness)
|> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
rotorBumpSketch = startSketchOn(rotor, 'end')
rotorBumpSketch = startSketchOn(rotor, face = 'end')
|> circle(center = [0, 0], radius = rotorInnerDiameter / 2)
rotorBump = extrude(rotorBumpSketch, length = rotorInnerDiameterThickness)
lugHoles = startSketchOn(rotorBump, 'end')
lugHoles = startSketchOn(rotorBump, face = 'end')
|> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
|> patternCircular2d(
arcDegrees = 360,
@ -28,15 +28,15 @@ lugHoles = startSketchOn(rotorBump, 'end')
|> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
// (update when boolean is available)
centerSpacer = startSketchOn(rotor, 'start')
centerSpacer = startSketchOn(rotor, face = 'start')
|> circle(%, center = [0, 0], radius = .25)
|> extrude(%, length = spacerLength)
secondaryRotorSketch = startSketchOn(centerSpacer, 'end')
secondaryRotorSketch = startSketchOn(centerSpacer, face = 'end')
|> circle(center = [0, 0], radius = rotorDiameter / 2)
secondRotor = extrude(secondaryRotorSketch, length = rotorSinglePlateThickness)
lugHoles2 = startSketchOn(secondRotor, 'end')
lugHoles2 = startSketchOn(secondRotor, face = 'end')
|> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
|> patternCircular2d(
arcDegrees = 360,
@ -46,7 +46,7 @@ lugHoles2 = startSketchOn(secondRotor, 'end')
)
|> extrude(length = -rotorSinglePlateThickness)
spacerSketch = startSketchOn(rotor, 'start')
spacerSketch = startSketchOn(rotor, face = 'start')
|> circle(center = [spacerPatternDiameter / 2, 0], radius = spacerDiameter)
|> patternCircular2d(
arcDegrees = 360,
@ -56,7 +56,7 @@ spacerSketch = startSketchOn(rotor, 'start')
)
spacers = extrude(spacerSketch, length = spacerLength)
rotorSlottedSketch = startSketchOn(rotor, 'START')
rotorSlottedSketch = startSketchOn(rotor, face = 'START')
|> startProfileAt([2.17, 2.56], %)
|> xLine(length = 0.12)
|> yLine(length = 2.56)
@ -71,7 +71,7 @@ rotorSlottedSketch = startSketchOn(rotor, 'START')
)
rotorSlotted = extrude(rotorSlottedSketch, length = -rotorSinglePlateThickness / 2)
secondRotorSlottedSketch = startSketchOn(secondRotor, 'END')
secondRotorSlottedSketch = startSketchOn(secondRotor, face = 'END')
|> startProfileAt([-2.17, 2.56], %)
|> xLine(length = -0.12)
|> yLine(length = 2.56)

View File

@ -14,13 +14,13 @@ lugBase = startSketchOn(XZ)
|> extrude(length = wheelWidth / 20)
// Extend the wheel center and bore holes to accomidate the lug heads
lugExtrusion = startSketchOn(lugBase, 'END')
lugExtrusion = startSketchOn(lugBase, face = 'END')
|> circle(center = [0, 0], radius = (lugSpacing + 1.5) / 2)
|> hole(circle(center = [0, 0], radius = (lugSpacing - 1.5) / 2), %)
|> extrude(length = wheelWidth / 10)
// Create the circular pattern for the lugs
lugClearance = startSketchOn(lugExtrusion, 'END')
lugClearance = startSketchOn(lugExtrusion, face = 'END')
|> circle(center = [lugSpacing / 2, 0], radius = 1.2 / 2)
|> patternCircular2d(
arcDegrees = 360,
@ -31,7 +31,7 @@ lugClearance = startSketchOn(lugExtrusion, 'END')
|> extrude(length = -wheelWidth / 10)
// Create the circular pattern for the lug holes
lugHoles = startSketchOn(lugBase, 'END')
lugHoles = startSketchOn(lugBase, face = 'END')
|> circle(center = [lugSpacing / 2, 0], radius = fromMm(16) / 2)
|> patternCircular2d(
arcDegrees = 360,
@ -75,12 +75,10 @@ wheelCenterOuter = startSketchOn(XY)
fn spoke(spokeGap, spokeAngle, spokeThickness) {
// Seperating the spoke base planes
plane001 = {
plane = {
origin = [0.0, 0.0, spokeGap / 2],
xAxis = [1.0, 0.0, spokeAngle],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, spokeGap / 2],
xAxis = [1.0, 0.0, spokeAngle],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
// Spoke cross sections

View File

@ -8,16 +8,14 @@
import lugDiameter, lugHeadLength, lugThreadDiameter, lugLength, lugThreadDepth, lugSpacing from "parameters.kcl"
customPlane = {
plane = {
origin = {
x = lugSpacing / 2,
y = fromMm(-30),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = -1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = {
x = lugSpacing / 2,
y = fromMm(-30),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = -1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
fn lug(plane, length, diameter) {

View File

@ -26,16 +26,14 @@ pentR = edgeL / 2 / sin(toRadians(36))
// Define a plane for the bottom angled face
plane = {
plane = {
origin = [
-inscR * cos(toRadians(toDegrees(dihedral) - 90)),
0,
inscR - (inscR * sin(toRadians(toDegrees(dihedral) - 90)))
],
xAxis = [cos(dihedral), 0.0, sin(dihedral)],
yAxis = [0, 1, 0],
zAxis = [sin(dihedral), 0, -cos(dihedral)]
}
origin = [
-inscR * cos(toRadians(toDegrees(dihedral) - 90)),
0,
inscR - (inscR * sin(toRadians(toDegrees(dihedral) - 90)))
],
xAxis = [cos(dihedral), 0.0, sin(dihedral)],
yAxis = [0, 1, 0],
zAxis = [sin(dihedral), 0, -cos(dihedral)]
}
// Create a regular pentagon inscribed in a circle of radius pentR

View File

@ -117,7 +117,7 @@ sinkOffsetFront = 40
sinkOffsetLeft = 350
sinkSpacing = tableWidth - sinkWidth - (sinkOffsetLeft * 2)
sinkPlaneOutside = startSketchOn(tableTopBody, 'START')
sinkPlaneOutside = startSketchOn(tableTopBody, face = 'START')
sinkBodyOutside = startProfileAt([-sinkOffsetLeft, sinkOffsetFront], sinkPlaneOutside)
|> yLine(length = sinkLength)
|> xLine(length = -sinkWidth)
@ -127,7 +127,7 @@ sinkBodyOutside = startProfileAt([-sinkOffsetLeft, sinkOffsetFront], sinkPlaneOu
|> patternLinear2d(axis = [-1, 0], instances = sinkCount, distance = sinkSpacing)
|> extrude(length = sinkDepth)
sinkPlaneInside = startSketchOn(tableTopBody, 'END')
sinkPlaneInside = startSketchOn(tableTopBody, face = 'END')
sinkBodyInside = startProfileAt([
sinkOffsetLeft + metalThickness,
sinkOffsetFront + metalThickness

View File

@ -37,12 +37,10 @@ extrude001 = extrude(sketch001, length = height)
fn function001(originStart) {
// Create a plane to sketch on shell interior
plane001 = {
plane = {
origin = [0.0, 0.0, wallThickness],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, wallThickness],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
// Create a pillar with a fasterner hole at the center
@ -120,7 +118,7 @@ extrude003 = extrude(sketch003, length = wallThickness)
)
// Define lid inner and sealing surfaces
sketch004 = startSketchOn(extrude003, 'END')
sketch004 = startSketchOn(extrude003, face = 'END')
|> startProfileAt([
width * 1.2 + wallThickness,
wallThickness

View File

@ -17,16 +17,14 @@ fn primaryTube(n, angle001, length001, length002, length003) {
// Define a plane for each sweep path defined by an angle
sweepPlane = {
plane = {
origin = [pos001, 0.0, 0],
xAxis = [
sin(toRadians(-angle001)),
cos(toRadians(-angle001)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [pos001, 0.0, 0],
xAxis = [
sin(toRadians(-angle001)),
cos(toRadians(-angle001)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Draw a path for each sweep

View File

@ -37,16 +37,16 @@ flangeBase = startSketchOn(XY)
|> extrude(length = baseThickness)
// Create the extrusion on the top of the flange base
topExtrusion = startSketchOn(flangeBase, 'end')
topExtrusion = startSketchOn(flangeBase, face = 'end')
|> circle(center = [0, 0], radius = topTotalDiameter / 2)
|> extrude(length = topTotalThickness)
// Create the extrusion on the bottom of the flange base
bottomExtrusion = startSketchOn(flangeBase, 'start')
bottomExtrusion = startSketchOn(flangeBase, face = 'start')
|> circle(center = [0, 0], radius = bottomTotalDiameter / 2)
|> extrude(length = bottomThickness)
// Cut a hole through the entire body
pipeHole = startSketchOn(topExtrusion, 'end')
pipeHole = startSketchOn(topExtrusion, face = 'end')
|> circle(center = [0, 0], radius = pipeDia / 2)
|> extrude(%, length = -(topTotalThickness + baseThickness + bottomThickness))

View File

@ -28,12 +28,10 @@ fn rectShape(pos, w, l) {
// Define the bracket plane
bracketPlane = {
plane = {
origin = { x = 0, y = length / 2 + thk, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
origin = { x = 0, y = length / 2 + thk, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
// Build the bracket sketch around the body
@ -67,12 +65,10 @@ bracketBody = bs
// Define the tab plane
tabPlane = {
plane = {
origin = { x = 0, y = 0, z = depth + thk },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = { x = 0, y = 0, z = depth + thk },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
// Build the tabs of the mounting bracket (right side)
@ -125,12 +121,10 @@ tabsL = startSketchOn(tabPlane)
// Define a plane for retention bumps
retPlane = {
plane = {
origin = { x = -width / 2 + 20, y = 0, z = 0 },
xAxis = { x = 0, y = 1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
origin = { x = -width / 2 + 20, y = 0, z = 0 },
xAxis = { x = 0, y = 1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
// Build the retention bump in the front

View File

@ -114,12 +114,10 @@ fillet(
// Define a plane which is at the end of the handle
handlePlane = {
plane = {
origin = [208.593833, 0.0, 75.921946],
xAxis = [0.342020, -0.0, -0.939693],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.939693, -0.0, 0.342020]
}
origin = [208.593833, 0.0, 75.921946],
xAxis = [0.342020, -0.0, -0.939693],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.939693, -0.0, 0.342020]
}
// Create a sketch on the handle plane
@ -157,7 +155,7 @@ gripProfile = startProfileAt([-26.806746, -10.0], gripSketch)
grip = extrude(gripProfile, length = -gripLength)
// Create a sketch on the grip for the hole
holeSketch = startSketchOn(grip, gripEdgeTop)
holeSketch = startSketchOn(grip, face = gripEdgeTop)
// Create a profile for the grip hole
gripHoleProfile = slot(holeSketch, [0, 200], [0, 210], gripSlotWidth)

View File

@ -21,12 +21,10 @@ sketch001 = startSketchOn(XZ)
// Create an angled plane to sketch the supports
plane001 = {
plane = {
origin = [-0.26, 0.26, 0.0],
xAxis = [1, 1, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [-0.26, 0.26, 0.0],
xAxis = [1, 1, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Cross section of the metal supports
@ -88,7 +86,7 @@ sketch003 = startSketchOn(offsetPlane(XY, offset = 1))
extrude001 = extrude(sketch003, length = 0.050)
sketch004 = startSketchOn(extrude001, 'END')
sketch004 = startSketchOn(extrude001, face = 'END')
|> startProfileAt([0.3, 0.17], %)
|> yLine(length = 1.2)
|> arc({
@ -140,7 +138,7 @@ sketch007 = startSketchOn(offsetPlane(XY, offset = 1.12))
extrude003 = extrude(sketch007, length = 0.050)
// Pattern holes in the spiral plate
sketch008 = startSketchOn(extrude003, 'END')
sketch008 = startSketchOn(extrude003, face = 'END')
|> circle(center = [1.4, 0], radius = .3)
|> patternCircular2d(
center = [0, 0],
@ -152,7 +150,7 @@ sketch008 = startSketchOn(extrude003, 'END')
extrude004 = extrude(sketch008, length = -0.050)
// Pattern holes in the spiral plate
sketch009 = startSketchOn(extrude003, 'END')
sketch009 = startSketchOn(extrude003, face = 'END')
|> circle(center = [0.6, 0], radius = .2)
|> patternCircular2d(
center = [0, 0],

View File

@ -87,7 +87,7 @@ holeRadius = 1
startAngle = asin(keywayWidth / 2 / holeRadius)
// Sketch the keyway and center hole and extrude
keyWay = startSketchOn(body, 'END')
keyWay = startSketchOn(body, face = 'END')
|> startProfileAt([
holeRadius * cos(startAngle),
holeRadius * sin(startAngle)

View File

@ -109,7 +109,7 @@ singleBinFill = startSketchOn(XY)
],
)
magCutout000 = startSketchOn(singleBinFill, "start")
magCutout000 = startSketchOn(singleBinFill, face = "start")
|> circle(
center = [
-magOffset - binBaseLength - binTol,
@ -195,42 +195,36 @@ fn lipFace(plane) {
}
plane000 = {
plane = {
origin = [
cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [
cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
plane001 = {
plane = {
origin = [
0.0,
cornerRadius,
height + binHeight * countBinHeight
],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [0.0, 1.0, 0.0]
}
origin = [
0.0,
cornerRadius,
height + binHeight * countBinHeight
],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [0.0, 1.0, 0.0]
}
plane002 = {
plane = {
origin = [
countBinWidth * (binLength + 2 * binTol) - cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [
countBinWidth * (binLength + 2 * binTol) - cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Extrude a single side of the lip of the bin

View File

@ -102,7 +102,7 @@ singleBinFill = startSketchOn(XY)
],
)
magCutout000 = startSketchOn(singleBinFill, "start")
magCutout000 = startSketchOn(singleBinFill, face = "start")
|> circle(
center = [
-magOffset - binBaseLength - binTol,

View File

@ -39,7 +39,7 @@ sketch001 = startSketchOn(YZ)
)
// Create a short cylindrical foot at each corner of the keyboard
sketch003 = startSketchOn(sketch001, seg04)
sketch003 = startSketchOn(sketch001, face = seg04)
profile001 = circle(sketch003, center = [0.75, 0.75], radius = 0.4)
profile003 = circle(sketch003, center = [4.4, 0.75], radius = 0.4)
profile004 = circle(sketch003, center = [0.73, 13.6 - .75], radius = 0.4)
@ -56,12 +56,10 @@ extrude(
// Define the plane to sketch keyboard keys on
plane001 = {
plane = {
origin = [0.0, 0.0, 0.7],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, 0.7],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
// Create a function to build a key. Parameterize for position, width, height, number of instances, and appearance color.
@ -128,12 +126,10 @@ keyFn([spacing * 3 + 12, row6], 1, keyHeight * .6, 0, highlightColor2)
// Create a plane to sketch ZOO brand letters on
plane002 = {
plane = {
origin = [0.0, 0.0, .81],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, .81],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
// Define a function to draw the ZOO 'Z'

View File

@ -3,7 +3,7 @@
// Pixel box function
fn pixelBox(kitExtrude, extrudeTag, positionY, positionZ, width, height, depth) {
pixelBoxBody = startSketchOn(kitExtrude, extrudeTag)
pixelBoxBody = startSketchOn(kitExtrude, face = extrudeTag)
|> startProfileAt([positionY, positionZ], %)
|> line(end = [0, height])
|> line(end = [width, 0])
@ -45,7 +45,7 @@ kitFaceWidth = kitHeadWidth - 4
kitFaceHeight = kitHeadElevation + kitHeadHeight - kitFaceElevation - 3
kitFaceDepth = 2
kitFace = startSketchOn(kitHead, 'END')
kitFace = startSketchOn(kitHead, face = 'END')
|> startProfileAt([-kitFaceWidth / 2, kitFaceElevation], %)
|> line(end = [0, 1]) // left lower corner up
|> line(end = [-1, 0]) // left lower corner left
@ -78,7 +78,7 @@ kitLeftEye2 = pixelBox(kitFace, 'START', -kitEyeOffset + 1, kitEyeHeihgt + 1, 3,
kitLeftEye3 = pixelBox(kitFace, 'START', -kitEyeOffset + 4, kitEyeHeihgt, 1, 1, kitEyeDepth)
kitRightEye = pixelBox(kitFace, 'START', kitEyeOffset - 3, kitEyeHeihgt - 1, 2, 4, kitEyeDepth)
kitNoseElevation = kitEyeHeihgt - 5
kitNose = startSketchOn(kitFace, 'START')
kitNose = startSketchOn(kitFace, face = 'START')
|> startProfileAt([-2, kitNoseElevation], %) // H V
|> line(end = [0, 1]) // lower-left up
|> line(end = [2, 0]) // lower-left right

View File

@ -35,7 +35,7 @@ base = startSketchOn(XY)
|> extrude(length = height)
// Sketch and extrude a rectangular shape to create the shell underneath the lego. Will replace with shell function when able to call a face created from shell.
shellExtrude = startSketchOn(base, "start")
shellExtrude = startSketchOn(base, face = "start")
|> startProfileAt([
-(totalWidth / 2 - t),
-(totalLength / 2 - t)
@ -47,7 +47,7 @@ shellExtrude = startSketchOn(base, "start")
|> extrude(length = -(height - t))
// Create the pegs on the top of the base
peg = startSketchOn(base, 'end')
peg = startSketchOn(base, face = 'end')
|> circle(
center = [
-(pitch * (wbumps - 1) / 2),
@ -60,7 +60,7 @@ peg = startSketchOn(base, 'end')
|> extrude(length = bumpHeight)
// Create the pegs on the bottom of the base
tubePattern = startSketchOn(shellExtrude, 'start')
tubePattern = startSketchOn(shellExtrude, face = 'start')
|> circle(
center = [
-(pitch * (wbumps - 1) / 2 - (pitch / 2)),

View File

@ -28,37 +28,31 @@ export axisJ3CArmThickness = 2.5
// Planes
export plane001 = {
plane = {
origin = [0.0, 0.0, baseHeight - 1.5 + 0.1],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, baseHeight - 1.5 + 0.1],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
export plane002 = {
plane = {
origin = [0.0, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [0.0, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Define Plane to Move J2 Axis Robot Arm
export plane003 = {
plane = {
origin = [-0.1, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [-0.1, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}

View File

@ -26,16 +26,16 @@ extrude001 = extrude(sketch001, length = basePlateThickness)
)
// Base Motor for actuating first joint
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|> circle(center = [0, 0], radius = 4, tag = $referenceEdge)
extrude002 = extrude(sketch002, length = baseHeight - basePlateThickness - 1.5)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge)])
sketch003 = startSketchOn(extrude002, 'END')
sketch003 = startSketchOn(extrude002, face = 'END')
|> circle(center = [0, 0], radius = 0.5)
extrude003 = extrude(sketch003, length = 1)
// Pattern M8 mounting bolts in base
sketch4A = startSketchOn(extrude001, 'END')
sketch4A = startSketchOn(extrude001, face = 'END')
|> circle(
center = [
-basePlateRadius + 1,
@ -52,7 +52,7 @@ sketch4A = startSketchOn(extrude001, 'END')
extrude4A = extrude(sketch4A, length = -basePlateThickness)
sketch4B = startSketchOn(extrude001, 'END')
sketch4B = startSketchOn(extrude001, face = 'END')
|> circle(
center = [
-basePlateRadius + 0.5 + baseChamfer,

View File

@ -26,12 +26,12 @@ sketch011 = startSketchOn(plane003)
|> close()
extrude011 = extrude(sketch011, length = -axisJ2ArmThickness)
sketch012 = startSketchOn(extrude011, 'START')
sketch012 = startSketchOn(extrude011, face = 'START')
|> circle(center = [-1.75, 8], radius = 1.9, tag = $referenceEdge4)
extrude012 = extrude(sketch012, length = 0.15)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge4)])
sketch013 = startSketchOn(extrude011, 'START')
sketch013 = startSketchOn(extrude011, face = 'START')
|> circle(
center = [
-1.75 - (axisJ2ArmLength * cos(toRadians(axisJ2))),
@ -45,7 +45,7 @@ extrude013 = extrude(sketch013, length = 1)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge5)])
// Draw Bolt Patterns on J2 Robot Arm
sketch014 = startSketchOn(extrude012, 'END')
sketch014 = startSketchOn(extrude012, face = 'END')
|> circle(center = [-1.75, 6.75], radius = 0.2)
|> patternCircular2d(
center = [-1.75, 8],
@ -56,7 +56,7 @@ sketch014 = startSketchOn(extrude012, 'END')
extrude014 = extrude(sketch014, length = 0.15)
sketch015 = startSketchOn(extrude013, 'END')
sketch015 = startSketchOn(extrude013, face = 'END')
|> circle(
center = [
-1.75 - ((axisJ2ArmLength - 1) * cos(toRadians(axisJ2))),
@ -76,7 +76,7 @@ sketch015 = startSketchOn(extrude013, 'END')
extrude015 = extrude(sketch015, length = 0.15)
sketch016 = startSketchOn(extrude011, 'END')
sketch016 = startSketchOn(extrude011, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)),

View File

@ -26,7 +26,7 @@ sketch017 = startSketchOn(plane002)
|> close()
extrude017 = extrude(sketch017, length = axisJ3CArmThickness)
sketch018 = startSketchOn(extrude017, 'END')
sketch018 = startSketchOn(extrude017, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)),
@ -40,7 +40,7 @@ extrude018 = extrude(sketch018, length = 0.15)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge6)])
// Draw Bolt Pattern on J3 Robot Arm
sketch019 = startSketchOn(extrude018, 'END')
sketch019 = startSketchOn(extrude018, face = 'END')
|> circle(
center = [
1.75 + (axisJ2ArmLength - 1) * cos(toRadians(axisJ2)),
@ -61,7 +61,7 @@ sketch019 = startSketchOn(extrude018, 'END')
extrude019 = extrude(sketch019, length = 0.15)
// On the J3 Robot Arm Body, Create Mounting Clevis for Grabber Claw
sketch020 = startSketchOn(extrude017, 'START')
sketch020 = startSketchOn(extrude017, face = 'START')
|> circle(
center = [
-1.75 - (axisJ2ArmLength * cos(toRadians(axisJ2))) - (axisJ3CArmLength * cos(toRadians(axisJ3C))),
@ -71,7 +71,7 @@ sketch020 = startSketchOn(extrude017, 'START')
)
extrude020 = extrude(sketch020, length = -0.5)
sketch021 = startSketchOn(extrude017, 'END')
sketch021 = startSketchOn(extrude017, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
@ -85,13 +85,13 @@ extrude021 = extrude(sketch021, length = -0.5)
// Define Grabber Claw Constants
grabberLength = 7
sketch022 = startSketchOn(extrude021, 'START')
sketch022 = startSketchOn(extrude021, face = 'START')
|> circle(center = [0, 0], radius = 0.10)
extrude022 = extrude(sketch022, length = -0.01)
// Build Upper Claw Finger
sketch023 = startSketchOn(extrude022, 'START')
sketch023 = startSketchOn(extrude022, face = 'START')
|> startProfileAt([
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))
@ -112,7 +112,7 @@ sketch023 = startSketchOn(extrude022, 'START')
extrude023 = extrude(sketch023, length = -1.5)
// Build Lower Claw Finger
sketch024 = startSketchOn(extrude022, 'START')
sketch024 = startSketchOn(extrude022, face = 'START')
|> startProfileAt([
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))

View File

@ -26,7 +26,7 @@ sketch006 = startSketchOn(plane002)
extrude006 = extrude(sketch006, length = 1)
sketch007 = startSketchOn(extrude006, 'END')
sketch007 = startSketchOn(extrude006, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),
@ -39,7 +39,7 @@ extrude007 = extrude(sketch007, length = 1.5)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge2)])
// Draw Bolt Pattern on Rotating Base
sketch008 = startSketchOn(extrude007, 'END')
sketch008 = startSketchOn(extrude007, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),
@ -58,7 +58,7 @@ sketch008 = startSketchOn(extrude007, 'END')
)
extrude008 = extrude(sketch008, length = 0.2)
sketch009 = startSketchOn(extrude007, 'END')
sketch009 = startSketchOn(extrude007, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),

View File

@ -22,7 +22,7 @@ body = startSketchOn(XY)
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> extrude(length = height)
counterBoreHoles = startSketchOn(body, 'end')
counterBoreHoles = startSketchOn(body, face = 'end')
|> circle(
center = [
-(width / 2 - (padding / 2)),
@ -34,7 +34,7 @@ counterBoreHoles = startSketchOn(body, 'end')
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|> extrude(%, length = -cbDepth)
boltHoles = startSketchOn(body, 'start')
boltHoles = startSketchOn(body, face = 'start')
|> circle(
center = [
-(width / 2 - (padding / 2)),
@ -46,6 +46,6 @@ boltHoles = startSketchOn(body, 'start')
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|> extrude(length = -height + cbDepth)
centerHole = startSketchOn(body, 'end')
centerHole = startSketchOn(body, face = 'end')
|> circle(center = [0, 0], radius = bearingDia / 2)
|> extrude(length = -height)

View File

@ -15,7 +15,7 @@ export fn pipe() {
|> extrude(%, length = pipeLength)
// Extrude a hole through the length of the pipe
pipe = startSketchOn(pipeBase, 'end')
pipe = startSketchOn(pipeBase, face = 'end')
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|> extrude(%, length = -pipeLength)
|> appearance(color = "#a24ed0")

View File

@ -27,15 +27,15 @@ export fn flange() {
|> extrude(%, length = flangeBaseThickness)
// Create both the raised portions on the front and back of the flange base
flangeBack = startSketchOn(flangeBase, 'start')
flangeBack = startSketchOn(flangeBase, face = 'start')
|> circle(%, center = [0, 0], radius = flangeBackDiameter / 2)
|> extrude(%, length = flangeBackHeight)
flangeFront = startSketchOn(flangeBase, 'end')
flangeFront = startSketchOn(flangeBase, face = 'end')
|> circle(%, center = [0, 0], radius = flangeFrontDiameter / 2)
|> extrude(%, length = flangeFrontHeight)
// Create the circular cut in the center for the pipe
pipeCut = startSketchOn(flangeFront, 'end')
pipeCut = startSketchOn(flangeFront, face = 'end')
|> circle(%, center = [0, 0], radius = pipeDiameter / 2)
|> extrude(%, length = -flangeTotalThickness)
|> appearance(%, color = "#bab0b0")

View File

@ -16,7 +16,7 @@ export fn bolt() {
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
// Define the sketch of the hex pattern on the screw head and extrude into the head
hexPatternSketch = startSketchOn(boltHead, 'start')
hexPatternSketch = startSketchOn(boltHead, face = 'start')
|> startProfileAt([
boltHexDrive / 2,
boltHexFlatLength / 2
@ -30,7 +30,7 @@ export fn bolt() {
|> extrude(length = -boltHeadLength * 0.75)
// create the body of the bolt
boltBody = startSketchOn(boltHead, 'end')
boltBody = startSketchOn(boltHead, face = 'end')
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)

View File

@ -13,7 +13,7 @@ gasketBase = startSketchOn(XY)
|> extrude(%, length = gasketThickness)
// Extrude a circular hole through the gasket base
startSketchOn(gasketBase, 'end')
startSketchOn(gasketBase, face = 'end')
|> circle(%, center = [0, 0], radius = gasketInnerDiameter / 2)
|> extrude(%, length = -gasketThickness)
|> appearance(%, color = "#d0cb3e")

View File

@ -24,7 +24,7 @@ export fn hexNut() {
|> extrude(length = hexNutThickness)
// Create the hole in the center of the hex nut
hexNut = startSketchOn(hexNutBase, 'end')
hexNut = startSketchOn(hexNutBase, face = 'end')
|> circle(center = [0, 0], radius = hexNutDiameter / 2)
|> extrude(%, length = -hexNutThickness)
|> appearance(%, color = "#4edfd5")

View File

@ -15,7 +15,7 @@ export fn washer() {
|> extrude(length = washerThickness)
// Extrude a hole through the washer
washer = startSketchOn(washerBase, 'end')
washer = startSketchOn(washerBase, face = 'end')
|> circle(center = [0, 0], radius = washerInnerDia / 2)
|> extrude(%, length = -washerThickness)
|> appearance(%, color = "#ee4f4f")

View File

@ -15,7 +15,7 @@ pipeBase = startSketchOn(XZ)
|> extrude(%, length = pipeLength)
// Extrude a hole through the length of the pipe
pipe = startSketchOn(pipeBase, 'end')
pipe = startSketchOn(pipeBase, face = 'end')
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|> extrude(%, length = -pipeLength)
|> appearance(color = "#a24ed0")

View File

@ -56,16 +56,14 @@ sketch002 = startSketchOn(-YZ)
|> extrude(length = backLength - height)
customPlane = {
plane = {
origin = {
x = 0,
y = -(wallsWidth / 2 - (wallThickness / 2)),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
origin = {
x = 0,
y = -(wallsWidth / 2 - (wallThickness / 2)),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
sketch003 = startSketchOn(customPlane)
|> startProfileAt([0, 0], %)
@ -75,7 +73,7 @@ sketch003 = startSketchOn(customPlane)
|> extrude(length = wallThickness)
// Create the right side wall of the tub
sketch004 = startSketchOn(sketch002, 'END')
sketch004 = startSketchOn(sketch002, face = 'END')
|> startProfileAt([0, 0], %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = wallThickness)
@ -95,16 +93,14 @@ sketch004 = startSketchOn(sketch002, 'END')
|> extrude(length = wallThickness)
customPlane2 = {
plane = {
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = 0
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = 0
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
sketch005 = startSketchOn(customPlane2)
|> startProfileAt([0, 0], %)
@ -119,7 +115,7 @@ sketch005 = startSketchOn(customPlane2)
|> close()
|> extrude(length = wallThickness)
sketch006 = startSketchOn(sketch005, seg03)
sketch006 = startSketchOn(sketch005, face = seg03)
|> startProfileAt([0, -1 * (backLength - height)], %)
|> xLine(endAbsolute = -exitHeight)
|> yLine(length = -wallsWidth)
@ -127,7 +123,7 @@ sketch006 = startSketchOn(sketch005, seg03)
|> close()
|> extrude(length = wallThickness)
sketch007 = startSketchOn(sketch004, 'END')
sketch007 = startSketchOn(sketch004, face = 'END')
|> startProfileAt([0, 0], %)
|> xLine(endAbsolute = wallThickness)
|> yLine(endAbsolute = height)
@ -136,16 +132,14 @@ sketch007 = startSketchOn(sketch004, 'END')
|> extrude(length = wallsWidth - (2 * wallThickness))
customPlane3 = {
plane = {
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = wallThickness
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 1, y = 0, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = wallThickness
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 1, y = 0, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
sketch008 = startSketchOn(customPlane3)

View File

@ -54,7 +54,7 @@ sketch001 = startSketchOn(XZ)
extrude001 = extrude(sketch001, length = 5)
// Create the second sketch
sketch002 = startSketchOn(extrude001, 'START')
sketch002 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([distanceToInsideEdge, 0], %)
|> angledLine(angle = 180, length = templateThickness, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90, length = templateThickness, tag = $rectangleSegmentB002)
@ -66,7 +66,7 @@ sketch002 = startSketchOn(extrude001, 'START')
extrude002 = extrude(sketch002, length = 13)
// Create the third sketch
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([-distanceToInsideEdge, 0], %)
|> angledLine(angle = 0, length = templateThickness, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = templateThickness, tag = $rectangleSegmentB001)
@ -78,7 +78,7 @@ sketch003 = startSketchOn(extrude001, 'START')
extrude003 = extrude(sketch003, length = 13)
// Create the fourth sketch
sketch004 = startSketchOn(extrude002, 'END')
sketch004 = startSketchOn(extrude002, face = 'END')
|> startProfileAt([-distanceToInsideEdge, 0], %)
|> angledLine(angle = 0, length = distanceToInsideEdge * 2, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = templateThickness, tag = $rectangleSegmentB003)

View File

@ -48,7 +48,7 @@ sketch001 = startSketchOn(XZ)
extrude001 = extrude(sketch001, length = 5)
// Create the second sketch
sketch002 = startSketchOn(extrude001, 'START')
sketch002 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
-slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)
@ -63,7 +63,7 @@ sketch002 = startSketchOn(extrude001, 'START')
extrude002 = extrude(sketch002, length = 7.5)
// Create the third sketch
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -95,7 +95,7 @@ bracketProfile = startSketchOn(XZ)
)
// Cut the bolt pattern in the left base flange
leftFlangeBoltPattern = startSketchOn(bracketProfile, seg04)
leftFlangeBoltPattern = startSketchOn(bracketProfile, face = seg04)
|> circle(center = [-mountingBoltPatternX / 2, overhang], radius = mountingBoltDiameter / 2)
|> patternLinear2d(
%,
@ -106,7 +106,7 @@ leftFlangeBoltPattern = startSketchOn(bracketProfile, seg04)
|> extrude(length = -thickness)
// Cut the bolt pattern in the right base flange
rightFlangeBoltPattern = startSketchOn(bracketProfile, seg06)
rightFlangeBoltPattern = startSketchOn(bracketProfile, face = seg06)
|> circle(center = [mountingBoltPatternX / 2, overhang], radius = mountingBoltDiameter / 2)
|> patternLinear2d(
%,
@ -117,7 +117,7 @@ rightFlangeBoltPattern = startSketchOn(bracketProfile, seg06)
|> extrude(length = -thickness)
// Provision the top flange with holes to mount an object
topFlangeBoltPattern = startSketchOn(bracketProfile, seg05)
topFlangeBoltPattern = startSketchOn(bracketProfile, face = seg05)
|> circle(
center = [
-componentBoltPatternX / 2,
@ -140,6 +140,6 @@ topFlangeBoltPattern = startSketchOn(bracketProfile, seg05)
|> extrude(length = -thickness)
// Place a hole at the center of the component bolt pattern to reduce mass
centeredHole = startSketchOn(bracketProfile, seg05)
centeredHole = startSketchOn(bracketProfile, face = seg05)
|> circle(center = [0, flangeExtrusion / 2], radius = 0.75)
|> extrude(length = -thickness)

View File

@ -19,7 +19,7 @@ boltHead = startSketchOn(XZ)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
// Define the sketch of the hex pattern on the screw head
hexPatternSketch = startSketchOn(boltHead, 'start')
hexPatternSketch = startSketchOn(boltHead, face = 'start')
|> startProfileAt([
boltHexDrive / 2,
boltHexFlatLength / 2
@ -31,7 +31,7 @@ hexPatternSketch = startSketchOn(boltHead, 'start')
|> angledLine(angle = 30, length = boltHexFlatLength)
|> close()
|> extrude(length = -boltHeadLength * 0.75)
boltBody = startSketchOn(boltHead, 'end')
boltBody = startSketchOn(boltHead, face = 'end')
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> fillet(radius = .020, tags = [getOppositeEdge(filletEdge)])

View File

@ -26,7 +26,7 @@ body = startSketchOn(XZ)
)
// Cut out the indentation for the case
caseIndentSketch = startSketchOn(body, 'END')
caseIndentSketch = startSketchOn(body, face = 'END')
|> startProfileAt([
-width / 2 + offset,
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
@ -51,7 +51,7 @@ caseIndentSketch = startSketchOn(body, 'END')
extrude002 = extrude(caseIndentSketch, length = -0.0625)
// Create the pocket for the screen
screenCutout = startSketchOn(extrude002, 'start')
screenCutout = startSketchOn(extrude002, face = 'start')
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|> xLine(length = screenWidth, tag = $seg01)
|> yLine(length = -screenHeight)
@ -61,7 +61,7 @@ screenCutout = startSketchOn(extrude002, 'start')
extrude003 = extrude(screenCutout, length = screenDepth)
// Create the speaker box
speakerBox = startSketchOn(extrude002, 'start')
speakerBox = startSketchOn(extrude002, face = 'start')
|> startProfileAt([-1.25 / 2, -.125], %)
|> xLine(length = speakerBoxWidth)
|> yLine(length = -speakerBoxHeight)

24
rust/Cargo.lock generated
View File

@ -1780,7 +1780,7 @@ dependencies = [
[[package]]
name = "kcl-bumper"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"anyhow",
"clap",
@ -1791,7 +1791,7 @@ dependencies = [
[[package]]
name = "kcl-derive-docs"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"Inflector",
"anyhow",
@ -1810,7 +1810,7 @@ dependencies = [
[[package]]
name = "kcl-directory-test-macro"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"proc-macro2",
"quote",
@ -1819,7 +1819,7 @@ dependencies = [
[[package]]
name = "kcl-language-server"
version = "0.2.58"
version = "0.2.59"
dependencies = [
"anyhow",
"clap",
@ -1840,7 +1840,7 @@ dependencies = [
[[package]]
name = "kcl-language-server-release"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"anyhow",
"clap",
@ -1860,7 +1860,7 @@ dependencies = [
[[package]]
name = "kcl-lib"
version = "0.2.58"
version = "0.2.59"
dependencies = [
"anyhow",
"approx 0.5.1",
@ -1928,7 +1928,7 @@ dependencies = [
[[package]]
name = "kcl-python-bindings"
version = "0.3.58"
version = "0.3.59"
dependencies = [
"anyhow",
"kcl-lib",
@ -1943,7 +1943,7 @@ dependencies = [
[[package]]
name = "kcl-test-server"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"anyhow",
"hyper 0.14.32",
@ -1956,7 +1956,7 @@ dependencies = [
[[package]]
name = "kcl-to-core"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"anyhow",
"async-trait",
@ -1970,7 +1970,7 @@ dependencies = [
[[package]]
name = "kcl-wasm-lib"
version = "0.1.58"
version = "0.1.59"
dependencies = [
"bson",
"console_error_panic_hook",
@ -2033,9 +2033,9 @@ dependencies = [
[[package]]
name = "kittycad-modeling-cmds"
version = "0.2.110"
version = "0.2.112"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfd16800a12a2eaefff53958bd871875c246e669274269f7caefc25d19641ad"
checksum = "08f06b4eb4e98ded7cda21586347baeb8055c4898f609f55f7c544cfed2b229c"
dependencies = [
"anyhow",
"chrono",

View File

@ -36,7 +36,7 @@ dashmap = { version = "6.1.0" }
http = "1"
indexmap = "2.7.0"
kittycad = { version = "0.3.36", default-features = false, features = ["js", "requests"] }
kittycad-modeling-cmds = { version = "0.2.110", features = ["ts-rs", "websocket"] }
kittycad-modeling-cmds = { version = "0.2.112", features = ["ts-rs", "websocket"] }
lazy_static = "1.5.0"
miette = "7.5.0"
pyo3 = { version = "0.24.0" }

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-bumper"
version = "0.1.58"
version = "0.1.59"
edition = "2021"
repository = "https://github.com/KittyCAD/modeling-api"
rust-version = "1.76"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-derive-docs"
description = "A tool for generating documentation from Rust derive macros"
version = "0.1.58"
version = "0.1.59"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,7 +1,7 @@
[package]
name = "kcl-directory-test-macro"
description = "A tool for generating tests from a directory of kcl files"
version = "0.1.58"
version = "0.1.59"
edition = "2021"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"

View File

@ -1,6 +1,6 @@
[package]
name = "kcl-language-server-release"
version = "0.1.58"
version = "0.1.59"
edition = "2021"
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
publish = false

View File

@ -2,7 +2,7 @@
name = "kcl-language-server"
description = "A language server for KCL."
authors = ["KittyCAD Inc <kcl@kittycad.io>"]
version = "0.2.58"
version = "0.2.59"
edition = "2021"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -9,7 +9,10 @@ export async function createClient(
serverOptions: lc.ServerOptions
): Promise<lc.LanguageClient> {
const clientOptions: lc.LanguageClientOptions = {
documentSelector: [{ scheme: 'file', language: 'kcl' }],
documentSelector: [
{ scheme: 'file', language: 'kcl' },
{ scheme: 'untitled', language: 'kcl' },
],
initializationOptions,
traceOutputChannel,
outputChannel,

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