Kwargs: startProfileAt (#6424)

Previous:

```
startProfileAt([x, y], %)
startProfileAt([x, y], sketch001)
```

New:
```
startProfile(%, at = [x, y])
startProfile(sketch001, at = [x, y])
```
This commit is contained in:
Adam Chalmers
2025-04-25 16:01:35 -05:00
committed by GitHub
parent 9547e95e9d
commit ffbe20b586
573 changed files with 19805 additions and 16552 deletions

View File

@ -34,7 +34,7 @@ abs(num: number): number
myAngle = -120
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [8, 0])
|> angledLine(angle = abs(myAngle), length = 5)
|> line(end = [-5, 0])

View File

@ -32,7 +32,7 @@ acos(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = toDegrees(acos(0.5)), length = 10)
|> line(end = [5, 0])
|> line(endAbsolute = [12, 0])

View File

@ -34,7 +34,7 @@ angleToMatchLengthX(
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [2, 5], tag = $seg01)
|> angledLine(angle = -angleToMatchLengthX(seg01, 7, %), endAbsoluteX = 10)
|> close()

View File

@ -34,7 +34,7 @@ angleToMatchLengthY(
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [1, 2], tag = $seg01)
|> angledLine(angle = angleToMatchLengthY(seg01, 15, %), length = 5)
|> yLine(endAbsolute = 0)

View File

@ -44,7 +44,7 @@ angledLine(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> yLine(endAbsolute = 15)
|> angledLine(angle = 30, length = 15)
|> line(end = [8, -10])

View File

@ -38,7 +38,7 @@ angledLineThatIntersects(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [5, 10])
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|> line(endAbsolute = [0, 20])

View File

@ -37,7 +37,7 @@ appearance(
```js
// Add color to an extruded solid.
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [10, 0])
|> line(endAbsolute = [0, 10])
|> line(endAbsolute = [-10, 0])
@ -64,7 +64,7 @@ sketch001 = startSketchOn(XY)
// Add color to different solids.
fn cube(center) {
return startSketchOn(XY)
|> startProfileAt([center[0] - 10, center[1] - 10], %)
|> startProfile(at = [center[0] - 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
@ -96,7 +96,7 @@ appearance(
// You can set the appearance before or after you shell it will yield the same result.
// This example shows setting the appearance _after_ the shell.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -113,7 +113,7 @@ shell(firstSketch, faces = [END], thickness = 0.25)
// You can set the appearance before or after you shell it will yield the same result.
// This example shows setting the appearance _before_ the shell.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -130,7 +130,7 @@ shell(firstSketch, faces = [END], thickness = 0.25)
// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.
// This example shows _before_ the pattern.
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 2])
|> line(end = [3, 1])
|> line(end = [0, -4])
@ -147,7 +147,7 @@ example = extrude(exampleSketch, length = 1)
// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.
// This example shows _after_ the pattern.
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 2])
|> line(end = [3, 1])
|> line(end = [0, -4])
@ -163,7 +163,7 @@ example = extrude(exampleSketch, length = 1)
```js
// Color the result of a 2D pattern that was extruded.
exampleSketch = startSketchOn(XZ)
|> startProfileAt([.5, 25], %)
|> startProfile(at = [.5, 25])
|> line(end = [0, 5])
|> line(end = [-1, 0])
|> line(end = [0, -5])
@ -186,7 +186,7 @@ example = extrude(exampleSketch, length = 1)
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])

View File

@ -44,7 +44,7 @@ arc(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> arc(angleStart = 0, angleEnd = 280, radius = 16)
|> close()
@ -55,7 +55,7 @@ example = extrude(exampleSketch, length = 10)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> arc(endAbsolute = [10, 0], interiorAbsolute = [5, 5])
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -32,7 +32,7 @@ asin(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = toDegrees(asin(0.5)), length = 20)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -32,7 +32,7 @@ atan(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = toDegrees(atan(1.25)), length = 20)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -36,7 +36,7 @@ atan2(
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = toDegrees(atan2(y = 1.25, x = 2)), length = 20)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -38,7 +38,7 @@ bezierCurve(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 10])
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|> line(endAbsolute = [10, 0])

View File

@ -32,7 +32,7 @@ ceil(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [ceil(7.02986), 0])
|> yLine(endAbsolute = 0)

View File

@ -42,7 +42,7 @@ thickness = 1
chamferLength = 2
mountingPlateSketch = startSketchOn(XY)
|> startProfileAt([-width / 2, -length / 2], %)
|> startProfile(at = [-width / 2, -length / 2])
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
@ -66,7 +66,7 @@ mountingPlate = extrude(mountingPlateSketch, length = thickness)
// Sketch on the face of a chamfer.
fn cube(pos, scale) {
sg = startSketchOn(XY)
|> startProfileAt(pos, %)
|> startProfile(at = pos)
|> line(end = [0, scale])
|> line(end = [scale, 0])
|> line(end = [0, -scale])
@ -81,7 +81,7 @@ part001 = cube([0, 0], 20)
|> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
sketch001 = startSketchOn(part001, face = chamfer1)
|> startProfileAt([10, 10], %)
|> startProfile(at = [10, 10])
|> line(end = [2, 0])
|> line(end = [0, 2])
|> line(end = [-2, 0])

View File

@ -33,7 +33,7 @@ clone(geometry: GeometryWithImportedGeometry): GeometryWithImportedGeometry
```js
// Clone a basic sketch and move it and extrude it.
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> line(end = [-10, 0])
@ -52,7 +52,7 @@ clonedSketch = clone(exampleSketch)
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> line(end = [-10, 0])
@ -70,7 +70,7 @@ clonedPart = clone(myPart)
sketch001 = startSketchOn(XY)
|> startProfileAt([-10, 10], %)
|> startProfile(at = [-10, 10])
|> xLine(length = 20)
|> yLine(length = -20)
|> xLine(length = -20)
@ -90,7 +90,7 @@ loft([sketch001, sketch002])
sketch001 = startSketchOn(XY)
|> startProfileAt([-10, 10], %)
|> startProfile(at = [-10, 10])
|> xLine(length = 20)
|> yLine(length = -20)
|> xLine(length = -20, tag = $filletTag)
@ -109,7 +109,7 @@ sketch002 = clone(sketch001)
sketch001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10], tag = $sketchingFace)
|> line(end = [-10, 0])
@ -120,7 +120,7 @@ sketch002 = clone(sketch001)
|> extrude(length = 5)
startSketchOn(sketch002, face = sketchingFace)
|> startProfileAt([1, 1], %)
|> startProfile(at = [1, 1])
|> line(end = [8, 0])
|> line(end = [0, 8])
|> line(end = [-8, 0])
@ -140,7 +140,7 @@ thickness = 1
filletRadius = 2
mountingPlateSketch = startSketchOn(XY)
|> startProfileAt([-width / 2, -length / 2], %)
|> startProfile(at = [-width / 2, -length / 2])
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
@ -205,7 +205,7 @@ sketch002 = clone(sketch001)
exampleSketch = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -228,7 +228,7 @@ example001 = revolve(
// Sketch on the cloned face.
// exampleSketch002 = startSketchOn(example002, face = end01)
// |> startProfileAt([4.5, -5], %)
// |> startProfile(at = [4.5, -5])
// |> line(end = [0, 5])
// |> line(end = [5, 0])
// |> line(end = [0, -5])

View File

@ -32,7 +32,7 @@ close(
```js
startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 10])
|> line(end = [10, 0])
|> close()
@ -43,7 +43,7 @@ startSketchOn(XZ)
```js
exampleSketch = startSketchOn(-XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> close()

View File

@ -16,7 +16,7 @@ std::math::E: number = 2.71828182845904523536028747135266250_
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 30,
length = 2 * E ^ 2,

View File

@ -16,7 +16,7 @@ std::math::TAU: number = 6.28318530717958647692528676655900577_
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = 10 * TAU,

View File

@ -29,7 +29,7 @@ e(): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 30, length = 2 * e() ^ 2)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -40,7 +40,7 @@ extrude(
```js
example = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> arc(angleStart = 120, angleEnd = 0, radius = 5)
|> line(end = [5, 0])
@ -55,7 +55,7 @@ example = startSketchOn(XZ)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([-10, 0], %)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])
@ -71,7 +71,7 @@ example = extrude(exampleSketch, length = 10)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([-10, 0], %)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])
@ -87,7 +87,7 @@ example = extrude(exampleSketch, length = 20, symmetric = true)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([-10, 0], %)
|> startProfile(at = [-10, 0])
|> arc(angleStart = 120, angleEnd = -60, radius = 5)
|> line(end = [10, 0])
|> line(end = [5, 0])

View File

@ -43,7 +43,7 @@ thickness = 1
filletRadius = 2
mountingPlateSketch = startSketchOn(XY)
|> startProfileAt([-width / 2, -length / 2], %)
|> startProfile(at = [-width / 2, -length / 2])
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
@ -70,7 +70,7 @@ thickness = 1
filletRadius = 1
mountingPlateSketch = startSketchOn(XY)
|> startProfileAt([-width / 2, -length / 2], %)
|> startProfile(at = [-width / 2, -length / 2])
|> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)

View File

@ -32,7 +32,7 @@ floor(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [floor(7.02986), 0])
|> yLine(endAbsolute = 0)

View File

@ -32,7 +32,7 @@ getCommonEdge(faces: [TagIdentifier]): Uuid
scale = 20
part001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, scale])
|> line(end = [scale, 0])
|> line(end = [0, -scale])

View File

@ -28,7 +28,7 @@ getNextAdjacentEdge(edge: TagIdentifier): Uuid
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)

View File

@ -28,7 +28,7 @@ getOppositeEdge(edge: TagIdentifier): Uuid
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)

View File

@ -28,7 +28,7 @@ getPreviousAdjacentEdge(edge: TagIdentifier): Uuid
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> angledLine(angle = 60, length = 10)
|> angledLine(angle = 120, length = 10)

View File

@ -32,7 +32,7 @@ hole(
```js
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 5])
|> line(end = [5, 0])
|> line(end = [0, -5])
@ -48,7 +48,7 @@ example = extrude(exampleSketch, length = 1)
```js
fn squareHoleSketch() {
squareSketch = startSketchOn(-XZ)
|> startProfileAt([-1, -1], %)
|> startProfile(at = [-1, -1])
|> line(end = [2, 0])
|> line(end = [0, 2])
|> line(end = [-2, 0])

View File

@ -33,7 +33,7 @@ hollow(
```js
// Hollow a basic sketch.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -47,7 +47,7 @@ firstSketch = startSketchOn(XY)
```js
// Hollow a basic sketch.
firstSketch = startSketchOn(-XZ)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -62,7 +62,7 @@ firstSketch = startSketchOn(-XZ)
// Hollow a sketch on face object.
size = 100
case = startSketchOn(-XZ)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])

View File

@ -103,7 +103,7 @@ layout: manual
* [`segStartY`](kcl/segStartY)
* [`shell`](kcl/shell)
* [`sqrt`](kcl/sqrt)
* [`startProfileAt`](kcl/startProfileAt)
* [`startProfile`](kcl/startProfile)
* [`startSketchOn`](kcl/startSketchOn)
* [`subtract`](kcl/subtract)
* [`sweep`](kcl/sweep)

View File

@ -36,7 +36,7 @@ intersect(
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
@ -61,7 +61,7 @@ intersectedPart = intersect([part001, part002])
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])

View File

@ -42,7 +42,7 @@ involuteCircular(
a = 10
b = 14
startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> involuteCircular(startRadius = a, endRadius = b, angle = 60)
|> involuteCircular(
startRadius = a,

View File

@ -28,7 +28,7 @@ lastSegX(sketch: Sketch): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [5, 0])
|> line(end = [20, 5])
|> line(end = [lastSegX(%), 0])

View File

@ -28,7 +28,7 @@ lastSegY(sketch: Sketch): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [5, 0])
|> line(end = [20, 5])
|> line(end = [0, lastSegY(%)])

View File

@ -36,7 +36,7 @@ line(
```js
triangle = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
// The END argument means it ends at exactly [10, 0].
// This is an absolute measurement, it is NOT relative to
// the start of the sketch.
@ -47,7 +47,7 @@ triangle = startSketchOn(XZ)
|> extrude(length = 5)
box = startSketchOn(XZ)
|> startProfileAt([10, 10], %)
|> startProfile(at = [10, 10])
// The 'to' argument means move the pen this much.
// So, [10, 0] is a relative distance away from the current point.
|> line(end = [10, 0])

View File

@ -32,7 +32,7 @@ ln(num: number): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [ln(100), 15])
|> line(end = [5, -6])
|> line(end = [-10, -10])

View File

@ -43,7 +43,7 @@ loft(
```js
// Loft a square and a triangle.
squareSketch = startSketchOn(XY)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -51,7 +51,7 @@ squareSketch = startSketchOn(XY)
|> close()
triangleSketch = startSketchOn(offsetPlane(XY, offset = 75))
|> startProfileAt([0, 125], %)
|> startProfile(at = [0, 125])
|> line(end = [-15, -30])
|> line(end = [30, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -65,7 +65,7 @@ loft([squareSketch, triangleSketch])
```js
// Loft a square, a circle, and another circle.
squareSketch = startSketchOn(XY)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -90,7 +90,7 @@ loft([
```js
// Loft a square, a circle, and another circle with options.
squareSketch = startSketchOn(XY)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])

View File

@ -36,7 +36,7 @@ log(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [log(100, 5), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])

View File

@ -32,7 +32,7 @@ log10(num: number): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [log10(100), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])

View File

@ -32,7 +32,7 @@ log2(num: number): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [log2(100), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])

View File

@ -32,7 +32,7 @@ max(args: [number]): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 70, length = max(15, 31, 4, 13, 22))
|> line(end = [20, 0])
|> close()

View File

@ -32,7 +32,7 @@ min(args: [number]): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 70, length = min(15, 31, 4, 13, 22))
|> line(end = [20, 0])
|> close()

View File

@ -73,7 +73,7 @@ There are two common patterns for reusing geometry:
```kcl
fn cube(center) {
return startSketchOn(XY)
|> startProfileAt([center[0] - 10, center[1] - 10], %)
|> startProfile(at = [center[0] - 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> line(endAbsolute = [center[0] - 10, center[1] + 10])

121
docs/kcl/offsetPlane.md Normal file

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@ patternCircular2d(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([.5, 25], %)
|> startProfile(at = [.5, 25])
|> line(end = [0, 5])
|> line(end = [-1, 0])
|> line(end = [0, -5])

View File

@ -38,7 +38,7 @@ patternLinear3d(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 2])
|> line(end = [3, 1])
|> line(end = [0, -4])
@ -54,7 +54,7 @@ example = extrude(exampleSketch, length = 1)
// Pattern a whole sketch on face.
size = 100
case = startSketchOn(XY)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])
@ -85,7 +85,7 @@ patternLinear3d(
// Pattern an object on a face.
size = 100
case = startSketchOn(XY)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])

View File

@ -102,7 +102,7 @@ fn cube(length, center) {
p3 = [l + x, -l + y]
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> startProfile(at = p0)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)
@ -140,7 +140,7 @@ fn cube(length, center) {
p3 = [l + x, -l + y]
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> startProfile(at = p0)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)
@ -204,7 +204,7 @@ fn transform(i) {
]
}
startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> polygon(
radius = 10,
numSides = 4,

View File

@ -36,7 +36,7 @@ pow(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 50, length = pow(5, 2))
|> yLine(endAbsolute = 0)
|> close()

View File

@ -28,7 +28,7 @@ profileStart(profile: Sketch): [number]
```js
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> startProfile(at = [5, 2])
|> angledLine(angle = 120, length = 50, tag = $seg01)
|> angledLine(angle = segAng(seg01) + 120, length = 50)
|> line(end = profileStart(%))

View File

@ -28,7 +28,7 @@ profileStartX(profile: Sketch): number
```js
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> startProfile(at = [5, 2])
|> angledLine(angle = -26.6, length = 50)
|> angledLine(angle = 90, length = 50)
|> angledLine(angle = 30, endAbsoluteX = profileStartX(%))

View File

@ -28,7 +28,7 @@ profileStartY(profile: Sketch): number
```js
sketch001 = startSketchOn(XY)
|> startProfileAt([5, 2], %)
|> startProfile(at = [5, 2])
|> angledLine(angle = -60, length = 14)
|> angledLine(angle = 30, endAbsoluteY = profileStartY(%))
```

View File

@ -93,7 +93,7 @@ fn decagon(radius) {
// Start the decagon sketch at this point.
startOfDecagonSketch = startSketchOn(XY)
|> startProfileAt([cos(0) * radius, sin(0) * radius], %)
|> startProfile(at = [cos(0) * radius, sin(0) * radius])
// Use a `reduce` to draw the remaining decagon sides.
// For each number in the array 1..10, run the given function,
@ -112,7 +112,7 @@ fn decagon(radius) {
fn decagon(radius):
stepAngle = (1/10) * TAU
plane = startSketchOn('XY')
startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)
startOfDecagonSketch = startProfile(plane, at = [(cos(0)*radius), (sin(0) * radius)])
// Here's the reduce part.
partialDecagon = startOfDecagonSketch

View File

@ -63,7 +63,7 @@ rotate(
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -88,7 +88,7 @@ sweepSketch = startSketchOn(XY)
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -113,7 +113,7 @@ sweepSketch = startSketchOn(XY)
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -150,7 +150,7 @@ cube
sketch001 = startSketchOn(XY)
rectangleSketch = startProfileAt([-200, 23.86], sketch001)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
@ -160,7 +160,7 @@ rectangleSketch = startProfileAt([-200, 23.86], sketch001)
circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfileAt([0, 0], sketch002)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)
@ -178,7 +178,7 @@ rotate(parts, axis = [0, 0, 1.0], angle = 90)
sketch001 = startSketchOn(XY)
fn square() {
return startProfileAt([-10, 10], sketch001)
return startProfile(sketch001, at = [-10, 10])
|> xLine(length = 20)
|> yLine(length = -20)
|> xLine(length = -20)

View File

@ -32,7 +32,7 @@ round(num: number): number
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [round(7.02986), 0])
|> yLine(endAbsolute = 0)

View File

@ -47,7 +47,7 @@ scale(
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -84,7 +84,7 @@ cube
sketch001 = startSketchOn(XY)
rectangleSketch = startProfileAt([-200, 23.86], sketch001)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
@ -94,7 +94,7 @@ rectangleSketch = startProfileAt([-200, 23.86], sketch001)
circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfileAt([0, 0], sketch002)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)

View File

@ -28,7 +28,7 @@ segAng(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [5, 10], tag = $seg01)
|> line(end = [-10, 0])

View File

@ -29,7 +29,7 @@ segEnd(tag: TagIdentifier): [number]
```js
w = 15
cube = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [w, 0], tag = $line1)
|> line(end = [0, w], tag = $line2)
|> line(end = [-w, 0], tag = $line3)
@ -39,7 +39,7 @@ cube = startSketchOn(XY)
fn cylinder(radius, tag) {
return startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> circle(radius = radius, center = segEnd(tag))
|> extrude(length = radius)
}

View File

@ -28,7 +28,7 @@ segEndX(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [20, 0], tag = $thing)
|> line(end = [0, 5])
|> line(end = [segEndX(thing), 0])

View File

@ -28,7 +28,7 @@ segEndY(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [20, 0])
|> line(end = [0, 3], tag = $thing)
|> line(end = [-10, 0])

View File

@ -28,7 +28,7 @@ segLen(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60, length = 10, tag = $thing)
|> tangentialArc(angle = -120, radius = 5)
|> angledLine(angle = -60, length = segLen(thing))

View File

@ -29,7 +29,7 @@ segStart(tag: TagIdentifier): [number]
```js
w = 15
cube = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [w, 0], tag = $line1)
|> line(end = [0, w], tag = $line2)
|> line(end = [-w, 0], tag = $line3)
@ -39,7 +39,7 @@ cube = startSketchOn(XY)
fn cylinder(radius, tag) {
return startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> circle(radius = radius, center = segStart(tag))
|> extrude(length = radius)
}

View File

@ -28,7 +28,7 @@ segStartX(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [20, 0], tag = $thing)
|> line(end = [0, 5])
|> line(end = [20 - segStartX(thing), 0])

View File

@ -28,7 +28,7 @@ segStartY(tag: TagIdentifier): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [20, 0])
|> line(end = [0, 3], tag = $thing)
|> line(end = [-10, 0])

View File

@ -35,7 +35,7 @@ shell(
```js
// Remove the end face for the extrusion.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -51,7 +51,7 @@ shell(firstSketch, faces = [END], thickness = 0.25)
```js
// Remove the start face for the extrusion.
firstSketch = startSketchOn(-XZ)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -67,7 +67,7 @@ shell(firstSketch, faces = [START], thickness = 0.25)
```js
// Remove a tagged face and the end face for the extrusion.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0], tag = $myTag)
@ -83,7 +83,7 @@ shell(firstSketch, faces = [myTag], thickness = 0.25)
```js
// Remove multiple faces at once.
firstSketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0], tag = $myTag)
@ -100,7 +100,7 @@ shell(firstSketch, faces = [myTag, END], thickness = 0.25)
// Shell a sketch on face.
size = 100
case = startSketchOn(-XZ)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])
@ -125,7 +125,7 @@ shell(case, faces = [START], thickness = 5)
// Shell a sketch on face object on the end face.
size = 100
case = startSketchOn(XY)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])
@ -153,7 +153,7 @@ shell(thing1, faces = [END], thickness = 5)
size = 100
case = startSketchOn(XY)
|> startProfileAt([-size, -size], %)
|> startProfile(at = [-size, -size])
|> line(end = [2 * size, 0])
|> line(end = [0, 2 * size])
|> tangentialArc(endAbsolute = [-size, size])

View File

@ -32,7 +32,7 @@ sqrt(num: number): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 50, length = sqrt(2500))
|> yLine(endAbsolute = 0)
|> close()

74
docs/kcl/startProfile.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@ startSketchOn(
```js
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> line(end = [-10, 0])
@ -49,7 +49,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5)
exampleSketch002 = startSketchOn(example, face = END)
|> startProfileAt([1, 1], %)
|> startProfile(at = [1, 1])
|> line(end = [8, 0])
|> line(end = [0, 8])
|> line(end = [-8, 0])
@ -58,7 +58,7 @@ exampleSketch002 = startSketchOn(example, face = END)
example002 = extrude(exampleSketch002, length = 5)
exampleSketch003 = startSketchOn(example002, face = END)
|> startProfileAt([2, 2], %)
|> startProfile(at = [2, 2])
|> line(end = [6, 0])
|> line(end = [0, 6])
|> line(end = [-6, 0])
@ -74,7 +74,7 @@ example003 = extrude(exampleSketch003, length = 5)
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> line(end = [-10, 0])
@ -83,7 +83,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5, tagEnd = $end01)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([1, 1], %)
|> startProfile(at = [1, 1])
|> line(end = [8, 0])
|> line(end = [0, 8])
|> line(end = [-8, 0])
@ -92,7 +92,7 @@ exampleSketch002 = startSketchOn(example, face = end01)
example002 = extrude(exampleSketch002, length = 5, tagEnd = $end02)
exampleSketch003 = startSketchOn(example002, face = end02)
|> startProfileAt([2, 2], %)
|> startProfile(at = [2, 2])
|> line(end = [6, 0])
|> line(end = [0, 6])
|> line(end = [-6, 0])
@ -105,7 +105,7 @@ example003 = extrude(exampleSketch003, length = 5)
```js
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10], tag = $sketchingFace)
|> line(end = [-10, 0])
@ -114,7 +114,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 10)
exampleSketch002 = startSketchOn(example, face = sketchingFace)
|> startProfileAt([1, 1], %)
|> startProfile(at = [1, 1])
|> line(end = [8, 0])
|> line(end = [0, 8])
|> line(end = [-8, 0])
@ -123,7 +123,7 @@ exampleSketch002 = startSketchOn(example, face = sketchingFace)
example002 = extrude(exampleSketch002, length = 10)
exampleSketch003 = startSketchOn(example002, face = sketchingFace002)
|> startProfileAt([-8, 12], %)
|> startProfile(at = [-8, 12])
|> line(end = [0, 6])
|> line(end = [6, 0])
|> line(end = [0, -6])
@ -136,7 +136,7 @@ example003 = extrude(exampleSketch003, length = 5)
```js
exampleSketch = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -149,7 +149,7 @@ exampleSketch = startSketchOn(XY)
example = revolve(exampleSketch, axis = Y, angle = 180)
exampleSketch002 = startSketchOn(example, face = END)
|> startProfileAt([4.5, -5], %)
|> startProfile(at = [4.5, -5])
|> line(end = [0, 5])
|> line(end = [5, 0])
|> line(end = [0, -5])
@ -165,7 +165,7 @@ example002 = extrude(exampleSketch002, length = 5)
exampleSketch = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -183,7 +183,7 @@ example = revolve(
)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([4.5, -5], %)
|> startProfile(at = [4.5, -5])
|> line(end = [0, 5])
|> line(end = [5, 0])
|> line(end = [0, -5])
@ -201,7 +201,7 @@ a1 = startSketchOn({
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
})
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [100.0, 0])
|> yLine(length = -100.0)
|> xLine(length = -100.0)

View File

@ -62,7 +62,7 @@ springSketch = startSketchOn(YZ)
```js
// Create a helix around an edge.
helper001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 10], tag = $edge001)
helixPath = helix(

View File

@ -28,7 +28,7 @@ cos(@num: number(Angle)): number(_)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 30,
length = 3 / cos(30deg),

View File

@ -33,7 +33,7 @@ polar(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|> line(end = [0, 5])
|> line(end = [segEndX(thing), 0])

View File

@ -28,7 +28,7 @@ sin(@num: number(Angle)): number(_)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = 15 / sin(135deg),

View File

@ -28,7 +28,7 @@ tan(@num: number(Angle)): number(_)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = 50 * tan((1/2): number(rad)),

View File

@ -34,7 +34,7 @@ offsetPlane(
```js
// Loft a square and a circle on the `XY` plane using offset.
squareSketch = startSketchOn(XY)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -52,7 +52,7 @@ loft([squareSketch, circleSketch])
```js
// Loft a square and a circle on the `XZ` plane using offset.
squareSketch = startSketchOn(XZ)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -70,7 +70,7 @@ loft([squareSketch, circleSketch])
```js
// Loft a square and a circle on the `YZ` plane using offset.
squareSketch = startSketchOn(YZ)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -88,7 +88,7 @@ loft([squareSketch, circleSketch])
```js
// Loft a square and a circle on the `-XZ` plane using offset.
squareSketch = startSketchOn(-XZ)
|> startProfileAt([-100, 200], %)
|> startProfile(at = [-100, 200])
|> line(end = [200, 0])
|> line(end = [0, -200])
|> line(end = [-200, 0])
@ -106,12 +106,12 @@ loft([squareSketch, circleSketch])
```js
// A circle on the XY plane
startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> circle( radius = 10, center = [0, 0] )
// Triangle on the plane 4 units above
startSketchOn(offsetPlane(XY, offset = 4))
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0])
|> line(end = [0, 10])
|> close()

View File

@ -53,7 +53,7 @@ revolve(
```js
part001 = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -81,7 +81,7 @@ sketch001 = startSketchOn(XY)
```js
part001 = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -97,7 +97,7 @@ part001 = startSketchOn(XY)
```js
part001 = startSketchOn(XY)
|> startProfileAt([4, 12], %)
|> startProfile(at = [4, 12])
|> line(end = [2, 0])
|> line(end = [0, -6])
|> line(end = [4, -6])
@ -109,7 +109,7 @@ part001 = startSketchOn(XY)
|> revolve(axis = Y, angle = 180)
part002 = startSketchOn(part001, face = END)
|> startProfileAt([4.5, -5], %)
|> startProfile(at = [4.5, -5])
|> line(end = [0, 5])
|> line(end = [5, 0])
|> line(end = [0, -5])
@ -121,7 +121,7 @@ part002 = startSketchOn(part001, face = END)
```js
box = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20])
|> line(end = [20, 0])
|> line(end = [0, -20])
@ -140,7 +140,7 @@ sketch001 = startSketchOn(box, face = END)
```js
box = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20])
|> line(end = [20, 0])
|> line(end = [0, -20], tag = $revolveAxis)
@ -159,7 +159,7 @@ sketch001 = startSketchOn(box, face = END)
```js
box = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20])
|> line(end = [20, 0])
|> line(end = [0, -20], tag = $revolveAxis)
@ -179,7 +179,7 @@ sketch001 = startSketchOn(box, face = END)
```js
sketch001 = startSketchOn(XY)
|> startProfileAt([10, 0], %)
|> startProfile(at = [10, 0])
|> line(end = [5, -5])
|> line(end = [5, 5])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
@ -200,14 +200,14 @@ part001 = revolve(
// Revolve two sketches around the same axis.
sketch001 = startSketchOn(XY)
profile001 = startProfileAt([4, 8], sketch001)
profile001 = startProfile(sketch001, at = [4, 8])
|> xLine(length = 3)
|> yLine(length = -3)
|> xLine(length = -3)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
profile002 = startProfileAt([-5, 8], sketch001)
profile002 = startProfile(sketch001, at = [-5, 8])
|> xLine(length = 3)
|> yLine(length = -3)
|> xLine(length = -3)
@ -226,7 +226,7 @@ revolve(
// Revolve around a path that has not been extruded.
profile001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20], tag = $revolveAxis)
|> line(end = [20, 0])
|> line(end = [0, -20])
@ -243,7 +243,7 @@ sketch001 = startSketchOn(XY)
// Revolve around a path that has not been extruded or closed.
profile001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20], tag = $revolveAxis)
|> line(end = [20, 0])
@ -258,7 +258,7 @@ sketch001 = startSketchOn(XY)
// Symmetrically revolve around a path.
profile001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20], tag = $revolveAxis)
|> line(end = [20, 0])
@ -273,7 +273,7 @@ sketch001 = startSketchOn(XY)
// Bidirectional revolve around a path.
profile001 = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20], tag = $revolveAxis)
|> line(end = [20, 0])

View File

@ -46,7 +46,7 @@ example = extrude(exampleSketch, length = 5)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([-15, 0], %)
|> startProfile(at = [-15, 0])
|> line(end = [30, 0])
|> line(end = [0, 30])
|> line(end = [-30, 0])

View File

@ -35,7 +35,7 @@ mirror2d(
```js
// Mirror an un-closed sketch across the Y axis.
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 10], %)
|> startProfile(at = [0, 10])
|> line(end = [15, 0])
|> line(end = [-7, -3])
|> line(end = [9, -1])
@ -54,7 +54,7 @@ example = extrude(sketch001, length = 10)
```js
// Mirror a un-closed sketch across the Y axis.
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 8.5], %)
|> startProfile(at = [0, 8.5])
|> line(end = [20, -8.5])
|> line(end = [-20, -8.5])
|> mirror2d(axis = Y)
@ -67,11 +67,11 @@ example = extrude(sketch001, length = 10)
```js
// Mirror a un-closed sketch across an edge.
helper001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 10], tag = $edge001)
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 8.5], %)
|> startProfile(at = [0, 8.5])
|> line(end = [20, -8.5])
|> line(end = [-20, -8.5])
|> mirror2d(axis = edge001)
@ -84,7 +84,7 @@ sketch001 = startSketchOn(XZ)
```js
// Mirror an un-closed sketch across a custom axis.
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 8.5], %)
|> startProfile(at = [0, 8.5])
|> line(end = [20, -8.5])
|> line(end = [-20, -8.5])
|> mirror2d(
@ -101,7 +101,7 @@ example = extrude(sketch001, length = 10)
```js
// Sketch on the face of a mirrored sketch, that has been extruded.
sketch0011 = startSketchOn(XY)
|> startProfileAt([6.77, 0], %)
|> startProfile(at = [6.77, 0])
|> yLine(length = 1.27)
|> tangentialArc(endAbsolute = [5.96, 2.37])
|> tangentialArc(endAbsolute = [-6.2, 2.44])

View File

@ -28,7 +28,7 @@ toDegrees(@num: number(deg)): number(deg)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = 70 * cos(toDegrees((PI/4): number(rad))),

View File

@ -28,7 +28,7 @@ toRadians(@num: number(rad)): number(rad)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = 70 * cos(toRadians(45)),

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ subtract(
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
@ -63,7 +63,7 @@ subtractedPart = subtract([part001], tools = [part002])
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])

View File

@ -45,7 +45,7 @@ sweep(
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -90,7 +90,7 @@ springSketch = startSketchOn(YZ)
sketch001 = startSketchOn(XY)
rectangleSketch = startProfileAt([-200, 23.86], sketch001)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
@ -100,7 +100,7 @@ rectangleSketch = startProfileAt([-200, 23.86], sketch001)
circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfileAt([0, 0], sketch002)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)
@ -118,7 +118,7 @@ sketch001 = startSketchOn(XY)
circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfileAt([0, 0], sketch002)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)

View File

@ -29,7 +29,7 @@ tangentToEnd(tag: TagIdentifier): number
```js
// Horizontal pill.
pillSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [20, 0])
|> tangentialArc(end = [0, 10], tag = $arc1)
|> angledLine(angle = tangentToEnd(arc1), length = 20)
@ -44,7 +44,7 @@ pillExtrude = extrude(pillSketch, length = 10)
```js
// Vertical pill. Use absolute coordinate for arc.
pillSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 20])
|> tangentialArc(endAbsolute = [10, 20], tag = $arc1)
|> angledLine(angle = tangentToEnd(arc1), length = 20)
@ -58,7 +58,7 @@ pillExtrude = extrude(pillSketch, length = 10)
```js
rectangleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [10, 0], tag = $seg1)
|> angledLine(angle = tangentToEnd(seg1), length = 10)
|> line(end = [0, 10])
@ -72,7 +72,7 @@ rectangleExtrude = extrude(rectangleSketch, length = 10)
```js
bottom = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> arc(endAbsolute = [10, 10], interiorAbsolute = [5, 1], tag = $arc1)
|> angledLine(angle = tangentToEnd(arc1), length = 20)
|> close()
@ -85,7 +85,7 @@ circSketch = startSketchOn(XY)
|> circle(center = [0, 0], radius = 3, tag = $circ)
triangleSketch = startSketchOn(XY)
|> startProfileAt([-5, 0], %)
|> startProfile(at = [-5, 0])
|> angledLine(angle = tangentToEnd(circ), length = 10)
|> line(end = [-15, 0])
|> close()

View File

@ -40,7 +40,7 @@ tangentialArc(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 45, length = 10)
|> tangentialArc(end = [0, -10])
|> line(end = [-10, 0])
@ -53,7 +53,7 @@ example = extrude(exampleSketch, length = 10)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60, length = 10)
|> tangentialArc(endAbsolute = [15, 15])
|> line(end = [10, -15])
@ -66,7 +66,7 @@ example = extrude(exampleSketch, length = 10)
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 60, length = 10)
|> tangentialArc(radius = 10, angle = -120)
|> angledLine(angle = -60, length = 10)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ tau(): number
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> angledLine(angle = 50, length = 10 * tau())
|> yLine(endAbsolute = 0)
|> close()

View File

@ -43,7 +43,7 @@ translate(
// Create a path for the sweep.
sweepPath = startSketchOn(XZ)
|> startProfileAt([0.05, 0.05], %)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> line(end = [-3, 0])
@ -85,7 +85,7 @@ cube
sketch001 = startSketchOn(XY)
rectangleSketch = startProfileAt([-200, 23.86], sketch001)
rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
|> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 50.61)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
@ -95,7 +95,7 @@ rectangleSketch = startProfileAt([-200, 23.86], sketch001)
circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
sketch002 = startSketchOn(YZ)
sweepPath = startProfileAt([0, 0], sketch002)
sweepPath = startProfile(sketch002, at = [0, 0])
|> yLine(length = 231.81)
|> tangentialArc(radius = 80, angle = -90)
|> xLine(length = 384.93)
@ -125,7 +125,7 @@ fn square(length) {
p3 = [l, -l]
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> startProfile(at = p0)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)
@ -144,7 +144,7 @@ square(10)
sketch001 = startSketchOn(XY)
fn square() {
return startProfileAt([-10, 10], sketch001)
return startProfile(sketch001, at = [-10, 10])
|> xLine(length = 20)
|> yLine(length = -20)
|> xLine(length = -20)

View File

@ -169,7 +169,7 @@ startSketchOn(XZ)
Note that we are still in the process of migrating KCL's standard library to use keyword arguments. So some
functions are still unfortunately using positional arguments. We're moving them over, so keep checking back.
Some functions like `angledLine`, `startProfileAt` etc are still using the old positional argument syntax.
Some functions are still using the old positional argument syntax.
Check the docs page for each function and look at its examples to see.
## Tags
@ -183,7 +183,7 @@ way:
```norun
startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
@ -218,7 +218,7 @@ However if the code was written like this:
```norun
fn rect(origin) {
return startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
@ -248,7 +248,7 @@ For example the following code works.
```norun
fn rect(origin) {
return startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,

View File

@ -10,7 +10,7 @@ When you define a sketch to a variable like:
```js
mySketch = startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -28,7 +28,7 @@ you can use a function.
```js
fn createSketch() {
return startSketchOn(XY)
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])

View File

@ -10,7 +10,7 @@ When you define a solid to a variable like:
```js
myPart = startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])
@ -29,7 +29,7 @@ you can use a function.
```js
fn createPart() {
return startSketchOn('XY')
|> startProfileAt([-12, 12], %)
|> startProfile(at = [-12, 12])
|> line(end = [24, 0])
|> line(end = [0, -24])
|> line(end = [-24, 0])

View File

@ -13,7 +13,7 @@ way:
```js
startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
@ -47,7 +47,7 @@ However if the code was written like this:
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
@ -76,7 +76,7 @@ For example the following code works.
```js
fn rect(origin) {
return startSketchOn(XZ)
|> startProfileAt(origin, %)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,

View File

@ -36,7 +36,7 @@ union(
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
@ -61,7 +61,7 @@ unionedPart = union([part001, part002])
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])
@ -87,7 +87,7 @@ unionedPart = part001 + part002
fn cube(center, size) {
return startSketchOn(XY)
|> startProfileAt([center[0] - size, center[1] - size], %)
|> startProfile(at = [center[0] - size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] - size])
|> line(endAbsolute = [center[0] + size, center[1] + size])
|> line(endAbsolute = [center[0] - size, center[1] + size])

View File

@ -36,7 +36,7 @@ xLine(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> xLine(length = 15)
|> angledLine(angle = 80, length = 15)
|> line(end = [8, -10])

View File

@ -36,7 +36,7 @@ yLine(
```js
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> yLine(length = 15)
|> angledLine(angle = 30, length = 15)
|> line(end = [8, -10])