Skip to content

Commit

Permalink
Make tag last optional param everywhere (#1739)
Browse files Browse the repository at this point in the history
* Make tag last optional param

* Update all test assertions with correct tag format

* Format ts

* Some progress on tests and code mods

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: ubuntu)

* More sketch fixes

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: ubuntu)

* Only 1 test left

* Clean up console.log

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: ubuntu)

* Fix last ts test

* Clean up fmt

* Fix clippy too

* Update docs and fix small oversight on angled lines

* Fix more rust tests

* Make typescript happy

* Fmt

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <[email protected]>
  • Loading branch information
3 people committed Mar 15, 2024
1 parent 4987965 commit 8168702
Show file tree
Hide file tree
Showing 60 changed files with 906 additions and 1,511 deletions.
2 changes: 1 addition & 1 deletion docs/kcl/angleToMatchLengthX.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angleToMatchLengthX(segment_name: string, to: number, sketch_group: SketchGroup)
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [1, 3.82], tag: 'seg01' }, %)
|> line([1, 3.82], %, 'seg01')
|> angledLineToX([
-angleToMatchLengthX('seg01', 10, %),
5
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/angleToMatchLengthY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angleToMatchLengthY(segment_name: string, to: number, sketch_group: SketchGroup)
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [1, 3.82], tag: 'seg01' }, %)
|> line([1, 3.82], %, 'seg01')
|> angledLineToX([
-angleToMatchLengthY('seg01', 10, %),
5
Expand Down
7 changes: 3 additions & 4 deletions docs/kcl/angledLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Draw an angled line.


```js
angledLine(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
angledLine(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> angledLine({ angle: 45, length: 10, tag: "edge1" }, %)
|> angledLine({ angle: 45, length: 10 }, %, "edge1")
|> line([10, 10], %)
|> line([0, 10], %)
|> close(%, "edge2")
Expand All @@ -33,8 +33,6 @@ startSketchOn('XY')
angle: number,
// The length of the line.
length: number,
// The tag.
tag: string,
} |
[number, number]
```
Expand Down Expand Up @@ -202,6 +200,7 @@ startSketchOn('XY')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
7 changes: 3 additions & 4 deletions docs/kcl/angledLineOfXLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Draw an angled line of a given x length.


```js
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle: 45, length: 10, tag: "edge1" }, %)
|> angledLineOfXLength({ angle: 45, length: 10 }, %, "edge1")
|> line([10, 10], %)
|> line([0, 10], %)
|> close(%, "edge2")
Expand All @@ -33,8 +33,6 @@ startSketchOn('XZ')
angle: number,
// The length of the line.
length: number,
// The tag.
tag: string,
} |
[number, number]
```
Expand Down Expand Up @@ -202,6 +200,7 @@ startSketchOn('XZ')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
7 changes: 3 additions & 4 deletions docs/kcl/angledLineOfYLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Draw an angled line of a given y length.


```js
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup) -> SketchGroup
angledLineOfYLength(data: AngledLineData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
startSketchOn('YZ')
|> startProfileAt([0, 0], %)
|> angledLineOfYLength({ angle: 45, length: 10, tag: "edge1" }, %)
|> angledLineOfYLength({ angle: 45, length: 10 }, %, "edge1")
|> line([10, 10], %)
|> line([0, 10], %)
|> close(%, "edge2")
Expand All @@ -34,8 +34,6 @@ startSketchOn('YZ')
angle: number,
// The length of the line.
length: number,
// The tag.
tag: string,
} |
[number, number]
```
Expand Down Expand Up @@ -203,6 +201,7 @@ startSketchOn('YZ')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
12 changes: 5 additions & 7 deletions docs/kcl/angledLineThatIntersects.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ Draw an angled line that intersects with a given line.


```js
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup) -> SketchGroup
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> lineTo({ to: [2, 2], tag: "yo" }, %)
|> lineTo([2, 2], %, "yo")
|> lineTo([3, 1], %)
|> angledLineThatIntersects({
angle: 180,
intersectTag: 'yo',
offset: 12,
tag: "yo2"
}, %)
offset: 12
}, %, "yo2")
|> line([4, 0], %)
|> close(%, "yo3")
|> extrude(10, %)
Expand All @@ -41,8 +40,6 @@ const part001 = startSketchOn('XY')
intersectTag: string,
// The offset from the intersecting line.
offset: number,
// The tag.
tag: string,
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
Expand Down Expand Up @@ -209,6 +206,7 @@ const part001 = startSketchOn('XY')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
10 changes: 4 additions & 6 deletions docs/kcl/angledLineToX.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Draw an angled line to a given x coordinate.


```js
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
angledLineToX(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> angledLineToX({ angle: 45, to: 10, tag: "edge1" }, %)
|> angledLineToX({ angle: 45, to: 10 }, %, "edge1")
|> line([10, 10], %)
|> line([0, 10], %)
|> close(%, "edge2")
Expand All @@ -32,12 +32,9 @@ startSketchOn('XY')
{
// The angle of the line.
angle: number,
// The tag.
tag: string,
// The point to draw to.
to: number,
} |
[number, number]
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
Expand Down Expand Up @@ -203,6 +200,7 @@ startSketchOn('XY')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
10 changes: 4 additions & 6 deletions docs/kcl/angledLineToY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Draw an angled line to a given y coordinate.


```js
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup) -> SketchGroup
angledLineToY(data: AngledLineToData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples

```js
startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> angledLineToY({ angle: 45, to: 10, tag: "edge1" }, %)
|> angledLineToY({ angle: 45, to: 10 }, %, "edge1")
|> line([10, 10], %)
|> line([0, 10], %)
|> close(%, "edge2")
Expand All @@ -31,12 +31,9 @@ startSketchOn('XY')
{
// The angle of the line.
angle: number,
// The tag.
tag: string,
// The point to draw to.
to: number,
} |
[number, number]
}
```
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
```js
Expand Down Expand Up @@ -202,6 +199,7 @@ startSketchOn('XY')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
12 changes: 4 additions & 8 deletions docs/kcl/arc.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Draw an arc.


```js
arc(data: ArcData, sketch_group: SketchGroup) -> SketchGroup
arc(data: ArcData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples
Expand All @@ -20,9 +20,8 @@ startSketchOn('-YZ')
|> arc({
angle_start: 0,
angle_end: 360,
radius: 10,
tag: "edge1"
}, %)
radius: 10
}, %, "edge1")
|> extrude(10, %)
```

Expand All @@ -37,16 +36,12 @@ startSketchOn('-YZ')
angle_start: number,
// The radius.
radius: number,
// The tag.
tag: string,
} |
{
// The center.
center: [number, number],
// The radius.
radius: number,
// The tag.
tag: string,
// The to point.
to: [number, number],
}
Expand Down Expand Up @@ -215,6 +210,7 @@ startSketchOn('-YZ')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
10 changes: 4 additions & 6 deletions docs/kcl/bezierCurve.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Draw a bezier curve.


```js
bezierCurve(data: BezierData, sketch_group: SketchGroup) -> SketchGroup
bezierCurve(data: BezierData, sketch_group: SketchGroup, tag?: String) -> SketchGroup
```

### Examples
Expand All @@ -20,9 +20,8 @@ startSketchOn('XY')
|> bezierCurve({
to: [10, 10],
control1: [5, 0],
control2: [5, 10],
tag: "edge1"
}, %)
control2: [5, 10]
}, %, "edge1")
|> close(%)
|> extrude(10, %)
```
Expand All @@ -36,8 +35,6 @@ startSketchOn('XY')
control1: [number, number],
// The second control point.
control2: [number, number],
// The tag.
tag: string,
// The to point.
to: [number, number],
}
Expand Down Expand Up @@ -206,6 +203,7 @@ startSketchOn('XY')
},
}
```
* `tag`: `String` (OPTIONAL)

### Returns

Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/fillet.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ fillet(data: FilletData, extrude_group: ExtrudeGroup) -> ExtrudeGroup
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %)
|> line([0, 10], %, "thing")
|> line([10, 0], %)
|> line({ to: [0, -10], tag: "thing2" }, %)
|> line([0, -10], %, "thing2")
|> close(%)
|> extrude(10, %)
|> fillet({ radius: 2, tags: ["thing", "thing2"] }, %)
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/getExtrudeWallTransform.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const box = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line([0, 10], %)
|> line([10, 0], %)
|> line({ to: [0, -10], tag: "surface" }, %)
|> line([0, -10], %, "surface")
|> close(%)
|> extrude(5, %)

Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/getNextAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ getNextAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %)
|> line({ to: [10, 0], tag: "thing1" }, %)
|> line({ to: [0, -10], tag: "thing2" }, %)
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> extrude(10, %)
|> fillet({
Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/getOppositeEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ getOppositeEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %)
|> line([0, 10], %, "thing")
|> line([10, 0], %)
|> line({ to: [0, -10], tag: "thing2" }, %)
|> line([0, -10], %, "thing2")
|> close(%)
|> extrude(10, %)
|> fillet({
Expand Down
6 changes: 3 additions & 3 deletions docs/kcl/getPreviousAdjacentEdge.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ getPreviousAdjacentEdge(tag: String, extrude_group: ExtrudeGroup) -> Uuid
```js
const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line({ to: [0, 10], tag: "thing" }, %)
|> line({ to: [10, 0], tag: "thing1" }, %)
|> line({ to: [0, -10], tag: "thing2" }, %)
|> line([0, 10], %, "thing")
|> line([10, 0], %, "thing1")
|> line([0, -10], %, "thing2")
|> close(%)
|> extrude(10, %)
|> fillet({
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/lastSegX.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lastSegX(sketch_group: SketchGroup) -> number
```js
startSketchOn("YZ")
|> startProfileAt([0, 0], %)
|> line({ to: [5, 0], tag: "thing" }, %)
|> line([5, 0], %, "thing")
|> line([5, 5], %)
|> line([0, lastSegX(%)], %)
|> close(%)
Expand Down
Loading

0 comments on commit 8168702

Please sign in to comment.