add an example for a custom plane (#2507)
* updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * regenerate images Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
@ -63731,7 +63731,8 @@
|
||||
"examples": [
|
||||
"const exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %)\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(5, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%)\n\nconst example002 = extrude(5, exampleSketch002)\n\nconst exampleSketch003 = startSketchOn(example002, 'end')\n |> startProfileAt([2, 2], %)\n |> line([6, 0], %)\n |> line([0, 6], %)\n |> line([-6, 0], %)\n |> close(%)\n\nconst example003 = extrude(5, exampleSketch003)",
|
||||
"const exampleSketch = startSketchOn(\"XY\")\n |> startProfileAt([0, 0], %)\n |> line([10, 0], %)\n |> line([0, 10], %, 'sketchingFace')\n |> line([-10, 0], %)\n |> close(%)\n\nconst example = extrude(10, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'sketchingFace')\n |> startProfileAt([1, 1], %)\n |> line([8, 0], %)\n |> line([0, 8], %)\n |> line([-8, 0], %)\n |> close(%, 'sketchingFace002')\n\nconst example002 = extrude(10, exampleSketch002)\n\nconst exampleSketch003 = startSketchOn(example002, 'sketchingFace002')\n |> startProfileAt([-8, 12], %)\n |> line([0, 6], %)\n |> line([6, 0], %)\n |> line([0, -6], %)\n |> close(%)\n\nconst example003 = extrude(5, exampleSketch003)",
|
||||
"const exampleSketch = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([2, 0], %)\n |> line([0, -6], %)\n |> line([4, -6], %)\n |> line([0, -6], %)\n |> line([-3.75, -4.5], %)\n |> line([0, -5.5], %)\n |> line([-2, 0], %)\n |> close(%)\n\nconst example = revolve({ axis: 'y', angle: 180 }, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n\nconst example002 = extrude(5, exampleSketch002)"
|
||||
"const exampleSketch = startSketchOn('XY')\n |> startProfileAt([4, 12], %)\n |> line([2, 0], %)\n |> line([0, -6], %)\n |> line([4, -6], %)\n |> line([0, -6], %)\n |> line([-3.75, -4.5], %)\n |> line([0, -5.5], %)\n |> line([-2, 0], %)\n |> close(%)\n\nconst example = revolve({ axis: 'y', angle: 180 }, exampleSketch)\n\nconst exampleSketch002 = startSketchOn(example, 'end')\n |> startProfileAt([4.5, -5], %)\n |> line([0, 5], %)\n |> line([5, 0], %)\n |> line([0, -5], %)\n |> close(%)\n\nconst example002 = extrude(5, exampleSketch002)",
|
||||
"const a1 = startSketchOn({\n plane: {\n origin: { x: 0, y: 0, z: 0 },\n x_axis: { x: 1, y: 0, z: 0 },\n y_axis: { x: 0, y: 1, z: 0 },\n z_axis: { x: 0, y: 0, z: 1 }\n }\n })\n |> startProfileAt([0, 0], %)\n |> line([100.0, 0], %)\n |> yLine(-100.0, %)\n |> xLine(-100.0, %)\n |> yLine(100.0, %)\n |> close(%)\n |> extrude(3.14, %)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
8
src/wasm-lib/Cargo.lock
generated
@ -1915,7 +1915,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kcl-lib"
|
||||
version = "0.1.57"
|
||||
version = "0.1.58"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"approx 0.5.1",
|
||||
@ -1984,9 +1984,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kittycad"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81d3481e1b63f063ccf7d211f643da0563d2a42dd8b95b6006610742b729996b"
|
||||
checksum = "b0cbef813153197e60c0e96f59eea0b75f8418380f414b20250ee81b60e522c3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -2685,7 +2685,7 @@ dependencies = [
|
||||
"bincode",
|
||||
"either",
|
||||
"fnv",
|
||||
"itertools 0.12.1",
|
||||
"itertools 0.10.5",
|
||||
"lazy_static",
|
||||
"nom",
|
||||
"quick-xml",
|
||||
|
@ -62,7 +62,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
kittycad = { version = "0.3.1", default-features = false, features = ["js", "requests"] }
|
||||
kittycad = { version = "0.3.3", default-features = false, features = ["js", "requests"] }
|
||||
kittycad-execution-plan = "0.1.6"
|
||||
kittycad-execution-plan-macros = "0.1.9"
|
||||
kittycad-execution-plan-traits = "0.1.14"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "kcl-lib"
|
||||
description = "KittyCAD Language implementation and tools"
|
||||
version = "0.1.57"
|
||||
version = "0.1.58"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/KittyCAD/modeling-app"
|
||||
|
@ -949,6 +949,24 @@ pub async fn start_sketch_on(args: Args) -> Result<MemoryItem, KclError> {
|
||||
///
|
||||
/// const example002 = extrude(5, exampleSketch002)
|
||||
/// ```
|
||||
///
|
||||
/// ```no_run
|
||||
/// const a1 = startSketchOn({
|
||||
/// plane: {
|
||||
/// origin: { x: 0, y: 0, z: 0 },
|
||||
/// x_axis: { x: 1, y: 0, z: 0 },
|
||||
/// y_axis: { x: 0, y: 1, z: 0 },
|
||||
/// z_axis: { x: 0, y: 0, z: 1 }
|
||||
/// }
|
||||
/// })
|
||||
/// |> startProfileAt([0, 0], %)
|
||||
/// |> line([100.0, 0], %)
|
||||
/// |> yLine(-100.0, %)
|
||||
/// |> xLine(-100.0, %)
|
||||
/// |> yLine(100.0, %)
|
||||
/// |> close(%)
|
||||
/// |> extrude(3.14, %)
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "startSketchOn",
|
||||
}]
|
||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |