add more shell samples (#3861)

* add more shell sampels

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>
This commit is contained in:
Jess Frazelle
2024-09-10 19:50:34 -07:00
committed by GitHub
parent 78ceba6d20
commit a00800bddc
6 changed files with 144 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -207809,9 +207809,12 @@
"unpublished": false,
"deprecated": false,
"examples": [
"const firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the end face for the extrusion.\nshell({ faces: ['end'], thickness: 0.25 }, firstSketch)",
"const firstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the start face for the extrusion.\nshell({ faces: ['start'], thickness: 0.25 }, firstSketch)",
"const firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face for the extrusion.\nshell({ faces: [myTag], thickness: 0.25 }, firstSketch)"
"// Remove the end face for the extrusion.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the end face for the extrusion.\nshell({ faces: ['end'], thickness: 0.25 }, firstSketch)",
"// Remove the start face for the extrusion.\nconst firstSketch = startSketchOn('-XZ')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %)\n |> close(%)\n |> extrude(6, %)\n\n// Remove the start face for the extrusion.\nshell({ faces: ['start'], thickness: 0.25 }, firstSketch)",
"// Remove a tagged face and the end face for the extrusion.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face for the extrusion.\nshell({ faces: [myTag], thickness: 0.25 }, firstSketch)",
"// Remove multiple faces at once.\nconst firstSketch = startSketchOn('XY')\n |> startProfileAt([-12, 12], %)\n |> line([24, 0], %)\n |> line([0, -24], %)\n |> line([-24, 0], %, $myTag)\n |> close(%)\n |> extrude(6, %)\n\n// Remove a tagged face and the end face for the extrusion.\nshell({\n faces: [myTag, 'end'],\n thickness: 0.25\n}, firstSketch)",
"// Shell a sketch on face.\nlet size = 100\nconst case = startSketchOn('-XZ')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle([-size / 2, -size / 2], 25, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle([size / 2, -size / 2], 25, %)\n |> extrude(50, %)\n\n// We put \"case\" in the shell function to shell the entire object.\nshell({ faces: ['start'], thickness: 5 }, case)",
"// Shell a sketch on face object on the end face.\nlet size = 100\nconst case = startSketchOn('XY')\n |> startProfileAt([-size, -size], %)\n |> line([2 * size, 0], %)\n |> line([0, 2 * size], %)\n |> tangentialArcTo([-size, size], %)\n |> close(%)\n |> extrude(65, %)\n\nconst thing1 = startSketchOn(case, 'end')\n |> circle([-size / 2, -size / 2], 25, %)\n |> extrude(50, %)\n\nconst thing2 = startSketchOn(case, 'end')\n |> circle([size / 2, -size / 2], 25, %)\n |> extrude(50, %)\n\n// We put \"thing1\" in the shell function to shell the end face of the object.\nshell({ faces: ['end'], thickness: 5 }, thing1)"
]
},
{

View File

@ -36,6 +36,7 @@ pub async fn shell(args: Args) -> Result<KclValue, KclError> {
/// face, leaving it open in that direction.
///
/// ```no_run
/// // Remove the end face for the extrusion.
/// const firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
@ -52,6 +53,7 @@ pub async fn shell(args: Args) -> Result<KclValue, KclError> {
/// ```
///
/// ```no_run
/// // Remove the start face for the extrusion.
/// const firstSketch = startSketchOn('-XZ')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
@ -68,6 +70,7 @@ pub async fn shell(args: Args) -> Result<KclValue, KclError> {
/// ```
///
/// ```no_run
/// // Remove a tagged face and the end face for the extrusion.
/// const firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
@ -82,6 +85,69 @@ pub async fn shell(args: Args) -> Result<KclValue, KclError> {
/// thickness: 0.25,
/// }, firstSketch)
/// ```
///
/// ```no_run
/// // Remove multiple faces at once.
/// const firstSketch = startSketchOn('XY')
/// |> startProfileAt([-12, 12], %)
/// |> line([24, 0], %)
/// |> line([0, -24], %)
/// |> line([-24, 0], %, $myTag)
/// |> close(%)
/// |> extrude(6, %)
///
/// // Remove a tagged face and the end face for the extrusion.
/// shell({
/// faces: [myTag, 'end'],
/// thickness: 0.25,
/// }, firstSketch)
/// ```
///
/// ```no_run
/// // Shell a sketch on face.
/// let size = 100
/// const case = startSketchOn('-XZ')
/// |> startProfileAt([-size, -size], %)
/// |> line([2 * size, 0], %)
/// |> line([0, 2 * size], %)
/// |> tangentialArcTo([-size, size], %)
/// |> close(%)
/// |> extrude(65, %)
///
/// const thing1 = startSketchOn(case, 'end')
/// |> circle([-size / 2, -size / 2], 25, %)
/// |> extrude(50, %)
///
/// const thing2 = startSketchOn(case, 'end')
/// |> circle([size / 2, -size / 2], 25, %)
/// |> extrude(50, %)
///
/// // We put "case" in the shell function to shell the entire object.
/// shell({ faces: ['start'], thickness: 5 }, case)
/// ```
///
/// ```no_run
/// // Shell a sketch on face object on the end face.
/// let size = 100
/// const case = startSketchOn('XY')
/// |> startProfileAt([-size, -size], %)
/// |> line([2 * size, 0], %)
/// |> line([0, 2 * size], %)
/// |> tangentialArcTo([-size, size], %)
/// |> close(%)
/// |> extrude(65, %)
///
/// const thing1 = startSketchOn(case, 'end')
/// |> circle([-size / 2, -size / 2], 25, %)
/// |> extrude(50, %)
///
/// const thing2 = startSketchOn(case, 'end')
/// |> circle([size / 2, -size / 2], 25, %)
/// |> extrude(50, %)
///
/// // We put "thing1" in the shell function to shell the end face of the object.
/// shell({ faces: ['end'], thickness: 5 }, thing1)
/// ```
#[stdlib {
name = "shell",
}]

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB