* make everything in engine a rwlock and cleanup repetitive code Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * docs Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
139 lines
376 KiB
Markdown
139 lines
376 KiB
Markdown
---
|
|
title: "startSketchOn"
|
|
excerpt: "Start a new 2-dimensional sketch on a specific plane or face."
|
|
layout: manual
|
|
---
|
|
|
|
Start a new 2-dimensional sketch on a specific plane or face.
|
|
|
|
|
|
|
|
```js
|
|
startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| 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` | [`FaceTag`](/docs/kcl/types/FaceTag) | A tag for a face. | No |
|
|
|
|
### Returns
|
|
|
|
[`SketchSurface`](/docs/kcl/types/SketchSurface) - A sketch type.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn("XY")
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [10, 0])
|
|
|> line(end = [0, 10])
|
|
|> line(end = [-10, 0])
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
|
|
exampleSketch002 = startSketchOn(example, 'end')
|
|
|> startProfileAt([1, 1], %)
|
|
|> line(end = [8, 0])
|
|
|> line(end = [0, 8])
|
|
|> line(end = [-8, 0])
|
|
|> close()
|
|
|
|
example002 = extrude(exampleSketch002, length = 5)
|
|
|
|
exampleSketch003 = startSketchOn(example002, 'end')
|
|
|> startProfileAt([2, 2], %)
|
|
|> line(end = [6, 0])
|
|
|> line(end = [0, 6])
|
|
|> line(end = [-6, 0])
|
|
|> close()
|
|
|
|
example003 = extrude(exampleSketch003, length = 5)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
exampleSketch = startSketchOn("XY")
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [10, 0])
|
|
|> line(end = [0, 10], tag = $sketchingFace)
|
|
|> line(end = [-10, 0])
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 10)
|
|
|
|
exampleSketch002 = startSketchOn(example, sketchingFace)
|
|
|> startProfileAt([1, 1], %)
|
|
|> line(end = [8, 0])
|
|
|> line(end = [0, 8])
|
|
|> line(end = [-8, 0])
|
|
|> close(tag = $sketchingFace002)
|
|
|
|
example002 = extrude(exampleSketch002, length = 10)
|
|
|
|
exampleSketch003 = startSketchOn(example002, sketchingFace002)
|
|
|> startProfileAt([-8, 12], %)
|
|
|> line(end = [0, 6])
|
|
|> line(end = [6, 0])
|
|
|> line(end = [0, -6])
|
|
|> close()
|
|
|
|
example003 = extrude(exampleSketch003, length = 5)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
exampleSketch = startSketchOn('XY')
|
|
|> startProfileAt([4, 12], %)
|
|
|> line(end = [2, 0])
|
|
|> line(end = [0, -6])
|
|
|> line(end = [4, -6])
|
|
|> line(end = [0, -6])
|
|
|> line(end = [-3.75, -4.5])
|
|
|> line(end = [0, -5.5])
|
|
|> line(end = [-2, 0])
|
|
|> close()
|
|
|
|
example = revolve({ axis = 'y', angle = 180 }, exampleSketch)
|
|
|
|
exampleSketch002 = startSketchOn(example, 'end')
|
|
|> startProfileAt([4.5, -5], %)
|
|
|> line(end = [0, 5])
|
|
|> line(end = [5, 0])
|
|
|> line(end = [0, -5])
|
|
|> close()
|
|
|
|
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 }
|
|
}
|
|
})
|
|
|> startProfileAt([0, 0], %)
|
|
|> line(end = [100.0, 0])
|
|
|> yLine(-100.0, %)
|
|
|> xLine(-100.0, %)
|
|
|> yLine(100.0, %)
|
|
|> close()
|
|
|> extrude(length = 3.14)
|
|
```
|
|
|
|

|
|
|
|
|