Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 48 additions & 2 deletions content/pages/docs/kcl-std/functions/std-sketch-extrude.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Extend a 2-dimensional sketch through a third dimension in order to create new 3

```kcl
extrude(
@sketches: [Sketch | Face | TaggedFace; 1+],
@sketches: [Sketch | Face | TaggedFace | Segment; 1+],
length?: number(Length),
to?: Point3d | Axis3d | Plane | Edge | Face | Sketch | Solid | TaggedEdge | TaggedFace,
symmetric?: bool,
Expand Down Expand Up @@ -37,7 +37,7 @@ can change this behavior by using the `method` parameter. See

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketches` | [[`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Face`](/docs/kcl-std/types/std-types-Face) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace); 1+] | Which sketch or sketches should be extruded. | Yes |
| `sketches` | [[`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Face`](/docs/kcl-std/types/std-types-Face) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) or [`Segment`](/docs/kcl-std/types/std-types-Segment); 1+] | Which sketch or sketches should be extruded. | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far to extrude the given sketches. Incompatible with `to`. | No |
| `to` | [`Point3d`](/docs/kcl-std/types/std-types-Point3d) or [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Edge`](/docs/kcl-std/types/std-types-Edge) or [`Face`](/docs/kcl-std/types/std-types-Face) or [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) | Reference to extrude to. Incompatible with `length` and `twistAngle`. | No |
| `symmetric` | [`bool`](/docs/kcl-std/types/std-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 |
Expand Down Expand Up @@ -544,4 +544,50 @@ solid = extrude(region(point = [2mm, 1mm], sketch = profile), length = 5)
>
</model-viewer>

```kcl
@settings(experimentalFeatures = allow)

// Sketch some disconnected lines in a sketch block.
originalSketch = sketch(on = YZ) {
line1 = line(start = [var -5.33mm, var 3.69mm], end = [var -5.93mm, var -2.59mm])
line2 = line(start = [var -0.9mm, var 0.63mm], end = [var 4.01mm, var 0.68mm])
}

// Surface extrudes of sketch blocks let you extrude any lines.
extrude(
[
originalSketch.line1,
originalSketch.line2
],
length = 1,
bodyType = SURFACE,
)

// Surface extrudes of sketch blocks are non-destructive: they leave the original sketch
// in place. So we can add another extrude of the same lines, in a different direction.
extrude(
[
originalSketch.line1,
originalSketch.line2
],
length = -1,
bodyType = SURFACE,
)

```


<model-viewer
class="kcl-example"
alt="Example showing a rendered KCL program that uses the extrude function"
src="/kcl-test-outputs/models/serial_test_example_fn_std-sketch-extrude14_output.gltf"
ar
environment-image="/moon_1k.hdr"
poster="/kcl-test-outputs/serial_test_example_fn_std-sketch-extrude14.png"
shadow-intensity="1"
camera-controls
touch-action="pan-y"
>
</model-viewer>


78 changes: 70 additions & 8 deletions content/pages/docs/kcl-std/functions/std-sketch-revolve.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Rotate a sketch around some provided axis, creating a solid from its extent.

```kcl
revolve(
@sketches: [Sketch; 1+],
@sketches: [Sketch | Segment; 1+],
axis: Axis2d | Edge,
angle?: number(Angle),
tolerance?: number(Length),
Expand All @@ -36,7 +36,7 @@ revolved around the same axis.

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketches` | [[`Sketch`](/docs/kcl-std/types/std-types-Sketch); 1+] | The sketch or set of sketches that should be revolved | Yes |
| `sketches` | [[`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Segment`](/docs/kcl-std/types/std-types-Segment); 1+] | The sketch or set of sketches that should be revolved, or solved sketch segments for a surface revolve. | Yes |
| `axis` | [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) | Axis of revolution. | Yes |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
Expand Down Expand Up @@ -440,12 +440,33 @@ sketch001 = startSketchOn(XY)
</model-viewer>

```kcl
halfTorus = startSketchOn(XY)
|> circle(center = [15, 0], radius = 5)
|> revolve(axis = Y, bodyType = SURFACE, angle = 180deg)
closedTorus = startSketchOn(XY)
|> circle(center = [15, 0], radius = 5)
|> revolve(axis = Y, bodyType = SURFACE)
@settings(experimentalFeatures = allow)

shellProfile = sketch(on = XY) {
outerWall = line(start = [var 10mm, var 0mm], end = [var 10mm, var 5mm])
connector = line(start = [var 10mm, var 5mm], end = [var 12mm, var 7mm])
innerWall = line(start = [var 12mm, var 7mm], end = [var 15mm, var 6mm])
coincident([outerWall.end, connector.start])
coincident([connector.end, innerWall.start])
}

halfShell = revolve(
[
shellProfile.outerWall,
shellProfile.innerWall
],
axis = Y,
bodyType = SURFACE,
angle = 180deg,
)
closedShell = revolve(
[
shellProfile.outerWall,
shellProfile.innerWall
],
axis = Y,
bodyType = SURFACE,
)
|> translate(z = 30)

```
Expand Down Expand Up @@ -497,4 +518,45 @@ ring = revolve(ringRegion, axis = Y)
>
</model-viewer>

```kcl
@settings(experimentalFeatures = allow)

// Sketch some disconnected lines in a sketch block.
originalSketch = sketch(on = YZ) {
line1 = line(start = [var -5.33mm, var 3.69mm], end = [var -5.93mm, var -2.59mm])
line2 = line(start = [var -0.9mm, var 0.63mm], end = [var 4.01mm, var 0.68mm])
}

// Revolve just one line in the sketch.
revolve(
[originalSketch.line1],
axis = Y,
angle = 180deg,
bodyType = SURFACE,
)
// Surface revolves of sketch blocks are non-destructive, so you can keep revolving
// the same line again.
revolve(
[originalSketch.line1],
axis = Y,
angle = -90deg,
bodyType = SURFACE,
)

```


<model-viewer
class="kcl-example"
alt="Example showing a rendered KCL program that uses the revolve function"
src="/kcl-test-outputs/models/serial_test_example_fn_std-sketch-revolve15_output.gltf"
ar
environment-image="/moon_1k.hdr"
poster="/kcl-test-outputs/serial_test_example_fn_std-sketch-revolve15.png"
shadow-intensity="1"
camera-controls
touch-action="pan-y"
>
</model-viewer>


2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-chamfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ chamfer(
secondLength?: number(Length),
angle?: number(Angle),
tag?: TagDecl,
legacyMethod?: bool,
): Solid
```

Expand All @@ -32,6 +33,7 @@ a sharp, straight transitional edge.
| `secondLength` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Chamfering cuts away two faces to create a third face. If this argument isn't given, the lengths chamfered away from both the first and second face are both given by `length`. If this argument _is_ given, it determines how much is cut away from the second face. Incompatible with `angle`. | No |
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Chamfering cuts away two faces to create a third face. This argument determines the angle between the two cut edges. Requires `length`, incompatible with `secondLength`. The valid range is 0deg < angle < 90deg. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this chamfer | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-fillet.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fillet(
tags: [Edge; 1+],
tolerance?: number(Length),
tag?: TagDecl,
legacyMethod?: bool,
): Solid
```

Expand All @@ -30,6 +31,7 @@ will smoothly blend the transition.
| `tags` | [[`Edge`](/docs/kcl-std/types/std-types-Edge); 1+] | The paths you want to fillet | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-intersect.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Intersect returns the shared volume between multiple solids, preserving only ove
intersect(
@solids: [Solid; 2+],
tolerance?: number(Length),
legacyMethod?: bool,
): [Solid; 1+]
```

Expand All @@ -25,6 +26,7 @@ verifying fit, and analyzing overlapping geometries in assemblies.
|----------|------|-------------|----------|
| `solids` | [[`Solid`](/docs/kcl-std/types/std-types-Solid); 2+] | The solids to intersect. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-split.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ split(
merge?: bool,
keepTools?: bool,
tools?: [Solid],
legacyMethod?: bool,
): [Solid; 1+]
```

Expand All @@ -26,6 +27,7 @@ split(
| `merge` | [`bool`](/docs/kcl-std/types/std-types-bool) | Whether to merge the bodies into one after. Defaults to false. | No |
| `keepTools` | [`bool`](/docs/kcl-std/types/std-types-bool) | If false, the tool bodies will be removed from the scene. If true, they'll be kept. Defaults to false. | No |
| `tools` | [[`Solid`](/docs/kcl-std/types/std-types-Solid)] | The tools to split the target bodies along. | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-subtract.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ subtract(
@solids: [Solid; 1+],
tools: [Solid],
tolerance?: number(Length),
legacyMethod?: bool,
): [Solid; 1+]
```

Expand All @@ -28,6 +29,7 @@ and complex multi-body part modeling.
| `solids` | [[`Solid`](/docs/kcl-std/types/std-types-Solid); 1+] | The solids to use as the base to subtract from. | Yes |
| `tools` | [[`Solid`](/docs/kcl-std/types/std-types-Solid)] | The solids to subtract. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/functions/std-solid-union.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Union two or more solids into a single solid.
union(
@solids: [Solid; 2+],
tolerance?: number(Length),
legacyMethod?: bool,
): [Solid; 1+]
```

Expand All @@ -22,6 +23,7 @@ union(
|----------|------|-------------|----------|
| `solids` | [[`Solid`](/docs/kcl-std/types/std-types-Solid); 2+] | The solids to union. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Defines the smallest distance below which two entities are considered coincident, intersecting, coplanar, or similar. For most use cases, it should not be changed from its default value of 10^-7 millimeters. | No |
| `legacyMethod` | [`bool`](/docs/kcl-std/types/std-types-bool) | You probably shouldn't set this or care about this, it's for opting back into an older version of an engine algorithm. If true, revert to older engine SSI algorithm. Defaults to false. | No |

### Returns

Expand Down
Loading