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
7 changes: 6 additions & 1 deletion content/pages/docs/kcl-lang/arithmetic.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ KCL supports the usual arithmetic operators on numbers and logic operators on bo
| `\|` | Logical 'or' |
| `!` | Unary logical 'not' |

KCL also supports comparsion operators which operate on numbers and produce booleans:
KCL also supports comparison operators which produce booleans. Ordering
comparisons operate on numbers, while `==` and `!=` operate on numbers or
strings:

| Operator | Meaning |
|----------|---------|
Expand All @@ -29,6 +31,9 @@ KCL also supports comparsion operators which operate on numbers and produce bool
| `<=` | Less than or equal |
| `>=` | Greater than or equal |

String equality is exact and case-sensitive. It does not perform Unicode
normalization.

Arithmetics and logic expressions can be arbitrairly combined with the usual rules of associativity and precedence, e.g.,

```
Expand Down
44 changes: 22 additions & 22 deletions content/pages/docs/kcl-lang/settings/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,36 @@ base_unit = "in"

## Available Settings

### cloud
### settings



#### meta

### settings
Information about the project itself. Choices about how settings are merged have prevent me (lee) from easily moving this out of the settings structure.


**Default:** None

This setting has the following nested options:

##### id

#### app

The settings for the Design Studio.


**Default:** None

This setting has the following nested options:

##### named_views
#### app

Settings that affect the behavior of the command bar.
The settings for the Design Studio.


**Default:** None

This setting has the following nested options:

##### stream_idle_mode

When the user is idle, and this is true, the stream will be torn down.
Expand All @@ -66,19 +71,9 @@ Zookeeper reasoning mode. Uses the app default if not set.

**Default:** None

##### named_views

#### meta

Information about the project itself. Choices about how settings are merged have prevent me (lee) from easily moving this out of the settings structure.


**Default:** None

This setting has the following nested options:

##### id


Settings that affect the behavior of the command bar.


**Default:** None
Expand All @@ -98,6 +93,13 @@ This setting has the following nested options:
The default unit to use in modeling dimensions.


**Default:** None

##### highlight_edges

Highlight edges of 3D objects?


**Default:** None

##### enable_ssao
Expand All @@ -114,12 +116,10 @@ When enabled, the grid will use a fixed size based on your selected units rather

**Default:** None

##### highlight_edges

Highlight edges of 3D objects?

### cloud

**Default:** None



Expand Down
24 changes: 12 additions & 12 deletions content/pages/docs/kcl-lang/settings/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ Settings that affect the behavior while modeling.

This setting has the following nested options:

##### backface_color
##### base_unit

The default color to use for surface backfaces.
The default unit to use in modeling dimensions. If not given, defaults to millimeters.


**Default:** None

##### base_unit
##### camera_projection

The default unit to use in modeling dimensions. If not given, defaults to millimeters.
The projection mode the camera should use while modeling.


**Default:** None
Expand All @@ -84,9 +84,9 @@ The methodology the camera should use to orbit around the model.

**Default:** None

##### camera_projection
##### highlight_edges

The projection mode the camera should use while modeling.
Highlight edges of 3D objects?


**Default:** None
Expand All @@ -98,23 +98,23 @@ Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.

**Default:** None

##### fixed_size_grid
##### backface_color

When enabled, the grid will use a fixed size based on your selected units rather than automatically scaling with zoom level. If true, the grid cells will be fixed-size, where the width is your default length unit. If false, the grid will get larger as you zoom out, and smaller as you zoom in.
The default color to use for surface backfaces.


**Default:** None

##### highlight_edges
##### show_scale_grid

Highlight edges of 3D objects?
Whether or not to show a scale grid in the 3D modeling view


**Default:** None

##### show_scale_grid
##### fixed_size_grid

Whether or not to show a scale grid in the 3D modeling view
When enabled, the grid will use a fixed size based on your selected units rather than automatically scaling with zoom level. If true, the grid cells will be fixed-size, where the width is your default length unit. If false, the grid will get larger as you zoom out, and smaller as you zoom in.


**Default:** None
Expand Down
8 changes: 1 addition & 7 deletions content/pages/docs/kcl-samples/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,7 @@
{
"file": "main.kcl",
"categories": [
"Maker",
"Automotive"
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-car/main.kcl",
"multipleFiles": false,
Expand All @@ -1124,7 +1123,6 @@
{
"file": "main.kcl",
"categories": [
"Automotive",
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-cybertruck/main.kcl",
Expand All @@ -1138,7 +1136,6 @@
{
"file": "main.kcl",
"categories": [
"Automotive",
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-dump-truck/main.kcl",
Expand All @@ -1152,7 +1149,6 @@
{
"file": "main.kcl",
"categories": [
"Automotive",
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-firetruck/main.kcl",
Expand All @@ -1166,7 +1162,6 @@
{
"file": "main.kcl",
"categories": [
"Automotive",
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-mini-bus/main.kcl",
Expand All @@ -1180,7 +1175,6 @@
{
"file": "main.kcl",
"categories": [
"Automotive",
"Maker"
],
"pathFromProjectDirectoryToFirstFile": "stylized-pickup-truck/main.kcl",
Expand Down
2 changes: 1 addition & 1 deletion content/pages/docs/kcl-samples/stylized-car/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Car
// A simplified, parametric 3-D model of a small toy car intended for use as a low-poly prop in real-time engines, visualization scenes, or rapid prototyping.
// Categories: Maker, Automotive
// Categories: Maker

// The model includes:
// - A chassis block forming the vehicle’s base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Cybertruck
// A simplified, parametric 3-D model of a low-poly toy cybertruck, intended for use as a game-ready asset, concept visualization, or real-time rendering demo.
// Categories: Automotive, Maker
// Categories: Maker

// The model includes:
// - A chassis block forming the vehicle’s base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Dump Truck
// A simplified, parametric 3D toy dump truck with front cab, extended cargo bed, and four wheels.
// Categories: Automotive, Maker
// Categories: Maker

// The model includes:
// - A chassis block forming the base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Fire Truck
// A toy parametric fire truck with extended rear compartment and roof ladder. Optimized for real-time rendering or schematic use in stylized design scenes.
// Categories: Automotive, Maker
// Categories: Maker

// Set units and version
@settings(defaultLengthUnit = m)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Mini-Bus
// A simplified, parametric 3-D model of a toy compact van or mini-bus, intended for use as a low-poly prop in real-time engines, visualization scenes, or rapid prototyping.
// Categories: Automotive, Maker
// Categories: Maker

// The model includes:
// - A solid chassis block forming the vehicle’s base
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Stylized Toy Pickup Truck
// A simplified, parametric 3-D model of a toy pickup truck intended for use as a low-poly prop in real-time engines, visualization scenes, or rapid prototyping.
// Categories: Automotive, Maker
// Categories: Maker

// The model includes:
// - A chassis block forming the vehicle’s base
Expand Down
45 changes: 45 additions & 0 deletions content/pages/docs/kcl-std/functions/std-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "fail"
subtitle: "Function in std"
excerpt: "Stop KCL evaluation with a user-defined error."
layout: manual
---

**WARNING:** This function is experimental and may change or be removed.

Stop KCL evaluation with a user-defined error.

```kcl
fail(@msg: string): never
```

Use `fail` when evaluation cannot continue and the caller should receive a
specific error message. `fail` never returns a value.

### Arguments

| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `msg` | [`string`](/docs/kcl-std/types/std-types-string) | Message reported to the caller. | Yes |

### Returns

[`never`](/docs/kcl-std/types/std-types-never) - The uninhabited type of computations that never complete normally.


### Examples

```kcl
fn positive(@value: number): number {
return if value > 0 {
value
} else {
fail("value must be positive")
}
}

```




9 changes: 9 additions & 0 deletions content/pages/docs/kcl-std/functions/std-runtime-exit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ Exit the program early.
exit()
```

Exiting early can be helpful to see the intermediate output of a program to
help debug. Remember to always remove the call to `exit()` after debugging
is complete.

When `exit()` is used in an imported module, only the imported module exits
early. Because imported modules execute concurrently, `exit()` in one module
does not affect other modules.

On the other hand, if you import a function from another module, and that
function calls `exit()`, then calling the function exits the caller.



Expand Down
10 changes: 6 additions & 4 deletions content/pages/docs/kcl-std/functions/std-sketch-extrude.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Extend a 2-dimensional sketch or individual segment of a sketch through a third

```kcl
extrude(
@sketches: [Sketch | Face | TaggedFace | TaggedEdge | Edge | Segment; 1+],
@sketches: [Sketch | Face | TaggedFace | TaggedEdge | Edge | Segment | any; 1+],
length?: number(Length),
to?: Point3d | Axis3d | Plane | Edge | Face | Sketch | Solid | TaggedEdge | TaggedFace | any,
symmetric?: bool,
direction?: Point3d | Edge | TaggedEdge | Segment,
direction?: Point3d | Edge | TaggedEdge | Segment | any,
bidirectionalLength?: number(Length),
tagStart?: TagDecl,
tagEnd?: TagDecl,
Expand All @@ -39,11 +39,11 @@ 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) or [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`Edge`](/docs/kcl-std/types/std-types-Edge) or [`Segment`](/docs/kcl-std/types/std-types-Segment); 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 [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`Edge`](/docs/kcl-std/types/std-types-Edge) or [`Segment`](/docs/kcl-std/types/std-types-Segment) or [`any`](/docs/kcl-std/types/std-types-any); 1+] | Which sketch or sketches should be extruded. Experimental face API: edge specifier objects (`{ sideFaces = [faceTag1, faceTag2], endFaces? = [...], index? }`) are not ready for generated or user-facing KCL yet; prefer existing sketch, face, tagged face, tagged edge, edge, or segment forms until point-and-click and migration support ships. | 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) or [`any`](/docs/kcl-std/types/std-types-any) | Reference to extrude to. Incompatible with `length` and `twistAngle`. Experimental face API: edge specifier objects (`{ sideFaces = [faceTag1, faceTag2], endFaces? = [...], index? }`) are not ready for generated or user-facing KCL yet; prefer existing point, axis, plane, edge, face, sketch, solid, or tag forms until point-and-click and migration support ships. | 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 |
| `direction` | [`Point3d`](/docs/kcl-std/types/std-types-Point3d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) or [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`Segment`](/docs/kcl-std/types/std-types-Segment) | If specified, will extrude in this direction instead of the sketch plane normal. If an edge is being extruded, this defaults to halfway between the faces on either side of the edge. | No |
| `direction` | [`Point3d`](/docs/kcl-std/types/std-types-Point3d) or [`Edge`](/docs/kcl-std/types/std-types-Edge) or [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`Segment`](/docs/kcl-std/types/std-types-Segment) or [`any`](/docs/kcl-std/types/std-types-any) | If specified, will extrude in this direction instead of the sketch plane normal. If an edge is being extruded, this defaults to halfway between the faces on either side of the edge. | No |
| `bidirectionalLength` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored. | No |
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the extrusion, i.e. the original sketch. | No |
| `tagEnd` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch. | No |
Expand Down Expand Up @@ -766,3 +766,5 @@ extrude002 = extrude(
touch-action="pan-y"
>
</model-viewer>


Loading
Loading