Compare commits

...

1 Commits

Author SHA1 Message Date
1b7126b9f3 More units of measure work
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-11 15:14:56 +12:00
445 changed files with 60577 additions and 34339 deletions

View File

@ -24,8 +24,8 @@ atan2(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
| `y` | [`number`](/docs/kcl/types/number) | Y | Yes |
| `x` | [`number`](/docs/kcl/types/number) | X | Yes |
### Returns
@ -37,7 +37,7 @@ atan2(
```js
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine(angle = toDegrees(atan2(1.25, 2)), length = 20)
|> angledLine(angle = toDegrees(atan2(y = 1.25, x = 2)), length = 20)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -80,7 +80,7 @@ part001 = cube([0, 0], 20)
// We tag the chamfer to reference it later.
|> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
sketch001 = startSketchOn(part001, chamfer1)
sketch001 = startSketchOn(part001, face = chamfer1)
|> startProfileAt([10, 10], %)
|> line(end = [2, 0])
|> line(end = [0, 2])

View File

@ -69,11 +69,11 @@ case = startSketchOn(-XZ)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

View File

@ -20,7 +20,7 @@ offsetPlane(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. 'XY') which this new plane is created from. | Yes |
| `plane` | [`PlaneData`](/docs/kcl/types/PlaneData) | The plane (e.g. XY) which this new plane is created from. | Yes |
| `offset` | [`number`](/docs/kcl/types/number) | Distance from the standard plane this new plane will be created at. | Yes |
### Returns

View File

@ -61,11 +61,11 @@ case = startSketchOn(XY)
|> close(%)
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -92,7 +92,7 @@ case = startSketchOn(XY)
|> close(%)
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

View File

@ -107,11 +107,11 @@ case = startSketchOn(-XZ)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -132,11 +132,11 @@ case = startSketchOn(XY)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
@ -160,11 +160,11 @@ case = startSketchOn(XY)
|> close()
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
thing1 = startSketchOn(case, face = 'end')
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
thing2 = startSketchOn(case, face = 'end')
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)

View File

@ -18,8 +18,8 @@ The point is if you want to export the result of a sketch on a face, you only ne
```js
startSketchOn(
data: SketchData,
tag?: FaceTag,
planeOrSolid: SketchData,
face?: FaceTag,
): SketchSurface
```
@ -28,8 +28,8 @@ startSketchOn(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`SketchData`](/docs/kcl/types/SketchData) | Data for start sketch on. You can start a sketch on a plane or an solid. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`FaceTag`](/docs/kcl/types/FaceTag) | A tag for a face. | No |
| `planeOrSolid` | [`SketchData`](/docs/kcl/types/SketchData) | The plane or solid to sketch on | Yes |
| `face` | [`FaceTag`](/docs/kcl/types/FaceTag) | Identify a face of a solid if a solid is specified as the input argument (`plane_or_solid`) | No |
### Returns
@ -48,7 +48,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5)
exampleSketch002 = startSketchOn(example, 'end')
exampleSketch002 = startSketchOn(example, face = 'end')
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -57,7 +57,7 @@ exampleSketch002 = startSketchOn(example, 'end')
example002 = extrude(exampleSketch002, length = 5)
exampleSketch003 = startSketchOn(example002, 'end')
exampleSketch003 = startSketchOn(example002, face = 'end')
|> startProfileAt([2, 2], %)
|> line(end = [6, 0])
|> line(end = [0, 6])
@ -82,7 +82,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 5, tagEnd = $end01)
exampleSketch002 = startSketchOn(example, end01)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -91,7 +91,7 @@ exampleSketch002 = startSketchOn(example, end01)
example002 = extrude(exampleSketch002, length = 5, tagEnd = $end02)
exampleSketch003 = startSketchOn(example002, end02)
exampleSketch003 = startSketchOn(example002, face = end02)
|> startProfileAt([2, 2], %)
|> line(end = [6, 0])
|> line(end = [0, 6])
@ -113,7 +113,7 @@ exampleSketch = startSketchOn(XY)
example = extrude(exampleSketch, length = 10)
exampleSketch002 = startSketchOn(example, sketchingFace)
exampleSketch002 = startSketchOn(example, face = sketchingFace)
|> startProfileAt([1, 1], %)
|> line(end = [8, 0])
|> line(end = [0, 8])
@ -122,7 +122,7 @@ exampleSketch002 = startSketchOn(example, sketchingFace)
example002 = extrude(exampleSketch002, length = 10)
exampleSketch003 = startSketchOn(example002, sketchingFace002)
exampleSketch003 = startSketchOn(example002, face = sketchingFace002)
|> startProfileAt([-8, 12], %)
|> line(end = [0, 6])
|> line(end = [6, 0])
@ -148,7 +148,7 @@ exampleSketch = startSketchOn(XY)
example = revolve(exampleSketch, axis = Y, angle = 180)
exampleSketch002 = startSketchOn(example, 'end')
exampleSketch002 = startSketchOn(example, face = 'end')
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -182,7 +182,7 @@ example = revolve(
tagEnd = $end01,
)
exampleSketch002 = startSketchOn(example, end01)
exampleSketch002 = startSketchOn(example, face = end01)
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -196,12 +196,10 @@ example002 = extrude(exampleSketch002, length = 5)
```js
a1 = startSketchOn({
plane = {
origin = { x = 0, y = 0, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = { x = 0, y = 0, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
})
|> startProfileAt([0, 0], %)
|> line(end = [100.0, 0])

View File

@ -11,11 +11,11 @@ Create a helix.
```js
helix(
revolutions: number(_),
angleStart: number(deg),
angleStart: number(Angle),
ccw?: bool,
radius?: number(mm),
radius?: number(Length),
axis?: Axis3d | Edge,
length?: number(mm),
length?: number(Length),
cylinder?: Solid,
): Helix
```
@ -26,11 +26,11 @@ helix(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `revolutions` | `number(_)` | Number of revolutions. | Yes |
| `angleStart` | `number(deg)` | Start angle (in degrees). | Yes |
| `angleStart` | `number(Angle)` | Start angle (in degrees). | Yes |
| `ccw` | [`bool`](/docs/kcl/types/bool) | Is the helix rotation counter clockwise? The default is `false`. | No |
| `radius` | `number(mm)` | Radius of the helix. | No |
| `radius` | `number(Length)` | Radius of the helix. | No |
| `axis` | `Axis3d | Edge` | Axis to use for the helix. | No |
| `length` | `number(mm)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `length` | `number(Length)` | Length of the helix. This is not necessary if the helix is created around an edge. If not given the length of the edge is used. | No |
| `cylinder` | [`Solid`](/docs/kcl/types/Solid) | Cylinder to create the helix on. | No |
### Returns

View File

@ -9,7 +9,7 @@ Compute the cosine of a number (in radians).
```js
cos(@num: number(rad)): number(_)
cos(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ cos(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -11,9 +11,9 @@ cartesian (x/y/z grid) coordinates.
```js
polar(
angle: number(deg),
length: number(mm),
): [number(mm); 2]
angle: number(Angle),
length: number(Length),
): Point2d
```
@ -21,12 +21,12 @@ polar(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` | `number(deg)` | | Yes |
| `length` | `number(mm)` | | Yes |
| `angle` | `number(Angle)` | | Yes |
| `length` | `number(Length)` | | Yes |
### Returns
`[number(mm); 2]`
[`Point2d`](/docs/kcl/types/Point2d)
### Examples

View File

@ -9,7 +9,7 @@ Compute the sine of a number (in radians).
```js
sin(@num: number(rad)): number(_)
sin(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ sin(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -9,7 +9,7 @@ Compute the tangent of a number (in radians).
```js
tan(@num: number(rad)): number(_)
tan(@num: number(Angle)): number(_)
```
@ -17,7 +17,7 @@ tan(@num: number(rad)): number(_)
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number(rad)` | | Yes |
| `num` | `number(Angle)` | | Yes |
### Returns

View File

@ -21,10 +21,10 @@ revolved around the same axis.
revolve(
@sketches: [Sketch; 1+],
axis: Axis2d | Edge,
angle?: number(deg),
tolerance?: number(mm),
angle?: number(Angle),
tolerance?: number(Length),
symmetric?: bool,
bidirectionalAngle?: number(deg),
bidirectionalAngle?: number(Angle),
tagStart?: tag,
tagEnd?: tag,
): Solid
@ -37,10 +37,10 @@ revolve(
|----------|------|-------------|----------|
| `sketches` | `[Sketch; 1+]` | The sketch or set of sketches that should be revolved | Yes |
| `axis` | `Axis2d | Edge` | Axis of revolution. | Yes |
| `angle` | `number(deg)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(mm)` | Tolerance for the revolve operation. | No |
| `angle` | `number(Angle)` | Angle to revolve (in degrees). Default is 360. | No |
| `tolerance` | `number(Length)` | Tolerance for the revolve operation. | No |
| `symmetric` | [`bool`](/docs/kcl/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(deg)` | If specified, will also revolve in the opposite direction to 'angle' to the specified angle. If 'symmetric' is true, this value is ignored. | No |
| `bidirectionalAngle` | `number(Angle)` | 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/types/tag) | A named tag for the face at the start of the revolve, i.e. the original sketch. | No |
| `tagEnd` | [`tag`](/docs/kcl/types/tag) | A named tag for the face at the end of the revolve. | No |
@ -108,7 +108,7 @@ part001 = startSketchOn(XY)
|> close()
|> revolve(axis = Y, angle = 180)
part002 = startSketchOn(part001, 'end')
part002 = startSketchOn(part001, face = 'end')
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -128,7 +128,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = -90,
@ -147,7 +147,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = 90,
@ -166,7 +166,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle( center = [10,10], radius = 4 )
|> revolve(
angle = 90,

View File

@ -13,7 +13,7 @@ the provided (x, y) origin point.
circle(
@sketch_or_surface: Sketch | Plane | Face,
center: Point2d,
radius: number,
radius: number(Length),
tag?: tag,
): Sketch
```
@ -25,7 +25,7 @@ circle(
|----------|------|-------------|----------|
| `sketch_or_surface` | [`Sketch`](/docs/kcl/types/Sketch) OR [`Plane`](/docs/kcl/types/Plane) OR [`Face`](/docs/kcl/types/Face) | Sketch to extend, or plane or surface to sketch on. | Yes |
| `center` | [`Point2d`](/docs/kcl/types/Point2d) | The center of the circle. | Yes |
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the circle. | Yes |
| `radius` | `number(Length)` | The radius of the circle. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`tag`](/docs/kcl/types/tag) | Create a new tag which refers to this circle. | No |
### Returns

View File

@ -110,7 +110,7 @@ sketch0011 = startSketchOn(XY)
|> mirror2d( axis = X )
|> extrude(length = 10)
sketch002 = startSketchOn(sketch0011, 'END')
sketch002 = startSketchOn(sketch0011, face = 'END')
|> circle( center = [-0.01, 1.58], radius = 1.2 )
|> extrude(length = 1.2)

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
---
title: "AngledLineData"
excerpt: "Data to draw an angled line."
layout: manual
---
Data to draw an angled line.
**This schema accepts any of the following:**
An angle and length with explicitly named parameters
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line (in degrees). | No |
| `length` |[`number`](/docs/kcl/types/number)| The length of the line. | No |
----
An angle and length given as a pair
**Type:** `array`
`[number, number]`
----

View File

@ -16,8 +16,8 @@ Data for drawing an angled line that intersects with a given line.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line. | No |
| `angle` |`TyF64`| The angle of the line. | No |
| `intersectTag` |[`TagIdentifier`](/docs/kcl/types#tag-identifier)| The tag of the line to intersect with. | No |
| `offset` |[`number`](/docs/kcl/types/number)| The offset from the intersecting line. | No |
| `offset` |`TyF64`| The offset from the intersecting line. | No |

View File

@ -1,22 +0,0 @@
---
title: "AngledLineToData"
excerpt: "Data to draw an angled line to a point."
layout: manual
---
Data to draw an angled line to a point.
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angle` |[`number`](/docs/kcl/types/number)| The angle of the line. | No |
| `to` |[`number`](/docs/kcl/types/number)| The point to draw to. | No |

View File

@ -23,9 +23,9 @@ Angles and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angleStart` |[`number`](/docs/kcl/types/number) (**maximum:** 360.0) (**minimum:** -360.0)| The start angle. | No |
| `angleEnd` |[`number`](/docs/kcl/types/number) (**maximum:** 360.0) (**minimum:** -360.0)| The end angle. | No |
| `radius` |[`number`](/docs/kcl/types/number)| The radius. | No |
| `angleStart` |`TyF64`| The start angle. | No |
| `angleEnd` |`TyF64`| The end angle. | No |
| `radius` |`TyF64`| The radius. | No |
----
@ -41,9 +41,9 @@ Center, to and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `center` |`[number, number]`| The center. | No |
| `to` |`[number, number]`| The to point. | No |
| `radius` |[`number`](/docs/kcl/types/number)| The radius. | No |
| `center` |`[, `TyF64`, `TyF64`]`| The center. | No |
| `to` |`[, `TyF64`, `TyF64`]`| The to point. | No |
| `radius` |`TyF64`| The radius. | No |
----

View File

@ -16,7 +16,7 @@ Data to draw a three point arc (arcTo).
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `end` |`[number, number]`| End point of the arc. A point in 3D space | No |
| `interior` |`[number, number]`| Interior point of the arc. A point in 3D space | No |
| `end` |`[, `TyF64`, `TyF64`]`| End point of the arc. A point in 3D space | No |
| `interior` |`[, `TyF64`, `TyF64`]`| Interior point of the arc. A point in 3D space | No |

View File

@ -16,8 +16,8 @@ Data to draw a bezier curve.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `to` |`[number, number]`| The to point. | No |
| `control1` |`[number, number]`| The first control point. | No |
| `control2` |`[number, number]`| The second control point. | No |
| `to` |`[, `TyF64`, `TyF64`]`| The to point. | No |
| `control1` |`[, `TyF64`, `TyF64`]`| The first control point. | No |
| `control2` |`[, `TyF64`, `TyF64`]`| The second control point. | No |

View File

@ -26,7 +26,7 @@ A fillet.
|----------|------|-------------|----------|
| `type` |enum: `fillet`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The id of the engine command that called this fillet. | No |
| `radius` |[`number`](/docs/kcl/types/number)| | No |
| `radius` |`TyF64`| | No |
| `edgeId` |[`string`](/docs/kcl/types/string)| The engine id of the edge to fillet. | No |
| [`tag`](/docs/kcl/types/tag) |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| | No |
@ -46,7 +46,7 @@ A chamfer.
|----------|------|-------------|----------|
| `type` |enum: `chamfer`| | No |
| `id` |[`string`](/docs/kcl/types/string)| The id of the engine command that called this chamfer. | No |
| `length` |[`number`](/docs/kcl/types/number)| | No |
| `length` |`TyF64`| | No |
| `edgeId` |[`string`](/docs/kcl/types/string)| The engine id of the edge to chamfer. | No |
| [`tag`](/docs/kcl/types/tag) |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| | No |

View File

@ -130,6 +130,21 @@ A unit of length.
| `type` |enum: `Yards`| | No |
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----
@ -178,6 +193,21 @@ A unit of angle.
| `type` |enum: `Radians`| | No |
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

View File

@ -7,7 +7,7 @@ layout: manual
A point in two dimensional space.
```kcl
type Point2d = [number; 2]
type Point2d = [number(Length); 2]
```
[`Point2d`](/docs/kcl/types/Point2d) is an alias for a two-element array of [number](/docs/kcl/types/number)s. To write a value

View File

@ -7,7 +7,7 @@ layout: manual
A point in three dimensional space.
```kcl
type Point3d = [number; 3]
type Point3d = [number(Length); 3]
```
[`Point3d`](/docs/kcl/types/Point3d) is an alias for a three-element array of [number](/docs/kcl/types/number)s. To write a value

View File

@ -16,9 +16,9 @@ Data for drawing a polygon
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `radius` |[`number`](/docs/kcl/types/number)| The radius of the polygon | No |
| `radius` |`TyF64`| The radius of the polygon | No |
| `numSides` |`integer`| The number of sides in the polygon | No |
| `center` |`[number, number]`| The center point of the polygon | No |
| `center` |`[, `TyF64`, `TyF64`]`| The center point of the polygon | No |
| `inscribed` |`boolean`| Whether the polygon is inscribed (true) or circumscribed (false) about a circle with the specified radius | No |

View File

@ -16,7 +16,7 @@ Data to draw a tangential arc.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `radius` |[`number`](/docs/kcl/types/number)| Radius of the arc. Not to be confused with Raiders of the Lost Ark. | No |
| `offset` |[`number`](/docs/kcl/types/number)| Offset of the arc, in degrees. | No |
| `radius` |`TyF64`| Radius of the arc. Not to be confused with Raiders of the Lost Ark. | No |
| `offset` |`TyF64`| Offset of the arc, in degrees. | No |

View File

@ -43,6 +43,21 @@ A unit of angle.
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

View File

@ -103,6 +103,21 @@ A unit of length.
----
**Type:** `object`
## Properties
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `Unknown`| | No |
----

View File

@ -731,7 +731,7 @@ sketch_001 = startSketchOn(XY)
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn(box, face = revolveAxis)
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])

View File

@ -44,7 +44,7 @@ const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)
extrude001 = extrude(sketch001, length = 10)
sketch002 = startSketchOn(extrude001, rectangleSegmentB001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentB001)
|> circle(
center = [-1, 2],
radius = .5
@ -194,7 +194,7 @@ test.describe('Feature Tree pane', () => {
highlightedCode: '',
diagnostics: [],
activeLines: [
'sketch002=startSketchOn(extrude001,rectangleSegmentB001)',
'sketch002=startSketchOn(extrude001,face=rectangleSegmentB001)',
],
})
await toolbar.exitSketchBtn.click()

View File

@ -44,8 +44,8 @@ profile001 = startProfileAt([-134.53, -56.17], sketch001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close()
extrude001 = extrude(profile001, length = 100)
sketch003 = startSketchOn(extrude001, seg02)
sketch002 = startSketchOn(extrude001, seg01)`
sketch003 = startSketchOn(extrude001, face = seg02)
sketch002 = startSketchOn(extrude001, face = seg01)`
)
})

View File

@ -220,7 +220,7 @@ test.describe('Point-and-click tests', () => {
)`,
afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)',
'sketch002 = startSketchOn(extrude001, face = seg03)',
afterRectangle1stClickSnippet:
'startProfileAt([205.96, 254.59], sketch002)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.39,tag=$rectangleSegmentA002)
@ -244,7 +244,7 @@ test.describe('Point-and-click tests', () => {
)`,
afterChamferSelectSnippet:
'sketch003 = startSketchOn(extrude001, seg04)',
'sketch003 = startSketchOn(extrude001, face = seg04)',
afterRectangle1stClickSnippet:
'startProfileAt([-209.64, 255.28], sketch003)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.56,tag=$rectangleSegmentA003)
@ -266,7 +266,7 @@ test.describe('Point-and-click tests', () => {
]
)`,
afterChamferSelectSnippet:
'sketch004 = startSketchOn(extrude001, seg05)',
'sketch004 = startSketchOn(extrude001, face = seg05)',
afterRectangle1stClickSnippet:
'startProfileAt([82.57, 322.96], sketch004)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.16,tag=$rectangleSegmentA004)
@ -284,7 +284,7 @@ test.describe('Point-and-click tests', () => {
beforeChamferSnippetEnd:
'|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)])',
afterChamferSelectSnippet:
'sketch005 = startSketchOn(extrude001, seg06)',
'sketch005 = startSketchOn(extrude001, face = seg06)',
afterRectangle1stClickSnippet:
'startProfileAt([-23.43, 19.69], sketch005)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=9.1,tag=$rectangleSegmentA005)
@ -309,28 +309,28 @@ extrude001 = extrude(sketch001, length = 100)
|> chamfer(length = 30, tags = [seg01], tag = $seg04)
|> chamfer(length = 30, tags = [getNextAdjacentEdge(seg02)], tag = $seg05)
|> chamfer(length = 30, tags = [getNextAdjacentEdge(yo)], tag = $seg06)
sketch005 = startSketchOn(extrude001, seg06)
sketch005 = startSketchOn(extrude001, face = seg06)
profile004=startProfileAt([-23.43,19.69], sketch005)
|> angledLine(angle = 0, length = 9.1, tag = $rectangleSegmentA005)
|> angledLine(angle = segAng(rectangleSegmentA005) - 90, length = 84.07)
|> angledLine(angle = segAng(rectangleSegmentA005), length = -segLen(rectangleSegmentA005))
|> line(endAbsolute=[profileStartX(%), profileStartY(%)])
|> close()
sketch004 = startSketchOn(extrude001, seg05)
sketch004 = startSketchOn(extrude001, face = seg05)
profile003 = startProfileAt([82.57, 322.96], sketch004)
|> angledLine(angle = 0, length = 11.16, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) - 90, length = 103.07)
|> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch003 = startSketchOn(extrude001, seg04)
sketch003 = startSketchOn(extrude001, face = seg04)
profile002 = startProfileAt([-209.64, 255.28], sketch003)
|> angledLine(angle = 0, length = 11.56, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 106.84)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch002 = startSketchOn(extrude001, seg03)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfileAt([205.96, 254.59], sketch002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
@ -383,7 +383,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
])`,
beforeChamferSnippetEnd: ')',
afterChamferSelectSnippet:
'sketch002 = startSketchOn(extrude001, seg03)',
'sketch002 = startSketchOn(extrude001, face = seg03)',
afterRectangle1stClickSnippet:
'startProfileAt([205.96, 254.59], sketch002)',
afterRectangle2ndClickSnippet: `angledLine(angle=0,length=11.39,tag=$rectangleSegmentA002)
@ -416,7 +416,7 @@ chamf = chamfer(
getNextAdjacentEdge(seg02)
],
)
sketch002 = startSketchOn(extrude001, seg03)
sketch002 = startSketchOn(extrude001, face = seg03)
profile001 = startProfileAt([205.96, 254.59], sketch002)
|> angledLine(angle = 0, length = 11.39, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 105.26)
@ -3188,7 +3188,7 @@ sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100)
|> extrude(length = 100)
sketch002 = startSketchOn(sketch001, 'END')
sketch002 = startSketchOn(sketch001, face = 'END')
|> circle(center = [0, 0], radius = 50)
|> extrude(length = 50)
`,
@ -3197,7 +3197,7 @@ sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 100)
extrude001 = extrude(sketch001, length = 100)
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|> circle(center = [0, 0], radius = 50)
extrude002 = extrude(sketch002, length = 50)
`,
@ -3447,7 +3447,7 @@ tag=$rectangleSegmentC001,
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 200)
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> startProfileAt([-66.77, 84.81], %)
|> angledLine(angle = 180, length = 27.08, tag = $rectangleSegmentA002)
|> angledLine(
@ -3535,7 +3535,7 @@ tag=$rectangleSegmentC002,
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 50)
sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentA001)
|> circle(center = [-11.34, 10.0], radius = 8.69)
`
@ -3623,7 +3623,7 @@ sketch002 = startSketchOn(extrude001, rectangleSegmentA001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 5)
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> circle(
center = [-0.69, 0.56],
radius = 0.28

View File

@ -1099,7 +1099,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 5)
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|>
`.replace(/\s/g, '')
)
@ -2634,7 +2634,7 @@ profile001 = startProfileAt([6.71, -3.66], sketch001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(profile001, length = 20)
sketch002 = startSketchOn(extrude001, seg01)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfileAt([0.75, 13.46], sketch002)
|> line(end = [4.52, 3.79])
|> line(end = [5.98, -2.81])

View File

@ -824,7 +824,7 @@ test(
|> line(end = [11.91, -10.42])
|> close()
|> extrude(length = ${KCL_DEFAULT_LENGTH})
part002 = startSketchOn(part001, seg01)
part002 = startSketchOn(part001, face = seg01)
|> startProfileAt([8, 8], %)
|> line(end = [4.68, 3.05])
|> line(end = [0, -7.79])

View File

@ -140,7 +140,7 @@ box = startSketchOn(XY)
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn(box, face = revolveAxis)
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])

View File

@ -272,27 +272,27 @@ sketch001 = startSketchOn(XZ)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = 50)
sketch005 = startSketchOn(extrude001, 'END')
sketch005 = startSketchOn(extrude001, face = 'END')
|> startProfileAt([23.24, 136.52], %)
|> line(end = [-8.44, 36.61])
|> line(end = [49.4, 2.05])
|> line(end = [29.69, -46.95])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch003 = startSketchOn(extrude001, seg01)
sketch003 = startSketchOn(extrude001, face = seg01)
|> startProfileAt([21.23, 17.81], %)
|> line(end = [51.97, 21.32])
|> line(end = [4.07, -22.75])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
sketch002 = startSketchOn(extrude001, seg02)
sketch002 = startSketchOn(extrude001, face = seg02)
|> startProfileAt([-100.54, 16.99], %)
|> line(end = [0, 20.03])
|> line(end = [62.61, 0], tag = $seg03)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude002 = extrude(sketch002, length = 50)
sketch004 = startSketchOn(extrude002, seg03)
sketch004 = startSketchOn(extrude002, face = seg03)
|> startProfileAt([57.07, 134.77], %)
|> line(end = [-4.72, 22.84])
|> line(end = [28.8, 6.71])
@ -391,28 +391,22 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
// `extrude001 = extrude(sketch001, length = 50)`
// )
// await expect(u.codeLocator).toContainText(`sketch005 = startSketchOn({
// plane = {
// origin = { x = 0, y = -50, z = 0 },
// xAxis = { x = 1, y = 0, z = 0 },
// yAxis = { x = 0, y = 0, z = 1 },
// zAxis = { x = 0, y = -1, z = 0 }
// }
// })`)
// await expect(u.codeLocator).toContainText(`sketch003 = startSketchOn({
// plane = {
// origin = { x = 116.53, y = 0, z = 163.25 },
// xAxis = { x = -0.81, y = 0, z = 0.58 },
// yAxis = { x = 0, y = -1, z = 0 },
// zAxis = { x = 0.58, y = 0, z = 0.81 }
// }
// })`)
// await expect(u.codeLocator).toContainText(`sketch002 = startSketchOn({
// plane = {
// origin = { x = -91.74, y = 0, z = 80.89 },
// xAxis = { x = -0.66, y = 0, z = -0.75 },
// yAxis = { x = 0, y = -1, z = 0 },
// zAxis = { x = -0.75, y = 0, z = 0.66 }
// }
// })`)
// DELETE SOLID 2D
@ -463,8 +457,8 @@ yo = startProfileAt([4.83, 12.56], part001)
|> line(end = [-13.02, 10.03])
|> close()
yoo = extrude(yo, length = 4)
sketch002 = startSketchOn(yoo, seg02)
sketch001 = startSketchOn(yoo, 'END')
sketch002 = startSketchOn(yoo, face = seg02)
sketch001 = startSketchOn(yoo, face = 'END')
profile002 = startProfileAt([-11.08, 2.39], sketch002)
|> line(end = [4.89, 0.9])
|> line(end = [-0.61, -2.41])
@ -893,7 +887,7 @@ part001 = startSketchOn(XZ)
await expect(page.locator('.cm-activeLine')).toHaveText('')
const codeToAdd = `${await u.codeLocator.allInnerTexts()}
sketch002 = startSketchOn(extrude001, $seg01)
sketch002 = startSketchOn(extrude001, face = $seg01)
|> startProfileAt([-12.94, 6.6], %)
|> line(end = [2.45, -0.2])
|> line(end = [-2, -1.25])

View File

@ -546,7 +546,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)`
previousCodeContent = await page.locator('.cm-content').innerText()
await expect.poll(u.normalisedEditorCode).toContain(
u.normalisedCode(`sketch002 = startSketchOn(extrude001, seg01)
u.normalisedCode(`sketch002 = startSketchOn(extrude001, face = seg01)
profile001 = startProfileAt([-12.34, 12.34], sketch002)
|> line(end = [12.34, -12.34])
|> line(end = [-12.34, -12.34])
@ -583,7 +583,7 @@ profile001 = startProfileAt([-12.34, 12.34], sketch002)
await expect(page.locator('.cm-content')).not.toHaveText(previousCodeContent)
previousCodeContent = await page.locator('.cm-content').innerText()
const result = makeTemplate`sketch002 = startSketchOn(extrude001, seg01)
const result = makeTemplate`sketch002 = startSketchOn(extrude001, face = seg01)
|> startProfileAt([-12.83, 6.7], %)
|> line(end = [${[2.28, 2.35]}, -${0.07}])
|> line(end = [-3.05, -1.47])

View File

@ -35,13 +35,13 @@ sketch001 = startSketchOn(XZ)
|> fillet(radius = filletRadius, tags = [seg02, getOppositeEdge(seg02)])
|> fillet(radius = filletRadius, tags = [seg05, getOppositeEdge(seg05)])
sketch002 = startSketchOn(sketch001, seg03)
sketch002 = startSketchOn(sketch001, face = seg03)
|> circle(center = [-1.25, 1], radius = mountingHoleDiameter / 2)
|> patternLinear2d(instances = 2, distance = 2.5, axis = [-1, 0])
|> patternLinear2d(instances = 2, distance = 4, axis = [0, 1])
|> extrude(%, length = -thickness - .01)
sketch003 = startSketchOn(sketch001, seg04)
sketch003 = startSketchOn(sketch001, face = seg04)
|> circle(center = [1, -1], radius = mountingHoleDiameter / 2)
|> patternLinear2d(instances = 2, distance = 4, axis = [1, 0])
|> extrude(%, length = -thickness - 0.1)

View File

@ -12,11 +12,11 @@ rotorSketch = startSketchOn(XZ)
rotor = extrude(rotorSketch, length = rotorSinglePlateThickness)
|> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
rotorBumpSketch = startSketchOn(rotor, 'end')
rotorBumpSketch = startSketchOn(rotor, face = 'end')
|> circle(center = [0, 0], radius = rotorInnerDiameter / 2)
rotorBump = extrude(rotorBumpSketch, length = rotorInnerDiameterThickness)
lugHoles = startSketchOn(rotorBump, 'end')
lugHoles = startSketchOn(rotorBump, face = 'end')
|> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
|> patternCircular2d(
arcDegrees = 360,
@ -28,15 +28,15 @@ lugHoles = startSketchOn(rotorBump, 'end')
|> appearance(color = "#dbcd70", roughness = 90, metalness = 90)
// (update when boolean is available)
centerSpacer = startSketchOn(rotor, 'start')
centerSpacer = startSketchOn(rotor, face = 'start')
|> circle(%, center = [0, 0], radius = .25)
|> extrude(%, length = spacerLength)
secondaryRotorSketch = startSketchOn(centerSpacer, 'end')
secondaryRotorSketch = startSketchOn(centerSpacer, face = 'end')
|> circle(center = [0, 0], radius = rotorDiameter / 2)
secondRotor = extrude(secondaryRotorSketch, length = rotorSinglePlateThickness)
lugHoles2 = startSketchOn(secondRotor, 'end')
lugHoles2 = startSketchOn(secondRotor, face = 'end')
|> circle(center = [-lugSpacing / 2, 0], radius = 0.315)
|> patternCircular2d(
arcDegrees = 360,
@ -46,7 +46,7 @@ lugHoles2 = startSketchOn(secondRotor, 'end')
)
|> extrude(length = -rotorSinglePlateThickness)
spacerSketch = startSketchOn(rotor, 'start')
spacerSketch = startSketchOn(rotor, face = 'start')
|> circle(center = [spacerPatternDiameter / 2, 0], radius = spacerDiameter)
|> patternCircular2d(
arcDegrees = 360,
@ -56,7 +56,7 @@ spacerSketch = startSketchOn(rotor, 'start')
)
spacers = extrude(spacerSketch, length = spacerLength)
rotorSlottedSketch = startSketchOn(rotor, 'START')
rotorSlottedSketch = startSketchOn(rotor, face = 'START')
|> startProfileAt([2.17, 2.56], %)
|> xLine(length = 0.12)
|> yLine(length = 2.56)
@ -71,7 +71,7 @@ rotorSlottedSketch = startSketchOn(rotor, 'START')
)
rotorSlotted = extrude(rotorSlottedSketch, length = -rotorSinglePlateThickness / 2)
secondRotorSlottedSketch = startSketchOn(secondRotor, 'END')
secondRotorSlottedSketch = startSketchOn(secondRotor, face = 'END')
|> startProfileAt([-2.17, 2.56], %)
|> xLine(length = -0.12)
|> yLine(length = 2.56)

View File

@ -14,13 +14,13 @@ lugBase = startSketchOn(XZ)
|> extrude(length = wheelWidth / 20)
// Extend the wheel center and bore holes to accomidate the lug heads
lugExtrusion = startSketchOn(lugBase, 'END')
lugExtrusion = startSketchOn(lugBase, face = 'END')
|> circle(center = [0, 0], radius = (lugSpacing + 1.5) / 2)
|> hole(circle(center = [0, 0], radius = (lugSpacing - 1.5) / 2), %)
|> extrude(length = wheelWidth / 10)
// Create the circular pattern for the lugs
lugClearance = startSketchOn(lugExtrusion, 'END')
lugClearance = startSketchOn(lugExtrusion, face = 'END')
|> circle(center = [lugSpacing / 2, 0], radius = 1.2 / 2)
|> patternCircular2d(
arcDegrees = 360,
@ -31,7 +31,7 @@ lugClearance = startSketchOn(lugExtrusion, 'END')
|> extrude(length = -wheelWidth / 10)
// Create the circular pattern for the lug holes
lugHoles = startSketchOn(lugBase, 'END')
lugHoles = startSketchOn(lugBase, face = 'END')
|> circle(center = [lugSpacing / 2, 0], radius = fromMm(16) / 2)
|> patternCircular2d(
arcDegrees = 360,
@ -75,12 +75,10 @@ wheelCenterOuter = startSketchOn(XY)
fn spoke(spokeGap, spokeAngle, spokeThickness) {
// Seperating the spoke base planes
plane001 = {
plane = {
origin = [0.0, 0.0, spokeGap / 2],
xAxis = [1.0, 0.0, spokeAngle],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, spokeGap / 2],
xAxis = [1.0, 0.0, spokeAngle],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
// Spoke cross sections

View File

@ -8,16 +8,14 @@
import lugDiameter, lugHeadLength, lugThreadDiameter, lugLength, lugThreadDepth, lugSpacing from "parameters.kcl"
customPlane = {
plane = {
origin = {
x = lugSpacing / 2,
y = fromMm(-30),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = -1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = {
x = lugSpacing / 2,
y = fromMm(-30),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = -1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
fn lug(plane, length, diameter) {

View File

@ -26,16 +26,14 @@ pentR = edgeL / 2 / sin(toRadians(36))
// Define a plane for the bottom angled face
plane = {
plane = {
origin = [
-inscR * cos(toRadians(toDegrees(dihedral) - 90)),
0,
inscR - (inscR * sin(toRadians(toDegrees(dihedral) - 90)))
],
xAxis = [cos(dihedral), 0.0, sin(dihedral)],
yAxis = [0, 1, 0],
zAxis = [sin(dihedral), 0, -cos(dihedral)]
}
origin = [
-inscR * cos(toRadians(toDegrees(dihedral) - 90)),
0,
inscR - (inscR * sin(toRadians(toDegrees(dihedral) - 90)))
],
xAxis = [cos(dihedral), 0.0, sin(dihedral)],
yAxis = [0, 1, 0],
zAxis = [sin(dihedral), 0, -cos(dihedral)]
}
// Create a regular pentagon inscribed in a circle of radius pentR

View File

@ -117,7 +117,7 @@ sinkOffsetFront = 40
sinkOffsetLeft = 350
sinkSpacing = tableWidth - sinkWidth - (sinkOffsetLeft * 2)
sinkPlaneOutside = startSketchOn(tableTopBody, 'START')
sinkPlaneOutside = startSketchOn(tableTopBody, face = 'START')
sinkBodyOutside = startProfileAt([-sinkOffsetLeft, sinkOffsetFront], sinkPlaneOutside)
|> yLine(length = sinkLength)
|> xLine(length = -sinkWidth)
@ -127,7 +127,7 @@ sinkBodyOutside = startProfileAt([-sinkOffsetLeft, sinkOffsetFront], sinkPlaneOu
|> patternLinear2d(axis = [-1, 0], instances = sinkCount, distance = sinkSpacing)
|> extrude(length = sinkDepth)
sinkPlaneInside = startSketchOn(tableTopBody, 'END')
sinkPlaneInside = startSketchOn(tableTopBody, face = 'END')
sinkBodyInside = startProfileAt([
sinkOffsetLeft + metalThickness,
sinkOffsetFront + metalThickness

View File

@ -37,12 +37,10 @@ extrude001 = extrude(sketch001, length = height)
fn function001(originStart) {
// Create a plane to sketch on shell interior
plane001 = {
plane = {
origin = [0.0, 0.0, wallThickness],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, wallThickness],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
// Create a pillar with a fasterner hole at the center
@ -120,7 +118,7 @@ extrude003 = extrude(sketch003, length = wallThickness)
)
// Define lid inner and sealing surfaces
sketch004 = startSketchOn(extrude003, 'END')
sketch004 = startSketchOn(extrude003, face = 'END')
|> startProfileAt([
width * 1.2 + wallThickness,
wallThickness

View File

@ -17,16 +17,14 @@ fn primaryTube(n, angle001, length001, length002, length003) {
// Define a plane for each sweep path defined by an angle
sweepPlane = {
plane = {
origin = [pos001, 0.0, 0],
xAxis = [
sin(toRadians(-angle001)),
cos(toRadians(-angle001)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [pos001, 0.0, 0],
xAxis = [
sin(toRadians(-angle001)),
cos(toRadians(-angle001)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Draw a path for each sweep

View File

@ -37,16 +37,16 @@ flangeBase = startSketchOn(XY)
|> extrude(length = baseThickness)
// Create the extrusion on the top of the flange base
topExtrusion = startSketchOn(flangeBase, 'end')
topExtrusion = startSketchOn(flangeBase, face = 'end')
|> circle(center = [0, 0], radius = topTotalDiameter / 2)
|> extrude(length = topTotalThickness)
// Create the extrusion on the bottom of the flange base
bottomExtrusion = startSketchOn(flangeBase, 'start')
bottomExtrusion = startSketchOn(flangeBase, face = 'start')
|> circle(center = [0, 0], radius = bottomTotalDiameter / 2)
|> extrude(length = bottomThickness)
// Cut a hole through the entire body
pipeHole = startSketchOn(topExtrusion, 'end')
pipeHole = startSketchOn(topExtrusion, face = 'end')
|> circle(center = [0, 0], radius = pipeDia / 2)
|> extrude(%, length = -(topTotalThickness + baseThickness + bottomThickness))

View File

@ -28,12 +28,10 @@ fn rectShape(pos, w, l) {
// Define the bracket plane
bracketPlane = {
plane = {
origin = { x = 0, y = length / 2 + thk, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
origin = { x = 0, y = length / 2 + thk, z = 0 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
// Build the bracket sketch around the body
@ -67,12 +65,10 @@ bracketBody = bs
// Define the tab plane
tabPlane = {
plane = {
origin = { x = 0, y = 0, z = depth + thk },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = { x = 0, y = 0, z = depth + thk },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
// Build the tabs of the mounting bracket (right side)
@ -125,12 +121,10 @@ tabsL = startSketchOn(tabPlane)
// Define a plane for retention bumps
retPlane = {
plane = {
origin = { x = -width / 2 + 20, y = 0, z = 0 },
xAxis = { x = 0, y = 1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
origin = { x = -width / 2 + 20, y = 0, z = 0 },
xAxis = { x = 0, y = 1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
// Build the retention bump in the front

View File

@ -114,12 +114,10 @@ fillet(
// Define a plane which is at the end of the handle
handlePlane = {
plane = {
origin = [208.593833, 0.0, 75.921946],
xAxis = [0.342020, -0.0, -0.939693],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.939693, -0.0, 0.342020]
}
origin = [208.593833, 0.0, 75.921946],
xAxis = [0.342020, -0.0, -0.939693],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.939693, -0.0, 0.342020]
}
// Create a sketch on the handle plane
@ -157,7 +155,7 @@ gripProfile = startProfileAt([-26.806746, -10.0], gripSketch)
grip = extrude(gripProfile, length = -gripLength)
// Create a sketch on the grip for the hole
holeSketch = startSketchOn(grip, gripEdgeTop)
holeSketch = startSketchOn(grip, face = gripEdgeTop)
// Create a profile for the grip hole
gripHoleProfile = slot(holeSketch, [0, 200], [0, 210], gripSlotWidth)

View File

@ -21,12 +21,10 @@ sketch001 = startSketchOn(XZ)
// Create an angled plane to sketch the supports
plane001 = {
plane = {
origin = [-0.26, 0.26, 0.0],
xAxis = [1, 1, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [-0.26, 0.26, 0.0],
xAxis = [1, 1, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Cross section of the metal supports
@ -88,7 +86,7 @@ sketch003 = startSketchOn(offsetPlane(XY, offset = 1))
extrude001 = extrude(sketch003, length = 0.050)
sketch004 = startSketchOn(extrude001, 'END')
sketch004 = startSketchOn(extrude001, face = 'END')
|> startProfileAt([0.3, 0.17], %)
|> yLine(length = 1.2)
|> arc({
@ -140,7 +138,7 @@ sketch007 = startSketchOn(offsetPlane(XY, offset = 1.12))
extrude003 = extrude(sketch007, length = 0.050)
// Pattern holes in the spiral plate
sketch008 = startSketchOn(extrude003, 'END')
sketch008 = startSketchOn(extrude003, face = 'END')
|> circle(center = [1.4, 0], radius = .3)
|> patternCircular2d(
center = [0, 0],
@ -152,7 +150,7 @@ sketch008 = startSketchOn(extrude003, 'END')
extrude004 = extrude(sketch008, length = -0.050)
// Pattern holes in the spiral plate
sketch009 = startSketchOn(extrude003, 'END')
sketch009 = startSketchOn(extrude003, face = 'END')
|> circle(center = [0.6, 0], radius = .2)
|> patternCircular2d(
center = [0, 0],

View File

@ -87,7 +87,7 @@ holeRadius = 1
startAngle = asin(keywayWidth / 2 / holeRadius)
// Sketch the keyway and center hole and extrude
keyWay = startSketchOn(body, 'END')
keyWay = startSketchOn(body, face = 'END')
|> startProfileAt([
holeRadius * cos(startAngle),
holeRadius * sin(startAngle)

View File

@ -109,7 +109,7 @@ singleBinFill = startSketchOn(XY)
],
)
magCutout000 = startSketchOn(singleBinFill, "start")
magCutout000 = startSketchOn(singleBinFill, face = "start")
|> circle(
center = [
-magOffset - binBaseLength - binTol,
@ -195,42 +195,36 @@ fn lipFace(plane) {
}
plane000 = {
plane = {
origin = [
cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [
cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
plane001 = {
plane = {
origin = [
0.0,
cornerRadius,
height + binHeight * countBinHeight
],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [0.0, 1.0, 0.0]
}
origin = [
0.0,
cornerRadius,
height + binHeight * countBinHeight
],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [0.0, 1.0, 0.0]
}
plane002 = {
plane = {
origin = [
countBinWidth * (binLength + 2 * binTol) - cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [
countBinWidth * (binLength + 2 * binTol) - cornerRadius,
0.0,
height + binHeight * countBinHeight
],
xAxis = [0.0, 1.0, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Extrude a single side of the lip of the bin

View File

@ -102,7 +102,7 @@ singleBinFill = startSketchOn(XY)
],
)
magCutout000 = startSketchOn(singleBinFill, "start")
magCutout000 = startSketchOn(singleBinFill, face = "start")
|> circle(
center = [
-magOffset - binBaseLength - binTol,

View File

@ -39,7 +39,7 @@ sketch001 = startSketchOn(YZ)
)
// Create a short cylindrical foot at each corner of the keyboard
sketch003 = startSketchOn(sketch001, seg04)
sketch003 = startSketchOn(sketch001, face = seg04)
profile001 = circle(sketch003, center = [0.75, 0.75], radius = 0.4)
profile003 = circle(sketch003, center = [4.4, 0.75], radius = 0.4)
profile004 = circle(sketch003, center = [0.73, 13.6 - .75], radius = 0.4)
@ -56,12 +56,10 @@ extrude(
// Define the plane to sketch keyboard keys on
plane001 = {
plane = {
origin = [0.0, 0.0, 0.7],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, 0.7],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
// Create a function to build a key. Parameterize for position, width, height, number of instances, and appearance color.
@ -128,12 +126,10 @@ keyFn([spacing * 3 + 12, row6], 1, keyHeight * .6, 0, highlightColor2)
// Create a plane to sketch ZOO brand letters on
plane002 = {
plane = {
origin = [0.0, 0.0, .81],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, .81],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, sin(toRadians(7))],
zAxis = [0.0, 0.0, 1.0]
}
// Define a function to draw the ZOO 'Z'

View File

@ -3,7 +3,7 @@
// Pixel box function
fn pixelBox(kitExtrude, extrudeTag, positionY, positionZ, width, height, depth) {
pixelBoxBody = startSketchOn(kitExtrude, extrudeTag)
pixelBoxBody = startSketchOn(kitExtrude, face = extrudeTag)
|> startProfileAt([positionY, positionZ], %)
|> line(end = [0, height])
|> line(end = [width, 0])
@ -45,7 +45,7 @@ kitFaceWidth = kitHeadWidth - 4
kitFaceHeight = kitHeadElevation + kitHeadHeight - kitFaceElevation - 3
kitFaceDepth = 2
kitFace = startSketchOn(kitHead, 'END')
kitFace = startSketchOn(kitHead, face = 'END')
|> startProfileAt([-kitFaceWidth / 2, kitFaceElevation], %)
|> line(end = [0, 1]) // left lower corner up
|> line(end = [-1, 0]) // left lower corner left
@ -78,7 +78,7 @@ kitLeftEye2 = pixelBox(kitFace, 'START', -kitEyeOffset + 1, kitEyeHeihgt + 1, 3,
kitLeftEye3 = pixelBox(kitFace, 'START', -kitEyeOffset + 4, kitEyeHeihgt, 1, 1, kitEyeDepth)
kitRightEye = pixelBox(kitFace, 'START', kitEyeOffset - 3, kitEyeHeihgt - 1, 2, 4, kitEyeDepth)
kitNoseElevation = kitEyeHeihgt - 5
kitNose = startSketchOn(kitFace, 'START')
kitNose = startSketchOn(kitFace, face = 'START')
|> startProfileAt([-2, kitNoseElevation], %) // H V
|> line(end = [0, 1]) // lower-left up
|> line(end = [2, 0]) // lower-left right

View File

@ -35,7 +35,7 @@ base = startSketchOn(XY)
|> extrude(length = height)
// Sketch and extrude a rectangular shape to create the shell underneath the lego. Will replace with shell function when able to call a face created from shell.
shellExtrude = startSketchOn(base, "start")
shellExtrude = startSketchOn(base, face = "start")
|> startProfileAt([
-(totalWidth / 2 - t),
-(totalLength / 2 - t)
@ -47,7 +47,7 @@ shellExtrude = startSketchOn(base, "start")
|> extrude(length = -(height - t))
// Create the pegs on the top of the base
peg = startSketchOn(base, 'end')
peg = startSketchOn(base, face = 'end')
|> circle(
center = [
-(pitch * (wbumps - 1) / 2),
@ -60,7 +60,7 @@ peg = startSketchOn(base, 'end')
|> extrude(length = bumpHeight)
// Create the pegs on the bottom of the base
tubePattern = startSketchOn(shellExtrude, 'start')
tubePattern = startSketchOn(shellExtrude, face = 'start')
|> circle(
center = [
-(pitch * (wbumps - 1) / 2 - (pitch / 2)),

View File

@ -28,37 +28,31 @@ export axisJ3CArmThickness = 2.5
// Planes
export plane001 = {
plane = {
origin = [0.0, 0.0, baseHeight - 1.5 + 0.1],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
origin = [0.0, 0.0, baseHeight - 1.5 + 0.1],
xAxis = [1.0, 0.0, 0.0],
yAxis = [0.0, 1.0, 0.0],
zAxis = [0.0, 0.0, 1.0]
}
export plane002 = {
plane = {
origin = [0.0, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [0.0, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
// Define Plane to Move J2 Axis Robot Arm
export plane003 = {
plane = {
origin = [-0.1, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
origin = [-0.1, 0.0, 0.0],
xAxis = [
sin(toRadians(axisJ1)),
cos(toRadians(axisJ1)),
0.0
],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}

View File

@ -26,16 +26,16 @@ extrude001 = extrude(sketch001, length = basePlateThickness)
)
// Base Motor for actuating first joint
sketch002 = startSketchOn(extrude001, 'END')
sketch002 = startSketchOn(extrude001, face = 'END')
|> circle(center = [0, 0], radius = 4, tag = $referenceEdge)
extrude002 = extrude(sketch002, length = baseHeight - basePlateThickness - 1.5)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge)])
sketch003 = startSketchOn(extrude002, 'END')
sketch003 = startSketchOn(extrude002, face = 'END')
|> circle(center = [0, 0], radius = 0.5)
extrude003 = extrude(sketch003, length = 1)
// Pattern M8 mounting bolts in base
sketch4A = startSketchOn(extrude001, 'END')
sketch4A = startSketchOn(extrude001, face = 'END')
|> circle(
center = [
-basePlateRadius + 1,
@ -52,7 +52,7 @@ sketch4A = startSketchOn(extrude001, 'END')
extrude4A = extrude(sketch4A, length = -basePlateThickness)
sketch4B = startSketchOn(extrude001, 'END')
sketch4B = startSketchOn(extrude001, face = 'END')
|> circle(
center = [
-basePlateRadius + 0.5 + baseChamfer,

View File

@ -26,12 +26,12 @@ sketch011 = startSketchOn(plane003)
|> close()
extrude011 = extrude(sketch011, length = -axisJ2ArmThickness)
sketch012 = startSketchOn(extrude011, 'START')
sketch012 = startSketchOn(extrude011, face = 'START')
|> circle(center = [-1.75, 8], radius = 1.9, tag = $referenceEdge4)
extrude012 = extrude(sketch012, length = 0.15)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge4)])
sketch013 = startSketchOn(extrude011, 'START')
sketch013 = startSketchOn(extrude011, face = 'START')
|> circle(
center = [
-1.75 - (axisJ2ArmLength * cos(toRadians(axisJ2))),
@ -45,7 +45,7 @@ extrude013 = extrude(sketch013, length = 1)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge5)])
// Draw Bolt Patterns on J2 Robot Arm
sketch014 = startSketchOn(extrude012, 'END')
sketch014 = startSketchOn(extrude012, face = 'END')
|> circle(center = [-1.75, 6.75], radius = 0.2)
|> patternCircular2d(
center = [-1.75, 8],
@ -56,7 +56,7 @@ sketch014 = startSketchOn(extrude012, 'END')
extrude014 = extrude(sketch014, length = 0.15)
sketch015 = startSketchOn(extrude013, 'END')
sketch015 = startSketchOn(extrude013, face = 'END')
|> circle(
center = [
-1.75 - ((axisJ2ArmLength - 1) * cos(toRadians(axisJ2))),
@ -76,7 +76,7 @@ sketch015 = startSketchOn(extrude013, 'END')
extrude015 = extrude(sketch015, length = 0.15)
sketch016 = startSketchOn(extrude011, 'END')
sketch016 = startSketchOn(extrude011, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)),

View File

@ -26,7 +26,7 @@ sketch017 = startSketchOn(plane002)
|> close()
extrude017 = extrude(sketch017, length = axisJ3CArmThickness)
sketch018 = startSketchOn(extrude017, 'END')
sketch018 = startSketchOn(extrude017, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)),
@ -40,7 +40,7 @@ extrude018 = extrude(sketch018, length = 0.15)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge6)])
// Draw Bolt Pattern on J3 Robot Arm
sketch019 = startSketchOn(extrude018, 'END')
sketch019 = startSketchOn(extrude018, face = 'END')
|> circle(
center = [
1.75 + (axisJ2ArmLength - 1) * cos(toRadians(axisJ2)),
@ -61,7 +61,7 @@ sketch019 = startSketchOn(extrude018, 'END')
extrude019 = extrude(sketch019, length = 0.15)
// On the J3 Robot Arm Body, Create Mounting Clevis for Grabber Claw
sketch020 = startSketchOn(extrude017, 'START')
sketch020 = startSketchOn(extrude017, face = 'START')
|> circle(
center = [
-1.75 - (axisJ2ArmLength * cos(toRadians(axisJ2))) - (axisJ3CArmLength * cos(toRadians(axisJ3C))),
@ -71,7 +71,7 @@ sketch020 = startSketchOn(extrude017, 'START')
)
extrude020 = extrude(sketch020, length = -0.5)
sketch021 = startSketchOn(extrude017, 'END')
sketch021 = startSketchOn(extrude017, face = 'END')
|> circle(
center = [
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
@ -85,13 +85,13 @@ extrude021 = extrude(sketch021, length = -0.5)
// Define Grabber Claw Constants
grabberLength = 7
sketch022 = startSketchOn(extrude021, 'START')
sketch022 = startSketchOn(extrude021, face = 'START')
|> circle(center = [0, 0], radius = 0.10)
extrude022 = extrude(sketch022, length = -0.01)
// Build Upper Claw Finger
sketch023 = startSketchOn(extrude022, 'START')
sketch023 = startSketchOn(extrude022, face = 'START')
|> startProfileAt([
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))
@ -112,7 +112,7 @@ sketch023 = startSketchOn(extrude022, 'START')
extrude023 = extrude(sketch023, length = -1.5)
// Build Lower Claw Finger
sketch024 = startSketchOn(extrude022, 'START')
sketch024 = startSketchOn(extrude022, face = 'START')
|> startProfileAt([
1.75 + axisJ2ArmLength * cos(toRadians(axisJ2)) + axisJ3CArmLength * cos(toRadians(axisJ3C)),
8 + axisJ2ArmLength * sin(toRadians(axisJ2)) + axisJ3CArmLength * sin(toRadians(axisJ3C))

View File

@ -26,7 +26,7 @@ sketch006 = startSketchOn(plane002)
extrude006 = extrude(sketch006, length = 1)
sketch007 = startSketchOn(extrude006, 'END')
sketch007 = startSketchOn(extrude006, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),
@ -39,7 +39,7 @@ extrude007 = extrude(sketch007, length = 1.5)
|> fillet(radius = 0.1, tags = [getOppositeEdge(referenceEdge2)])
// Draw Bolt Pattern on Rotating Base
sketch008 = startSketchOn(extrude007, 'END')
sketch008 = startSketchOn(extrude007, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),
@ -58,7 +58,7 @@ sketch008 = startSketchOn(extrude007, 'END')
)
extrude008 = extrude(sketch008, length = 0.2)
sketch009 = startSketchOn(extrude007, 'END')
sketch009 = startSketchOn(extrude007, face = 'END')
|> circle(
center = [
1.75 * cos(toRadians(axisJ1)) / abs(cos(toRadians(axisJ1))),

View File

@ -22,7 +22,7 @@ body = startSketchOn(XY)
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> extrude(length = height)
counterBoreHoles = startSketchOn(body, 'end')
counterBoreHoles = startSketchOn(body, face = 'end')
|> circle(
center = [
-(width / 2 - (padding / 2)),
@ -34,7 +34,7 @@ counterBoreHoles = startSketchOn(body, 'end')
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|> extrude(%, length = -cbDepth)
boltHoles = startSketchOn(body, 'start')
boltHoles = startSketchOn(body, face = 'start')
|> circle(
center = [
-(width / 2 - (padding / 2)),
@ -46,6 +46,6 @@ boltHoles = startSketchOn(body, 'start')
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|> extrude(length = -height + cbDepth)
centerHole = startSketchOn(body, 'end')
centerHole = startSketchOn(body, face = 'end')
|> circle(center = [0, 0], radius = bearingDia / 2)
|> extrude(length = -height)

View File

@ -15,7 +15,7 @@ export fn pipe() {
|> extrude(%, length = pipeLength)
// Extrude a hole through the length of the pipe
pipe = startSketchOn(pipeBase, 'end')
pipe = startSketchOn(pipeBase, face = 'end')
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|> extrude(%, length = -pipeLength)
|> appearance(color = "#a24ed0")

View File

@ -27,15 +27,15 @@ export fn flange() {
|> extrude(%, length = flangeBaseThickness)
// Create both the raised portions on the front and back of the flange base
flangeBack = startSketchOn(flangeBase, 'start')
flangeBack = startSketchOn(flangeBase, face = 'start')
|> circle(%, center = [0, 0], radius = flangeBackDiameter / 2)
|> extrude(%, length = flangeBackHeight)
flangeFront = startSketchOn(flangeBase, 'end')
flangeFront = startSketchOn(flangeBase, face = 'end')
|> circle(%, center = [0, 0], radius = flangeFrontDiameter / 2)
|> extrude(%, length = flangeFrontHeight)
// Create the circular cut in the center for the pipe
pipeCut = startSketchOn(flangeFront, 'end')
pipeCut = startSketchOn(flangeFront, face = 'end')
|> circle(%, center = [0, 0], radius = pipeDiameter / 2)
|> extrude(%, length = -flangeTotalThickness)
|> appearance(%, color = "#bab0b0")

View File

@ -16,7 +16,7 @@ export fn bolt() {
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
// Define the sketch of the hex pattern on the screw head and extrude into the head
hexPatternSketch = startSketchOn(boltHead, 'start')
hexPatternSketch = startSketchOn(boltHead, face = 'start')
|> startProfileAt([
boltHexDrive / 2,
boltHexFlatLength / 2
@ -30,7 +30,7 @@ export fn bolt() {
|> extrude(length = -boltHeadLength * 0.75)
// create the body of the bolt
boltBody = startSketchOn(boltHead, 'end')
boltBody = startSketchOn(boltHead, face = 'end')
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)

View File

@ -13,7 +13,7 @@ gasketBase = startSketchOn(XY)
|> extrude(%, length = gasketThickness)
// Extrude a circular hole through the gasket base
startSketchOn(gasketBase, 'end')
startSketchOn(gasketBase, face = 'end')
|> circle(%, center = [0, 0], radius = gasketInnerDiameter / 2)
|> extrude(%, length = -gasketThickness)
|> appearance(%, color = "#d0cb3e")

View File

@ -24,7 +24,7 @@ export fn hexNut() {
|> extrude(length = hexNutThickness)
// Create the hole in the center of the hex nut
hexNut = startSketchOn(hexNutBase, 'end')
hexNut = startSketchOn(hexNutBase, face = 'end')
|> circle(center = [0, 0], radius = hexNutDiameter / 2)
|> extrude(%, length = -hexNutThickness)
|> appearance(%, color = "#4edfd5")

View File

@ -15,7 +15,7 @@ export fn washer() {
|> extrude(length = washerThickness)
// Extrude a hole through the washer
washer = startSketchOn(washerBase, 'end')
washer = startSketchOn(washerBase, face = 'end')
|> circle(center = [0, 0], radius = washerInnerDia / 2)
|> extrude(%, length = -washerThickness)
|> appearance(%, color = "#ee4f4f")

View File

@ -15,7 +15,7 @@ pipeBase = startSketchOn(XZ)
|> extrude(%, length = pipeLength)
// Extrude a hole through the length of the pipe
pipe = startSketchOn(pipeBase, 'end')
pipe = startSketchOn(pipeBase, face = 'end')
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|> extrude(%, length = -pipeLength)
|> appearance(color = "#a24ed0")

View File

@ -56,16 +56,14 @@ sketch002 = startSketchOn(-YZ)
|> extrude(length = backLength - height)
customPlane = {
plane = {
origin = {
x = 0,
y = -(wallsWidth / 2 - (wallThickness / 2)),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
origin = {
x = 0,
y = -(wallsWidth / 2 - (wallThickness / 2)),
z = 0
},
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = -1, z = 0 }
}
sketch003 = startSketchOn(customPlane)
|> startProfileAt([0, 0], %)
@ -75,7 +73,7 @@ sketch003 = startSketchOn(customPlane)
|> extrude(length = wallThickness)
// Create the right side wall of the tub
sketch004 = startSketchOn(sketch002, 'END')
sketch004 = startSketchOn(sketch002, face = 'END')
|> startProfileAt([0, 0], %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = wallThickness)
@ -95,16 +93,14 @@ sketch004 = startSketchOn(sketch002, 'END')
|> extrude(length = wallThickness)
customPlane2 = {
plane = {
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = 0
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = 0
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 1, y = 0, z = 0 }
}
sketch005 = startSketchOn(customPlane2)
|> startProfileAt([0, 0], %)
@ -119,7 +115,7 @@ sketch005 = startSketchOn(customPlane2)
|> close()
|> extrude(length = wallThickness)
sketch006 = startSketchOn(sketch005, seg03)
sketch006 = startSketchOn(sketch005, face = seg03)
|> startProfileAt([0, -1 * (backLength - height)], %)
|> xLine(endAbsolute = -exitHeight)
|> yLine(length = -wallsWidth)
@ -127,7 +123,7 @@ sketch006 = startSketchOn(sketch005, seg03)
|> close()
|> extrude(length = wallThickness)
sketch007 = startSketchOn(sketch004, 'END')
sketch007 = startSketchOn(sketch004, face = 'END')
|> startProfileAt([0, 0], %)
|> xLine(endAbsolute = wallThickness)
|> yLine(endAbsolute = height)
@ -136,16 +132,14 @@ sketch007 = startSketchOn(sketch004, 'END')
|> extrude(length = wallsWidth - (2 * wallThickness))
customPlane3 = {
plane = {
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = wallThickness
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 1, y = 0, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
origin = {
x = -1 * (backLength - height + wallsWidth),
y = 0,
z = wallThickness
},
xAxis = { x = 0, y = -1, z = 0 },
yAxis = { x = 1, y = 0, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
sketch008 = startSketchOn(customPlane3)

View File

@ -54,7 +54,7 @@ sketch001 = startSketchOn(XZ)
extrude001 = extrude(sketch001, length = 5)
// Create the second sketch
sketch002 = startSketchOn(extrude001, 'START')
sketch002 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([distanceToInsideEdge, 0], %)
|> angledLine(angle = 180, length = templateThickness, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90, length = templateThickness, tag = $rectangleSegmentB002)
@ -66,7 +66,7 @@ sketch002 = startSketchOn(extrude001, 'START')
extrude002 = extrude(sketch002, length = 13)
// Create the third sketch
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([-distanceToInsideEdge, 0], %)
|> angledLine(angle = 0, length = templateThickness, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = templateThickness, tag = $rectangleSegmentB001)
@ -78,7 +78,7 @@ sketch003 = startSketchOn(extrude001, 'START')
extrude003 = extrude(sketch003, length = 13)
// Create the fourth sketch
sketch004 = startSketchOn(extrude002, 'END')
sketch004 = startSketchOn(extrude002, face = 'END')
|> startProfileAt([-distanceToInsideEdge, 0], %)
|> angledLine(angle = 0, length = distanceToInsideEdge * 2, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = templateThickness, tag = $rectangleSegmentB003)

View File

@ -48,7 +48,7 @@ sketch001 = startSketchOn(XZ)
extrude001 = extrude(sketch001, length = 5)
// Create the second sketch
sketch002 = startSketchOn(extrude001, 'START')
sketch002 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
-slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)
@ -63,7 +63,7 @@ sketch002 = startSketchOn(extrude001, 'START')
extrude002 = extrude(sketch002, length = 7.5)
// Create the third sketch
sketch003 = startSketchOn(extrude001, 'START')
sketch003 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)

View File

@ -95,7 +95,7 @@ bracketProfile = startSketchOn(XZ)
)
// Cut the bolt pattern in the left base flange
leftFlangeBoltPattern = startSketchOn(bracketProfile, seg04)
leftFlangeBoltPattern = startSketchOn(bracketProfile, face = seg04)
|> circle(center = [-mountingBoltPatternX / 2, overhang], radius = mountingBoltDiameter / 2)
|> patternLinear2d(
%,
@ -106,7 +106,7 @@ leftFlangeBoltPattern = startSketchOn(bracketProfile, seg04)
|> extrude(length = -thickness)
// Cut the bolt pattern in the right base flange
rightFlangeBoltPattern = startSketchOn(bracketProfile, seg06)
rightFlangeBoltPattern = startSketchOn(bracketProfile, face = seg06)
|> circle(center = [mountingBoltPatternX / 2, overhang], radius = mountingBoltDiameter / 2)
|> patternLinear2d(
%,
@ -117,7 +117,7 @@ rightFlangeBoltPattern = startSketchOn(bracketProfile, seg06)
|> extrude(length = -thickness)
// Provision the top flange with holes to mount an object
topFlangeBoltPattern = startSketchOn(bracketProfile, seg05)
topFlangeBoltPattern = startSketchOn(bracketProfile, face = seg05)
|> circle(
center = [
-componentBoltPatternX / 2,
@ -140,6 +140,6 @@ topFlangeBoltPattern = startSketchOn(bracketProfile, seg05)
|> extrude(length = -thickness)
// Place a hole at the center of the component bolt pattern to reduce mass
centeredHole = startSketchOn(bracketProfile, seg05)
centeredHole = startSketchOn(bracketProfile, face = seg05)
|> circle(center = [0, flangeExtrusion / 2], radius = 0.75)
|> extrude(length = -thickness)

View File

@ -19,7 +19,7 @@ boltHead = startSketchOn(XZ)
|> fillet(radius = 0.020, tags = [topEdge, getOppositeEdge(topEdge)])
// Define the sketch of the hex pattern on the screw head
hexPatternSketch = startSketchOn(boltHead, 'start')
hexPatternSketch = startSketchOn(boltHead, face = 'start')
|> startProfileAt([
boltHexDrive / 2,
boltHexFlatLength / 2
@ -31,7 +31,7 @@ hexPatternSketch = startSketchOn(boltHead, 'start')
|> angledLine(angle = 30, length = boltHexFlatLength)
|> close()
|> extrude(length = -boltHeadLength * 0.75)
boltBody = startSketchOn(boltHead, 'end')
boltBody = startSketchOn(boltHead, face = 'end')
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> fillet(radius = .020, tags = [getOppositeEdge(filletEdge)])

View File

@ -26,7 +26,7 @@ body = startSketchOn(XZ)
)
// Cut out the indentation for the case
caseIndentSketch = startSketchOn(body, 'END')
caseIndentSketch = startSketchOn(body, face = 'END')
|> startProfileAt([
-width / 2 + offset,
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
@ -51,7 +51,7 @@ caseIndentSketch = startSketchOn(body, 'END')
extrude002 = extrude(caseIndentSketch, length = -0.0625)
// Create the pocket for the screen
screenCutout = startSketchOn(extrude002, 'start')
screenCutout = startSketchOn(extrude002, face = 'start')
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
|> xLine(length = screenWidth, tag = $seg01)
|> yLine(length = -screenHeight)
@ -61,7 +61,7 @@ screenCutout = startSketchOn(extrude002, 'start')
extrude003 = extrude(screenCutout, length = screenDepth)
// Create the speaker box
speakerBox = startSketchOn(extrude002, 'start')
speakerBox = startSketchOn(extrude002, face = 'start')
|> startProfileAt([-1.25 / 2, -.125], %)
|> xLine(length = speakerBoxWidth)
|> yLine(length = -speakerBoxHeight)

View File

@ -18,7 +18,7 @@ extrude002 = extrude(profile002, length = 150)
tag = $seg02,
)
sketch003 = startSketchOn(extrude002, mySeg)
sketch003 = startSketchOn(extrude002, face = mySeg)
profile003 = startProfileAt([207.36, 126.19], sketch003)
|> angledLine(angle = 0, length = 33.57, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 99.11)
@ -26,7 +26,7 @@ profile003 = startProfileAt([207.36, 126.19], sketch003)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude003 = extrude(profile003, length = -20)
sketch004 = startSketchOn(extrude003, seg01)
sketch004 = startSketchOn(extrude003, face = seg01)
profile004 = startProfileAt([-235.38, 66.16], sketch004)
|> angledLine(angle = 0, length = 24.21, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 3.72)
@ -35,7 +35,7 @@ profile004 = startProfileAt([-235.38, 66.16], sketch004)
|> close()
extrude004 = extrude(profile004, length = 30)
sketch005 = startSketchOn(extrude002, seg02)
sketch005 = startSketchOn(extrude002, face = seg02)
profile005 = startProfileAt([-129.93, -59.19], sketch005)
|> xLine(length = 48.79)
|> line(end = [1.33, 11.03])
@ -43,7 +43,7 @@ profile005 = startProfileAt([-129.93, -59.19], sketch005)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude005 = extrude(profile005, length = -10)
sketch006 = startSketchOn(extrude005, seg03)
sketch006 = startSketchOn(extrude005, face = seg03)
profile006 = startProfileAt([-95.86, 38.73], sketch006)
|> angledLine(angle = 0, length = 3.48, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) - 90, length = 3.36)

View File

@ -10,12 +10,10 @@ const extrude000 = extrude(sketch000, length = 1.0)
// define a plane with name plane005
const plane005 = {
plane: {
origin: [0.0, 0.0, 1.0],
xAxis: [0.707107, 0.707107, 0.0],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [0.707107, -0.707107, 0.0]
}
origin: [0.0, 0.0, 1.0],
xAxis: [0.707107, 0.707107, 0.0],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [0.707107, -0.707107, 0.0]
}
// create a sketch with name sketch001

View File

@ -15,7 +15,7 @@ const tabThk = 4
// define a rectangular shape func
fn rectShape = (pos, w, l) => {
const rr = startSketchOn('xy')
const rr = startSketchOn(XY)
|> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)
|> line(endAbsolute = [pos[0] + w / 2, pos[1] - (l / 2)], tag = $edge01)
|> line(endAbsolute = [pos[0] + w / 2, pos[1] + l / 2], tag = $edge02)
@ -26,12 +26,10 @@ fn rectShape = (pos, w, l) => {
// define the bracket plane
const bracketPlane = {
plane: {
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
// build the bracket sketch around the body
@ -65,7 +63,7 @@ const bracketBody = bs
// sketch on the face
const retBack = startSketchOn(bs, bs.sketch.tags.edge4)
const retBack = startSketchOn(bs, face = bs.sketch.tags.edge4)
|> startProfileAt([length / 2 + thk, 0], %)
|> line(end = [0, thk])
|> line(end = [-thk, 0])

View File

@ -26,12 +26,10 @@ fn rectShape = (pos, w, l) => {
// define the bracket plane
const bracketPlane = {
plane: {
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
// build the bracket sketch around the body
@ -65,12 +63,10 @@ const bracketBody = bs
// define the tab plane
const tabPlane = {
plane: {
origin: { x: 0, y: 0, z: depth + thk },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
origin: { x: 0, y: 0, z: depth + thk },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
// build the tabs of the mounting bracket (right side)
@ -131,12 +127,10 @@ const tabsL = startSketchOn(tabPlane)
// define a plane for retention bumps
const retPlane = {
plane: {
origin: { x: -width / 2 + 20, y: 0, z: 0 },
xAxis: { x: 0, y: 1, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 1, y: 0, z: 0 }
}
origin: { x: -width / 2 + 20, y: 0, z: 0 },
xAxis: { x: 0, y: 1, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 1, y: 0, z: 0 }
}
// build the retention bump in the front

View File

@ -26,12 +26,10 @@ fn rectShape = (pos, w, l) => {
// define the bracket plane
const bracketPlane = {
plane: {
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
origin: { x: 0, y: length / 2 + thk, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 0, y: -1, z: 0 }
}
// build the bracket sketch around the body
@ -65,12 +63,10 @@ const bracketBody = bs
// define the tab plane
const tabPlane = {
plane: {
origin: { x: 0, y: 0, z: depth + thk },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
origin: { x: 0, y: 0, z: depth + thk },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
// build the tabs of the mounting bracket (right side)
@ -131,12 +127,10 @@ const tabsL = startSketchOn(tabPlane)
// define a plane for retention bumps
const retPlane = {
plane: {
origin: { x: -width / 2 + 20, y: 0, z: 0 },
xAxis: { x: 0, y: 1, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 1, y: 0, z: 0 }
}
origin: { x: -width / 2 + 20, y: 0, z: 0 },
xAxis: { x: 0, y: 1, z: 0 },
yAxis: { x: 0, y: 0, z: 1 },
zAxis: { x: 1, y: 0, z: 0 }
}
// build the retention bump in the front

View File

@ -27,7 +27,7 @@ const s = startSketchOn(XY)
|> close()
|> extrude(length = height)
const shellExtrude = startSketchOn(s, "start")
const shellExtrude = startSketchOn(s, face = "start")
|> startProfileAt([
-(total_width / 2 - t),
-(total_length / 2 - t)
@ -38,7 +38,7 @@ const shellExtrude = startSketchOn(s, "start")
|> close()
|> extrude(length = -(height - t))
const peg = startSketchOn(s, "end")
const peg = startSketchOn(s, face = "end")
|> circle( center= [
-(total_width / 2 - wSegments),
-(total_length / 2 - lSegments)

View File

@ -1,19 +1,17 @@
// define a plane with UID 94894440791888
const plane94894440791888 = {
plane: {
origin: [0.005000000000000001, 0.01, -0.005],
xAxis: [
0.9285064634886234,
0.37131623619207604,
0.0
],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [
0.37131623619207604,
-0.9285064634886234,
0.0
]
}
origin: [0.005000000000000001, 0.01, -0.005],
xAxis: [
0.9285064634886234,
0.37131623619207604,
0.0
],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [
0.37131623619207604,
-0.9285064634886234,
0.0
]
}
// create a sketch with UID 94894440902176

View File

@ -1,19 +1,17 @@
// define a plane with UID 94894440791888
const plane94894440791888 = {
plane: {
origin: [0.005000000000000001, 0.01, -0.005],
xAxis: [
0.9285064634886234,
0.37131623619207604,
0.0
],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [
0.37131623619207604,
-0.9285064634886234,
0.0
]
}
origin: [0.005000000000000001, 0.01, -0.005],
xAxis: [
0.9285064634886234,
0.37131623619207604,
0.0
],
yAxis: [-0.0, 0.0, 1.0],
zAxis: [
0.37131623619207604,
-0.9285064634886234,
0.0
]
}
// create a sketch with UID 94894440902176

View File

@ -12,7 +12,7 @@ const p = startSketchOn(XY)
|> extrude(length = triangleHeight)
fn circl = (x, face) => {
return startSketchOn(p, face)
return startSketchOn(p, face = face)
|> startProfileAt([x + radius, triangleHeight/2], %)
|> arc(circ, %, $arc_tag)
|> close()

View File

@ -33,7 +33,7 @@ const sketch001 = startSketchOn(XZ)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
const extrude001 = extrude(sketch001, length = 5)
const sketch002 = startSketchOn(extrude001, 'START')
const sketch002 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
-slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)
@ -44,7 +44,7 @@ const sketch002 = startSketchOn(extrude001, 'START')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
const extrude002 = extrude(sketch002, length = 7.5)
const sketch003 = startSketchOn(extrude001, 'START')
const sketch003 = startSketchOn(extrude001, face = 'START')
|> startProfileAt([
slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)

View File

@ -11,7 +11,6 @@ const width = 21.53
// simple caster model at each corner
fn caster = (originStart) => {
const plane001c = {
plane: {
origin: [
-(3.543 - 2.756) / 2 + originStart[0],
-(3.543 - 2.756) / 2 + originStart[1],
@ -20,7 +19,6 @@ fn caster = (originStart) => {
x_axis: [1.0, 0.0, 0.0],
y_axis: [0.0, 1.0, 0.0],
z_axis: [0.0, 0.0, 1.0]
}
}
const sketch001c = startSketchOn(plane001c)
@ -48,7 +46,7 @@ fn caster = (originStart) => {
], radius = 8.8 / 2 / 25.4 ), %)
|> extrude(length = -.25)
const sketch002c = startSketchOn(sketch001c, 'START')
const sketch002c = startSketchOn(sketch001c, face = 'START')
|> startProfileAt([-originStart[0], 2.2 + originStart[1]], %)
|> arc({
angle_start: 30,
@ -59,7 +57,6 @@ fn caster = (originStart) => {
|> extrude(length = 3.1)
const plane002c = {
plane: {
origin: [
0 + originStart[0],
0.8 + originStart[1],
@ -68,7 +65,6 @@ fn caster = (originStart) => {
x_axis: [1, 0, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch003c = startSketchOn(plane002c)
|> circle(center = [0, 1.2], radius = 2.48 / 2)
@ -96,7 +92,6 @@ caster([
// left wall
const plane001 = {
plane: {
origin: [
originStart[0] - 4,
originStart[1] + 2,
@ -105,7 +100,6 @@ const plane001 = {
x_axis: [0, 1, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch001l = startSketchOn(plane001)
@ -187,7 +181,6 @@ const extrude007l = extrude(sketch007l, length = 1)
// right wall
const plane002 = {
plane: {
origin: [
originStart[0] - 4 + width - 1,
originStart[1] - 1,
@ -196,7 +189,6 @@ const plane002 = {
x_axis: [0, 1, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch001w = startSketchOn(plane002)
@ -488,12 +480,10 @@ const extrude025w = extrude(sketch025w, length = 1)
// Base plane of rack
const plane003 = {
plane: {
origin: [0, 0, 4.114],
x_axis: [1, 0, 0],
y_axis: [0, 1, 0],
z_axis: [0, 0, 1]
}
}
const sketch005 = startSketchOn(plane003)
@ -541,12 +531,10 @@ const extrude008 = extrude(sketch008, length = 1)
// Top Plane
const plane004 = {
plane: {
origin: [0, 0, 4.114 + railHeight * 1.75 + 2],
x_axis: [1, 0, 0],
y_axis: [0, 1, 0],
z_axis: [0, 0, 1]
}
}
const sketch005t = startSketchOn(plane004)
@ -594,30 +582,24 @@ const extrude009t = extrude(sketch009t, length = -1)
// front left vertical rail
// Define planes so the rail can be moved
const planeXYfl = {
plane: {
origin: [0, 0, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZfl = {
plane: {
origin: [originStart[1], originStart[0], originStart[2]],
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZfl = {
plane: {
origin: [originStart[1], originStart[0], originStart[2]],
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -661,7 +643,7 @@ const sketch003fl = startSketchOn(planeXYfl)
const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75)
// EIA-310-D standard hole pattern
const sketch004fl = startSketchOn(extrude002fl, 'START')
const sketch004fl = startSketchOn(extrude002fl, face = 'START')
|> startProfileAt([0.72 + originStart[1], originStart[2] + 0.15], %)
|> angledLine(angle = 0, length = -0.375, tag = $rectangleSegmentA003fl)
|> angledLine(angle = segAng(rectangleSegmentA003fl) - 90, length = 0.375, tag = $rectangleSegmentB003fl)
@ -676,7 +658,7 @@ const sketch004fl = startSketchOn(extrude002fl, 'START')
const extrude004fl = extrude(sketch004fl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch005fl = startSketchOn(extrude002fl, 'START')
const sketch005fl = startSketchOn(extrude002fl, face = 'START')
|> startProfileAt([0.72 + originStart[1],originStart[2] + 0.15 + .62], %)
|> angledLine(angle = 0, length = -0.375, tag = $rectangleSegmentA004fl)
|> angledLine(angle = segAng(rectangleSegmentA004fl) - 90, length = 0.375, tag = $rectangleSegmentB004fl)
@ -691,7 +673,7 @@ const sketch005fl = startSketchOn(extrude002fl, 'START')
const extrude005fl = extrude(sketch005fl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch006fl = startSketchOn(extrude002fl, 'START')
const sketch006fl = startSketchOn(extrude002fl, face = 'START')
|> startProfileAt([
0.72 + originStart[1],
originStart[2] + 0.15 + 0.62 + 0.50
@ -709,7 +691,7 @@ const sketch006fl = startSketchOn(extrude002fl, 'START')
const extrude006fl = extrude(sketch006fl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch007fl = startSketchOn(extrude001fl, 'START')
const sketch007fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([-1.45 - originStart[0], originStart[2] + 0.15], %)
|> angledLine(angle = 0, length = -0.375, tag = $rectangleSegmentA006fl)
|> angledLine(angle = segAng(rectangleSegmentA006fl) - 90, length = 0.375, tag = $rectangleSegmentB006fl)
@ -724,7 +706,7 @@ const sketch007fl = startSketchOn(extrude001fl, 'START')
const extrude007fl = extrude(sketch007fl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch008fl = startSketchOn(extrude001fl, 'START')
const sketch008fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([-1.45 - originStart[0],originStart[2] + 0.15 + 0.62], %)
|> angledLine(angle = 0, length = -0.375, tag = $rectangleSegmentA007fl)
|> angledLine(angle = segAng(rectangleSegmentA007fl) - 90, length = 0.375, tag = $rectangleSegmentB007fl)
@ -739,7 +721,7 @@ const sketch008fl = startSketchOn(extrude001fl, 'START')
const extrude008fl = extrude(sketch008fl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch009fl = startSketchOn(extrude001fl, 'START')
const sketch009fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.45 - originStart[0],
originStart[2] + 0.15 + 0.62 + 0.5
@ -757,7 +739,7 @@ const sketch009fl = startSketchOn(extrude001fl, 'START')
const extrude009fl = extrude(sketch009fl, length = -thickness)
// define slots
const sketch010fl = startSketchOn(extrude001fl, 'START')
const sketch010fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2)
@ -775,7 +757,7 @@ const sketch010fl = startSketchOn(extrude001fl, 'START')
const extrude010fl = extrude(sketch010fl, length = -thickness)
// define slots
const sketch011fl = startSketchOn(extrude001fl, 'START')
const sketch011fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -792,7 +774,7 @@ const sketch011fl = startSketchOn(extrude001fl, 'START')
const extrude011fl = extrude(sketch011fl, length = -thickness)
// define slots
const sketch012fl = startSketchOn(extrude001fl, 'START')
const sketch012fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0], originStart[2] +
railHeight * 1.75 - .81 + .438 / 2
@ -815,16 +797,13 @@ const extrude012fl = extrude(sketch012fl, length = -thickness)
// FRONT RIGHT VERTICAL RAIL
// Define planes so the rail can be moved
const planeXYfr = {
plane: {
origin: [0, 0, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZfr = {
plane: {
origin: [
originStart[1] + width - thickness - 2,
originStart[0],
@ -833,11 +812,9 @@ const planeXZfr = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZfr = {
plane: {
origin: [
originStart[1] + width - 2,
originStart[0],
@ -846,7 +823,6 @@ const planeYZfr = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -892,7 +868,7 @@ const sketch003fr = startSketchOn(planeXYfr)
const extrude003fr = extrude(sketch003fr, length = railHeight * 1.75)
// EIA-310-D standard hole pattern
const sketch004fr = startSketchOn(extrude002fr, 'START')
const sketch004fr = startSketchOn(extrude002fr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15
@ -910,7 +886,7 @@ const sketch004fr = startSketchOn(extrude002fr, 'START')
const extrude004fr = extrude(sketch004fr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch005fr = startSketchOn(extrude002fr, 'START')
const sketch005fr = startSketchOn(extrude002fr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15 + .62
@ -928,7 +904,7 @@ const sketch005fr = startSketchOn(extrude002fr, 'START')
const extrude005fr = extrude(sketch005fr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch006fr = startSketchOn(extrude002fr, 'START')
const sketch006fr = startSketchOn(extrude002fr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15 + 0.62 + 0.50
@ -946,7 +922,7 @@ const sketch006fr = startSketchOn(extrude002fr, 'START')
const extrude006fr = extrude(sketch006fr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch007fr = startSketchOn(extrude001fr, 'START')
const sketch007fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.45 - originStart[0],
originStart[2] + 0.15
@ -964,7 +940,7 @@ const sketch007fr = startSketchOn(extrude001fr, 'START')
const extrude007fr = extrude(sketch007fr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch008fr = startSketchOn(extrude001fr, 'START')
const sketch008fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.45 - originStart[0],
originStart[2] + 0.15 + 0.62
@ -982,7 +958,7 @@ const sketch008fr = startSketchOn(extrude001fr, 'START')
const extrude008fr = extrude(sketch008fr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch009fr = startSketchOn(extrude001fr, 'START')
const sketch009fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.45 - originStart[0],
originStart[2] + 0.15 + 0.62 + 0.5
@ -1000,7 +976,7 @@ const sketch009fr = startSketchOn(extrude001fr, 'START')
const extrude009fr = extrude(sketch009fr, length = -thickness)
// define slots
const sketch010fr = startSketchOn(extrude001fr, 'START')
const sketch010fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2)
@ -1021,7 +997,7 @@ const sketch010fr = startSketchOn(extrude001fr, 'START')
const extrude010fr = extrude(sketch010fr, length = -thickness)
// define slots
const sketch011fr = startSketchOn(extrude001fr, 'START')
const sketch011fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -1038,7 +1014,7 @@ const sketch011fr = startSketchOn(extrude001fr, 'START')
const extrude011fr = extrude(sketch011fr, length = -thickness)
// define slots
const sketch012fr = startSketchOn(extrude001fr, 'START')
const sketch012fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -1061,16 +1037,13 @@ const extrude012fr = extrude(sketch012fr, length = -thickness)
// RIGHT REAR VERTICAL RAIL
// Define planes so the rail can be moved
const planeXYrr = {
plane: {
origin: [0, serverDepth, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZrr = {
plane: {
origin: [
originStart[1] + width - thickness - 2,
originStart[0]+serverDepth-2-bendRad,
@ -1079,11 +1052,9 @@ const planeXZrr = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZrr = {
plane: {
origin: [
originStart[1] + width - 2,
originStart[0]+serverDepth,
@ -1092,7 +1063,6 @@ const planeYZrr = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -1138,7 +1108,7 @@ const sketch003rr = startSketchOn(planeXYrr)
const extrude003rr = extrude(sketch003rr, length = railHeight * 1.75)
// EIA-310-D standard hole pattern
const sketch004rr = startSketchOn(extrude002rr, 'START')
const sketch004rr = startSketchOn(extrude002rr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15
@ -1156,7 +1126,7 @@ const sketch004rr = startSketchOn(extrude002rr, 'START')
const extrude004rr = extrude(sketch004rr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch005rr = startSketchOn(extrude002rr, 'START')
const sketch005rr = startSketchOn(extrude002rr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15 + .62
@ -1174,7 +1144,7 @@ const sketch005rr = startSketchOn(extrude002rr, 'START')
const extrude005rr = extrude(sketch005rr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch006rr = startSketchOn(extrude002rr, 'START')
const sketch006rr = startSketchOn(extrude002rr, face = 'START')
|> startProfileAt([
-0.35 + originStart[1] + width - 2,
originStart[2] + 0.15 + 0.62 + 0.50
@ -1192,7 +1162,7 @@ const sketch006rr = startSketchOn(extrude002rr, 'START')
const extrude006rr = extrude(sketch006rr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch007rr = startSketchOn(extrude001rr, 'START')
const sketch007rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-originStart[0]-serverDepth+1.7,
originStart[2] + 0.15
@ -1210,7 +1180,7 @@ const sketch007rr = startSketchOn(extrude001rr, 'START')
const extrude007rr = extrude(sketch007rr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch008rr = startSketchOn(extrude001rr, 'START')
const sketch008rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-originStart[0]-serverDepth+1.7,
originStart[2] + 0.15 + 0.62
@ -1228,7 +1198,7 @@ const sketch008rr = startSketchOn(extrude001rr, 'START')
const extrude008rr = extrude(sketch008rr, length = -thickness)
// EIA-310-D standard hole pattern
const sketch009rr = startSketchOn(extrude001rr, 'START')
const sketch009rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-originStart[0]-serverDepth+1.7,
originStart[2] + 0.15 + 0.62 + 0.5
@ -1246,7 +1216,7 @@ const sketch009rr = startSketchOn(extrude001rr, 'START')
const extrude009rr = extrude(sketch009rr, length = -thickness)
// define slots
const sketch010rr = startSketchOn(extrude001rr, 'START')
const sketch010rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + .81 - (.438 / 2)
@ -1267,7 +1237,7 @@ const sketch010rr = startSketchOn(extrude001rr, 'START')
const extrude010rr = extrude(sketch010rr, length = -thickness)
// define slots
const sketch011rr = startSketchOn(extrude001rr, 'START')
const sketch011rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -1284,7 +1254,7 @@ const sketch011rr = startSketchOn(extrude001rr, 'START')
const extrude011rr = extrude(sketch011rr, length = -thickness)
// define slots
const sketch012rr = startSketchOn(extrude001rr, 'START')
const sketch012rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -1307,16 +1277,13 @@ const extrude012rr = extrude(sketch012rr, length = -thickness)
// REAR LEFT VETCIAL RAIL
// Define planes so the rail can be moved
const planeXYrl = {
plane: {
origin: [0, serverDepth, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZrl = {
plane: {
origin: [
originStart[1],
originStart[0] + serverDepth - 2 - bendRad,
@ -1325,11 +1292,9 @@ const planeXZrl = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZrl = {
plane: {
origin: [
originStart[1],
originStart[0] + serverDepth,
@ -1338,7 +1303,6 @@ const planeYZrl = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
const sketch001rl = startSketchOn(planeXZrl)
@ -1383,7 +1347,7 @@ const sketch003rl = startSketchOn(planeXYrl)
const extrude003rl = extrude(sketch003rl, length = railHeight * 1.75)
// EIA-310-D standard hole pattern
const sketch004rl = startSketchOn(extrude002rl, 'START')
const sketch004rl = startSketchOn(extrude002rl, face = 'START')
|> startProfileAt([
-1.38 + 2 + thickness + originStart[1],
originStart[2] + 0.15
@ -1401,7 +1365,7 @@ const sketch004rl = startSketchOn(extrude002rl, 'START')
const extrude004rl = extrude(sketch004rl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch005rl = startSketchOn(extrude002rl, 'START')
const sketch005rl = startSketchOn(extrude002rl, face = 'START')
|> startProfileAt([
-1.38 + 2 + thickness + originStart[1],
originStart[2] + 0.15 + .62
@ -1419,7 +1383,7 @@ const sketch005rl = startSketchOn(extrude002rl, 'START')
const extrude005rl = extrude(sketch005rl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch006rl = startSketchOn(extrude002rl, 'START')
const sketch006rl = startSketchOn(extrude002rl, face = 'START')
|> startProfileAt([
-1.38 + 2 + thickness + originStart[1],
originStart[2] + 0.15 + 0.62 + 0.50
@ -1437,7 +1401,7 @@ const sketch006rl = startSketchOn(extrude002rl, 'START')
const extrude006rl = extrude(sketch006rl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch007rl = startSketchOn(extrude001rl, 'START')
const sketch007rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
1.75 - originStart[0] - serverDepth,
originStart[2] + 0.15
@ -1455,7 +1419,7 @@ const sketch007rl = startSketchOn(extrude001rl, 'START')
const extrude007rl = extrude(sketch007rl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch008rl = startSketchOn(extrude001rl, 'START')
const sketch008rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
1.75 - originStart[0] - serverDepth,
originStart[2] + 0.15 + 0.62
@ -1473,7 +1437,7 @@ const sketch008rl = startSketchOn(extrude001rl, 'START')
const extrude008rl = extrude(sketch008rl, length = -thickness)
// EIA-310-D standard hole pattern
const sketch009rl = startSketchOn(extrude001rl, 'START')
const sketch009rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
1.75 - originStart[0] - serverDepth,
originStart[2] + 0.15 + 0.62 + 0.5
@ -1491,7 +1455,7 @@ const sketch009rl = startSketchOn(extrude001rl, 'START')
const extrude009rl = extrude(sketch009rl, length = -thickness)
// define slots
const sketch010rl = startSketchOn(extrude001rl, 'START')
const sketch010rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 - (.438 / 2)
@ -1512,7 +1476,7 @@ const sketch010rl = startSketchOn(extrude001rl, 'START')
const extrude010rl = extrude(sketch010rl, length = -thickness)
// define slots
const sketch011rl = startSketchOn(extrude001rl, 'START')
const sketch011rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -1529,7 +1493,7 @@ const sketch011rl = startSketchOn(extrude001rl, 'START')
const extrude011rl = extrude(sketch011rl, length = -thickness)
// define slots
const sketch012rl = startSketchOn(extrude001rl, 'START')
const sketch012rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -1553,29 +1517,23 @@ const extrude012rl = extrude(sketch012rl, length = -thickness)
// Define planes so the server can be moved
fn streamServer = (serverPos) => {
const planeXYs = {
plane: {
origin: [0, 0 + 2, 4.114 + 1 + serverPos * 1.75],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZs = {
plane: {
origin: [0 + 1.2 + .1, 0 + 2, 0],
xAxis: [0, -1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeXZs2 = {
plane: {
origin: [18 + 1.4, 0 + 2, 0],
xAxis: [0, -1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const sketch001s = startSketchOn(planeXYs)

View File

@ -9,7 +9,6 @@ const width = 21.53
// simple caster model at each corner
fn caster = (originStart) => {
const plane001c = {
plane: {
origin: [
-(3.543 - 2.756) / 2 + originStart[0],
-(3.543 - 2.756) / 2 + originStart[1],
@ -18,7 +17,6 @@ fn caster = (originStart) => {
x_axis: [1.0, 0.0, 0.0],
y_axis: [0.0, 1.0, 0.0],
z_axis: [0.0, 0.0, 1.0]
}
}
const sketch001c = startSketchOn(plane001c)
@ -46,7 +44,7 @@ fn caster = (originStart) => {
], radius= 8.8 / 2 / 25.4), %)
|> extrude(length = -.25)
const sketch002c = startSketchOn(sketch001c, 'START')
const sketch002c = startSketchOn(sketch001c, face = 'START')
|> startProfileAt([-originStart[0], 2.2 + originStart[1]], %)
|> arc({
angle_start: 30,
@ -57,7 +55,6 @@ fn caster = (originStart) => {
|> extrude(length = 3.1)
const plane002c = {
plane: {
origin: [
0 + originStart[0],
0.8 + originStart[1],
@ -66,7 +63,6 @@ fn caster = (originStart) => {
x_axis: [1, 0, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch003c = startSketchOn(plane002c)
|> circle(center = [0, 1.2], radius = 2.48 / 2)
@ -94,7 +90,6 @@ caster([
// left wall
const plane001 = {
plane: {
origin: [
originStart[0] - 4,
originStart[1] + 2,
@ -103,7 +98,6 @@ const plane001 = {
x_axis: [0, 1, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch001l = startSketchOn(plane001)
@ -185,7 +179,6 @@ const extrude007l = extrude(sketch007l, length = 1)
// right wall
const plane002 = {
plane: {
origin: [
originStart[0] - 4 + width - 1,
originStart[1] - 1,
@ -194,7 +187,6 @@ const plane002 = {
x_axis: [0, 1, 0],
y_axis: [0, 0, 1],
z_axis: [1, 0, 0]
}
}
const sketch001w = startSketchOn(plane002)
@ -486,12 +478,10 @@ const extrude025w = extrude(sketch025w, length = 1)
// Base plane of rack
const plane003 = {
plane: {
origin: [0, 0, 4.114],
x_axis: [1, 0, 0],
y_axis: [0, 1, 0],
z_axis: [0, 0, 1]
}
}
const sketch005 = startSketchOn(plane003)
@ -539,12 +529,10 @@ const extrude008 = extrude(sketch008, length = 1)
// Top Plane
const plane004 = {
plane: {
origin: [0, 0, 4.114 + railHeight * 1.75 + 2],
x_axis: [1, 0, 0],
y_axis: [0, 1, 0],
z_axis: [0, 0, 1]
}
}
const sketch005t = startSketchOn(plane004)
@ -592,16 +580,13 @@ const extrude009t = extrude(sketch009t, length = -1)
// front left vertical rail
// Define planes so the rail can be moved
const planeXYfl = {
plane: {
origin: [0, 0, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZfl = {
plane: {
origin: [
originStart[1],
originStart[0],
@ -610,11 +595,9 @@ const planeXZfl = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZfl = {
plane: {
origin: [
originStart[1],
originStart[0],
@ -623,7 +606,6 @@ const planeYZfl = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -670,7 +652,7 @@ const sketch003fl = startSketchOn(planeXYfl)
const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75)
// define slots
const sketch010fl = startSketchOn(extrude001fl, 'START')
const sketch010fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2)
@ -691,7 +673,7 @@ const sketch010fl = startSketchOn(extrude001fl, 'START')
const extrude010fl = extrude(sketch010fl, length = -thickness)
// define slots
const sketch011fl = startSketchOn(extrude001fl, 'START')
const sketch011fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -708,7 +690,7 @@ const sketch011fl = startSketchOn(extrude001fl, 'START')
const extrude011fl = extrude(sketch011fl, length = -thickness)
// define slots
const sketch012fl = startSketchOn(extrude001fl, 'START')
const sketch012fl = startSketchOn(extrude001fl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -731,16 +713,13 @@ const extrude012fl = extrude(sketch012fl, length = -thickness)
// FRONT RIGHT VERTICAL RAIL
// Define planes so the rail can be moved
const planeXYfr = {
plane: {
origin: [0, 0, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZfr = {
plane: {
origin: [
originStart[1] + width - thickness - 2,
originStart[0],
@ -749,11 +728,9 @@ const planeXZfr = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZfr = {
plane: {
origin: [
originStart[1] + width - 2,
originStart[0],
@ -762,7 +739,6 @@ const planeYZfr = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -808,7 +784,7 @@ const sketch003fr = startSketchOn(planeXYfr)
const extrude003fr = extrude(sketch003fr, length = railHeight * 1.75)
// define slots
const sketch010fr = startSketchOn(extrude001fr, 'START')
const sketch010fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2)
@ -829,7 +805,7 @@ const sketch010fr = startSketchOn(extrude001fr, 'START')
const extrude010fr = extrude(sketch010fr, length = -thickness)
// define slots
const sketch011fr = startSketchOn(extrude001fr, 'START')
const sketch011fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -846,7 +822,7 @@ const sketch011fr = startSketchOn(extrude001fr, 'START')
const extrude011fr = extrude(sketch011fr, length = -thickness)
// define slots
const sketch012fr = startSketchOn(extrude001fr, 'START')
const sketch012fr = startSketchOn(extrude001fr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -869,16 +845,13 @@ const extrude012fr = extrude(sketch012fr, length = -thickness)
// RIGHT REAR VERTICAL RAIL
// Define planes so the rail can be moved
const planeXYrr = {
plane: {
origin: [0, serverDepth, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZrr = {
plane: {
origin: [
originStart[1] + width - thickness - 2,
originStart[0] + serverDepth - 2 - bendRad,
@ -887,11 +860,9 @@ const planeXZrr = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZrr = {
plane: {
origin: [
originStart[1] + width - 2,
originStart[0] + serverDepth,
@ -900,7 +871,6 @@ const planeYZrr = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
@ -946,7 +916,7 @@ const sketch003rr = startSketchOn(planeXYrr)
const extrude003rr = extrude(sketch003rr, length = railHeight * 1.75)
// define slots
const sketch010rr = startSketchOn(extrude001rr, 'START')
const sketch010rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + .81 - (.438 / 2)
@ -967,7 +937,7 @@ const sketch010rr = startSketchOn(extrude001rr, 'START')
const extrude010rr = extrude(sketch010rr, length = -thickness)
// define slots
const sketch011rr = startSketchOn(extrude001rr, 'START')
const sketch011rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -984,7 +954,7 @@ const sketch011rr = startSketchOn(extrude001rr, 'START')
const extrude011rr = extrude(sketch011rr, length = -thickness)
// define slots
const sketch012rr = startSketchOn(extrude001rr, 'START')
const sketch012rr = startSketchOn(extrude001rr, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -1007,16 +977,13 @@ const extrude012rr = extrude(sketch012rr, length = -thickness)
// REAR LEFT VETCIAL RAIL
// Define planes so the rail can be moved
const planeXYrl = {
plane: {
origin: [0, serverDepth, originStart[2]],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZrl = {
plane: {
origin: [
originStart[1],
originStart[0] + serverDepth - 2 - bendRad,
@ -1025,11 +992,9 @@ const planeXZrl = {
xAxis: [0, 1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeYZrl = {
plane: {
origin: [
originStart[1],
originStart[0] + serverDepth,
@ -1038,7 +1003,6 @@ const planeYZrl = {
xAxis: [-1, 0, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
// Base flange
const sketch001rl = startSketchOn(planeXZrl)
@ -1083,7 +1047,7 @@ const sketch003rl = startSketchOn(planeXYrl)
const extrude003rl = extrude(sketch003rl, length = railHeight * 1.75)
// define slots
const sketch010rl = startSketchOn(extrude001rl, 'START')
const sketch010rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 - (.438 / 2)
@ -1104,7 +1068,7 @@ const sketch010rl = startSketchOn(extrude001rl, 'START')
const extrude010rl = extrude(sketch010rl, length = -thickness)
// define slots
const sketch011rl = startSketchOn(extrude001rl, 'START')
const sketch011rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2
@ -1121,7 +1085,7 @@ const sketch011rl = startSketchOn(extrude001rl, 'START')
const extrude011rl = extrude(sketch011rl, length = -thickness)
// define slots
const sketch012rl = startSketchOn(extrude001rl, 'START')
const sketch012rl = startSketchOn(extrude001rl, face = 'START')
|> startProfileAt([
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2
@ -1144,29 +1108,23 @@ const extrude012rl = extrude(sketch012rl, length = -thickness)
// Define planes so the server can be moved
fn streamServer = (serverPos) => {
const planeXYs = {
plane: {
origin: [0, 0 + 2, 4.114 + 1 + serverPos * 1.75],
xAxis: [1.0, 0.0, 0.0],
yAxis: [0.0, 1.0, 0.0],
zAxis: [0.0, 0.0, 1.0]
}
}
const planeXZs = {
plane: {
origin: [0 + 1.2 + .1, 0 + 2, 0],
xAxis: [0, -1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const planeXZs2 = {
plane: {
origin: [18 + 1.4, 0 + 2, 0],
xAxis: [0, -1, 0],
yAxis: [0, 0, 1],
zAxis: [1, 0, 0]
}
}
const sketch001s = startSketchOn(planeXYs)

View File

@ -14,14 +14,14 @@ const extrude001 = extrude(sketch001, length = 100)
)
|> chamfer(length = 50, tags = [seg02], tag = $seg04)
const sketch003 = startSketchOn(extrude001, seg04)
const sketch003 = startSketchOn(extrude001, face = seg04)
|> startProfileAt([-69.1, 277.34], %)
|> angledLine(angle = 0, length = 41.48, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 104.8, tag = $rectangleSegmentB002)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003), tag = $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
const sketch002 = startSketchOn(extrude001, seg03)
const sketch002 = startSketchOn(extrude001, face = seg03)
|> startProfileAt([159.25, 278.35], %)
|> angledLine(angle = 0, length = 40.82, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 132.27, tag = $rectangleSegmentB001)

View File

@ -14,14 +14,14 @@ const extrude001 = extrude(sketch001, length = 100)
tag = $seg03
)
const sketch003 = startSketchOn(extrude001, seg04)
const sketch003 = startSketchOn(extrude001, face = seg04)
|> startProfileAt([-69.1, 277.34], %)
|> angledLine(angle = 0, length = 41.48, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 104.8, tag = $rectangleSegmentB002)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003), tag = $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
const sketch002 = startSketchOn(extrude001, seg03)
const sketch002 = startSketchOn(extrude001, face = seg03)
|> startProfileAt([159.25, 278.35], %)
|> angledLine(angle = 0, length = 40.82, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 132.27, tag = $rectangleSegmentB001)

View File

@ -6,7 +6,7 @@ part001 = startSketchOn(XY)
|> close()
|> extrude(length = 5)
part002 = startSketchOn(part001, here)
part002 = startSketchOn(part001, face = here)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])

View File

@ -45,7 +45,7 @@ bracket = startSketchOn(XY)
]
)
sketch001 = startSketchOn(bracket, seg01)
sketch001 = startSketchOn(bracket, face = seg01)
|> startProfileAt([4.28, 3.83], %)
|> line(end = [2.17, -0.03])
|> line(end = [-0.07, -1.8])

View File

@ -11,6 +11,6 @@ const part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
const part002 = startSketchOn(part001, "end")
const part002 = startSketchOn(part001, face = "end")
|> circle(center: [0, 0], radius: 5, tag =$myCircle)
|> extrude(length = 5)

View File

@ -11,7 +11,7 @@ const part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
const part002 = startSketchOn(part001, "END")
const part002 = startSketchOn(part001, face = "END")
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])

View File

@ -11,7 +11,7 @@ const part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
const part002 = startSketchOn(part001, "END")
const part002 = startSketchOn(part001, face = "END")
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])

View File

@ -11,7 +11,7 @@ const part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
const part002 = startSketchOn(part001, "start")
const part002 = startSketchOn(part001, face = "start")
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])

View File

@ -13,21 +13,17 @@ const totalLength = lbumps * pitch - (2.0 * clearance)
const totalWidth = wbumps * pitch - (2.0 * clearance)
// Create the plane for the pegs. This is a hack so that the pegs can be patterned along the face of the lego base.
const pegFace = {
plane: {
origin: { x: 0, y: 0, z: height },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
origin: { x: 0, y: 0, z: height },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
// Create the plane for the tubes underneath the lego. This is a hack so that the tubes can be patterned underneath the lego.
const tubeFace = {
plane: {
origin: { x: 0, y: 0, z: height - t },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
origin: { x: 0, y: 0, z: height - t },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
// Make the base
const s = startSketchOn('XY')

View File

@ -715,7 +715,7 @@ part001 = cube([0, 0], 20)
|> close()
|> extrude(length = 20)
part002 = startSketchOn(part001, part001.sketch.tags.here)
part002 = startSketchOn(part001, face = part001.sketch.tags.here)
|> startProfileAt([0, 0], %)
|> line(end = [5, 0])
|> line(end = [5, 5])
@ -751,7 +751,7 @@ part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
part002 = startSketchOn(part001, "end")
part002 = startSketchOn(part001, face = "end")
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])
@ -759,7 +759,7 @@ part002 = startSketchOn(part001, "end")
|> close()
|> extrude(length = 5)
part003 = startSketchOn(part002, "end")
part003 = startSketchOn(part002, face = "end")
|> startProfileAt([0, 0], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -811,7 +811,7 @@ part001 = cube([0,0], 20)
|> close()
|> extrude(length = 20)
part002 = startSketchOn(part001, "end")
part002 = startSketchOn(part001, face = "end")
|> circle(center = [0, 0], radius= 5)
|> extrude(length = 5)
"#;
@ -865,7 +865,7 @@ part = rectShape([0, 0], 20, 20)
};
assert_eq!(
err.error.message(),
"The input argument of `std::sketch::circle` requires a value with type `Sketch | Plane | Face`, but found string (text)"
"This function expected the input argument to be of type SketchOrSurface but it's actually of type string (text)"
);
}
@ -1031,7 +1031,7 @@ async fn kcl_test_revolve_on_edge() {
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, "end")
sketch001 = startSketchOn(box, face = "end")
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])
@ -1055,7 +1055,7 @@ async fn kcl_test_revolve_on_edge_get_edge() {
|> close()
|> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn(box, face = revolveAxis)
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])
@ -1085,7 +1085,7 @@ async fn kcl_test_revolve_on_face_circle_edge() {
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle(center = [10,10], radius= 4)
|> revolve(
angle = 90,
@ -1107,7 +1107,7 @@ async fn kcl_test_revolve_on_face_circle() {
|> close()
|> extrude(length = 20)
sketch001 = startSketchOn(box, "END")
sketch001 = startSketchOn(box, face = "END")
|> circle(center = [10,10], radius= 4 )
|> revolve(
angle = -90,
@ -1129,7 +1129,7 @@ async fn kcl_test_revolve_on_face() {
|> close(tag = $revolveAxis)
|> extrude(length = 10)
sketch001 = startSketchOn(box, "end")
sketch001 = startSketchOn(box, face = "end")
|> startProfileAt([5, 10], %)
|> line(end = [0, -10])
|> line(end = [2, 0])
@ -1173,7 +1173,7 @@ async fn kcl_test_simple_revolve_sketch_on_edge() {
|> close()
|> revolve(axis = Y, angle = 180)
part002 = startSketchOn(part001, 'end')
part002 = startSketchOn(part001, face = 'end')
|> startProfileAt([4.5, -5], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
@ -1189,7 +1189,7 @@ part002 = startSketchOn(part001, 'end')
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_plumbus_fillets() {
let code = r#"fn make_circle = (ext, face, pos, radius) => {
sg = startSketchOn(ext, face)
sg = startSketchOn(ext, face = face)
|> startProfileAt([pos[0] + radius, pos[1]], %)
|> arc({
angleEnd = 360,
@ -1264,20 +1264,18 @@ async fn kcl_test_empty_file_is_ok() {
async fn kcl_test_member_expression_in_params() {
let code = r#"fn capScrew = (originStart, length, dia, capDia, capHeadLength) => {
screwHead = startSketchOn({
plane: {
origin: {
x: originStart[0],
y: originStart[1],
z: originStart[2],
},
xAxis: { x: 0, y: 0, z: -1 },
yAxis: { x: 1, y: 0, z: 0 },
zAxis: { x: 0, y: 1, z: 0 }
}
origin: {
x: originStart[0],
y: originStart[1],
z: originStart[2],
},
xAxis: { x: 0, y: 0, z: -1 },
yAxis: { x: 1, y: 0, z: 0 },
zAxis: { x: 0, y: 1, z: 0 }
})
|> circle(center = [0, 0], radius= capDia / 2)
|> extrude(length = capHeadLength)
screw = startSketchOn(screwHead, "start")
screw = startSketchOn(screwHead, face = "start")
|> circle(center = [0, 0], radius= dia / 2)
|> extrude(length = length)
return screw
@ -1346,7 +1344,7 @@ async fn kcl_test_error_empty_start_sketch_on_string() {
|> close()
|> extrude(length = 100)
secondSketch = startSketchOn(part001, '')
secondSketch = startSketchOn(part001, face = '')
|> circle(center = [-20, 50], radius= 40)
|> extrude(length = 20)
"#;
@ -1355,7 +1353,7 @@ secondSketch = startSketchOn(part001, '')
assert!(result.is_err());
assert_eq!(
result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([297, 299, 0])], message: "Argument at index 1 was supposed to be type Option<FaceTag> but found string (text)" }"#
r#"type: KclErrorDetails { source_ranges: [SourceRange([274, 307, 0])], message: "The arg face was given, but it was the wrong type. It should be type FaceTag but it was string (text)" }"#
);
}
@ -1991,7 +1989,7 @@ someFunction('INVALID')
assert!(result.is_err());
assert_eq!(
result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([51, 60, 0]), SourceRange([65, 88, 0])], message: "This function expected the input argument to be Solid or Plane but it's actually of type string (text)" }"#
);
}
@ -2012,7 +2010,7 @@ someFunction('INVALID')
assert!(result.is_err());
assert_eq!(
result.err().unwrap().to_string(),
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "Argument at index 0 was supposed to be type SketchData but found string (text)" }"#
r#"semantic: KclErrorDetails { source_ranges: [SourceRange([103, 113, 0]), SourceRange([126, 155, 0]), SourceRange([159, 182, 0])], message: "This function expected the input argument to be Solid or Plane but it's actually of type string (text)" }"#
);
}

View File

@ -37,7 +37,7 @@ use uuid::Uuid;
use crate::{
errors::{KclError, KclErrorDetails},
execution::{ArtifactCommand, DefaultPlanes, IdGenerator, Point3d},
execution::{types::UnitLen, ArtifactCommand, DefaultPlanes, IdGenerator, Point3d},
SourceRange,
};
@ -517,7 +517,13 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
) -> Result<uuid::Uuid, KclError> {
// Create new default planes.
let default_size = 100.0;
let default_origin = Point3d { x: 0.0, y: 0.0, z: 0.0 }.into();
let default_origin = Point3d {
x: 0.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
}
.into();
self.batch_modeling_cmd(
plane_id,
@ -555,8 +561,18 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
(
PlaneName::Xy,
id_generator.next_uuid(),
Point3d { x: 1.0, y: 0.0, z: 0.0 },
Point3d { x: 0.0, y: 1.0, z: 0.0 },
Point3d {
x: 1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 1.0,
z: 0.0,
units: UnitLen::Mm,
},
Some(Color {
r: 0.7,
g: 0.28,
@ -567,8 +583,18 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
(
PlaneName::Yz,
id_generator.next_uuid(),
Point3d { x: 0.0, y: 1.0, z: 0.0 },
Point3d { x: 0.0, y: 0.0, z: 1.0 },
Point3d {
x: 0.0,
y: 1.0,
z: 0.,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 0.0,
z: 1.0,
units: UnitLen::Mm,
},
Some(Color {
r: 0.28,
g: 0.7,
@ -579,8 +605,18 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
(
PlaneName::Xz,
id_generator.next_uuid(),
Point3d { x: 1.0, y: 0.0, z: 0.0 },
Point3d { x: 0.0, y: 0.0, z: 1.0 },
Point3d {
x: 1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 0.0,
z: 1.0,
units: UnitLen::Mm,
},
Some(Color {
r: 0.28,
g: 0.28,
@ -595,8 +631,14 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
x: -1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 1.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d { x: 0.0, y: 1.0, z: 0.0 },
None,
),
(
@ -606,8 +648,14 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
x: 0.0,
y: -1.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 0.0,
z: 1.0,
units: UnitLen::Mm,
},
Point3d { x: 0.0, y: 0.0, z: 1.0 },
None,
),
(
@ -617,8 +665,14 @@ pub trait EngineManager: std::fmt::Debug + Send + Sync + 'static {
x: -1.0,
y: 0.0,
z: 0.0,
units: UnitLen::Mm,
},
Point3d {
x: 0.0,
y: 0.0,
z: 1.0,
units: UnitLen::Mm,
},
Point3d { x: 0.0, y: 0.0, z: 1.0 },
None,
),
];

View File

@ -725,12 +725,7 @@ fn apply_ascription(
let ty = RuntimeType::from_parsed(ty.inner.clone(), exec_state, value.into())
.map_err(|e| KclError::Semantic(e.into()))?;
if let KclValue::Number {
ty: NumericType::Unknown,
value,
meta,
} = value
{
if let KclValue::Number { value, meta, .. } = value {
// If the number has unknown units but the user is explicitly specifying them, treat the value as having had it's units erased,
// rather than forcing the user to explicitly erase them.
KclValue::Number {

Some files were not shown because too many files have changed in this diff Show More