Skip to content
Open
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.

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.
45 changes: 24 additions & 21 deletions content/pages/docs/kcl-samples/gdt-tutorial/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// GD&T Basics in Zoo Design Studio
// A simple sample project demonstrating how to use GD&T in Zoo Design Studio. This project keeps the geometry and annotations intentionally minimal so users can quickly understand what GD&T is, how it works in the app, and how to start applying it to their own designs. Future updates may add more examples while keeping the project beginner-friendly.

@settings(defaultLengthUnit = mm, kclVersion = 2.0)

sketch001 = sketch(on = XY) {
line1 = line(start = [var -99.36mm, var 49.61mm], end = [var 100.64mm, var 49.61mm])
line2 = line(start = [var 100.64mm, var 49.61mm], end = [var 100.64mm, var -50.39mm])
Expand All @@ -25,6 +27,24 @@ extrude001 = extrude(
tagEnd = $capEnd001,
tagStart = $capStart001,
)

gdt::datum(
face = region001.tags.line2,
name = "A",
framePlane = XZ,
leaderScale = 1,
)

gdt::distance(
edges = [
getCommonEdge(faces = [region001.tags.line3, capEnd001])
],
tolerance = 0.1mm,
framePosition = [0, 30],
framePlane = XZ,
fontSize = 9.3333mm,
)

gdt::flatness(
faces = [region001.tags.line1],
tolerance = 0.001mm,
Expand All @@ -33,12 +53,7 @@ gdt::flatness(
leaderScale = 1,
fontSize = 10mm,
)
gdt::datum(
face = region001.tags.line3,
name = "A",
framePlane = XZ,
leaderScale = 1,
)

gdt::perpendicularity(
faces = [capEnd001],
tolerance = 0.1mm,
Expand All @@ -47,28 +62,16 @@ gdt::perpendicularity(
leaderScale = 1,
)
gdt::parallelism(
faces = [region001.tags.line2],
faces = [region001.tags.line4],
tolerance = 0.2mm,
datums = ["A"],
framePlane = XZ,
framePosition = [-100, 100],
leaderScale = 1,
)
gdt::distance(
from = getCommonEdge(faces = [
region001.tags.line2,
region001.tags.line4
]),
to = getCommonEdge(faces = [
region001.tags.line4,
region001.tags.line3
]),
tolerance = 0.1mm,
framePlane = XZ,
leaderScale = 1,
)

gdt::annotation(
faces = [region001.tags.line4],
faces = [region001.tags.line3],
annotation = "BREAK ALL SHARP EDGES",
framePosition = [100, -100],
leaderScale = 1,
Expand Down
38 changes: 18 additions & 20 deletions content/pages/docs/kcl-std/functions/std-gdt-profile.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
title: "gdt::profile"
subtitle: "Function in std::gdt"
excerpt: "GD&T profile annotation specifying how much edges may deviate from their ideal shape."
excerpt: "GD&T profile annotation specifying how much edges or faces may deviate from their ideal shape."
layout: manual
---

GD&T profile annotation specifying how much edges may deviate from their ideal shape.
GD&T profile annotation specifying how much edges or faces may deviate from their ideal shape.

```kcl
gdt::profile(
edges: [Edge; 1+],
tolerance: number(Length),
edges?: [Edge; 1+],
faces?: [TaggedFace; 1+],
datums?: [string; 1+],
precision?: number(_),
framePosition?: Point2d,
Expand All @@ -22,12 +23,21 @@ gdt::profile(

This is part of model-based definition (MBD).

`gdt::profile` is kept for backwards compatibility with existing KCL programs.
For new code, prefer `gdt::profileLine` when annotating edges and
`gdt::profileSurface` when annotating faces.

Provide exactly one of `edges` or `faces`. Passing `edges` delegates to
`profileLine`; passing `faces` delegates to `profileSurface`. Passing both,
or neither, is a KCL error.

### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `edges` | [[`Edge`](/docs/kcl-std/types/std-types-Edge); 1+] | The edges to be annotated. | Yes |
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The amount of deviation from an ideal profile that is acceptable. | Yes |
| `edges` | [[`Edge`](/docs/kcl-std/types/std-types-Edge); 1+] | The edges to be annotated with profile of a line. Provide either `edges` or `faces`, but not both. | No |
| `faces` | [[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace); 1+] | The faces to be annotated with profile of a surface. Provide either `edges` or `faces`, but not both. | No |
| `datums` | [[`string`](/docs/kcl-std/types/std-types-string); 1+] | The datum references to display in the feature control frame. Supports up to primary, secondary, and tertiary datums. | No |
| `precision` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The number of decimal places to display. The default is `3`. Must be greater than or equal to `0` and less than or equal to `9`. | No |
| `framePosition` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The position of the feature control frame relative to the leader arrow. The default is `[100mm, 100mm]`. | No |
Expand Down Expand Up @@ -68,25 +78,13 @@ gdt::profile(
![Rendered example of gdt::profile 0](/kcl-test-outputs/serial_test_example_fn_std-gdt-profile0.png)

```kcl
blockProfile = sketch(on = XY) {
edge1 = line(start = [var 0mm, var 0mm], end = [var 10mm, var 0mm])
edge2 = line(start = [var 10mm, var 0mm], end = [var 10mm, var 6mm])
edge3 = line(start = [var 10mm, var 6mm], end = [var 0mm, var 6mm])
edge4 = line(start = [var 0mm, var 6mm], end = [var 0mm, var 0mm])
coincident([edge1.end, edge2.start])
coincident([edge2.end, edge3.start])
coincident([edge3.end, edge4.start])
coincident([edge4.end, edge1.start])
horizontal(edge1)
vertical(edge2)
horizontal(edge3)
vertical(edge4)
cylinderSketch = sketch(on = XY) {
perimeter = circle(start = [var 5mm, var 0mm], center = [var 0mm, var 0mm])
}

block = extrude(region(point = [5mm, 3mm], sketch = blockProfile), length = 4mm, tagEnd = $top)
profileEdge = getCommonEdge(faces = [block.sketch.tags.edge1, top])
cylinder = extrude(region(point = cylinderSketch.perimeter.center, sketch = cylinderSketch), length = 10mm, tagEnd = $top)
gdt::profile(
edges = [profileEdge],
faces = [top],
tolerance = 0.05mm,
framePosition = [12mm, 8mm],
framePlane = XZ,
Expand Down
55 changes: 53 additions & 2 deletions content/pages/docs/kcl-std/functions/std-sketch-sweep.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Create a 3D surface or solid by sweeping a sketch along a path.

```kcl
sweep(
@sketches: [Sketch | Segment; 1+],
@sketches: [Sketch | Face | TaggedFace | Segment; 1+],
path: Sketch | Helix | [Segment; 1+],
sectional?: bool,
tolerance?: number(Length),
Expand All @@ -36,7 +36,7 @@ swept along the same path.

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `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 swept in space. | 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+] | The sketch or set of sketches that should be swept in space. | Yes |
| `path` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Helix`](/docs/kcl-std/types/std-types-Helix) or [[`Segment`](/docs/kcl-std/types/std-types-Segment); 1+] | The path to sweep the sketch along. | Yes |
| `sectional` | [`bool`](/docs/kcl-std/types/std-types-bool) | If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components. | 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 @@ -465,4 +465,55 @@ sweep(sketch001.line2, path, bodyType = SURFACE)
>
</model-viewer>

```kcl
// Demonstrates a sweep from a face
sketch001 = sketch(on = XY) {
line1 = line(start = [var -5mm, var 3mm], end = [var 5mm, var 3mm])
line2 = line(start = [var 5mm, var 3mm], end = [var 5mm, var 0mm])
line3 = line(start = [var 5mm, var 0mm], end = [var -5mm, var 0mm])
line4 = line(start = [var -5mm, var 0mm], end = [var -5mm, var 3mm])
coincident([line1.end, line2.start])
coincident([line2.end, line3.start])
coincident([line3.end, line4.start])
coincident([line4.end, line1.start])
parallel([line2, line4])
parallel([line3, line1])
perpendicular([line1, line2])
horizontal(line3)
}
hidden001 = hide(sketch001)
region001 = region(point = [0mm, 2.9975mm], sketch = sketch001)
extrude001 = extrude(region001, length = 5, tagEnd = $capFace)
sketch002 = sketch(on = XZ) {
line1 = line(start = [var 0mm, var 4mm], end = [var 0mm, var 12mm])
vertical([line1.start, ORIGIN])
vertical([line1.end, ORIGIN])
arc1 = arc(start = [var 10mm, var 20mm], end = [var 0mm, var 12mm], center = [var 7mm, var 12mm])
coincident([line1.end, arc1.end])
tangent([line1, arc1])
arc2 = arc(start = [var 10mm, var 20mm], end = [var 10mm, var 34mm], center = [var 13mm, var 27mm])
coincident([arc1.start, arc2.start])
tangent([arc1, arc2])
}

// sweep the tagged face
sweep(capFace, path = sketch002)
|> appearance(color = "#ff00aa")

```


<model-viewer
class="kcl-example"
alt="Example showing a rendered KCL program that uses the sweep function"
src="/kcl-test-outputs/models/serial_test_example_fn_std-sketch-sweep11_output.gltf"
ar
environment-image="/moon_1k.hdr"
poster="/kcl-test-outputs/serial_test_example_fn_std-sketch-sweep11.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 @@ -40,6 +40,8 @@ layout: manual
* [`gdt::perpendicularity`](/docs/kcl-std/functions/std-gdt-perpendicularity)
* [`gdt::position`](/docs/kcl-std/functions/std-gdt-position)
* [`gdt::profile`](/docs/kcl-std/functions/std-gdt-profile)
* [`gdt::profileLine`](/docs/kcl-std/functions/std-gdt-profileLine)
* [`gdt::profileSurface`](/docs/kcl-std/functions/std-gdt-profileSurface)
* [`gdt::runout`](/docs/kcl-std/functions/std-gdt-runout)
* [`gdt::straightness`](/docs/kcl-std/functions/std-gdt-straightness)
* [`gdt::symmetry`](/docs/kcl-std/functions/std-gdt-symmetry)
Expand Down
Loading