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.

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.
57 changes: 57 additions & 0 deletions content/pages/docs/kcl-std/functions/std-edgeId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "edgeId"
subtitle: "Function in std"
excerpt: "Given an edge index, find its ID."
layout: manual
---

Given an edge index, find its ID.

```kcl
edgeId(
@body: Solid,
index: number(_),
): Edge
```



### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `body` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges we're trying to find | Yes |
| `index` | [`number(_)`](/docs/kcl-std/types/std-types-number) | Edge to identify. The index is a stable ordering of edges, used when you can't get the usual ID of an edge. | Yes |

### Returns

[`Edge`](/docs/kcl-std/types/std-types-Edge) - An edge of a solid.


### Examples

```kcl
// Cylinder
cylinder = startSketchOn(XY)
|> circle(center = [0, 0], radius = 4.09, tag = $seg01)
|> extrude(length = 5)
// Fillet the edge at index 2, i.e. the top edge.
|> fillet(radius = 1, tags = [edgeId(index = 2)])

```


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


59 changes: 59 additions & 0 deletions content/pages/docs/kcl-std/functions/std-faceId.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "faceId"
subtitle: "Function in std"
excerpt: "Given a face index, find its ID."
layout: manual
---

Given a face index, find its ID.

```kcl
faceId(
@body: Solid,
index: number(_),
): TaggedFace
```



### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `body` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose faces we're trying to find | Yes |
| `index` | [`number(_)`](/docs/kcl-std/types/std-types-number) | Face to identify. The index is a stable ordering of faces, used when you can't get the usual ID of a face. | Yes |

### Returns

[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.


### Examples

```kcl
// Cylinder
cylinder = startSketchOn(XY)
|> circle(center = [0, 0], radius = 4.09, tag = $seg01)
|> extrude(length = 5)

// Delete the face at index 2
// (the top face)
deleteFace(cylinder, faces = [faceId(cylinder, index = 2)])

```


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


2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ layout: manual
* [`assert`](/docs/kcl-std/functions/std-assert)
* [`assertIs`](/docs/kcl-std/functions/std-assertIs)
* [`clone`](/docs/kcl-std/functions/std-clone)
* [`edgeId`](/docs/kcl-std/functions/std-edgeId)
* [`faceId`](/docs/kcl-std/functions/std-faceId)
* [`helix`](/docs/kcl-std/functions/std-helix)
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)
* [**std::appearance**](/docs/kcl-std/modules/std-appearance)
Expand Down
2 changes: 2 additions & 0 deletions content/pages/docs/kcl-std/modules/std.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ You might also want the [KCL language reference](/docs/kcl-lang) or the [KCL gui
* [`assert`](/docs/kcl-std/functions/std-assert)
* [`assertIs`](/docs/kcl-std/functions/std-assertIs)
* [`clone`](/docs/kcl-std/functions/std-clone)
* [`edgeId`](/docs/kcl-std/functions/std-edgeId)
* [`faceId`](/docs/kcl-std/functions/std-faceId)
* [`helix`](/docs/kcl-std/functions/std-helix)
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)

Loading