Compare commits
5 Commits
nicboone8-
...
pierremtb/
| Author | SHA1 | Date | |
|---|---|---|---|
| 09ca9cb207 | |||
| 4159cc0047 | |||
| 3936017f10 | |||
| aa219ffc61 | |||
| 42e09e8b5e |
@ -44,7 +44,7 @@ detail on importing geometry.
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### `TagDeclarator`
|
||||
### Tag declarations - `TagDecl`
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
@ -67,24 +67,28 @@ startSketchOn(XZ)
|
||||
|> close()
|
||||
```
|
||||
|
||||
### `TagIdentifier`
|
||||
When a function requires declaring a new tag (using the `$` syntax), the argument has type [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
### Tag identifiers
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001)`.
|
||||
A tag created using a tag declarator can be used by writing its name without the `$`, e.g., `myTag`.
|
||||
Where necessary to disambiguate from tag declarations, we call these tag identifiers.
|
||||
|
||||
### `Start`
|
||||
In the example above we use the tag identifier `rectangleSegmentA001` to get the angle of the segment
|
||||
using `segAng(rectangleSegmentA001)`.
|
||||
|
||||
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
|
||||
is extruded).
|
||||
Tags can identify either an edge or face of a solid, or a line or other edge of a sketch. Functions
|
||||
which take a tag identifier as an argument will use either [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) (for the edge of a
|
||||
solid or sketch) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace).
|
||||
|
||||
### `End`
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before
|
||||
extrusion and a `TaggedFace` after extrusion.
|
||||
|
||||
#### `START` and `END`
|
||||
|
||||
[`START`](/docs/kcl-std/consts/std-START) and [`END`](/docs/kcl-std/consts/std-END) are special tags
|
||||
for identifying the starting and ending faces of an extruded solid.
|
||||
|
||||
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was finishes an extrusion.
|
||||
|
||||
### Tag Scope
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
|
||||
|
||||
```kcl
|
||||
END: string = 'end'
|
||||
END: TaggedFace
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||
|
||||
```kcl
|
||||
START: string = 'start'
|
||||
START: TaggedFace
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) - A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
The X-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
X
|
||||
X: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
||||
|
||||
```kcl
|
||||
XY
|
||||
XY: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
|
||||
|
||||
```kcl
|
||||
XZ
|
||||
XZ: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
The Y-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
Y
|
||||
Y: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
|
||||
|
||||
```kcl
|
||||
YZ
|
||||
YZ: Plane
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Plane`](/docs/kcl-std/types/std-types-Plane) - An abstract plane.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
The 3D Z-axis.
|
||||
|
||||
```kcl
|
||||
Z
|
||||
Z: Axis3d
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`Axis3d`](/docs/kcl-std/types/std-types-Axis3d) - An abstract and infinite line in 3d space.
|
||||
|
||||
|
||||
|
||||
@ -13,6 +13,10 @@ E: number = 2.71828182845904523536028747135266250_
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
|
||||
@ -11,7 +11,7 @@ The value of `pi`, Archimedes’ constant (π).
|
||||
PI: number(_?) = 3.14159265358979323846264338327950288_?
|
||||
```
|
||||
|
||||
`PI` is a number and is technically a ratio, so you might expect it to have type `number(_)`.
|
||||
`PI` is a number and is technically a ratio, so you might expect it to have type [`number(_)`](/docs/kcl-std/types/std-types-number).
|
||||
However, `PI` is nearly always used for converting between different units - usually degrees to or
|
||||
from radians. Therefore, `PI` is treated a bit specially by KCL and always has unknown units. This
|
||||
means that if you use `PI`, you will need to give KCL some extra information about the units of numbers.
|
||||
@ -19,6 +19,10 @@ Usually you should use type ascription on the result of calculations, e.g., `(2
|
||||
It is better to use `units::toRadians` or `units::toDegrees` to convert between angles with
|
||||
different units where possible.
|
||||
|
||||
### Type
|
||||
|
||||
[`number(_?)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
|
||||
@ -13,6 +13,10 @@ TAU: number = 6.28318530717958647692528676655900577_
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
### Examples
|
||||
|
||||
```kcl
|
||||
|
||||
@ -13,4 +13,8 @@ sweep::SKETCH_PLANE: string = 'sketchPlane'
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters
|
||||
|
||||
|
||||
|
||||
@ -13,4 +13,8 @@ sweep::TRAJECTORY: string = 'trajectoryCurve'
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`string`](/docs/kcl-std/types/std-types-string) - A sequence of characters
|
||||
|
||||
|
||||
|
||||
@ -13,4 +13,8 @@ turns::HALF_TURN: number(deg) = 180deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
||||
@ -13,4 +13,8 @@ turns::QUARTER_TURN: number(deg) = 90deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
||||
@ -13,4 +13,8 @@ turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(deg)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
||||
@ -8,9 +8,13 @@ layout: manual
|
||||
No turn, zero degrees/radians.
|
||||
|
||||
```kcl
|
||||
turns::ZERO
|
||||
turns::ZERO: number(Angle)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Type
|
||||
|
||||
[`number(Angle)`](/docs/kcl-std/types/std-types-number) - A number.
|
||||
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ angledLine(
|
||||
lengthY?: number(Length),
|
||||
endAbsoluteX?: number(Length),
|
||||
endAbsoluteY?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -33,7 +33,7 @@ angledLine(
|
||||
| `lengthY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteX` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteY` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -11,9 +11,9 @@ Draw an angled line from the current origin, constructing a line segment such th
|
||||
angledLineThatIntersects(
|
||||
@sketch: Sketch,
|
||||
angle: number(Angle),
|
||||
intersectTag: tag,
|
||||
intersectTag: TaggedEdge,
|
||||
offset?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,9 +25,9 @@ angledLineThatIntersects(
|
||||
|----------|------|-------------|----------|
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
|
||||
| `intersectTag` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the line to intersect with. | Yes |
|
||||
| `intersectTag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the line to intersect with. | Yes |
|
||||
| `offset` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ arc(
|
||||
diameter?: number(Length),
|
||||
interiorAbsolute?: Point2d,
|
||||
endAbsolute?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -40,7 +40,7 @@ for to construct your shape, you're likely looking for tangentialArc.
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How large should the circle be? Incompatible with `radius`. | No |
|
||||
| `interiorAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Any point between the arc's start and end? Requires `endAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ bezierCurve(
|
||||
control1Absolute?: Point2d,
|
||||
control2Absolute?: Point2d,
|
||||
endAbsolute?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -33,7 +33,7 @@ bezierCurve(
|
||||
| `control1Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic. Absolute point. | No |
|
||||
| `control2Absolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic. Absolute point. | No |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Coordinate on the plane at which this line should end. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ circle(
|
||||
center: Point2d,
|
||||
radius?: number(Length),
|
||||
diameter?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ circle(
|
||||
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center of the circle. | Yes |
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the circle. Incompatible with `diameter`. | No |
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The diameter of the circle. Incompatible with `radius`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this circle. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this circle. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ circleThreePoint(
|
||||
p1: Point2d,
|
||||
p2: Point2d,
|
||||
p3: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ circleThreePoint(
|
||||
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
|
||||
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Identifier for the circle to reference elsewhere. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Identifier for the circle to reference elsewhere. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Construct a line segment from the current origin back to the profile's origin, e
|
||||
```kcl
|
||||
close(
|
||||
@sketch: Sketch,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -24,7 +24,7 @@ starting point.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | The sketch you want to close. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -13,8 +13,8 @@ extrude(
|
||||
length: number(Length),
|
||||
symmetric?: bool,
|
||||
bidirectionalLength?: number(Length),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]
|
||||
```
|
||||
|
||||
@ -29,8 +29,8 @@ extruded in the same direction.
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far to extrude the given sketches. | Yes |
|
||||
| `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 |
|
||||
| `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` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the extrusion, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch. | 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 |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -30,8 +30,8 @@ extruded in the same direction with the same twist.
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The total angle that the sketch will be twisted around | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far to extrude the given sketches. | Yes |
|
||||
| `angleStep` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The size of each intermediate angle as the sketch twists around. Must be between 4 and 90 degrees. Defaults to 15 degrees. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the extrusion, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch. | No |
|
||||
| `tagStart` | `tag` | A named tag for the face at the start of the extrusion, i.e. the original sketch. | No |
|
||||
| `tagEnd` | `tag` | A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch. | No |
|
||||
| `center` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The center around which the sketch will be twisted. Relative to the sketch's center. If not given, defaults to 0,0 i.e. the sketch's center. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the shared edge between two faces.
|
||||
|
||||
```kcl
|
||||
getCommonEdge(faces: [tag; 2]): Edge
|
||||
getCommonEdge(faces: [TaggedFace; 2]): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getCommonEdge(faces: [tag; 2]): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `faces` | `[tag; 2]` | The tags of the faces you want to find the common edge between. | Yes |
|
||||
| `faces` | `[TaggedFace; 2]` | The tags of the faces you want to find the common edge between. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the next adjacent edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getNextAdjacentEdge(@edge: tag): Edge
|
||||
getNextAdjacentEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getNextAdjacentEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the next adjacent edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the next adjacent edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the opposite edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getOppositeEdge(@edge: tag): Edge
|
||||
getOppositeEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getOppositeEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the opposite edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the opposite edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Get the previous adjacent edge to the edge given.
|
||||
|
||||
```kcl
|
||||
getPreviousAdjacentEdge(@edge: tag): Edge
|
||||
getPreviousAdjacentEdge(@edge: TaggedEdge): Edge
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(@edge: tag): Edge
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `edge` | [`tag`](/docs/kcl-std/types/std-types-tag) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
|
||||
| `edge` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The tag of the edge you want to find the previous adjacent edge of. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ involuteCircular(
|
||||
endRadius: number(Length),
|
||||
angle: number(Angle),
|
||||
reverse?: bool,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ involuteCircular(
|
||||
| `endRadius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The involute is described between two circles, end_radius is the radius of the outer circle. | Yes |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | The angle to rotate the involute by. A value of zero will produce a curve with a tangent along the x-axis at the start point of the curve. | Yes |
|
||||
| `reverse` | [`bool`](/docs/kcl-std/types/std-types-bool) | If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ line(
|
||||
@sketch: Sketch,
|
||||
endAbsolute?: Point2d,
|
||||
end?: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ line(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `endAbsolute` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Which absolute point should this line go to? Incompatible with `end`. | No |
|
||||
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -14,8 +14,8 @@ loft(
|
||||
bezApproximateRational?: bool,
|
||||
baseCurveIndex?: number(_),
|
||||
tolerance?: number(Length),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -30,8 +30,8 @@ The sketches need to be closed and on different planes that are parallel.
|
||||
| `bezApproximateRational` | [`bool`](/docs/kcl-std/types/std-types-bool) | Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios. Over time, this field won't be necessary. | No |
|
||||
| `baseCurveIndex` | [`number(_)`](/docs/kcl-std/types/std-types-number) | This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the loft operation. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the loft, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the loft. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the loft, 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 loft. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -15,8 +15,8 @@ revolve(
|
||||
tolerance?: number(Length),
|
||||
symmetric?: bool,
|
||||
bidirectionalAngle?: number(Angle),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]
|
||||
```
|
||||
|
||||
@ -41,8 +41,8 @@ revolved around the same axis.
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Tolerance for the revolve operation. | 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 |
|
||||
| `bidirectionalAngle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the revolve. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the revolve, 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 revolve. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the angle (in degrees) of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segAng(@tag: tag): number(Angle)
|
||||
segAng(@tag: TaggedEdge): number(Angle)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segAng(@tag: tag): number(Angle)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segEnd(@tag: tag): Point2d
|
||||
segEnd(@tag: TaggedEdge): Point2d
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEnd(@tag: tag): Point2d
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment along the 'x' axis.
|
||||
|
||||
```kcl
|
||||
segEndX(@tag: tag): number(Length)
|
||||
segEndX(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEndX(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the ending point of the provided line segment along the 'y' axis.
|
||||
|
||||
```kcl
|
||||
segEndY(@tag: tag): number(Length)
|
||||
segEndY(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segEndY(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the length of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segLen(@tag: tag): number(Length)
|
||||
segLen(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segLen(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment.
|
||||
|
||||
```kcl
|
||||
segStart(@tag: tag): Point2d
|
||||
segStart(@tag: TaggedEdge): Point2d
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStart(@tag: tag): Point2d
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment along the 'x' axis.
|
||||
|
||||
```kcl
|
||||
segStartX(@tag: tag): number(Length)
|
||||
segStartX(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStartX(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Compute the starting point of the provided line segment along the 'y' axis.
|
||||
|
||||
```kcl
|
||||
segStartY(@tag: tag): number(Length)
|
||||
segStartY(@tag: TaggedEdge): number(Length)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ segStartY(@tag: tag): number(Length)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Start a new profile at a given point.
|
||||
startProfile(
|
||||
@startProfileOn: Plane | Face,
|
||||
at: Point2d,
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -23,7 +23,7 @@ startProfile(
|
||||
|----------|------|-------------|----------|
|
||||
| `startProfileOn` | [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | What to start the profile on. | Yes |
|
||||
| `at` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Where to start the profile. An absolute point. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Tag this first starting point. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Tag this first starting point. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ Start a new 2-dimensional sketch on a specific plane or face.
|
||||
```kcl
|
||||
startSketchOn(
|
||||
@planeOrSolid: Solid | Plane,
|
||||
face?: tag,
|
||||
face?: TaggedFace,
|
||||
): Plane | Face
|
||||
```
|
||||
|
||||
@ -36,7 +36,7 @@ face, since it will include all the parent faces and Solids.
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `planeOrSolid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) or [`Plane`](/docs/kcl-std/types/std-types-Plane) | Profile whose start is being used. | Yes |
|
||||
| `face` | [`tag`](/docs/kcl-std/types/std-types-tag) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
|
||||
| `face` | [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) | Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`). | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -14,8 +14,8 @@ sweep(
|
||||
sectional?: bool,
|
||||
tolerance?: number(Length),
|
||||
relativeTo?: string,
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]
|
||||
```
|
||||
|
||||
@ -37,8 +37,8 @@ swept along the same path.
|
||||
| `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) | Tolerance for this operation. | No |
|
||||
| `relativeTo` | [`string`](/docs/kcl-std/types/std-types-string) | What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'. | No |
|
||||
| `tagStart` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the start of the sweep, i.e. the original sketch. | No |
|
||||
| `tagEnd` | [`tag`](/docs/kcl-std/types/std-types-tag) | A named tag for the face at the end of the sweep. | No |
|
||||
| `tagStart` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | A named tag for the face at the start of the sweep, 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 sweep. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ layout: manual
|
||||
Returns the angle coming out of the end of the segment in degrees.
|
||||
|
||||
```kcl
|
||||
tangentToEnd(@tag: tag): number(Angle)
|
||||
tangentToEnd(@tag: TaggedEdge): number(Angle)
|
||||
```
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ tangentToEnd(@tag: tag): number(Angle)
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | The line segment being queried by its tag. | Yes |
|
||||
| `tag` | [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) | The line segment being queried by its tag. | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ tangentialArc(
|
||||
radius?: number(Length),
|
||||
diameter?: number(Length),
|
||||
angle?: number(Angle),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -35,7 +35,7 @@ for 'angle' degrees along the imaginary circle.
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Radius of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `diameter`. | No |
|
||||
| `diameter` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Diameter of the imaginary circle. `angle` must be given. Incompatible with `end` and `endAbsolute` and `radius`. | No |
|
||||
| `angle` | [`number(Angle)`](/docs/kcl-std/types/std-types-number) | Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this arc. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this arc. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ xLine(
|
||||
@sketch: Sketch,
|
||||
length?: number(Length),
|
||||
endAbsolute?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ xLine(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the X axis should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute X value should this line go to? Incompatible with `length`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ yLine(
|
||||
@sketch: Sketch,
|
||||
length?: number(Length),
|
||||
endAbsolute?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
@ -25,7 +25,7 @@ yLine(
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | How far away along the Y axis should this line go? Incompatible with `endAbsolute`. | No |
|
||||
| `endAbsolute` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | Which absolute Y value should this line go to? Incompatible with `length`. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this line. | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this line. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ chamfer(
|
||||
@solid: Solid,
|
||||
length: number(Length),
|
||||
tags: [Edge; 1+],
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -27,7 +27,7 @@ a sharp, straight transitional edge.
|
||||
| `solid` | [`Solid`](/docs/kcl-std/types/std-types-Solid) | The solid whose edges should be chamfered | Yes |
|
||||
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The length of the chamfer | Yes |
|
||||
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to chamfer | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this chamfer | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this chamfer | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ fillet(
|
||||
radius: number(Length),
|
||||
tags: [Edge; 1+],
|
||||
tolerance?: number(Length),
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ will smoothly blend the transition.
|
||||
| `radius` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The radius of the fillet | Yes |
|
||||
| `tags` | [`[Edge; 1+]`](/docs/kcl-std/types/std-types-Edge) | The paths you want to fillet | Yes |
|
||||
| `tolerance` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The tolerance for this fillet | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`tag`](/docs/kcl-std/types/std-types-tag) | Create a new tag which refers to this fillet | No |
|
||||
| `tag` | [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl) | Create a new tag which refers to this fillet | No |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Remove volume from a 3-dimensional shape such that a wall of the provided thickn
|
||||
shell(
|
||||
@solids: [Solid; 1+],
|
||||
thickness: number(Length),
|
||||
faces: [tag; 1+],
|
||||
faces: [TaggedFace; 1+],
|
||||
): [Solid]
|
||||
```
|
||||
|
||||
@ -23,7 +23,7 @@ shell(
|
||||
|----------|------|-------------|----------|
|
||||
| `solids` | [`[Solid; 1+]`](/docs/kcl-std/types/std-types-Solid) | Which solid (or solids) to shell out | Yes |
|
||||
| `thickness` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | The thickness of the shell | Yes |
|
||||
| `faces` | [`[tag; 1+]`](/docs/kcl-std/types/std-types-tag) | The faces you want removed | Yes |
|
||||
| `faces` | [`[TaggedFace; 1+]`](/docs/kcl-std/types/std-types-TaggedFace) | The faces you want removed | Yes |
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
@ -146,12 +146,12 @@ See also the [types overview](/docs/kcl-lang/types)
|
||||
|
||||
* [**Primitive types**](/docs/kcl-lang/types)
|
||||
* [`ImportedGeometry`](/docs/kcl-std/types/std-types-ImportedGeometry)
|
||||
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
|
||||
* [`any`](/docs/kcl-std/types/std-types-any)
|
||||
* [`bool`](/docs/kcl-std/types/std-types-bool)
|
||||
* [`fn`](/docs/kcl-std/types/std-types-fn)
|
||||
* [`number`](/docs/kcl-std/types/std-types-number)
|
||||
* [`string`](/docs/kcl-std/types/std-types-string)
|
||||
* [`tag`](/docs/kcl-std/types/std-types-tag)
|
||||
* [**std::types**](/docs/kcl-std/modules/std-types)
|
||||
* [`Axis2d`](/docs/kcl-std/types/std-types-Axis2d)
|
||||
* [`Axis3d`](/docs/kcl-std/types/std-types-Axis3d)
|
||||
@ -163,3 +163,5 @@ See also the [types overview](/docs/kcl-lang/types)
|
||||
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
|
||||
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
|
||||
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
|
||||
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
|
||||
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
|
||||
|
||||
@ -24,6 +24,9 @@ Types can (optionally) be used to describe a function's arguments and returned v
|
||||
* [`Point3d`](/docs/kcl-std/types/std-types-Point3d)
|
||||
* [`Sketch`](/docs/kcl-std/types/std-types-Sketch)
|
||||
* [`Solid`](/docs/kcl-std/types/std-types-Solid)
|
||||
* [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)
|
||||
* [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge)
|
||||
* [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace)
|
||||
* [`any`](/docs/kcl-std/types/std-types-any)
|
||||
* [`bool`](/docs/kcl-std/types/std-types-bool)
|
||||
* [`fn`](/docs/kcl-std/types/std-types-fn)
|
||||
|
||||
102
docs/kcl-std/types/std-types-TagDecl.md
Normal file
102
docs/kcl-std/types/std-types-TagDecl.md
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
title: "TagDecl"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### Tag Declaration
|
||||
|
||||
The syntax for declaring a tag is `$myTag`. You would use it in the following
|
||||
way:
|
||||
|
||||
```js
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
```
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
rect(origin = [20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
myRect = rect(origin = [20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(length = 10)
|
||||
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
|
||||
|
||||
|
||||
17
docs/kcl-std/types/std-types-TaggedEdge.md
Normal file
17
docs/kcl-std/types/std-types-TaggedEdge.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "TaggedEdge"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A tag which references a line, arc, or other edge in a sketch or an edge of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A tag which references a line, arc, or other edge in a sketch or an edge of a solid.
|
||||
|
||||
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)). Can be used where an [`Edge`](/docs/kcl-std/types/std-types-Edge) is
|
||||
required.
|
||||
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
|
||||
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.
|
||||
|
||||
|
||||
|
||||
16
docs/kcl-std/types/std-types-TaggedFace.md
Normal file
16
docs/kcl-std/types/std-types-TaggedFace.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "TaggedFace"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A tag which references a face of a solid, including the distinguished tags `START` and `END`."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
|
||||
Created by using a tag declarator (see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl)).
|
||||
|
||||
If a line in a sketch is tagged and then the sketch is extruded, the tag is a [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) before
|
||||
extrusion and a [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace) after extrusion.
|
||||
|
||||
|
||||
|
||||
@ -1,109 +1,19 @@
|
||||
---
|
||||
title: "tag"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
excerpt: "Reference a previously created tag. Used much like a variable."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
**WARNING:** This type is deprecated.
|
||||
|
||||
### Tag Declaration
|
||||
Reference a previously created tag. Used much like a variable.
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
|
||||
```js
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
```kcl
|
||||
type tag = TaggedEdge
|
||||
```
|
||||
|
||||
### Tag Identifier
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001)`.
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
rect(origin = [20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```js
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
length = 196.99
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001)
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
myRect = rect(origin = [20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(length = 10)
|
||||
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
Prefer to use [`TaggedEdge`](/docs/kcl-std/types/std-types-TaggedEdge) or [`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace). For more details on tags, see the docs for [`TagDecl`](/docs/kcl-std/types/std-types-TagDecl).
|
||||
|
||||
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found a value with type `string`.'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -369,7 +369,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found a value with type `string`.'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
|
||||
// black pixel means the scene has been cleared.
|
||||
@ -408,7 +408,7 @@ test(
|
||||
// error text on hover
|
||||
await page.hover('.cm-lint-marker-error')
|
||||
const crypticErrorText =
|
||||
'tag requires a value with type `tag`, but found a value with type `string`.'
|
||||
'tag requires a value with type `TagDecl`, but found a value with type `string`.'
|
||||
await expect(page.getByText(crypticErrorText).first()).toBeVisible()
|
||||
}
|
||||
)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Axial Fan
|
||||
// PC Fan
|
||||
// A small axial fan, used to push or draw airflow over components to remove excess heat
|
||||
|
||||
// Set units
|
||||
|
||||
@ -11,7 +11,7 @@ centerHoleDiameter = 1 + 3 / 4
|
||||
plateThickness = 0.375
|
||||
|
||||
// Check that the plate is thick enough to countersink a hole
|
||||
assert(plateThickness, isGreaterThan = boltDiameter, error = "This plate is not thick enough for the necessary countersink dimensions")
|
||||
// assertGreaterThan(plateThickness, boltDiameter, "This plate is not thick enough for the necessary countersink dimensions")
|
||||
|
||||
// A bit of math to calculate the tangent line between the two diameters
|
||||
r1 = centerHoleDiameter / 2 * 1.5 + .35
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"file": "main.kcl",
|
||||
"pathFromProjectDirectoryToFirstFile": "axial-fan/main.kcl",
|
||||
"multipleFiles": true,
|
||||
"title": "Axial Fan",
|
||||
"title": "PC Fan",
|
||||
"description": "A small axial fan, used to push or draw airflow over components to remove excess heat",
|
||||
"files": [
|
||||
"fan-housing.kcl",
|
||||
@ -667,7 +667,7 @@
|
||||
"pathFromProjectDirectoryToFirstFile": "t-slot-rail/main.kcl",
|
||||
"multipleFiles": false,
|
||||
"title": "T-Slotted Framing Rail",
|
||||
"description": "A T-slotted framing rail, commonly known as an 80/20 rail, is a rectangular or square aluminum extrusion with a \"T\" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.",
|
||||
"description": "A T-slotted framing rail, or T-slot extrusion, is a rectangular or square aluminum profile with a \"T\" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.",
|
||||
"files": [
|
||||
"main.kcl"
|
||||
]
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
@ -1,5 +1,5 @@
|
||||
// T-Slotted Framing Rail
|
||||
// A T-slotted framing rail, commonly known as an 80/20 rail, is a rectangular or square aluminum extrusion with a "T" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.
|
||||
// A T-slotted framing rail, or T-slot extrusion, is a rectangular or square aluminum profile with a "T" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.
|
||||
|
||||
// Set units
|
||||
@settings(defaultLengthUnit = in, kclVersion = 1.0)
|
||||
|
||||
@ -1232,7 +1232,7 @@ secondSketch = startSketchOn(part001, face = '')
|
||||
let err = err.as_kcl_error().unwrap();
|
||||
assert_eq!(
|
||||
err.message(),
|
||||
"face requires a value with type `tag`, but found a value with type `string`."
|
||||
"face requires a value with type `TaggedFace`, but found a value with type `string`."
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -351,7 +351,7 @@ fn docs_for_type(ty: &str, kcl_std: &ModData) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
fn generate_const_from_kcl(cnst: &ConstData, file_name: String, example_name: String) -> Result<()> {
|
||||
fn generate_const_from_kcl(cnst: &ConstData, file_name: String, example_name: String, kcl_std: &ModData) -> Result<()> {
|
||||
if cnst.properties.doc_hidden {
|
||||
return Ok(());
|
||||
}
|
||||
@ -371,11 +371,13 @@ fn generate_const_from_kcl(cnst: &ConstData, file_name: String, example_name: St
|
||||
"description": cnst.description,
|
||||
"deprecated": cnst.properties.deprecated,
|
||||
"type_": cnst.ty,
|
||||
"type_desc": cnst.ty.as_ref().map(|t| docs_for_type(t, kcl_std).unwrap_or_default()),
|
||||
"examples": examples,
|
||||
"value": cnst.value.as_deref().unwrap_or(""),
|
||||
});
|
||||
|
||||
let output = hbs.render("const", &data)?;
|
||||
let output = cleanup_types(&output, kcl_std);
|
||||
expectorate::assert_contents(format!("../../docs/kcl-std/{}.md", file_name), &output);
|
||||
|
||||
Ok(())
|
||||
@ -529,7 +531,8 @@ fn cleanup_type_string(input: &str, fmt_for_text: bool, kcl_std: &ModData) -> St
|
||||
format!("[{prefix}{ty}{suffix}](/docs/kcl-std/types/std-types-number)")
|
||||
} else if fmt_for_text && ty.starts_with("fn") {
|
||||
format!("[{prefix}{ty}{suffix}](/docs/kcl-std/types/std-types-fn)")
|
||||
} else if fmt_for_text && matches!(kcl_std.find_by_name(ty), Some(DocData::Ty(_))) {
|
||||
// Special case for `tag` because it exists as a type but is deprecated and mostly used as an arg name
|
||||
} else if fmt_for_text && matches!(kcl_std.find_by_name(ty), Some(DocData::Ty(_))) && ty != "tag" {
|
||||
format!("[{prefix}{ty}{suffix}](/docs/kcl-std/types/std-types-{ty})")
|
||||
} else {
|
||||
format!("{prefix}{ty}{suffix}")
|
||||
@ -550,7 +553,7 @@ fn test_generate_stdlib_markdown_docs() {
|
||||
for d in kcl_std.all_docs() {
|
||||
match d {
|
||||
DocData::Fn(f) => generate_function_from_kcl(f, d.file_name(), d.example_name(), &kcl_std).unwrap(),
|
||||
DocData::Const(c) => generate_const_from_kcl(c, d.file_name(), d.example_name()).unwrap(),
|
||||
DocData::Const(c) => generate_const_from_kcl(c, d.file_name(), d.example_name(), &kcl_std).unwrap(),
|
||||
DocData::Ty(t) => generate_type_from_kcl(t, d.file_name(), d.example_name(), &kcl_std).unwrap(),
|
||||
DocData::Mod(m) => generate_mod_from_kcl(m, d.file_name()).unwrap(),
|
||||
}
|
||||
|
||||
@ -359,6 +359,7 @@ impl ConstData {
|
||||
crate::parsing::ast::types::LiteralValue::Bool { .. } => "boolean".to_owned(),
|
||||
}),
|
||||
),
|
||||
crate::parsing::ast::types::Expr::AscribedExpression(e) => (None, Some(e.ty.to_string())),
|
||||
_ => (None, None),
|
||||
};
|
||||
|
||||
@ -831,7 +832,7 @@ impl ArgData {
|
||||
Some("Edge") => Some((index, format!(r#"{label}${{{index}:tag_or_edge_fn}}"#))),
|
||||
Some("[Edge; 1+]") => Some((index, format!(r#"{label}[${{{index}:tag_or_edge_fn}}]"#))),
|
||||
Some("Plane") | Some("Solid | Plane") => Some((index, format!(r#"{label}${{{}:XY}}"#, index))),
|
||||
Some("[tag; 2]") => Some((
|
||||
Some("[TaggedFace; 2]") => Some((
|
||||
index + 1,
|
||||
format!(r#"{label}[${{{}:tag}}, ${{{}:tag}}]"#, index, index + 1),
|
||||
)),
|
||||
@ -1098,7 +1099,7 @@ trait ApplyMeta {
|
||||
self.impl_kind(annotations::Impl::from_str(s).unwrap());
|
||||
}
|
||||
}
|
||||
"deprecated" => {
|
||||
annotations::DEPRECATED => {
|
||||
if let Some(b) = p.value.literal_bool() {
|
||||
self.deprecated(b);
|
||||
}
|
||||
|
||||
@ -281,8 +281,8 @@ mod tests {
|
||||
length: number(Length),
|
||||
symmetric?: bool,
|
||||
bidirectionalLength?: number(Length),
|
||||
tagStart?: tag,
|
||||
tagEnd?: tag,
|
||||
tagStart?: TagDecl,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+]"#
|
||||
);
|
||||
}
|
||||
|
||||
6
rust/kcl-lib/src/docs/templates/const.hbs
vendored
6
rust/kcl-lib/src/docs/templates/const.hbs
vendored
@ -17,6 +17,12 @@ layout: manual
|
||||
|
||||
{{{description}}}
|
||||
|
||||
{{#if type_}}
|
||||
### Type
|
||||
|
||||
`{{type_}}`{{#if type_desc}} - {{{firstLine type_desc}}}{{/if}}
|
||||
|
||||
{{/if}}
|
||||
{{#if examples}}
|
||||
### Examples
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@ pub(crate) const IMPL_KCL: &str = "kcl";
|
||||
pub(crate) const IMPL_PRIMITIVE: &str = "primitive";
|
||||
pub(super) const IMPL_VALUES: [&str; 3] = [IMPL_RUST, IMPL_KCL, IMPL_PRIMITIVE];
|
||||
|
||||
pub(crate) const DEPRECATED: &str = "deprecated";
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug, Default)]
|
||||
pub enum Impl {
|
||||
#[default]
|
||||
|
||||
@ -84,16 +84,16 @@ impl RuntimeType {
|
||||
RuntimeType::Primitive(PrimitiveType::Face)
|
||||
}
|
||||
|
||||
pub fn tag() -> Self {
|
||||
RuntimeType::Primitive(PrimitiveType::Tag)
|
||||
}
|
||||
|
||||
pub fn tag_decl() -> Self {
|
||||
RuntimeType::Primitive(PrimitiveType::TagDecl)
|
||||
}
|
||||
|
||||
pub fn tag_identifier() -> Self {
|
||||
RuntimeType::Primitive(PrimitiveType::TagId)
|
||||
pub fn tagged_face() -> Self {
|
||||
RuntimeType::Primitive(PrimitiveType::TaggedFace)
|
||||
}
|
||||
|
||||
pub fn tagged_edge() -> Self {
|
||||
RuntimeType::Primitive(PrimitiveType::TaggedEdge)
|
||||
}
|
||||
|
||||
pub fn bool() -> Self {
|
||||
@ -196,7 +196,7 @@ impl RuntimeType {
|
||||
RuntimeType::Primitive(PrimitiveType::Number(ty))
|
||||
}
|
||||
AstPrimitiveType::Named { id } => Self::from_alias(&id.name, exec_state, source_range)?,
|
||||
AstPrimitiveType::Tag => RuntimeType::Primitive(PrimitiveType::Tag),
|
||||
AstPrimitiveType::TagDecl => RuntimeType::Primitive(PrimitiveType::TagDecl),
|
||||
AstPrimitiveType::ImportedGeometry => RuntimeType::Primitive(PrimitiveType::ImportedGeometry),
|
||||
AstPrimitiveType::Function(_) => RuntimeType::Primitive(PrimitiveType::Function),
|
||||
})
|
||||
@ -383,8 +383,8 @@ pub enum PrimitiveType {
|
||||
Number(NumericType),
|
||||
String,
|
||||
Boolean,
|
||||
Tag,
|
||||
TagId,
|
||||
TaggedEdge,
|
||||
TaggedFace,
|
||||
TagDecl,
|
||||
Sketch,
|
||||
Solid,
|
||||
@ -416,9 +416,9 @@ impl PrimitiveType {
|
||||
PrimitiveType::Axis3d => "3d axes".to_owned(),
|
||||
PrimitiveType::ImportedGeometry => "imported geometries".to_owned(),
|
||||
PrimitiveType::Function => "functions".to_owned(),
|
||||
PrimitiveType::Tag => "tags".to_owned(),
|
||||
PrimitiveType::TagDecl => "tag declarators".to_owned(),
|
||||
PrimitiveType::TagId => "tag identifiers".to_owned(),
|
||||
PrimitiveType::TaggedEdge => "tagged edges".to_owned(),
|
||||
PrimitiveType::TaggedFace => "tagged faces".to_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -426,7 +426,8 @@ impl PrimitiveType {
|
||||
match (self, other) {
|
||||
(_, PrimitiveType::Any) => true,
|
||||
(PrimitiveType::Number(n1), PrimitiveType::Number(n2)) => n1.subtype(n2),
|
||||
(PrimitiveType::TagId, PrimitiveType::Tag) | (PrimitiveType::TagDecl, PrimitiveType::Tag) => true,
|
||||
(PrimitiveType::TaggedEdge, PrimitiveType::TaggedFace)
|
||||
| (PrimitiveType::TaggedEdge, PrimitiveType::Edge) => true,
|
||||
(t1, t2) => t1 == t2,
|
||||
}
|
||||
}
|
||||
@ -442,9 +443,9 @@ impl fmt::Display for PrimitiveType {
|
||||
PrimitiveType::Number(NumericType::Any) => write!(f, "number(any units)"),
|
||||
PrimitiveType::String => write!(f, "string"),
|
||||
PrimitiveType::Boolean => write!(f, "bool"),
|
||||
PrimitiveType::Tag => write!(f, "tag"),
|
||||
PrimitiveType::TagDecl => write!(f, "tag declarator"),
|
||||
PrimitiveType::TagId => write!(f, "tag identifier"),
|
||||
PrimitiveType::TaggedEdge => write!(f, "tagged edge"),
|
||||
PrimitiveType::TaggedFace => write!(f, "tagged face"),
|
||||
PrimitiveType::Sketch => write!(f, "Sketch"),
|
||||
PrimitiveType::Solid => write!(f, "Solid"),
|
||||
PrimitiveType::Plane => write!(f, "Plane"),
|
||||
@ -1207,6 +1208,17 @@ impl KclValue {
|
||||
KclValue::TagIdentifier { .. } => Ok(self.clone()),
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::TaggedEdge => match self {
|
||||
KclValue::TagIdentifier { .. } => Ok(self.clone()),
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::TaggedFace => match self {
|
||||
KclValue::TagIdentifier { .. } => Ok(self.clone()),
|
||||
s @ KclValue::String { value, .. } if ["start", "end", "START", "END"].contains(&&**value) => {
|
||||
Ok(s.clone())
|
||||
}
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::Axis2d => match self {
|
||||
KclValue::Object { value: values, meta } => {
|
||||
if values
|
||||
@ -1295,23 +1307,10 @@ impl KclValue {
|
||||
KclValue::Function { .. } => Ok(self.clone()),
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::TagId => match self {
|
||||
KclValue::TagIdentifier { .. } => Ok(self.clone()),
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::TagDecl => match self {
|
||||
KclValue::TagDeclarator { .. } => Ok(self.clone()),
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
PrimitiveType::Tag => match self {
|
||||
KclValue::TagDeclarator { .. } | KclValue::TagIdentifier { .. } | KclValue::Uuid { .. } => {
|
||||
Ok(self.clone())
|
||||
}
|
||||
s @ KclValue::String { value, .. } if ["start", "end", "START", "END"].contains(&&**value) => {
|
||||
Ok(s.clone())
|
||||
}
|
||||
_ => Err(self.into()),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -1501,9 +1500,9 @@ impl KclValue {
|
||||
KclValue::HomArray { ty, value, .. } => {
|
||||
Some(RuntimeType::Array(Box::new(ty.clone()), ArrayLen::Known(value.len())))
|
||||
}
|
||||
KclValue::TagIdentifier(_) => Some(RuntimeType::Primitive(PrimitiveType::TagId)),
|
||||
KclValue::TagIdentifier(_) => Some(RuntimeType::Primitive(PrimitiveType::TaggedEdge)),
|
||||
KclValue::TagDeclarator(_) => Some(RuntimeType::Primitive(PrimitiveType::TagDecl)),
|
||||
KclValue::Uuid { .. } => Some(RuntimeType::Primitive(PrimitiveType::Tag)),
|
||||
KclValue::Uuid { .. } => Some(RuntimeType::Primitive(PrimitiveType::Edge)),
|
||||
KclValue::Function { .. } => Some(RuntimeType::Primitive(PrimitiveType::Function)),
|
||||
KclValue::Module { .. } | KclValue::KclNone { .. } | KclValue::Type { .. } => None,
|
||||
}
|
||||
|
||||
@ -223,7 +223,7 @@ impl PrimitiveType {
|
||||
PrimitiveType::String => hasher.update(b"string"),
|
||||
PrimitiveType::Number(suffix) => hasher.update(suffix.digestable_id()),
|
||||
PrimitiveType::Boolean => hasher.update(b"bool"),
|
||||
PrimitiveType::Tag => hasher.update(b"tag"),
|
||||
PrimitiveType::TagDecl => hasher.update(b"TagDecl"),
|
||||
PrimitiveType::ImportedGeometry => hasher.update(b"ImportedGeometry"),
|
||||
PrimitiveType::Function(f) => hasher.update(f.compute_digest()),
|
||||
}
|
||||
|
||||
@ -3151,8 +3151,8 @@ pub enum PrimitiveType {
|
||||
/// A boolean type.
|
||||
#[serde(rename = "bool")]
|
||||
Boolean,
|
||||
/// A tag.
|
||||
Tag,
|
||||
/// A tag declaration.
|
||||
TagDecl,
|
||||
/// Imported from other CAD system.
|
||||
ImportedGeometry,
|
||||
/// `fn`, type of functions.
|
||||
@ -3167,7 +3167,7 @@ impl PrimitiveType {
|
||||
("any", None) => Some(PrimitiveType::Any),
|
||||
("string", None) => Some(PrimitiveType::String),
|
||||
("bool", None) => Some(PrimitiveType::Boolean),
|
||||
("tag", None) => Some(PrimitiveType::Tag),
|
||||
("TagDecl", None) => Some(PrimitiveType::TagDecl),
|
||||
("number", None) => Some(PrimitiveType::Number(NumericSuffix::None)),
|
||||
("number", Some(s)) => Some(PrimitiveType::Number(s)),
|
||||
("ImportedGeometry", None) => Some(PrimitiveType::ImportedGeometry),
|
||||
@ -3184,7 +3184,7 @@ impl PrimitiveType {
|
||||
PrimitiveType::ImportedGeometry => "imported geometries".to_owned(),
|
||||
PrimitiveType::Function(_) => "functions".to_owned(),
|
||||
PrimitiveType::Named { id } => format!("`{}`s", id.name),
|
||||
PrimitiveType::Tag => "tags".to_owned(),
|
||||
PrimitiveType::TagDecl => "tag declarations".to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3202,7 +3202,7 @@ impl fmt::Display for PrimitiveType {
|
||||
}
|
||||
PrimitiveType::String => write!(f, "string"),
|
||||
PrimitiveType::Boolean => write!(f, "bool"),
|
||||
PrimitiveType::Tag => write!(f, "tag"),
|
||||
PrimitiveType::TagDecl => write!(f, "TagDecl"),
|
||||
PrimitiveType::ImportedGeometry => write!(f, "ImportedGeometry"),
|
||||
PrimitiveType::Function(t) => {
|
||||
write!(f, "fn")?;
|
||||
|
||||
@ -11,12 +11,13 @@ use crate::{
|
||||
types::{ArrayLen, RuntimeType},
|
||||
ExecState, ExtrudeSurface, KclValue, ModelingCmdMeta, TagIdentifier,
|
||||
},
|
||||
std::Args,
|
||||
std::{sketch::FaceTag, Args},
|
||||
SourceRange,
|
||||
};
|
||||
|
||||
/// Get the opposite edge to the edge given.
|
||||
pub async fn get_opposite_edge(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
|
||||
let edge = inner_get_opposite_edge(input_edge, exec_state, args.clone()).await?;
|
||||
Ok(KclValue::Uuid {
|
||||
@ -64,7 +65,7 @@ async fn inner_get_opposite_edge(
|
||||
|
||||
/// Get the next adjacent edge to the edge given.
|
||||
pub async fn get_next_adjacent_edge(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
|
||||
let edge = inner_get_next_adjacent_edge(input_edge, exec_state, args.clone()).await?;
|
||||
Ok(KclValue::Uuid {
|
||||
@ -121,7 +122,7 @@ async fn inner_get_next_adjacent_edge(
|
||||
|
||||
/// Get the previous adjacent edge to the edge given.
|
||||
pub async fn get_previous_adjacent_edge(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let input_edge = args.get_unlabeled_kw_arg("edge", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
|
||||
let edge = inner_get_previous_adjacent_edge(input_edge, exec_state, args.clone()).await?;
|
||||
Ok(KclValue::Uuid {
|
||||
@ -177,13 +178,33 @@ async fn inner_get_previous_adjacent_edge(
|
||||
|
||||
/// Get the shared edge between two faces.
|
||||
pub async fn get_common_edge(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let faces: Vec<TagIdentifier> = args.get_kw_arg(
|
||||
let mut faces: Vec<FaceTag> = args.get_kw_arg(
|
||||
"faces",
|
||||
&RuntimeType::Array(Box::new(RuntimeType::tag_identifier()), ArrayLen::Known(2)),
|
||||
&RuntimeType::Array(Box::new(RuntimeType::tagged_face()), ArrayLen::Known(2)),
|
||||
exec_state,
|
||||
)?;
|
||||
|
||||
let edge = inner_get_common_edge(faces, exec_state, args.clone()).await?;
|
||||
if faces.len() != 2 {
|
||||
return Err(KclError::new_type(KclErrorDetails::new(
|
||||
"getCommonEdge requires exactly two tags for faces".to_owned(),
|
||||
vec![args.source_range],
|
||||
)));
|
||||
}
|
||||
|
||||
fn into_tag(face: FaceTag, source_range: SourceRange) -> Result<TagIdentifier, KclError> {
|
||||
match face {
|
||||
FaceTag::StartOrEnd(_) => Err(KclError::new_type(KclErrorDetails::new(
|
||||
"getCommonEdge requires a tagged face, it cannot use `START` or `END` faces".to_owned(),
|
||||
vec![source_range],
|
||||
))),
|
||||
FaceTag::Tag(tag_identifier) => Ok(*tag_identifier),
|
||||
}
|
||||
}
|
||||
|
||||
let face2 = into_tag(faces.pop().unwrap(), args.source_range)?;
|
||||
let face1 = into_tag(faces.pop().unwrap(), args.source_range)?;
|
||||
|
||||
let edge = inner_get_common_edge(face1, face2, exec_state, args.clone()).await?;
|
||||
Ok(KclValue::Uuid {
|
||||
value: edge,
|
||||
meta: vec![args.source_range.into()],
|
||||
@ -191,7 +212,8 @@ pub async fn get_common_edge(exec_state: &mut ExecState, args: Args) -> Result<K
|
||||
}
|
||||
|
||||
async fn inner_get_common_edge(
|
||||
faces: Vec<TagIdentifier>,
|
||||
face1: TagIdentifier,
|
||||
face2: TagIdentifier,
|
||||
exec_state: &mut ExecState,
|
||||
args: Args,
|
||||
) -> Result<Uuid, KclError> {
|
||||
@ -200,17 +222,11 @@ async fn inner_get_common_edge(
|
||||
return Ok(id);
|
||||
}
|
||||
|
||||
if faces.len() != 2 {
|
||||
return Err(KclError::new_type(KclErrorDetails::new(
|
||||
"getCommonEdge requires exactly two tags for faces".to_string(),
|
||||
vec![args.source_range],
|
||||
)));
|
||||
}
|
||||
let first_face_id = args.get_adjacent_face_to_tag(exec_state, &faces[0], false).await?;
|
||||
let second_face_id = args.get_adjacent_face_to_tag(exec_state, &faces[1], false).await?;
|
||||
let first_face_id = args.get_adjacent_face_to_tag(exec_state, &face1, false).await?;
|
||||
let second_face_id = args.get_adjacent_face_to_tag(exec_state, &face2, false).await?;
|
||||
|
||||
let first_tagged_path = args.get_tag_engine_info(exec_state, &faces[0])?.clone();
|
||||
let second_tagged_path = args.get_tag_engine_info(exec_state, &faces[1])?;
|
||||
let first_tagged_path = args.get_tag_engine_info(exec_state, &face1)?.clone();
|
||||
let second_tagged_path = args.get_tag_engine_info(exec_state, &face2)?;
|
||||
|
||||
if first_tagged_path.sketch != second_tagged_path.sketch {
|
||||
return Err(KclError::new_type(KclErrorDetails::new(
|
||||
@ -252,7 +268,7 @@ async fn inner_get_common_edge(
|
||||
KclError::new_type(KclErrorDetails::new(
|
||||
format!(
|
||||
"No common edge was found between `{}` and `{}`",
|
||||
faces[0].value, faces[1].value
|
||||
face1.value, face2.value
|
||||
),
|
||||
vec![args.source_range],
|
||||
))
|
||||
|
||||
@ -440,6 +440,8 @@ pub(crate) fn std_ty(path: &str, fn_name: &str) -> (PrimitiveType, StdFnProps) {
|
||||
("types", "Edge") => (PrimitiveType::Edge, StdFnProps::default("std::types::Edge")),
|
||||
("types", "Axis2d") => (PrimitiveType::Axis2d, StdFnProps::default("std::types::Axis2d")),
|
||||
("types", "Axis3d") => (PrimitiveType::Axis3d, StdFnProps::default("std::types::Axis3d")),
|
||||
("types", "TaggedEdge") => (PrimitiveType::TaggedEdge, StdFnProps::default("std::types::TaggedEdge")),
|
||||
("types", "TaggedFace") => (PrimitiveType::TaggedFace, StdFnProps::default("std::types::TaggedFace")),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ use crate::{
|
||||
|
||||
/// Returns the point at the end of the given segment.
|
||||
pub async fn segment_end(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let pt = inner_segment_end(&tag, exec_state, args.clone())?;
|
||||
|
||||
args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone())
|
||||
@ -38,7 +38,7 @@ fn inner_segment_end(tag: &TagIdentifier, exec_state: &mut ExecState, args: Args
|
||||
|
||||
/// Returns the segment end of x.
|
||||
pub async fn segment_end_x(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let result = inner_segment_end_x(&tag, exec_state, args.clone())?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result))
|
||||
@ -58,7 +58,7 @@ fn inner_segment_end_x(tag: &TagIdentifier, exec_state: &mut ExecState, args: Ar
|
||||
|
||||
/// Returns the segment end of y.
|
||||
pub async fn segment_end_y(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let result = inner_segment_end_y(&tag, exec_state, args.clone())?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result))
|
||||
@ -78,7 +78,7 @@ fn inner_segment_end_y(tag: &TagIdentifier, exec_state: &mut ExecState, args: Ar
|
||||
|
||||
/// Returns the point at the start of the given segment.
|
||||
pub async fn segment_start(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let pt = inner_segment_start(&tag, exec_state, args.clone())?;
|
||||
|
||||
args.make_kcl_val_from_point([pt[0].n, pt[1].n], pt[0].ty.clone())
|
||||
@ -101,7 +101,7 @@ fn inner_segment_start(tag: &TagIdentifier, exec_state: &mut ExecState, args: Ar
|
||||
|
||||
/// Returns the segment start of x.
|
||||
pub async fn segment_start_x(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let result = inner_segment_start_x(&tag, exec_state, args.clone())?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result))
|
||||
@ -121,7 +121,7 @@ fn inner_segment_start_x(tag: &TagIdentifier, exec_state: &mut ExecState, args:
|
||||
|
||||
/// Returns the segment start of y.
|
||||
pub async fn segment_start_y(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let result = inner_segment_start_y(&tag, exec_state, args.clone())?;
|
||||
|
||||
Ok(args.make_user_val_from_f64_with_type(result))
|
||||
@ -186,7 +186,7 @@ fn inner_last_segment_y(sketch: Sketch, args: Args) -> Result<TyF64, KclError> {
|
||||
|
||||
/// Returns the length of the segment.
|
||||
pub async fn segment_length(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let result = inner_segment_length(&tag, exec_state, args.clone())?;
|
||||
Ok(args.make_user_val_from_f64_with_type(result))
|
||||
}
|
||||
@ -205,7 +205,7 @@ fn inner_segment_length(tag: &TagIdentifier, exec_state: &mut ExecState, args: A
|
||||
|
||||
/// Returns the angle of the segment.
|
||||
pub async fn segment_angle(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
|
||||
let result = inner_segment_angle(&tag, exec_state, args.clone())?;
|
||||
Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees())))
|
||||
@ -227,7 +227,7 @@ fn inner_segment_angle(tag: &TagIdentifier, exec_state: &mut ExecState, args: Ar
|
||||
|
||||
/// Returns the angle coming out of the end of the segment in degrees.
|
||||
pub async fn tangent_to_end(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let tag: TagIdentifier = args.get_unlabeled_kw_arg("tag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
|
||||
let result = inner_tangent_to_end(&tag, exec_state, args.clone()).await?;
|
||||
Ok(args.make_user_val_from_f64_with_type(TyF64::new(result, NumericType::degrees())))
|
||||
|
||||
@ -20,7 +20,7 @@ pub async fn shell(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
|
||||
let thickness: TyF64 = args.get_kw_arg("thickness", &RuntimeType::length(), exec_state)?;
|
||||
let faces = args.get_kw_arg(
|
||||
"faces",
|
||||
&RuntimeType::Array(Box::new(RuntimeType::tag()), ArrayLen::Minimum(1)),
|
||||
&RuntimeType::Array(Box::new(RuntimeType::tagged_face()), ArrayLen::Minimum(1)),
|
||||
exec_state,
|
||||
)?;
|
||||
|
||||
|
||||
@ -684,7 +684,7 @@ async fn inner_angled_line_to_y(
|
||||
pub async fn angled_line_that_intersects(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
|
||||
let sketch = args.get_unlabeled_kw_arg("sketch", &RuntimeType::Primitive(PrimitiveType::Sketch), exec_state)?;
|
||||
let angle: TyF64 = args.get_kw_arg("angle", &RuntimeType::angle(), exec_state)?;
|
||||
let intersect_tag: TagIdentifier = args.get_kw_arg("intersectTag", &RuntimeType::tag_identifier(), exec_state)?;
|
||||
let intersect_tag: TagIdentifier = args.get_kw_arg("intersectTag", &RuntimeType::tagged_edge(), exec_state)?;
|
||||
let offset = args.get_kw_arg_opt("offset", &RuntimeType::length(), exec_state)?;
|
||||
let tag: Option<TagNode> = args.get_kw_arg_opt("tag", &RuntimeType::tag_decl(), exec_state)?;
|
||||
let new_sketch =
|
||||
@ -776,7 +776,7 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
|
||||
&RuntimeType::Union(vec![RuntimeType::solid(), RuntimeType::plane()]),
|
||||
exec_state,
|
||||
)?;
|
||||
let face = args.get_kw_arg_opt("face", &RuntimeType::tag(), exec_state)?;
|
||||
let face = args.get_kw_arg_opt("face", &RuntimeType::tagged_face(), exec_state)?;
|
||||
|
||||
match inner_start_sketch_on(data, face, exec_state, &args).await? {
|
||||
SketchSurface::Plane(value) => Ok(KclValue::Plane { value }),
|
||||
|
||||
@ -64,10 +64,10 @@ export Z = {
|
||||
}: Axis3d
|
||||
|
||||
/// Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||
export START = 'start'
|
||||
export START = 'start': TaggedFace
|
||||
|
||||
/// Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
|
||||
export END = 'end'
|
||||
export END = 'end': TaggedFace
|
||||
|
||||
/// Create a helix.
|
||||
///
|
||||
|
||||
@ -186,7 +186,7 @@ export fn startSketchOn(
|
||||
/// Profile whose start is being used.
|
||||
@planeOrSolid: Solid | Plane,
|
||||
/// Identify a face of a solid if a solid is specified as the input argument (`planeOrSolid`).
|
||||
face?: tag,
|
||||
face?: TaggedFace,
|
||||
): Plane | Face {}
|
||||
|
||||
/// Start a new profile at a given point.
|
||||
@ -231,7 +231,7 @@ export fn startProfile(
|
||||
@(snippetArray = ["0", "0"])
|
||||
at: Point2d,
|
||||
/// Tag this first starting point.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Construct a 2-dimensional circle, of the specified radius, centered at
|
||||
@ -268,7 +268,7 @@ export fn circle(
|
||||
@(includeInSnippet = true)
|
||||
diameter?: number(Length),
|
||||
/// Create a new tag which refers to this circle.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Extend a 2-dimensional sketch through a third dimension in order to
|
||||
@ -375,9 +375,9 @@ export fn extrude(
|
||||
/// If specified, will also extrude in the opposite direction to 'distance' to the specified distance. If 'symmetric' is true, this value is ignored.
|
||||
bidirectionalLength?: number(Length),
|
||||
/// A named tag for the face at the start of the extrusion, i.e. the original sketch.
|
||||
tagStart?: tag,
|
||||
tagStart?: TagDecl,
|
||||
/// A named tag for the face at the end of the extrusion, i.e. the new face created by extruding the original sketch.
|
||||
tagEnd?: tag,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+] {}
|
||||
|
||||
/// Works just like the `extrude` command, but also twists the sketch around
|
||||
@ -647,9 +647,9 @@ export fn revolve(
|
||||
/// If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored.
|
||||
bidirectionalAngle?: number(Angle),
|
||||
/// A named tag for the face at the start of the revolve, i.e. the original sketch.
|
||||
tagStart?: tag,
|
||||
tagStart?: TagDecl,
|
||||
/// A named tag for the face at the end of the revolve.
|
||||
tagEnd?: tag,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+] {}
|
||||
|
||||
/// Just like `patternTransform`, but works on 2D sketches not 3D solids.
|
||||
@ -708,7 +708,7 @@ export fn patternTransform2d(
|
||||
@(impl = std_rust)
|
||||
export fn getOppositeEdge(
|
||||
/// The tag of the edge you want to find the opposite edge of.
|
||||
@edge: tag,
|
||||
@edge: TaggedEdge,
|
||||
): Edge {}
|
||||
|
||||
/// Get the next adjacent edge to the edge given.
|
||||
@ -742,7 +742,7 @@ export fn getOppositeEdge(
|
||||
@(impl = std_rust)
|
||||
export fn getNextAdjacentEdge(
|
||||
/// The tag of the edge you want to find the next adjacent edge of.
|
||||
@edge: tag,
|
||||
@edge: TaggedEdge,
|
||||
): Edge {}
|
||||
|
||||
/// Get the previous adjacent edge to the edge given.
|
||||
@ -776,7 +776,7 @@ export fn getNextAdjacentEdge(
|
||||
@(impl = std_rust)
|
||||
export fn getPreviousAdjacentEdge(
|
||||
/// The tag of the edge you want to find the previous adjacent edge of.
|
||||
@edge: tag,
|
||||
@edge: TaggedEdge,
|
||||
): Edge {}
|
||||
|
||||
/// Get the shared edge between two faces.
|
||||
@ -805,7 +805,7 @@ export fn getPreviousAdjacentEdge(
|
||||
@(impl = std_rust)
|
||||
export fn getCommonEdge(
|
||||
/// The tags of the faces you want to find the common edge between.
|
||||
faces: [tag; 2],
|
||||
faces: [TaggedFace; 2],
|
||||
): Edge {}
|
||||
|
||||
/// Construct a circle derived from 3 points.
|
||||
@ -826,7 +826,7 @@ export fn circleThreePoint(
|
||||
/// 3rd point to derive the circle.
|
||||
p3: Point2d,
|
||||
/// Identifier for the circle to reference elsewhere.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Create a regular polygon with the specified number of sides that is either inscribed or circumscribed around a circle of the specified radius.
|
||||
@ -984,9 +984,9 @@ export fn sweep(
|
||||
/// What is the sweep relative to? Can be either 'sketchPlane' or 'trajectoryCurve'.
|
||||
relativeTo?: string = 'trajectoryCurve',
|
||||
/// A named tag for the face at the start of the sweep, i.e. the original sketch.
|
||||
tagStart?: tag,
|
||||
tagStart?: TagDecl,
|
||||
/// A named tag for the face at the end of the sweep.
|
||||
tagEnd?: tag,
|
||||
tagEnd?: TagDecl,
|
||||
): [Solid; 1+] {}
|
||||
|
||||
/// Create a 3D surface or solid by interpolating between two or more sketches.
|
||||
@ -1068,9 +1068,9 @@ export fn loft(
|
||||
/// Tolerance for the loft operation.
|
||||
tolerance?: number(Length),
|
||||
/// A named tag for the face at the start of the loft, i.e. the original sketch.
|
||||
tagStart?: tag,
|
||||
tagStart?: TagDecl,
|
||||
/// A named tag for the face at the end of the loft.
|
||||
tagEnd?: tag,
|
||||
tagEnd?: TagDecl,
|
||||
): Solid {}
|
||||
|
||||
/// Repeat a 2-dimensional sketch along some dimension, with a dynamic amount
|
||||
@ -1184,7 +1184,7 @@ export fn patternCircular2d(
|
||||
@(impl = std_rust)
|
||||
export fn segEnd(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): Point2d {}
|
||||
|
||||
/// Compute the ending point of the provided line segment along the 'x' axis.
|
||||
@ -1203,7 +1203,7 @@ export fn segEnd(
|
||||
@(impl = std_rust)
|
||||
export fn segEndX(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Length) {}
|
||||
|
||||
/// Compute the ending point of the provided line segment along the 'y' axis.
|
||||
@ -1223,7 +1223,7 @@ export fn segEndX(
|
||||
@(impl = std_rust)
|
||||
export fn segEndY(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Length) {}
|
||||
|
||||
/// Compute the starting point of the provided line segment.
|
||||
@ -1254,7 +1254,7 @@ export fn segEndY(
|
||||
@(impl = std_rust)
|
||||
export fn segStart(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): Point2d {}
|
||||
|
||||
/// Compute the starting point of the provided line segment along the 'x' axis.
|
||||
@ -1273,7 +1273,7 @@ export fn segStart(
|
||||
@(impl = std_rust)
|
||||
export fn segStartX(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Length) {}
|
||||
|
||||
/// Compute the starting point of the provided line segment along the 'y' axis.
|
||||
@ -1293,7 +1293,7 @@ export fn segStartX(
|
||||
@(impl = std_rust)
|
||||
export fn segStartY(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Length) {}
|
||||
|
||||
/// Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
|
||||
@ -1356,7 +1356,7 @@ export fn lastSegY(
|
||||
@(impl = std_rust)
|
||||
export fn segLen(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Length) {}
|
||||
|
||||
/// Compute the angle (in degrees) of the provided line segment.
|
||||
@ -1377,7 +1377,7 @@ export fn segLen(
|
||||
@(impl = std_rust)
|
||||
export fn segAng(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Angle) {}
|
||||
|
||||
/// Returns the angle coming out of the end of the segment in degrees.
|
||||
@ -1454,7 +1454,7 @@ export fn segAng(
|
||||
@(impl = std_rust)
|
||||
export fn tangentToEnd(
|
||||
/// The line segment being queried by its tag.
|
||||
@tag: tag,
|
||||
@tag: TaggedEdge,
|
||||
): number(Angle) {}
|
||||
|
||||
/// Extract the provided 2-dimensional sketch's profile's origin value.
|
||||
@ -1526,7 +1526,7 @@ export fn involuteCircular(
|
||||
/// If reverse is true, the segment will start from the end of the involute, otherwise it will start from that start.
|
||||
reverse?: bool = false,
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Extend the current sketch with a new straight line.
|
||||
@ -1563,7 +1563,7 @@ export fn line(
|
||||
@(includeInSnippet = true)
|
||||
end?: Point2d,
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw a line relative to the current origin to a specified distance away
|
||||
@ -1598,7 +1598,7 @@ export fn xLine(
|
||||
/// Which absolute X value should this line go to? Incompatible with `length`.
|
||||
endAbsolute?: number(Length),
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw a line relative to the current origin to a specified distance away
|
||||
@ -1628,7 +1628,7 @@ export fn yLine(
|
||||
/// Which absolute Y value should this line go to? Incompatible with `length`.
|
||||
endAbsolute?: number(Length),
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw a line segment relative to the current origin using the polar
|
||||
@ -1665,7 +1665,7 @@ export fn angledLine(
|
||||
/// Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given.
|
||||
endAbsoluteY?: number(Length),
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw an angled line from the current origin, constructing a line segment
|
||||
@ -1694,11 +1694,11 @@ export fn angledLineThatIntersects(
|
||||
/// Which angle should the line be drawn at?
|
||||
angle: number(Angle),
|
||||
/// The tag of the line to intersect with.
|
||||
intersectTag: tag,
|
||||
intersectTag: TaggedEdge,
|
||||
/// The offset from the intersecting line.
|
||||
offset?: number(Length) = 0mm,
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Construct a line segment from the current origin back to the profile's
|
||||
@ -1732,7 +1732,7 @@ export fn close(
|
||||
/// The sketch you want to close.
|
||||
@sketch: Sketch,
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw a curved line segment along an imaginary circle.
|
||||
@ -1789,7 +1789,7 @@ export fn arc(
|
||||
/// Where should this arc end? Requires `interiorAbsolute`. Incompatible with `angleStart` or `angleEnd`.
|
||||
endAbsolute?: Point2d,
|
||||
/// Create a new tag which refers to this arc.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Starting at the current sketch's origin, draw a curved line segment along
|
||||
@ -1862,7 +1862,7 @@ export fn tangentialArc(
|
||||
/// Offset of the arc. `radius` must be given. Incompatible with `end` and `endAbsolute`.
|
||||
angle?: number(Angle),
|
||||
/// Create a new tag which refers to this arc.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Draw a smooth, continuous, curved line segment from the current origin to
|
||||
@ -1910,7 +1910,7 @@ export fn bezierCurve(
|
||||
/// Coordinate on the plane at which this line should end.
|
||||
endAbsolute?: Point2d,
|
||||
/// Create a new tag which refers to this line.
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Sketch {}
|
||||
|
||||
/// Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
|
||||
|
||||
@ -73,7 +73,7 @@ export fn fillet(
|
||||
/// The tolerance for this fillet
|
||||
tolerance?: number(Length),
|
||||
/// Create a new tag which refers to this fillet
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid {}
|
||||
|
||||
/// Cut a straight transitional edge along a tagged path.
|
||||
@ -148,7 +148,7 @@ export fn chamfer(
|
||||
/// The paths you want to chamfer
|
||||
tags: [Edge; 1+],
|
||||
/// Create a new tag which refers to this chamfer
|
||||
tag?: tag,
|
||||
tag?: TagDecl,
|
||||
): Solid {}
|
||||
|
||||
/// Remove volume from a 3-dimensional shape such that a wall of the
|
||||
@ -304,7 +304,7 @@ export fn shell(
|
||||
/// The thickness of the shell
|
||||
thickness: number(Length),
|
||||
/// The faces you want removed
|
||||
faces: [tag; 1+],
|
||||
faces: [TaggedFace; 1+],
|
||||
): [Solid] {}
|
||||
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ export type string
|
||||
///
|
||||
/// ### Tag Declaration
|
||||
///
|
||||
/// The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
/// The syntax for declaring a tag is `$myTag`. You would use it in the following
|
||||
/// way:
|
||||
///
|
||||
/// ```norun,inline
|
||||
@ -86,14 +86,6 @@ export type string
|
||||
/// |> close()
|
||||
/// ```
|
||||
///
|
||||
/// ### Tag Identifier
|
||||
///
|
||||
/// As per the example above you can use the tag identifier to get a reference to the
|
||||
/// tagged object. The syntax for this is `myTag`.
|
||||
///
|
||||
/// In the example above we use the tag identifier to get the angle of the segment
|
||||
/// `segAng(rectangleSegmentA001)`.
|
||||
///
|
||||
/// ### Tag Scope
|
||||
///
|
||||
/// Tags are scoped globally if in the root context meaning in this example you can
|
||||
@ -109,7 +101,8 @@ export type string
|
||||
/// |> angledLine(
|
||||
/// angle = segAng(rectangleSegmentA001) - 90,
|
||||
/// length = 196.99,
|
||||
/// tag = $rectangleSegmentB001)
|
||||
/// tag = $rectangleSegmentB001
|
||||
/// )
|
||||
/// |> angledLine(
|
||||
/// angle = segAng(rectangleSegmentA001),
|
||||
/// length = -segLen(rectangleSegmentA001),
|
||||
@ -137,12 +130,12 @@ export type string
|
||||
/// |> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
/// |> angledLine(
|
||||
/// angle = segAng(rectangleSegmentA001) - 90deg,
|
||||
/// length = 196.99
|
||||
/// length = 196.99,
|
||||
/// tag = $rectangleSegmentB001,
|
||||
/// )
|
||||
/// |> angledLine(
|
||||
/// angle = segAng(rectangleSegmentA001),
|
||||
/// length = -segLen(rectangleSegmentA001)
|
||||
/// length = -segLen(rectangleSegmentA001),
|
||||
/// tag = $rectangleSegmentC001,
|
||||
/// )
|
||||
/// |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
@ -161,7 +154,32 @@ export type string
|
||||
/// the `rect` function. This is because the `rect` function is returning the
|
||||
/// sketch group that contains the tags.
|
||||
@(impl = primitive)
|
||||
export type tag
|
||||
export type TagDecl
|
||||
|
||||
/// A tag which references a line, arc, or other edge in a sketch or an edge of a solid.
|
||||
///
|
||||
/// Created by using a tag declarator (see the docs for `TagDecl`). Can be used where an `Edge` is
|
||||
/// required.
|
||||
///
|
||||
/// If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before
|
||||
/// extrusion and a `TaggedFace` after extrusion.
|
||||
@(impl = std_rust)
|
||||
export type TaggedEdge
|
||||
|
||||
/// A tag which references a face of a solid, including the distinguished tags `START` and `END`.
|
||||
///
|
||||
/// Created by using a tag declarator (see the docs for `TagDecl`).
|
||||
///
|
||||
/// If a line in a sketch is tagged and then the sketch is extruded, the tag is a `TaggedEdge` before
|
||||
/// extrusion and a `TaggedFace` after extrusion.
|
||||
@(impl = std_rust)
|
||||
export type TaggedFace
|
||||
|
||||
/// Reference a previously created tag. Used much like a variable.
|
||||
///
|
||||
/// Prefer to use `TaggedEdge` or `TaggedFace`. For more details on tags, see the docs for `TagDecl`.
|
||||
@(deprecated = true)
|
||||
export type tag = TaggedEdge
|
||||
|
||||
/// Represents geometry which is defined using some other CAD system and imported into KCL.
|
||||
@(impl = primitive)
|
||||
|
||||
@ -160,7 +160,7 @@ description: Result of parsing axial-fan.kcl
|
||||
"type": "Identifier"
|
||||
},
|
||||
"preComments": [
|
||||
"// Axial Fan",
|
||||
"// PC Fan",
|
||||
"// A small axial fan, used to push or draw airflow over components to remove excess heat",
|
||||
"",
|
||||
"",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
@ -95,16 +95,16 @@ flowchart LR
|
||||
9 --- 36
|
||||
10 --- 22
|
||||
10 x--> 25
|
||||
10 --- 29
|
||||
10 --- 35
|
||||
10 --- 32
|
||||
10 --- 38
|
||||
11 --- 23
|
||||
11 x--> 25
|
||||
11 --- 33
|
||||
11 --- 39
|
||||
12 --- 24
|
||||
12 x--> 25
|
||||
12 --- 32
|
||||
12 --- 38
|
||||
12 --- 29
|
||||
12 --- 35
|
||||
14 --- 19
|
||||
14 x--> 27
|
||||
14 --- 28
|
||||
@ -138,15 +138,15 @@ flowchart LR
|
||||
21 --- 30
|
||||
21 --- 36
|
||||
37 <--x 21
|
||||
22 --- 29
|
||||
22 --- 35
|
||||
36 <--x 22
|
||||
22 --- 32
|
||||
22 --- 38
|
||||
39 <--x 22
|
||||
23 --- 33
|
||||
35 <--x 23
|
||||
23 --- 39
|
||||
24 --- 32
|
||||
24 --- 38
|
||||
39 <--x 24
|
||||
24 --- 29
|
||||
24 --- 35
|
||||
36 <--x 24
|
||||
28 <--x 26
|
||||
29 <--x 27
|
||||
30 <--x 27
|
||||
|
||||
@ -366,112 +366,112 @@ flowchart LR
|
||||
11 ---- 74
|
||||
26 --- 75
|
||||
26 x--> 108
|
||||
26 --- 120
|
||||
26 --- 152
|
||||
26 --- 117
|
||||
26 --- 149
|
||||
27 --- 76
|
||||
27 x--> 108
|
||||
27 --- 128
|
||||
27 --- 160
|
||||
27 --- 116
|
||||
27 --- 148
|
||||
28 --- 77
|
||||
28 x--> 108
|
||||
28 --- 129
|
||||
28 --- 161
|
||||
28 --- 134
|
||||
28 --- 166
|
||||
29 --- 78
|
||||
29 x--> 108
|
||||
29 --- 138
|
||||
29 --- 170
|
||||
29 --- 114
|
||||
29 --- 146
|
||||
30 --- 79
|
||||
30 x--> 108
|
||||
30 --- 122
|
||||
30 --- 154
|
||||
30 --- 118
|
||||
30 --- 150
|
||||
31 --- 80
|
||||
31 x--> 108
|
||||
31 --- 133
|
||||
31 --- 165
|
||||
31 --- 139
|
||||
31 --- 171
|
||||
32 --- 81
|
||||
32 x--> 108
|
||||
32 --- 115
|
||||
32 --- 147
|
||||
33 --- 82
|
||||
33 x--> 108
|
||||
33 --- 137
|
||||
33 --- 169
|
||||
33 --- 126
|
||||
33 --- 158
|
||||
34 --- 83
|
||||
34 x--> 108
|
||||
34 --- 139
|
||||
34 --- 171
|
||||
34 --- 127
|
||||
34 --- 159
|
||||
35 --- 84
|
||||
35 x--> 108
|
||||
35 --- 130
|
||||
35 --- 162
|
||||
35 --- 138
|
||||
35 --- 170
|
||||
36 --- 85
|
||||
36 x--> 108
|
||||
36 --- 116
|
||||
36 --- 148
|
||||
36 --- 133
|
||||
36 --- 165
|
||||
37 --- 86
|
||||
37 x--> 108
|
||||
37 --- 127
|
||||
37 --- 159
|
||||
37 --- 119
|
||||
37 --- 151
|
||||
38 --- 87
|
||||
38 x--> 108
|
||||
38 --- 124
|
||||
38 --- 156
|
||||
38 --- 125
|
||||
38 --- 157
|
||||
39 --- 88
|
||||
39 x--> 108
|
||||
39 --- 126
|
||||
39 --- 158
|
||||
39 --- 124
|
||||
39 --- 156
|
||||
40 --- 89
|
||||
40 x--> 108
|
||||
40 --- 119
|
||||
40 --- 151
|
||||
40 --- 120
|
||||
40 --- 152
|
||||
41 --- 90
|
||||
41 x--> 108
|
||||
41 --- 121
|
||||
41 --- 153
|
||||
41 --- 131
|
||||
41 --- 163
|
||||
42 --- 91
|
||||
42 x--> 108
|
||||
42 --- 117
|
||||
42 --- 149
|
||||
42 --- 128
|
||||
42 --- 160
|
||||
43 --- 92
|
||||
43 x--> 108
|
||||
43 --- 132
|
||||
43 --- 164
|
||||
43 --- 130
|
||||
43 --- 162
|
||||
44 --- 93
|
||||
44 x--> 108
|
||||
44 --- 135
|
||||
44 --- 167
|
||||
44 --- 136
|
||||
44 --- 168
|
||||
45 --- 94
|
||||
45 x--> 108
|
||||
45 --- 125
|
||||
45 --- 157
|
||||
45 --- 135
|
||||
45 --- 167
|
||||
46 --- 95
|
||||
46 x--> 108
|
||||
46 --- 134
|
||||
46 --- 166
|
||||
46 --- 123
|
||||
46 --- 155
|
||||
47 --- 96
|
||||
47 x--> 108
|
||||
47 --- 118
|
||||
47 --- 150
|
||||
47 --- 122
|
||||
47 --- 154
|
||||
48 --- 97
|
||||
48 x--> 108
|
||||
48 --- 131
|
||||
48 --- 163
|
||||
48 --- 132
|
||||
48 --- 164
|
||||
49 --- 98
|
||||
49 x--> 108
|
||||
49 --- 113
|
||||
49 --- 145
|
||||
49 --- 129
|
||||
49 --- 161
|
||||
50 --- 99
|
||||
50 x--> 108
|
||||
50 --- 136
|
||||
50 --- 168
|
||||
50 --- 137
|
||||
50 --- 169
|
||||
51 --- 100
|
||||
51 x--> 108
|
||||
51 --- 114
|
||||
51 --- 146
|
||||
51 --- 113
|
||||
51 --- 145
|
||||
52 --- 101
|
||||
52 x--> 108
|
||||
52 --- 123
|
||||
52 --- 155
|
||||
52 --- 121
|
||||
52 --- 153
|
||||
61 --- 102
|
||||
61 x--> 110
|
||||
61 --- 140
|
||||
@ -594,87 +594,87 @@ flowchart LR
|
||||
74 --- 174
|
||||
74 --- 175
|
||||
74 --- 176
|
||||
75 --- 120
|
||||
75 --- 152
|
||||
153 <--x 75
|
||||
76 --- 128
|
||||
76 --- 160
|
||||
161 <--x 76
|
||||
77 --- 129
|
||||
77 --- 161
|
||||
162 <--x 77
|
||||
78 --- 138
|
||||
78 --- 170
|
||||
171 <--x 78
|
||||
79 --- 122
|
||||
79 --- 154
|
||||
155 <--x 79
|
||||
80 --- 133
|
||||
80 --- 165
|
||||
166 <--x 80
|
||||
75 --- 117
|
||||
75 --- 149
|
||||
150 <--x 75
|
||||
76 --- 116
|
||||
76 --- 148
|
||||
149 <--x 76
|
||||
77 --- 134
|
||||
77 --- 166
|
||||
167 <--x 77
|
||||
78 --- 114
|
||||
78 --- 146
|
||||
147 <--x 78
|
||||
79 --- 118
|
||||
79 --- 150
|
||||
151 <--x 79
|
||||
80 --- 139
|
||||
145 <--x 80
|
||||
80 --- 171
|
||||
81 --- 115
|
||||
81 --- 147
|
||||
148 <--x 81
|
||||
82 --- 137
|
||||
82 --- 169
|
||||
170 <--x 82
|
||||
83 --- 139
|
||||
145 <--x 83
|
||||
83 --- 171
|
||||
84 --- 130
|
||||
84 --- 162
|
||||
163 <--x 84
|
||||
85 --- 116
|
||||
85 --- 148
|
||||
149 <--x 85
|
||||
86 --- 127
|
||||
86 --- 159
|
||||
160 <--x 86
|
||||
87 --- 124
|
||||
87 --- 156
|
||||
157 <--x 87
|
||||
88 --- 126
|
||||
88 --- 158
|
||||
159 <--x 88
|
||||
89 --- 119
|
||||
89 --- 151
|
||||
152 <--x 89
|
||||
90 --- 121
|
||||
90 --- 153
|
||||
154 <--x 90
|
||||
91 --- 117
|
||||
91 --- 149
|
||||
150 <--x 91
|
||||
92 --- 132
|
||||
92 --- 164
|
||||
165 <--x 92
|
||||
93 --- 135
|
||||
93 --- 167
|
||||
168 <--x 93
|
||||
94 --- 125
|
||||
94 --- 157
|
||||
158 <--x 94
|
||||
95 --- 134
|
||||
95 --- 166
|
||||
167 <--x 95
|
||||
96 --- 118
|
||||
96 --- 150
|
||||
151 <--x 96
|
||||
97 --- 131
|
||||
97 --- 163
|
||||
164 <--x 97
|
||||
98 --- 113
|
||||
98 --- 145
|
||||
146 <--x 98
|
||||
99 --- 136
|
||||
99 --- 168
|
||||
169 <--x 99
|
||||
100 --- 114
|
||||
100 --- 146
|
||||
147 <--x 100
|
||||
101 --- 123
|
||||
101 --- 155
|
||||
156 <--x 101
|
||||
82 --- 126
|
||||
82 --- 158
|
||||
159 <--x 82
|
||||
83 --- 127
|
||||
83 --- 159
|
||||
160 <--x 83
|
||||
84 --- 138
|
||||
84 --- 170
|
||||
171 <--x 84
|
||||
85 --- 133
|
||||
85 --- 165
|
||||
166 <--x 85
|
||||
86 --- 119
|
||||
86 --- 151
|
||||
152 <--x 86
|
||||
87 --- 125
|
||||
87 --- 157
|
||||
158 <--x 87
|
||||
88 --- 124
|
||||
88 --- 156
|
||||
157 <--x 88
|
||||
89 --- 120
|
||||
89 --- 152
|
||||
153 <--x 89
|
||||
90 --- 131
|
||||
90 --- 163
|
||||
164 <--x 90
|
||||
91 --- 128
|
||||
91 --- 160
|
||||
161 <--x 91
|
||||
92 --- 130
|
||||
92 --- 162
|
||||
163 <--x 92
|
||||
93 --- 136
|
||||
93 --- 168
|
||||
169 <--x 93
|
||||
94 --- 135
|
||||
94 --- 167
|
||||
168 <--x 94
|
||||
95 --- 123
|
||||
95 --- 155
|
||||
156 <--x 95
|
||||
96 --- 122
|
||||
96 --- 154
|
||||
155 <--x 96
|
||||
97 --- 132
|
||||
97 --- 164
|
||||
165 <--x 97
|
||||
98 --- 129
|
||||
98 --- 161
|
||||
162 <--x 98
|
||||
99 --- 137
|
||||
99 --- 169
|
||||
170 <--x 99
|
||||
100 --- 113
|
||||
100 --- 145
|
||||
146 <--x 100
|
||||
101 --- 121
|
||||
101 --- 153
|
||||
154 <--x 101
|
||||
102 --- 140
|
||||
102 --- 172
|
||||
103 --- 144
|
||||
|
||||
@ -1,61 +1,61 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph path4 [Path]
|
||||
4["Path<br>[822, 886, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
8["Segment<br>[892, 949, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
9["Segment<br>[955, 1014, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
10["Segment<br>[1020, 1077, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
11["Segment<br>[1083, 1136, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
12["Segment<br>[1142, 1200, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
13["Segment<br>[1206, 1265, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||
14["Segment<br>[1271, 1327, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
|
||||
15["Segment<br>[1333, 1398, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
|
||||
16["Segment<br>[1404, 1411, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }]
|
||||
4["Path<br>[812, 876, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 1 }]
|
||||
8["Segment<br>[882, 939, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 2 }]
|
||||
9["Segment<br>[945, 1004, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 3 }]
|
||||
10["Segment<br>[1010, 1067, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 4 }]
|
||||
11["Segment<br>[1073, 1126, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 5 }]
|
||||
12["Segment<br>[1132, 1190, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 6 }]
|
||||
13["Segment<br>[1196, 1255, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 7 }]
|
||||
14["Segment<br>[1261, 1317, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 8 }]
|
||||
15["Segment<br>[1323, 1388, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 9 }]
|
||||
16["Segment<br>[1394, 1401, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 10 }]
|
||||
23[Solid2d]
|
||||
end
|
||||
subgraph path5 [Path]
|
||||
5["Path<br>[1435, 1497, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }, CallKwArg { index: 0 }]
|
||||
17["Segment<br>[1435, 1497, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }, CallKwArg { index: 0 }]
|
||||
5["Path<br>[1425, 1487, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }, CallKwArg { index: 0 }]
|
||||
17["Segment<br>[1425, 1487, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 11 }, CallKwArg { index: 0 }]
|
||||
20[Solid2d]
|
||||
end
|
||||
subgraph path6 [Path]
|
||||
6["Path<br>[1660, 1736, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
18["Segment<br>[1660, 1736, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
6["Path<br>[1650, 1726, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
18["Segment<br>[1650, 1726, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
21[Solid2d]
|
||||
end
|
||||
subgraph path7 [Path]
|
||||
7["Path<br>[1660, 1736, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
19["Segment<br>[1660, 1736, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
7["Path<br>[1650, 1726, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
19["Segment<br>[1650, 1726, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 1 }]
|
||||
22[Solid2d]
|
||||
end
|
||||
1["Plane<br>[710, 727, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
2["StartSketchOnFace<br>[1616, 1652, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
3["StartSketchOnFace<br>[1616, 1652, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
24["Sweep Extrusion<br>[1504, 1539, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 12 }]
|
||||
25["Sweep Extrusion<br>[1744, 1777, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 2 }]
|
||||
26["Sweep Extrusion<br>[1744, 1777, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 2 }]
|
||||
1["Plane<br>[700, 717, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 0 }]
|
||||
2["StartSketchOnFace<br>[1606, 1642, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
3["StartSketchOnFace<br>[1606, 1642, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
24["Sweep Extrusion<br>[1494, 1529, 0]"]
|
||||
%% [ProgramBodyItem { index: 9 }, VariableDeclarationDeclaration, VariableDeclarationInit, PipeBodyItem { index: 12 }]
|
||||
25["Sweep Extrusion<br>[1734, 1767, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 2 }]
|
||||
26["Sweep Extrusion<br>[1734, 1767, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 2 }]
|
||||
27[Wall]
|
||||
%% face_code_ref=Missing NodePath
|
||||
28[Wall]
|
||||
@ -79,7 +79,7 @@ flowchart LR
|
||||
37["Cap Start"]
|
||||
%% face_code_ref=Missing NodePath
|
||||
38["Cap End"]
|
||||
%% face_code_ref=[ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
%% face_code_ref=[ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 0 }]
|
||||
39["SweepEdge Opposite"]
|
||||
40["SweepEdge Opposite"]
|
||||
41["SweepEdge Opposite"]
|
||||
@ -100,10 +100,10 @@ flowchart LR
|
||||
56["SweepEdge Adjacent"]
|
||||
57["SweepEdge Adjacent"]
|
||||
58["SweepEdge Adjacent"]
|
||||
59["EdgeCut Chamfer<br>[1840, 1887, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
|
||||
60["EdgeCut Chamfer<br>[1840, 1887, 0]"]
|
||||
%% [ProgramBodyItem { index: 11 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
|
||||
59["EdgeCut Chamfer<br>[1830, 1877, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
|
||||
60["EdgeCut Chamfer<br>[1830, 1877, 0]"]
|
||||
%% [ProgramBodyItem { index: 10 }, VariableDeclarationDeclaration, VariableDeclarationInit, FunctionExpressionBody, FunctionExpressionBodyItem { index: 0 }, ExpressionStatementExpr, PipeBodyItem { index: 3 }]
|
||||
1 --- 4
|
||||
1 --- 5
|
||||
38 x--> 2
|
||||
|
||||
@ -200,103 +200,6 @@ description: Result of parsing countersunk-plate.kcl
|
||||
"type": "VariableDeclaration",
|
||||
"type": "VariableDeclaration"
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"expression": {
|
||||
"arguments": [
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "isGreaterThan",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "boltDiameter",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "LabeledArg",
|
||||
"label": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "error",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"arg": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"raw": "\"This plate is not thick enough for the necessary countersink dimensions\"",
|
||||
"start": 0,
|
||||
"type": "Literal",
|
||||
"type": "Literal",
|
||||
"value": "This plate is not thick enough for the necessary countersink dimensions"
|
||||
}
|
||||
}
|
||||
],
|
||||
"callee": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "assert",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name"
|
||||
},
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"start": 0,
|
||||
"type": "CallExpressionKw",
|
||||
"type": "CallExpressionKw",
|
||||
"unlabeled": {
|
||||
"abs_path": false,
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": {
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
"name": "plateThickness",
|
||||
"start": 0,
|
||||
"type": "Identifier"
|
||||
},
|
||||
"path": [],
|
||||
"start": 0,
|
||||
"type": "Name",
|
||||
"type": "Name"
|
||||
}
|
||||
},
|
||||
"preComments": [
|
||||
"",
|
||||
"",
|
||||
"// Check that the plate is thick enough to countersink a hole"
|
||||
],
|
||||
"start": 0,
|
||||
"type": "ExpressionStatement",
|
||||
"type": "ExpressionStatement"
|
||||
},
|
||||
{
|
||||
"commentStart": 0,
|
||||
"declaration": {
|
||||
@ -391,6 +294,10 @@ description: Result of parsing countersunk-plate.kcl
|
||||
"end": 0,
|
||||
"kind": "const",
|
||||
"preComments": [
|
||||
"",
|
||||
"",
|
||||
"// Check that the plate is thick enough to countersink a hole",
|
||||
"// assertGreaterThan(plateThickness, boltDiameter, \"This plate is not thick enough for the necessary countersink dimensions\")",
|
||||
"",
|
||||
"",
|
||||
"// A bit of math to calculate the tangent line between the two diameters"
|
||||
@ -2653,7 +2560,7 @@ description: Result of parsing countersunk-plate.kcl
|
||||
],
|
||||
"nonCodeMeta": {
|
||||
"nonCodeNodes": {
|
||||
"9": [
|
||||
"8": [
|
||||
{
|
||||
"commentStart": 0,
|
||||
"end": 0,
|
||||
|
||||
@ -157,7 +157,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 5
|
||||
"index": 4
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -190,7 +190,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 6
|
||||
"index": 5
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -223,7 +223,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 7
|
||||
"index": 6
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -252,7 +252,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 8
|
||||
"index": 7
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -285,7 +285,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 9
|
||||
"index": 8
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -312,7 +312,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 10
|
||||
"index": 9
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -370,7 +370,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 10
|
||||
"index": 9
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -464,7 +464,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 10
|
||||
"index": 9
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -514,7 +514,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 10
|
||||
"index": 9
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -558,7 +558,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 12
|
||||
"index": 11
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatementExpr"
|
||||
@ -592,7 +592,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -652,7 +652,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -725,7 +725,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -782,7 +782,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 13
|
||||
"index": 12
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatementExpr"
|
||||
@ -816,7 +816,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -876,7 +876,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
@ -949,7 +949,7 @@ description: Operations executed countersunk-plate.kcl
|
||||
"steps": [
|
||||
{
|
||||
"type": "ProgramBodyItem",
|
||||
"index": 11
|
||||
"index": 10
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarationDeclaration"
|
||||
|
||||
@ -582,48 +582,48 @@ flowchart LR
|
||||
46 --- 226
|
||||
72 --- 112
|
||||
72 x--> 151
|
||||
72 --- 168
|
||||
72 --- 202
|
||||
72 --- 166
|
||||
72 --- 200
|
||||
73 --- 113
|
||||
73 x--> 151
|
||||
73 --- 164
|
||||
73 --- 198
|
||||
74 --- 114
|
||||
74 x--> 151
|
||||
74 --- 160
|
||||
74 --- 194
|
||||
74 --- 162
|
||||
74 --- 196
|
||||
75 --- 115
|
||||
75 x--> 151
|
||||
75 --- 163
|
||||
75 --- 197
|
||||
75 --- 165
|
||||
75 --- 199
|
||||
76 --- 116
|
||||
76 x--> 151
|
||||
76 --- 165
|
||||
76 --- 199
|
||||
76 --- 160
|
||||
76 --- 194
|
||||
77 --- 117
|
||||
77 x--> 151
|
||||
77 --- 162
|
||||
77 --- 196
|
||||
77 --- 168
|
||||
77 --- 202
|
||||
78 --- 118
|
||||
78 x--> 151
|
||||
78 --- 169
|
||||
78 --- 203
|
||||
79 --- 119
|
||||
79 x--> 151
|
||||
79 --- 167
|
||||
79 --- 201
|
||||
79 --- 163
|
||||
79 --- 197
|
||||
80 --- 120
|
||||
80 x--> 151
|
||||
80 --- 161
|
||||
80 --- 195
|
||||
80 --- 170
|
||||
80 --- 204
|
||||
81 --- 121
|
||||
81 x--> 151
|
||||
81 --- 166
|
||||
81 --- 200
|
||||
81 --- 161
|
||||
81 --- 195
|
||||
82 --- 122
|
||||
82 x--> 151
|
||||
82 --- 170
|
||||
82 --- 204
|
||||
82 --- 167
|
||||
82 --- 201
|
||||
84 --- 123
|
||||
84 x--> 145
|
||||
84 --- 171
|
||||
@ -756,39 +756,39 @@ flowchart LR
|
||||
109 --- 107
|
||||
111 --- 159
|
||||
111 --- 193
|
||||
112 --- 168
|
||||
112 --- 202
|
||||
203 <--x 112
|
||||
112 --- 166
|
||||
112 --- 200
|
||||
201 <--x 112
|
||||
113 --- 164
|
||||
113 --- 198
|
||||
199 <--x 113
|
||||
114 --- 160
|
||||
114 --- 194
|
||||
195 <--x 114
|
||||
115 --- 163
|
||||
115 --- 197
|
||||
198 <--x 115
|
||||
116 --- 165
|
||||
116 --- 199
|
||||
200 <--x 116
|
||||
117 --- 162
|
||||
117 --- 196
|
||||
197 <--x 117
|
||||
114 --- 162
|
||||
114 --- 196
|
||||
197 <--x 114
|
||||
115 --- 165
|
||||
115 --- 199
|
||||
200 <--x 115
|
||||
116 --- 160
|
||||
116 --- 194
|
||||
195 <--x 116
|
||||
117 --- 168
|
||||
117 --- 202
|
||||
203 <--x 117
|
||||
118 --- 169
|
||||
118 --- 203
|
||||
204 <--x 118
|
||||
119 --- 167
|
||||
119 --- 201
|
||||
202 <--x 119
|
||||
120 --- 161
|
||||
120 --- 195
|
||||
196 <--x 120
|
||||
121 --- 166
|
||||
121 --- 200
|
||||
201 <--x 121
|
||||
122 --- 170
|
||||
194 <--x 122
|
||||
122 --- 204
|
||||
119 --- 163
|
||||
119 --- 197
|
||||
198 <--x 119
|
||||
120 --- 170
|
||||
194 <--x 120
|
||||
120 --- 204
|
||||
121 --- 161
|
||||
121 --- 195
|
||||
196 <--x 121
|
||||
122 --- 167
|
||||
122 --- 201
|
||||
202 <--x 122
|
||||
123 --- 171
|
||||
123 --- 205
|
||||
124 --- 186
|
||||
|
||||
@ -177,68 +177,68 @@ flowchart LR
|
||||
2 ---- 34
|
||||
17 --- 35
|
||||
17 x--> 52
|
||||
17 --- 63
|
||||
17 --- 80
|
||||
17 --- 66
|
||||
17 --- 83
|
||||
18 --- 36
|
||||
18 x--> 52
|
||||
18 --- 58
|
||||
18 --- 75
|
||||
18 --- 54
|
||||
18 --- 71
|
||||
19 --- 37
|
||||
19 x--> 52
|
||||
19 --- 55
|
||||
19 --- 72
|
||||
19 --- 61
|
||||
19 --- 78
|
||||
20 --- 38
|
||||
20 x--> 52
|
||||
20 --- 62
|
||||
20 --- 79
|
||||
20 --- 67
|
||||
20 --- 84
|
||||
21 --- 39
|
||||
21 x--> 52
|
||||
21 --- 68
|
||||
21 --- 85
|
||||
21 --- 57
|
||||
21 --- 74
|
||||
22 --- 40
|
||||
22 x--> 52
|
||||
22 --- 61
|
||||
22 --- 78
|
||||
22 --- 64
|
||||
22 --- 81
|
||||
23 --- 41
|
||||
23 x--> 52
|
||||
23 --- 67
|
||||
23 --- 84
|
||||
23 --- 62
|
||||
23 --- 79
|
||||
24 --- 42
|
||||
24 x--> 52
|
||||
24 --- 65
|
||||
24 --- 82
|
||||
24 --- 68
|
||||
24 --- 85
|
||||
25 --- 43
|
||||
25 x--> 52
|
||||
25 --- 66
|
||||
25 --- 83
|
||||
25 --- 70
|
||||
25 --- 87
|
||||
26 --- 44
|
||||
26 x--> 52
|
||||
26 --- 69
|
||||
26 --- 86
|
||||
26 --- 56
|
||||
26 --- 73
|
||||
27 --- 45
|
||||
27 x--> 52
|
||||
27 --- 56
|
||||
27 --- 73
|
||||
27 --- 69
|
||||
27 --- 86
|
||||
28 --- 46
|
||||
28 x--> 52
|
||||
28 --- 54
|
||||
28 --- 71
|
||||
28 --- 65
|
||||
28 --- 82
|
||||
29 --- 47
|
||||
29 x--> 52
|
||||
29 --- 60
|
||||
29 --- 77
|
||||
29 --- 55
|
||||
29 --- 72
|
||||
30 --- 48
|
||||
30 x--> 52
|
||||
30 --- 64
|
||||
30 --- 81
|
||||
30 --- 58
|
||||
30 --- 75
|
||||
31 --- 49
|
||||
31 x--> 52
|
||||
31 --- 70
|
||||
31 --- 87
|
||||
31 --- 60
|
||||
31 --- 77
|
||||
32 --- 50
|
||||
32 x--> 52
|
||||
32 --- 57
|
||||
32 --- 74
|
||||
32 --- 63
|
||||
32 --- 80
|
||||
33 --- 51
|
||||
33 x--> 52
|
||||
33 --- 59
|
||||
@ -296,54 +296,54 @@ flowchart LR
|
||||
34 --- 85
|
||||
34 --- 86
|
||||
34 --- 87
|
||||
35 --- 63
|
||||
79 <--x 35
|
||||
35 --- 80
|
||||
36 --- 58
|
||||
74 <--x 36
|
||||
36 --- 75
|
||||
37 --- 55
|
||||
71 <--x 37
|
||||
37 --- 72
|
||||
38 --- 62
|
||||
78 <--x 38
|
||||
38 --- 79
|
||||
39 --- 68
|
||||
84 <--x 39
|
||||
39 --- 85
|
||||
40 --- 61
|
||||
77 <--x 40
|
||||
40 --- 78
|
||||
41 --- 67
|
||||
83 <--x 41
|
||||
41 --- 84
|
||||
42 --- 65
|
||||
81 <--x 42
|
||||
42 --- 82
|
||||
43 --- 66
|
||||
82 <--x 43
|
||||
43 --- 83
|
||||
44 --- 69
|
||||
85 <--x 44
|
||||
44 --- 86
|
||||
45 --- 56
|
||||
72 <--x 45
|
||||
45 --- 73
|
||||
46 --- 54
|
||||
46 --- 71
|
||||
87 <--x 46
|
||||
47 --- 60
|
||||
76 <--x 47
|
||||
47 --- 77
|
||||
48 --- 64
|
||||
80 <--x 48
|
||||
48 --- 81
|
||||
49 --- 70
|
||||
86 <--x 49
|
||||
49 --- 87
|
||||
50 --- 57
|
||||
73 <--x 50
|
||||
50 --- 74
|
||||
35 --- 66
|
||||
82 <--x 35
|
||||
35 --- 83
|
||||
36 --- 54
|
||||
36 --- 71
|
||||
87 <--x 36
|
||||
37 --- 61
|
||||
77 <--x 37
|
||||
37 --- 78
|
||||
38 --- 67
|
||||
83 <--x 38
|
||||
38 --- 84
|
||||
39 --- 57
|
||||
73 <--x 39
|
||||
39 --- 74
|
||||
40 --- 64
|
||||
80 <--x 40
|
||||
40 --- 81
|
||||
41 --- 62
|
||||
78 <--x 41
|
||||
41 --- 79
|
||||
42 --- 68
|
||||
84 <--x 42
|
||||
42 --- 85
|
||||
43 --- 70
|
||||
86 <--x 43
|
||||
43 --- 87
|
||||
44 --- 56
|
||||
72 <--x 44
|
||||
44 --- 73
|
||||
45 --- 69
|
||||
85 <--x 45
|
||||
45 --- 86
|
||||
46 --- 65
|
||||
81 <--x 46
|
||||
46 --- 82
|
||||
47 --- 55
|
||||
71 <--x 47
|
||||
47 --- 72
|
||||
48 --- 58
|
||||
74 <--x 48
|
||||
48 --- 75
|
||||
49 --- 60
|
||||
76 <--x 49
|
||||
49 --- 77
|
||||
50 --- 63
|
||||
79 <--x 50
|
||||
50 --- 80
|
||||
51 --- 59
|
||||
75 <--x 51
|
||||
51 --- 76
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2341,7 +2341,7 @@ description: Result of parsing t-slot-rail.kcl
|
||||
},
|
||||
"preComments": [
|
||||
"// T-Slotted Framing Rail",
|
||||
"// A T-slotted framing rail, commonly known as an 80/20 rail, is a rectangular or square aluminum extrusion with a \"T\" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.",
|
||||
"// A T-slotted framing rail, or T-slot extrusion, is a rectangular or square aluminum profile with a \"T\" shaped slot along one or more sides. These slots allow for easy attachment of various hardware components like brackets, connectors, and fasteners, making it a versatile and customizable framing system.",
|
||||
"",
|
||||
"",
|
||||
"// Set units"
|
||||
|
||||
@ -889,7 +889,7 @@ flowchart LR
|
||||
99 --- 265
|
||||
99 --- 314
|
||||
106 --- 181
|
||||
106 x--> 212
|
||||
106 x--> 213
|
||||
106 --- 260
|
||||
106 --- 309
|
||||
126 --- 194
|
||||
@ -1227,7 +1227,7 @@ flowchart LR
|
||||
251 <--x 209
|
||||
252 <--x 209
|
||||
253 <--x 209
|
||||
260 <--x 213
|
||||
260 <--x 212
|
||||
261 <--x 214
|
||||
262 <--x 214
|
||||
263 <--x 214
|
||||
|
||||
@ -4,8 +4,8 @@ description: Error from executing panic_repro_cube.kcl
|
||||
---
|
||||
KCL Semantic error
|
||||
|
||||
× semantic: This function expected the input argument to be tag identifier
|
||||
│ but it's actually of type tag
|
||||
× semantic: The input argument of `getNextAdjacentEdge` requires a value
|
||||
│ with type `TaggedEdge`, but found a unique ID (uuid) (with type `Edge`).
|
||||
╭─[43:5]
|
||||
42 │ // these double wrapped functions are the point of this test
|
||||
43 │ getNextAdjacentEdge(getNextAdjacentEdge(seg01)),
|
||||
@ -16,8 +16,9 @@ KCL Semantic error
|
||||
╰────
|
||||
╰─▶ KCL Semantic error
|
||||
|
||||
× semantic: This function expected the input argument to be tag
|
||||
│ identifier but it's actually of type tag
|
||||
× semantic: The input argument of `getNextAdjacentEdge` requires a
|
||||
│ value with type `TaggedEdge`, but found a unique ID (uuid) (with
|
||||
│ type `Edge`).
|
||||
╭─[43:25]
|
||||
42 │ // these double wrapped functions are the point of this test
|
||||
43 │ getNextAdjacentEdge(getNextAdjacentEdge(seg01)),
|
||||
|
||||
@ -1049,23 +1049,35 @@ export class CameraControls {
|
||||
})
|
||||
}
|
||||
|
||||
async saveRemoteCameraState() {
|
||||
const cameraViewStateResponse =
|
||||
await this.engineCommandManager.sendSceneCommand({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: { type: 'default_camera_get_view' },
|
||||
})
|
||||
if (!cameraViewStateResponse) return
|
||||
if (
|
||||
'resp' in cameraViewStateResponse &&
|
||||
'modeling_response' in cameraViewStateResponse.resp.data &&
|
||||
'data' in cameraViewStateResponse.resp.data.modeling_response &&
|
||||
'view' in cameraViewStateResponse.resp.data.modeling_response.data
|
||||
) {
|
||||
this.oldCameraState =
|
||||
cameraViewStateResponse.resp.data.modeling_response.data.view
|
||||
}
|
||||
saveRemoteCameraState(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
// It's possible we've hit a disconnection, but the browser or nothing
|
||||
// indicates this, other than the amount of time between our request
|
||||
// and its response. Typically round-trip time is < 30ms. It seems safe
|
||||
// then to wait 1 magnitude of time before calling this request toasted.
|
||||
const timeoutId = setTimeout(reject, 300)
|
||||
;(async () => {
|
||||
const cameraViewStateResponse =
|
||||
await this.engineCommandManager.sendSceneCommand({
|
||||
type: 'modeling_cmd_req',
|
||||
cmd_id: uuidv4(),
|
||||
cmd: { type: 'default_camera_get_view' },
|
||||
})
|
||||
if (!cameraViewStateResponse) return
|
||||
if (
|
||||
'resp' in cameraViewStateResponse &&
|
||||
'modeling_response' in cameraViewStateResponse.resp.data &&
|
||||
'data' in cameraViewStateResponse.resp.data.modeling_response &&
|
||||
'view' in cameraViewStateResponse.resp.data.modeling_response.data
|
||||
) {
|
||||
this.oldCameraState =
|
||||
cameraViewStateResponse.resp.data.modeling_response.data.view
|
||||
}
|
||||
|
||||
clearTimeout(timeoutId)
|
||||
resolve()
|
||||
})().catch(reject)
|
||||
})
|
||||
}
|
||||
|
||||
async tweenCameraToQuaternion(
|
||||
|
||||
@ -496,10 +496,10 @@ export class KclManager extends EventTarget {
|
||||
if (!errors.length) {
|
||||
this.lastSuccessfulVariables = execState.variables
|
||||
this.lastSuccessfulOperations = execState.operations
|
||||
// updateArtifactGraph relies on updated executeState/variables
|
||||
await this.updateArtifactGraph(execState.artifactGraph)
|
||||
}
|
||||
this.ast = structuredClone(ast)
|
||||
// updateArtifactGraph relies on updated executeState/variables
|
||||
await this.updateArtifactGraph(execState.artifactGraph)
|
||||
if (!isInterrupted) {
|
||||
this.singletons.sceneInfra.modelingSend({
|
||||
type: 'code edit during sketch',
|
||||
|
||||
@ -229,7 +229,11 @@ export const engineStreamMachine = setup({
|
||||
}
|
||||
}
|
||||
|
||||
await rootContext.sceneInfra.camControls.saveRemoteCameraState()
|
||||
try {
|
||||
await rootContext.sceneInfra.camControls.saveRemoteCameraState()
|
||||
} catch (e) {
|
||||
console.warn('Save remote camera state timed out', e)
|
||||
}
|
||||
|
||||
// Make sure we're on the next frame for no flickering between canvas
|
||||
// and the video elements.
|
||||
|
||||
Reference in New Issue
Block a user