Revolve around sketch line (#5870)
* show we can revolve around paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * show we can revolve around paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -240502,7 +240502,9 @@
|
||||
"box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle(center = [10, 10], radius = 4)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis)\n }, %)",
|
||||
"box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20])\n |> line(end = [20, 0])\n |> line(end = [0, -20], tag = $revolveAxis)\n |> close()\n |> extrude(length = 20)\n\nsketch001 = startSketchOn(box, \"END\")\n |> circle(center = [10, 10], radius = 4)\n |> revolve({\n angle = 90,\n axis = getOppositeEdge(revolveAxis),\n tolerance = 0.0001\n }, %)",
|
||||
"sketch001 = startSketchOn('XY')\n |> startProfileAt([10, 0], %)\n |> line(end = [5, -5])\n |> line(end = [5, 5])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\npart001 = revolve({\n axis = {\n custom = {\n axis = [0.0, 1.0],\n origin = [0.0, 0.0]\n }\n }\n}, sketch001)",
|
||||
"// Revolve two sketches around the same axis.\n\n\nsketch001 = startSketchOn('XY')\nprofile001 = startProfileAt([4, 8], sketch001)\n |> xLine(length = 3)\n |> yLine(length = -3)\n |> xLine(length = -3)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\nprofile002 = startProfileAt([-5, 8], sketch001)\n |> xLine(length = 3)\n |> yLine(length = -3)\n |> xLine(length = -3)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\nrevolve({ axis = \"X\" }, [profile001, profile002])"
|
||||
"// Revolve two sketches around the same axis.\n\n\nsketch001 = startSketchOn('XY')\nprofile001 = startProfileAt([4, 8], sketch001)\n |> xLine(length = 3)\n |> yLine(length = -3)\n |> xLine(length = -3)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\nprofile002 = startProfileAt([-5, 8], sketch001)\n |> xLine(length = 3)\n |> yLine(length = -3)\n |> xLine(length = -3)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\nrevolve({ axis = \"X\" }, [profile001, profile002])",
|
||||
"// Revolve around a path that has not been extruded.\n\n\nprofile001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20], tag = $revolveAxis)\n |> line(end = [20, 0])\n |> line(end = [0, -20])\n |> close(%)\n\nsketch001 = startSketchOn('XY')\n |> circle(center = [-10, 10], radius = 4)\n |> revolve({ angle = 90, axis = revolveAxis }, %)",
|
||||
"// Revolve around a path that has not been extruded or closed.\n\n\nprofile001 = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 20], tag = $revolveAxis)\n |> line(end = [20, 0])\n\nsketch001 = startSketchOn('XY')\n |> circle(center = [-10, 10], radius = 4)\n |> revolve({ angle = 90, axis = revolveAxis }, %)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
@ -200,6 +200,34 @@ pub async fn revolve(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
|
||||
/// axis = "X",
|
||||
/// }, [profile001, profile002])
|
||||
/// ```
|
||||
///
|
||||
/// ```no_run
|
||||
/// // Revolve around a path that has not been extruded.
|
||||
///
|
||||
/// profile001 = startSketchOn('XY')
|
||||
/// |> startProfileAt([0, 0], %)
|
||||
/// |> line(end = [0, 20], tag = $revolveAxis)
|
||||
/// |> line(end = [20, 0])
|
||||
/// |> line(end = [0, -20])
|
||||
/// |> close(%)
|
||||
///
|
||||
/// sketch001 = startSketchOn('XY')
|
||||
/// |> circle(center = [-10, 10], radius = 4)
|
||||
/// |> revolve({ angle: 90, axis: revolveAxis }, %)
|
||||
/// ```
|
||||
///
|
||||
/// ```no_run
|
||||
/// // Revolve around a path that has not been extruded or closed.
|
||||
///
|
||||
/// profile001 = startSketchOn('XY')
|
||||
/// |> startProfileAt([0, 0], %)
|
||||
/// |> line(end = [0, 20], tag = $revolveAxis)
|
||||
/// |> line(end = [20, 0])
|
||||
///
|
||||
/// sketch001 = startSketchOn('XY')
|
||||
/// |> circle(center = [-10, 10], radius = 4)
|
||||
/// |> revolve({ angle: 90, axis: revolveAxis }, %)
|
||||
/// ```
|
||||
#[stdlib {
|
||||
name = "revolve",
|
||||
feature_tree_operation = true,
|
||||
|
BIN
rust/kcl-lib/tests/outputs/serial_test_example_revolve10.png
Normal file
BIN
rust/kcl-lib/tests/outputs/serial_test_example_revolve10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
rust/kcl-lib/tests/outputs/serial_test_example_revolve9.png
Normal file
BIN
rust/kcl-lib/tests/outputs/serial_test_example_revolve9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
Reference in New Issue
Block a user