Fixes to docs (#5440)
* updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * clenaup Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -6,7 +6,15 @@ layout: manual
|
|||||||
|
|
||||||
Start a new 2-dimensional sketch on a specific plane or face.
|
Start a new 2-dimensional sketch on a specific plane or face.
|
||||||
|
|
||||||
|
### Sketch on Face Behavior
|
||||||
|
|
||||||
|
There are some important behaviors to understand when sketching on a face:
|
||||||
|
|
||||||
|
The resulting sketch will _include_ the face and thus Solid that was sketched on. So say you were to export the resulting Sketch / Solid from a sketch on a face, you would get both the artifact of the sketch on the face and the parent face / Solid itself.
|
||||||
|
|
||||||
|
This is important to understand because if you were to then sketch on the resulting Solid, it would again include the face and parent Solid that was sketched on. This could go on indefinitely.
|
||||||
|
|
||||||
|
The point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
|
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
|
||||||
|
@ -271980,7 +271980,7 @@
|
|||||||
{
|
{
|
||||||
"name": "startSketchOn",
|
"name": "startSketchOn",
|
||||||
"summary": "Start a new 2-dimensional sketch on a specific plane or face.",
|
"summary": "Start a new 2-dimensional sketch on a specific plane or face.",
|
||||||
"description": "",
|
"description": "### Sketch on Face Behavior\n\nThere are some important behaviors to understand when sketching on a face:\n\nThe resulting sketch will _include_ the face and thus Solid that was sketched on. So say you were to export the resulting Sketch / Solid from a sketch on a face, you would get both the artifact of the sketch on the face and the parent face / Solid itself.\n\nThis is important to understand because if you were to then sketch on the resulting Solid, it would again include the face and parent Solid that was sketched on. This could go on indefinitely.\n\nThe point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids.",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"keywordArguments": false,
|
"keywordArguments": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
@ -18,7 +18,7 @@ A base path.
|
|||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A base path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
---
|
---
|
||||||
title: "EnvironmentRef"
|
title: "EnvironmentRef"
|
||||||
excerpt: ""
|
excerpt: "An index pointing to a snapshot within a specific (unspecified) environment."
|
||||||
layout: manual
|
layout: manual
|
||||||
---
|
---
|
||||||
|
|
||||||
|
An index pointing to a snapshot within a specific (unspecified) environment.
|
||||||
|
|
||||||
[`SnapshotRef`](/docs/kcl/types/SnapshotRef)
|
[`SnapshotRef`](/docs/kcl/types/SnapshotRef)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ An extrude plane.
|
|||||||
| `faceId` |`string`| The face id for the extrude plane. | No |
|
| `faceId` |`string`| The face id for the extrude plane. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
||||||
| `id` |`string`| The id of the geometry. | No |
|
| `id` |`string`| The id of the geometry. | No |
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -48,7 +48,7 @@ An extruded arc.
|
|||||||
| `faceId` |`string`| The face id for the extrude plane. | No |
|
| `faceId` |`string`| The face id for the extrude plane. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
||||||
| `id` |`string`| The id of the geometry. | No |
|
| `id` |`string`| The id of the geometry. | No |
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -68,7 +68,7 @@ Geometry metadata.
|
|||||||
| `faceId` |`string`| The id for the chamfer surface. | No |
|
| `faceId` |`string`| The id for the chamfer surface. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
||||||
| `id` |`string`| The id of the geometry. | No |
|
| `id` |`string`| The id of the geometry. | No |
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -88,7 +88,7 @@ Geometry metadata.
|
|||||||
| `faceId` |`string`| The id for the fillet surface. | No |
|
| `faceId` |`string`| The id for the fillet surface. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No |
|
||||||
| `id` |`string`| The id of the geometry. | No |
|
| `id` |`string`| The id of the geometry. | No |
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
@ -23,7 +23,7 @@ A face.
|
|||||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
|
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
|
||||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||||
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A face. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ A tag for a face.
|
|||||||
|
|
||||||
**This schema accepts any of the following:**
|
**This schema accepts any of the following:**
|
||||||
|
|
||||||
A tag for a face.
|
|
||||||
|
|
||||||
[`StartOrEnd`](/docs/kcl/types/StartOrEnd)
|
[`StartOrEnd`](/docs/kcl/types/StartOrEnd)
|
||||||
|
|
||||||
|
@ -17,6 +17,6 @@ Geometry metadata.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `id` |`string`| The id of the geometry. | No |
|
| `id` |`string`| The id of the geometry. | No |
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ A helix.
|
|||||||
| `revolutions` |`number`| Number of revolutions. | No |
|
| `revolutions` |`number`| Number of revolutions. | No |
|
||||||
| `angleStart` |`number`| Start angle (in degrees). | No |
|
| `angleStart` |`number`| Start angle (in degrees). | No |
|
||||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ A helix.
|
|||||||
| `revolutions` |`number`| Number of revolutions. | No |
|
| `revolutions` |`number`| Number of revolutions. | No |
|
||||||
| `angleStart` |`number`| Start angle (in degrees). | No |
|
| `angleStart` |`number`| Start angle (in degrees). | No |
|
||||||
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
| `ccw` |`boolean`| Is the helix rotation counter clockwise? | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A helix. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ Any KCL value.
|
|||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: `Number`| | No |
|
| `type` |enum: `Number`| | No |
|
||||||
| `value` |`number`| | No |
|
| `value` |`number`| | No |
|
||||||
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| Any KCL value. | No |
|
| `ty` |[`NumericType`](/docs/kcl/types/NumericType)| | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ Any KCL value.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`Plane`](/docs/kcl/types/Plane)| | No |
|
| `type` |enum: [`Plane`](/docs/kcl/types/Plane)| | No |
|
||||||
| `value` |[`Plane`](/docs/kcl/types/Plane)| Any KCL value. | No |
|
| `value` |[`Plane`](/docs/kcl/types/Plane)| A plane. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -180,7 +180,7 @@ Any KCL value.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`Face`](/docs/kcl/types/Face)| | No |
|
| `type` |enum: [`Face`](/docs/kcl/types/Face)| | No |
|
||||||
| `value` |[`Face`](/docs/kcl/types/Face)| Any KCL value. | No |
|
| `value` |[`Face`](/docs/kcl/types/Face)| A face. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -196,7 +196,7 @@ Any KCL value.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`Sketch`](/docs/kcl/types/Sketch)| | No |
|
| `type` |enum: [`Sketch`](/docs/kcl/types/Sketch)| | No |
|
||||||
| `value` |[`Sketch`](/docs/kcl/types/Sketch)| Any KCL value. | No |
|
| `value` |[`Sketch`](/docs/kcl/types/Sketch)| A sketch is a collection of paths. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -228,7 +228,7 @@ Any KCL value.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`Solid`](/docs/kcl/types/Solid)| | No |
|
| `type` |enum: [`Solid`](/docs/kcl/types/Solid)| | No |
|
||||||
| `value` |[`Solid`](/docs/kcl/types/Solid)| Any KCL value. | No |
|
| `value` |[`Solid`](/docs/kcl/types/Solid)| A solid is a collection of extrude surfaces. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -260,7 +260,7 @@ Any KCL value.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`Helix`](/docs/kcl/types/Helix)| | No |
|
| `type` |enum: [`Helix`](/docs/kcl/types/Helix)| | No |
|
||||||
| `value` |[`Helix`](/docs/kcl/types/Helix)| Any KCL value. | No |
|
| `value` |[`Helix`](/docs/kcl/types/Helix)| A helix. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
@ -312,7 +312,7 @@ Data for an imported geometry.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: `Module`| | No |
|
| `type` |enum: `Module`| | No |
|
||||||
| `value` |[`ModuleId`](/docs/kcl/types/ModuleId)| Any KCL value. | No |
|
| `value` |[`ModuleId`](/docs/kcl/types/ModuleId)| Identifier of a source file. Uses a u32 to keep the size small. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ Data for an imported geometry.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: [`KclNone`](/docs/kcl/types/KclNone)| | No |
|
| `type` |enum: [`KclNone`](/docs/kcl/types/KclNone)| | No |
|
||||||
| `value` |[`KclNone`](/docs/kcl/types/KclNone)| Any KCL value. | No |
|
| `value` |[`KclNone`](/docs/kcl/types/KclNone)| KCL value for an optional parameter which was not given an argument. (remember, parameters are in the function declaration, arguments are in the function call/application). | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@ Metadata.
|
|||||||
|
|
||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `sourceRange` |`SourceRange`| The source range. | No |
|
| `sourceRange` |[`SourceRange`](/docs/kcl/types/SourceRange)| The source range. | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,8 +211,8 @@ A unit of angle.
|
|||||||
| Property | Type | Description | Required |
|
| Property | Type | Description | Required |
|
||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `type` |enum: `Default`| | No |
|
| `type` |enum: `Default`| | No |
|
||||||
| `len` |[`UnitLen`](/docs/kcl/types/UnitLen)| | No |
|
| `len` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `angle` |[`UnitAngle`](/docs/kcl/types/UnitAngle)| | No |
|
| `angle` |[`UnitAngle`](/docs/kcl/types/UnitAngle)| A unit of angle. | No |
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
@ -27,7 +27,7 @@ A path that goes to a point.
|
|||||||
| `type` |enum: `ToPoint`| | No |
|
| `type` |enum: `ToPoint`| | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ A arc that is tangential to the last path segment that goes to a point
|
|||||||
| `ccw` |`boolean`| arc's direction | No |
|
| `ccw` |`boolean`| arc's direction | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ A arc that is tangential to the last path segment
|
|||||||
| `ccw` |`boolean`| arc's direction | No |
|
| `ccw` |`boolean`| arc's direction | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ a complete arc
|
|||||||
| `ccw` |`boolean`| arc's direction This is used to compute the tangential angle. | No |
|
| `ccw` |`boolean`| arc's direction This is used to compute the tangential angle. | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ A base path.
|
|||||||
| `p3` |`[number, number]`| Point 3 of the circle | No |
|
| `p3` |`[number, number]`| Point 3 of the circle | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ A path that is horizontal.
|
|||||||
| `x` |`number`| The x coordinate. | No |
|
| `x` |`number`| The x coordinate. | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ An angled line to.
|
|||||||
| `y` |`number`| The y coordinate. | No |
|
| `y` |`number`| The y coordinate. | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ A base path.
|
|||||||
| `type` |enum: `Base`| | No |
|
| `type` |enum: `Base`| | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ A circular arc, not necessarily tangential to the current point.
|
|||||||
| `ccw` |`boolean`| True if the arc is counterclockwise. | No |
|
| `ccw` |`boolean`| True if the arc is counterclockwise. | No |
|
||||||
| `from` |`[number, number]`| The from point. | No |
|
| `from` |`[number, number]`| The from point. | No |
|
||||||
| `to` |`[number, number]`| The to point. | No |
|
| `to` |`[number, number]`| The to point. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A path. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
|
||||||
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ A plane.
|
|||||||
|----------|------|-------------|----------|
|
|----------|------|-------------|----------|
|
||||||
| `id` |`string`| The id of the plane. | No |
|
| `id` |`string`| The id of the plane. | No |
|
||||||
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
|
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
|
||||||
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A plane. | No |
|
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| Type for a plane. | No |
|
||||||
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
|
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
|
||||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
||||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
||||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A plane. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `l
|
|||||||
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
||||||
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
|
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
|
||||||
| `originalId` |`string`| | No |
|
| `originalId` |`string`| | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch is a collection of paths. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
|
|||||||
|
|
||||||
**This schema accepts any of the following:**
|
**This schema accepts any of the following:**
|
||||||
|
|
||||||
Data for start sketch on. You can start a sketch on a plane or an solid.
|
Orientation data that can be used to construct a plane, not a plane in itself.
|
||||||
|
|
||||||
[`PlaneData`](/docs/kcl/types/PlaneData)
|
[`PlaneData`](/docs/kcl/types/PlaneData)
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
|
|||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
Data for start sketch on. You can start a sketch on a plane or an solid.
|
A plane.
|
||||||
|
|
||||||
[`Plane`](/docs/kcl/types/Plane)
|
[`Plane`](/docs/kcl/types/Plane)
|
||||||
|
|
||||||
@ -35,7 +35,43 @@ Data for start sketch on. You can start a sketch on a plane or an solid.
|
|||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
Data for start sketch on. You can start a sketch on a plane or an solid.
|
A solid is a collection of extrude surfaces.
|
||||||
|
|
||||||
|
When you define a solid to a variable like:
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
myPart = startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
|> extrude(length = 6)
|
||||||
|
```
|
||||||
|
|
||||||
|
The `myPart` variable will be an executed [`Solid`](/docs/kcl/types/Solid) object. Executed being past tense, because the engine has already executed the commands to create the solid.
|
||||||
|
|
||||||
|
The previous solid commands will never be executed again, in this case.
|
||||||
|
|
||||||
|
If you would like to encapsulate the commands to create the solid any time you call it, you can use a function.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
fn createPart() {
|
||||||
|
return startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
|> extrude(length = 6)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, every time you call `createPart()`, the commands will be executed and a new solid will be created.
|
||||||
|
|
||||||
|
When you assign the result of `createPart()` to a variable (`myPart = createPart()`), you are assigning the executed solid to that variable. Meaning that the solid `myPart` will not be executed again.
|
||||||
|
|
||||||
|
You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamfer`, etc. and the solid will be updated.
|
||||||
|
|
||||||
[`Solid`](/docs/kcl/types/Solid)
|
[`Solid`](/docs/kcl/types/Solid)
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ A sketch surface or a sketch.
|
|||||||
|
|
||||||
**This schema accepts any of the following:**
|
**This schema accepts any of the following:**
|
||||||
|
|
||||||
A sketch surface or a sketch.
|
A sketch type.
|
||||||
|
|
||||||
[`SketchSurface`](/docs/kcl/types/SketchSurface)
|
[`SketchSurface`](/docs/kcl/types/SketchSurface)
|
||||||
|
|
||||||
@ -23,7 +23,41 @@ A sketch surface or a sketch.
|
|||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
A sketch surface or a sketch.
|
A sketch is a collection of paths.
|
||||||
|
|
||||||
|
When you define a sketch to a variable like:
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
mySketch = startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
```
|
||||||
|
|
||||||
|
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
|
||||||
|
|
||||||
|
The previous sketch commands will never be executed again, in this case.
|
||||||
|
|
||||||
|
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
fn createSketch() {
|
||||||
|
return startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
|
||||||
|
|
||||||
|
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
|
||||||
|
|
||||||
|
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `l
|
|||||||
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
|
||||||
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
|
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The original id of the sketch. This stays the same even if the sketch is is sketched on face etc. | No |
|
||||||
| `originalId` |`string`| | No |
|
| `originalId` |`string`| | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch or a group of sketches. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ A plane.
|
|||||||
| `type` |enum: `plane`| | No |
|
| `type` |enum: `plane`| | No |
|
||||||
| `id` |`string`| The id of the plane. | No |
|
| `id` |`string`| The id of the plane. | No |
|
||||||
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
|
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
|
||||||
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A sketch type. | No |
|
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| Type for a plane. | No |
|
||||||
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
|
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
|
||||||
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
|
||||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
|
||||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ A face.
|
|||||||
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
|
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
|
||||||
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
|
||||||
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamf
|
|||||||
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
||||||
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
||||||
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A solid is a collection of extrude surfaces. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ You can still execute _new_ commands on the solid like `shell`, `fillet`, `chamf
|
|||||||
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
| `startCapId` |`string`| The id of the extrusion start cap | No |
|
||||||
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
| `endCapId` |`string`| The id of the extrusion end cap | No |
|
||||||
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
| `edgeCuts` |`[` [`EdgeCut`](/docs/kcl/types/EdgeCut) `]`| Chamfers or fillets on this solid. | No |
|
||||||
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A solid or a group of solids. | No |
|
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A unit of length. | No |
|
||||||
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| Metadata. | No |
|
||||||
|
|
||||||
|
|
||||||
|
15
docs/kcl/types/SourceRange.md
Normal file
15
docs/kcl/types/SourceRange.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "SourceRange"
|
||||||
|
excerpt: ""
|
||||||
|
layout: manual
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
**Type:** `integer` (`uint`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,7 +11,41 @@ A path to sweep along.
|
|||||||
|
|
||||||
**This schema accepts any of the following:**
|
**This schema accepts any of the following:**
|
||||||
|
|
||||||
A path to sweep along.
|
A sketch is a collection of paths.
|
||||||
|
|
||||||
|
When you define a sketch to a variable like:
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
mySketch = startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
```
|
||||||
|
|
||||||
|
The `mySketch` variable will be an executed [`Sketch`](/docs/kcl/types/Sketch) object. Executed being past tense, because the engine has already executed the commands to create the sketch.
|
||||||
|
|
||||||
|
The previous sketch commands will never be executed again, in this case.
|
||||||
|
|
||||||
|
If you would like to encapsulate the commands to create the sketch any time you call it, you can use a function.
|
||||||
|
|
||||||
|
```kcl
|
||||||
|
fn createSketch() {
|
||||||
|
return startSketchOn('XY')
|
||||||
|
|> startProfileAt([-12, 12], %)
|
||||||
|
|> line(end = [24, 0])
|
||||||
|
|> line(end = [0, -24])
|
||||||
|
|> line(end = [-24, 0])
|
||||||
|
|> close()
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, every time you call `createSketch()`, the commands will be executed and a new sketch will be created.
|
||||||
|
|
||||||
|
When you assign the result of `createSketch()` to a variable (`mySketch = createSketch()`), you are assigning the executed sketch to that variable. Meaning that the sketch `mySketch` will not be executed again.
|
||||||
|
|
||||||
|
You can still execute _new_ commands on the sketch like `extrude`, `revolve`, `loft`, etc. and the sketch will be updated.
|
||||||
|
|
||||||
[`Sketch`](/docs/kcl/types/Sketch)
|
[`Sketch`](/docs/kcl/types/Sketch)
|
||||||
|
|
||||||
@ -23,7 +57,7 @@ A path to sweep along.
|
|||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
A path to sweep along.
|
A helix.
|
||||||
|
|
||||||
[`Helix`](/docs/kcl/types/Helix)
|
[`Helix`](/docs/kcl/types/Helix)
|
||||||
|
|
||||||
|
@ -1525,9 +1525,9 @@ export class EngineCommandManager extends EventTarget {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const additionalSettings = this.settings.enableSSAO
|
let additionalSettings = this.settings.enableSSAO ? '&post_effect=ssao' : ''
|
||||||
? '&post_effect=ssao'
|
additionalSettings +=
|
||||||
: ''
|
'&show_grid=' + (this.settings.showScaleGrid ? 'true' : 'false')
|
||||||
const pool = !this.settings.pool ? '' : `&pool=${this.settings.pool}`
|
const pool = !this.settings.pool ? '' : `&pool=${this.settings.pool}`
|
||||||
const url = `${VITE_KC_API_WS_MODELING_URL}?video_res_width=${width}&video_res_height=${height}${additionalSettings}${pool}`
|
const url = `${VITE_KC_API_WS_MODELING_URL}?video_res_width=${width}&video_res_height=${height}${additionalSettings}${pool}`
|
||||||
this.engineConnection = new EngineConnection({
|
this.engineConnection = new EngineConnection({
|
||||||
|
@ -503,10 +503,10 @@ fn generate_function(internal_fn: Box<dyn StdLibFn>) -> Result<BTreeMap<String,
|
|||||||
for arg in internal_fn.args(false) {
|
for arg in internal_fn.args(false) {
|
||||||
if !arg.is_primitive()? {
|
if !arg.is_primitive()? {
|
||||||
add_to_types(&arg.type_, &arg.schema.schema.into(), &mut types)?;
|
add_to_types(&arg.type_, &arg.schema.schema.into(), &mut types)?;
|
||||||
// Add each definition as well.
|
}
|
||||||
for (name, definition) in &arg.schema.definitions {
|
// Add each definition as well.
|
||||||
add_to_types(name, definition, &mut types)?;
|
for (name, definition) in &arg.schema.definitions {
|
||||||
}
|
add_to_types(name, definition, &mut types)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,9 +514,9 @@ fn generate_function(internal_fn: Box<dyn StdLibFn>) -> Result<BTreeMap<String,
|
|||||||
if let Some(ret) = internal_fn.return_value(false) {
|
if let Some(ret) = internal_fn.return_value(false) {
|
||||||
if !ret.is_primitive()? {
|
if !ret.is_primitive()? {
|
||||||
add_to_types(&ret.type_, &ret.schema.schema.into(), &mut types)?;
|
add_to_types(&ret.type_, &ret.schema.schema.into(), &mut types)?;
|
||||||
for (name, definition) in &ret.schema.definitions {
|
}
|
||||||
add_to_types(name, definition, &mut types)?;
|
for (name, definition) in &ret.schema.definitions {
|
||||||
}
|
add_to_types(name, definition, &mut types)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,7 +615,7 @@ fn add_to_types(
|
|||||||
if let Some(items) = &array.items {
|
if let Some(items) = &array.items {
|
||||||
match items {
|
match items {
|
||||||
schemars::schema::SingleOrVec::Single(item) => {
|
schemars::schema::SingleOrVec::Single(item) => {
|
||||||
if is_primitive(item)?.is_some() {
|
if is_primitive(item)?.is_some() && name != "SourceRange" {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
return add_to_types(name.trim_start_matches('[').trim_end_matches(']'), item, types);
|
return add_to_types(name.trim_start_matches('[').trim_end_matches(']'), item, types);
|
||||||
@ -627,7 +627,6 @@ fn add_to_types(
|
|||||||
}
|
}
|
||||||
add_to_types(name.trim_start_matches('[').trim_end_matches(']'), item, types)?;
|
add_to_types(name.trim_start_matches('[').trim_end_matches(']'), item, types)?;
|
||||||
}
|
}
|
||||||
return Ok(());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -819,11 +818,13 @@ fn recurse_and_create_references(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If we already have a reference add the metadata to the reference if it has none.
|
// If we already have a reference add the metadata to the reference if it has none.
|
||||||
if o.reference.is_some() {
|
if let Some(reference) = &o.reference {
|
||||||
let mut obj = o.clone();
|
let mut obj = o.clone();
|
||||||
|
let reference = reference.trim_start_matches("#/components/schemas/");
|
||||||
let t = types
|
let t = types
|
||||||
.get(name)
|
.get(reference)
|
||||||
.ok_or_else(|| anyhow::anyhow!("Failed to get type: {}", name))?;
|
.ok_or_else(|| anyhow::anyhow!("Failed to get type: {} {:?}", reference, types.keys()))?;
|
||||||
|
|
||||||
let schemars::schema::Schema::Object(to) = t else {
|
let schemars::schema::Schema::Object(to) = t else {
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
"Failed to get object schema, should have not been a primitive"
|
"Failed to get object schema, should have not been a primitive"
|
||||||
@ -836,6 +837,9 @@ fn recurse_and_create_references(
|
|||||||
} else {
|
} else {
|
||||||
obj.metadata = to.metadata.clone();
|
obj.metadata = to.metadata.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let obj = cleanup_type_description(&obj)
|
||||||
|
.map_err(|e| anyhow::anyhow!("Failed to cleanup type description for type `{}`: {}", name, e))?;
|
||||||
return Ok(schemars::schema::Schema::Object(obj));
|
return Ok(schemars::schema::Schema::Object(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,7 +903,7 @@ async fn test_kcl_lsp_on_hover() {
|
|||||||
|
|
||||||
// Check the hover.
|
// Check the hover.
|
||||||
if let Some(hover) = hover {
|
if let Some(hover) = hover {
|
||||||
assert_eq!(hover.contents, tower_lsp::lsp_types::HoverContents::Markup(tower_lsp::lsp_types::MarkupContent { kind: tower_lsp::lsp_types::MarkupKind::Markdown, value: "```startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface```\nStart a new 2-dimensional sketch on a specific plane or face.".to_string() }));
|
assert_eq!(hover.contents, tower_lsp::lsp_types::HoverContents::Markup(tower_lsp::lsp_types::MarkupContent { kind: tower_lsp::lsp_types::MarkupKind::Markdown, value: "```startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface```\nStart a new 2-dimensional sketch on a specific plane or face.\n\n### Sketch on Face Behavior\n\nThere are some important behaviors to understand when sketching on a face:\n\nThe resulting sketch will _include_ the face and thus Solid that was sketched on. So say you were to export the resulting Sketch / Solid from a sketch on a face, you would get both the artifact of the sketch on the face and the parent face / Solid itself.\n\nThis is important to understand because if you were to then sketch on the resulting Solid, it would again include the face and parent Solid that was sketched on. This could go on indefinitely.\n\nThe point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids.".to_string() }));
|
||||||
} else {
|
} else {
|
||||||
panic!("Expected hover");
|
panic!("Expected hover");
|
||||||
}
|
}
|
||||||
|
@ -1009,6 +1009,24 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
|
|||||||
|
|
||||||
/// Start a new 2-dimensional sketch on a specific plane or face.
|
/// Start a new 2-dimensional sketch on a specific plane or face.
|
||||||
///
|
///
|
||||||
|
/// ### Sketch on Face Behavior
|
||||||
|
///
|
||||||
|
/// There are some important behaviors to understand when sketching on a face:
|
||||||
|
///
|
||||||
|
/// The resulting sketch will _include_ the face and thus Solid
|
||||||
|
/// that was sketched on. So say you were to export the resulting Sketch / Solid
|
||||||
|
/// from a sketch on a face, you would get both the artifact of the sketch
|
||||||
|
/// on the face and the parent face / Solid itself.
|
||||||
|
///
|
||||||
|
/// This is important to understand because if you were to then sketch on the
|
||||||
|
/// resulting Solid, it would again include the face and parent Solid that was
|
||||||
|
/// sketched on. This could go on indefinitely.
|
||||||
|
///
|
||||||
|
/// The point is if you want to export the result of a sketch on a face, you
|
||||||
|
/// only need to export the final Solid that was created from the sketch on the
|
||||||
|
/// face, since it will include all the parent faces and Solids.
|
||||||
|
///
|
||||||
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// exampleSketch = startSketchOn("XY")
|
/// exampleSketch = startSketchOn("XY")
|
||||||
/// |> startProfileAt([0, 0], %)
|
/// |> startProfileAt([0, 0], %)
|
||||||
|
Reference in New Issue
Block a user