* Log any Errors to stderr This isn't perfect -- in fact, this is maybe not even very good at all, but it's better than what we have today. Currently, when we get an Erorr back from the WebSocket, we drop it in kcl-lib. The web-app logs these to the console (I can't find my commit doing that off the top of my head, but I remember doing it) -- so this is some degree of partity. This won't be very useful at all for wasm usage, but it will fix issues with the zoo cli silently breaking with a "WebSocket Closed" error -- which is the same issue I was solving for in the desktop app too. In the future perhaps this can be a real Error? I'm not totally sure yet, since we can't align to the request-id, so we can't really tie it to a specific call (yet). * add to responses Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * add a test Signed-off-by: Jess Frazelle <github@jessfraz.com> * clippy[ Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest) * empty * fix error Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates tests 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> Co-authored-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
55 lines
245 KiB
Markdown
55 lines
245 KiB
Markdown
---
|
|
title: "circle"
|
|
excerpt: "Construct a 2-dimensional circle, of the specified radius, centered at"
|
|
layout: manual
|
|
---
|
|
|
|
Construct a 2-dimensional circle, of the specified radius, centered at
|
|
|
|
the provided (x, y) origin point.
|
|
|
|
```js
|
|
circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
|
```
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes |
|
|
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
|
|
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
|
|
|
### Returns
|
|
|
|
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
|
|
|
|
|
### Examples
|
|
|
|
```js
|
|
exampleSketch = startSketchOn("-XZ")
|
|
|> circle({ center: [0, 0], radius: 10 }, %)
|
|
|
|
example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
```js
|
|
exampleSketch = startSketchOn("XZ")
|
|
|> startProfileAt([-15, 0], %)
|
|
|> line([30, 0], %)
|
|
|> line([0, 30], %)
|
|
|> line([-30, 0], %)
|
|
|> close(%)
|
|
|> hole(circle({ center: [0, 15], radius: 5 }, %), %)
|
|
|
|
example = extrude(5, exampleSketch)
|
|
```
|
|
|
|

|
|
|
|
|